Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:13

0001 #include "PhysicsTools/TagAndProbe/interface/ZGeneratorLineShape.h"
0002 
0003 ClassImp(ZGeneratorLineShape);
0004 
0005 ZGeneratorLineShape::ZGeneratorLineShape(
0006     const char* name, const char* title, RooAbsReal& _m, const char* genfile, const char* histoName)
0007     : RooAbsPdf(name, title), m("m", "m", this, _m), dataHist(nullptr) {
0008   TFile* f_gen = TFile::Open(genfile);
0009   TH1F* mass_th1f = (TH1F*)f_gen->Get(histoName);
0010   dataHist = new RooDataHist("Mass_gen", "Mass_gen", _m, mass_th1f);
0011   f_gen->Close();
0012 }
0013 
0014 ZGeneratorLineShape::ZGeneratorLineShape(const ZGeneratorLineShape& other, const char* name)
0015     : RooAbsPdf(other, name), m("m", this, other.m), dataHist(other.dataHist) {}
0016 
0017 Double_t ZGeneratorLineShape::evaluate() const {
0018   // std::cout<<"gen shape: m, evaluate= "<<m<<", "<<dataHist->weight(m.arg())<<std::endl;
0019   return dataHist->weight(m.arg());
0020 }