#include "RooFit.h" #include "Riostream.h" #include "Riostream.h" #include #include "TMath.h" #include "RooGaussVar.h" #include "RooAbsReal.h" #include "RooRealVar.h" #include "RooArgList.h" #include "RooMsgService.h" #include "RooMath.h" #include "TMath.h" using namespace std; ClassImp(RooGaussVar) ; //_____________________________________________________________________________ RooGaussVar::RooGaussVar() { // Default constructor } //_____________________________________________________________________________ RooGaussVar::RooGaussVar(const char* name, const char* title, RooAbsReal& _x, RooAbsReal& _height, RooAbsReal& _mean, RooAbsReal& _sigma) : RooAbsReal(name, title), x("x", "Dependent", this, _x), height("height", "Height", this,_height), mean("mean", "Mean", this, _mean), sigma("sigma", "Sigma", this, _sigma) { ; } //_____________________________________________________________________________ /* RooGaussVar::RooGaussVar(const char* name, const char* title, RooAbsReal& x) : RooAbsReal(name, title), _x("x", "Dependent", this, x), { // Constructor of gaussian function _parIter = _parList.createIterator() ; } */ //_____________________________________________________________________________ RooGaussVar::RooGaussVar(const RooGaussVar& other, const char* name) : RooAbsReal(other, name), x("x", this, other.x), height("height", this, other.height), mean("mean", this, other.mean), sigma("sigma", this, other.sigma) { } //_____________________________________________________________________________ RooGaussVar::~RooGaussVar() { // Destructor } //_____________________________________________________________________________ Double_t RooGaussVar::evaluate() const { // Calculate and return value of gaussian Double_t arg(0) ; arg=(x-mean.arg().getVal()) / sigma.arg().getVal(); if (arg < -39.0 || arg > 39.0) return 0.0; Double_t res = height.arg().getVal() * TMath::Exp(-0.5*arg*arg); //std::cout<<"gausvar evaluate:"<