CMS 3D CMS Logo

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