29 if(verbose_)
cout <<
">>> Constructor (PhotonDataCertification) <<<" << endl;
49 if(verbose_)
std::cout <<
">>> Analyze (PhotonDataCertification) <<<" << std::endl;
70 if(verbose_)
std::cout <<
">>> BeginRun (PhotonDataCertification) <<<" << std::endl;
71 if(verbose_)
std::cout <<
">>> "<< run.
id() << std::endl;
79 if(verbose_)
std::cout <<
">>> EndRun (PhotonDataCertification) <<<" << std::endl;
81 std::vector<string> histoNameVector;
95 MonitorElement* CertificationSummaryMap =
dbe_->
book2D(
"CertificationSummaryMap",
"CertificationSummaryMap",2,0,2,2,0,2);
97 TH2 * reportSummaryMapTH2 = reportSummaryMap->
getTH2F();
99 reportSummaryMapTH2->GetXaxis()->SetBinLabel(1,
"Eta");
100 reportSummaryMapTH2->GetXaxis()->SetBinLabel(2,
"Phi");
101 reportSummaryMapTH2->GetYaxis()->SetBinLabel(1,
"SpikeTest");
102 reportSummaryMapTH2->GetYaxis()->SetBinLabel(2,
"HoleTest");
104 TH2 * CertificationSummaryMapTH2 = CertificationSummaryMap->
getTH2F();
106 CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(1,
"Eta");
107 CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(2,
"Phi");
108 CertificationSummaryMapTH2->GetYaxis()->SetBinLabel(1,
"SpikeTest");
109 CertificationSummaryMapTH2->GetYaxis()->SetBinLabel(2,
"HoleTest");
114 histoNameVector.push_back(
"nPhoAllEcal");
115 histoNameVector.push_back(
"r9AllEcal");
116 histoNameVector.push_back(
"phoEta");
117 histoNameVector.push_back(
"phoPhi");
132 if(verbose_)
std::cout <<
"\n>>> looping over histograms to be tested <<<\n\n";
133 for(std::vector<string>::iterator it=histoNameVector.begin();it!=histoNameVector.end();++it){
140 if(HistoName.find(
"Efficiency")!=std::string::npos){
141 TestHist =
dbe_->
get(
"Egamma/PhotonAnalyzer/Efficiencies/"+HistoName);
144 TestHist =
dbe_->
get(
"Egamma/PhotonAnalyzer/GoodCandidatePhotons/Et above 0 GeV/"+HistoName);
146 bool validMe = TestHist!=0;
147 if(verbose_)
std::cout <<
" is valid? " << validMe <<
"\n";
148 if(!validMe)
continue;
150 if(verbose_)
std::cout <<
">>> TestHist Name: " << TestHist->
getName() <<
"\n\n";
155 std::vector<QReport *> myQReports = TestHist->
getQReports();
156 if(verbose_)
cout << TestHist->
getName() <<
": myQReports.size() = " << myQReports.size() <<
"\n\n";
157 for(uint
i=0;
i!=myQReports.size();++
i) {
160 float qtresult = myQReports[
i]->getQTresult();
161 int qtstatus = myQReports[
i]->getStatus() ;
163 if(verbose_)
std::cout <<
"\tTest " <<
i <<
": qtname: " << qtname <<
"\n";
164 if(verbose_)
std::cout <<
"\tTest " <<
i <<
": qtresult: " << qtresult << std::endl;
165 if(verbose_)
std::cout <<
"\tTest " <<
i <<
": qtstatus: " << qtstatus <<
"\n\n";
171 Float->
Fill(qtresult);
180 float etaSpikeTestResult=0;
181 float phiSpikeTestResult=0;
182 float etaHoleTestResult=0;
183 float phiHoleTestResult=0;
185 if(
dbe_->
get(
"Egamma/EventInfo/reportSummaryContents/phoEta_SpikeTest")!=0)
186 etaSpikeTestResult =
dbe_->
get(
"Egamma/EventInfo/reportSummaryContents/phoEta_SpikeTest")->
getFloatValue();
187 else etaSpikeTestResult = -1;
189 if(
dbe_->
get(
"Egamma/EventInfo/reportSummaryContents/phoPhi_SpikeTest")!=0)
190 phiSpikeTestResult =
dbe_->
get(
"Egamma/EventInfo/reportSummaryContents/phoPhi_SpikeTest")->
getFloatValue();
191 else phiSpikeTestResult = -1;
193 if(
dbe_->
get(
"Egamma/EventInfo/reportSummaryContents/phoEta_HoleTest")!=0)
194 etaHoleTestResult =
dbe_->
get(
"Egamma/EventInfo/reportSummaryContents/phoEta_HoleTest")->
getFloatValue();
195 else etaHoleTestResult = -1;
197 if(
dbe_->
get(
"Egamma/EventInfo/reportSummaryContents/phoPhi_HoleTest")!=0)
198 phiHoleTestResult =
dbe_->
get(
"Egamma/EventInfo/reportSummaryContents/phoPhi_HoleTest")->
getFloatValue();
199 else phiHoleTestResult = -1;
203 if(verbose_)
std::cout <<
">>> Results of tests to be put into Summary Maps <<<\n\n";
204 if(verbose_)
std::cout <<
"\tetaSpikeTestResult= " << etaSpikeTestResult <<
"\n";
205 if(verbose_)
std::cout <<
"\tphiSpikeTestResult= " << phiSpikeTestResult <<
"\n";
206 if(verbose_)
std::cout <<
"\tetaHoleTestResult= " << etaHoleTestResult <<
"\n";
207 if(verbose_)
std::cout <<
"\tphiHoleTestResult= " << phiHoleTestResult <<
"\n\n";
211 float reportSummaryFloat = (etaSpikeTestResult+etaHoleTestResult+phiSpikeTestResult+phiHoleTestResult)/4.;
212 if(reportSummaryFloat<0) reportSummaryFloat = -1;
213 reportSummary->
Fill(reportSummaryFloat);
214 CertificationSummary->
Fill(reportSummaryFloat);
216 reportSummaryMap->
Fill(0,0,etaSpikeTestResult);
217 reportSummaryMap->
Fill(0,1,etaHoleTestResult);
218 reportSummaryMap->
Fill(1,0,phiSpikeTestResult);
219 reportSummaryMap->
Fill(1,1,phiHoleTestResult);
221 CertificationSummaryMap->
Fill(0,0,etaSpikeTestResult);
222 CertificationSummaryMap->
Fill(0,1,etaHoleTestResult);
223 CertificationSummaryMap->
Fill(1,0,phiSpikeTestResult);
224 CertificationSummaryMap->
Fill(1,1,phiHoleTestResult);
T getParameter(std::string const &) const
const std::string & getName(void) const
get name of ME
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 &)
virtual void endRun(const edm::Run &, const edm::EventSetup &)
double getFloatValue(void) const
void setVerbose(unsigned level)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
std::vector< QReport * > getQReports(void) const
get map of QReports
~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)