5 #include "RooGlobalFunc.h"
6 #include "RooRealVar.h"
7 #include "RooDataSet.h"
8 #include "RooBreitWigner.h"
9 #include "RooDataHist.h"
10 #include "RooFitResult.h"
30 if(verbose_)
cout <<
">>> Constructor (PhotonDataCertification) <<<" << endl;
72 if(verbose_)
std::cout <<
">>> BeginRun (PhotonDataCertification) <<<" << std::endl;
73 if(verbose_)
std::cout <<
">>> "<< run.
id() << std::endl;
81 using namespace RooFit;
82 if(verbose_)
std::cout <<
">>> EndRun (PhotonDataCertification) <<<" << std::endl;
88 reportSummaryMap_ =
dbe_->
book2D(
"reportSummaryMap",
"reportSummaryMap",3,0,3,1,0,1);
90 TH2F * reportSummaryMapTH2 = reportSummaryMap_->
getTH2F();
91 reportSummaryMapTH2->GetXaxis()->SetBinLabel(1,
"EB");
92 reportSummaryMapTH2->GetXaxis()->SetBinLabel(2,
"EE");
93 reportSummaryMapTH2->GetXaxis()->SetBinLabel(3,
"Total");
94 reportSummaryMapTH2->GetYaxis()->SetBinLabel(1,
"InvMassTest");
96 float EBResult = invMassZtest(
"Egamma/PhotonAnalyzer/InvMass/h_02_invMassIsoPhotonsEBarrel",
"invMassIsolatedPhotonsEB");
97 float EEResult = invMassZtest(
"Egamma/PhotonAnalyzer/InvMass/h_03_invMassIsoPhotonsEEndcap",
"invMassIsolatedPhotonsEE");
98 float AllResult = invMassZtest(
"Egamma/PhotonAnalyzer/InvMass/h_01_invMassAllIsolatedPhotons",
"invMassAllIsolatedPhotons");
101 std::cout <<
"EBResult: " << EBResult << std::endl;
102 std::cout <<
"EEResult: " << EEResult << std::endl;
103 std::cout <<
"AllResult: " << AllResult << std::endl;
106 reportSummaryMapTH2->SetBinContent(1, 1, EBResult);
107 reportSummaryMapTH2->SetBinContent(2, 1, EEResult);
108 reportSummaryMapTH2->SetBinContent(3, 1, AllResult);
109 reportSummary_->Fill(AllResult);
118 if(TestElem==0)
return 0;
119 TH1F *TestHist = TestElem->
getTH1F();
120 if(TestHist==0)
return 0;
121 RooRealVar mass(
"mass",
"Mass_{2#gamma}", 0, 200,
"GeV");
122 RooRealVar mRes(
"M_{Z}",
"Z Mass", ZMass, 70, 110);
123 RooRealVar gamma(
"#Gamma",
"#Gamma", ZWidth, 0, 10.0);
124 RooBreitWigner BreitWigner(
"BreitWigner",
"Breit-Wigner",mass,mRes,gamma);
125 RooDataHist
test(name, name, mass, TestHist);
129 if(
abs(mRes.getValV() - ZMass) < ZWidth){
return 1.0;}
130 else if(
abs(mRes.getValV() - ZMass) < gamma.getValV()){
return 0.9;}
T getParameter(std::string const &) const
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
PhotonDataCertification(const edm::ParameterSet &pset)
MonitorElement * bookFloat(const char *name)
Book float.
virtual void analyze(const edm::Event &, const edm::EventSetup &)
tuple path
else: Piece not in the list, fine.
virtual void endRun(const edm::Run &, const edm::EventSetup &)
Abs< T >::type abs(const T &t)
void setVerbose(unsigned level)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
PixelRecoRange< float > Range
float invMassZtest(std::string path, TString name)
TH1F * getTH1F(void) const
~PhotonDataCertification()
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setCurrentFolder(const std::string &fullpath)