CMS 3D CMS Logo

ZGeneratorLineShape.cc
Go to the documentation of this file.
2 
4 
6  const char* name, const char* title, RooAbsReal& _m, const char* genfile, const char* histoName)
7  : RooAbsPdf(name, title), m("m", "m", this, _m), dataHist(nullptr) {
8  TFile* f_gen = TFile::Open(genfile);
9  TH1F* mass_th1f = (TH1F*)f_gen->Get(histoName);
10  dataHist = new RooDataHist("Mass_gen", "Mass_gen", _m, mass_th1f);
11  f_gen->Close();
12 }
13 
15  : RooAbsPdf(other, name), m("m", this, other.m), dataHist(other.dataHist) {}
16 
17 Double_t ZGeneratorLineShape::evaluate() const {
18  // std::cout<<"gen shape: m, evaluate= "<<m<<", "<<dataHist->weight(m.arg())<<std::endl;
19  return dataHist->weight(m.arg());
20 }
#define nullptr
ClassImp(ZGeneratorLineShape)