48 if (
verbose_)
std::cout <<
">>> Constructor (DataCertificationJetMET) <<<" << std::endl;
59 if (
verbose_)
std::cout <<
">>> Deconstructor (DataCertificationJetMET) <<<" << std::endl;
67 if (
verbose_)
std::cout <<
">>> EndRun (DataCertificationJetMET) <<<" << std::endl;
69 std::vector<std::string> subDirVec;
110 if (RunDir==
"Reference") RunDir=
"";
128 if (RunDir ==
"") newHistoName =
"JetMET/Jet/";
129 else newHistoName = RunDir+
"/JetMET/Runsummary/Jet/";
132 cleaningdir =
"Cleaned";
134 cleaningdir =
"Uncleaned";
137 meJetPhi[0] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Phi_Barrel");
138 meJetPhi[1] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Phi_EndCap");
139 meJetPhi[2] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Phi_Forward");
140 meJetPhi[3] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"CaloJets/Phi");
144 meJetEta[0] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Eta");
145 meJetEta[1] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Eta");
146 meJetEta[2] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/EtaFirst");
147 meJetEta[3] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"CaloJets/Eta");
151 meJetPt[0] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Pt_Barrel");
152 meJetPt[1] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Pt_EndCap");
153 meJetPt[2] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Pt_Forward");
154 meJetPt[3] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"CaloJets/Pt_2");
157 meJetConstituents[0] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Constituents_Barrel");
158 meJetConstituents[1] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Constituents_EndCap");
159 meJetConstituents[2] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Constituents_Forward");
160 meJetConstituents[3] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"CaloJets/Constituents");
163 meJetEMFrac[0] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/EFrac_Barrel");
164 meJetEMFrac[1] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/EFrac_EndCap");
165 meJetEMFrac[2] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/EFrac_Forward");
166 meJetEMFrac[3] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"CaloJets/EFrac");
184 const QReport* QReport_JetEta[4] = {0};
185 const QReport* QReport_JetPhi[4] = {0};
187 const QReport* QReport_JetConstituents[4][2] = {{0}};
188 const QReport* QReport_JetEFrac[4][2] = {{0}};
189 const QReport* QReport_JetPt[4][2] = {{0}};
193 float qr_Jet_Eta[4] = {-1};
194 float qr_Jet_Phi[4] = {-1};
195 float dc_Jet[4] = {-1};
197 float qr_Jet_Constituents[4][2] = {{-1}};
198 float qr_Jet_EFrac[4][2] = {{-1}};
199 float qr_Jet_Pt[4][2] = {{-1}};
204 for (
int jtyp=0; jtyp<4; ++jtyp) {
207 if (meJetConstituents[jtyp] && meJetConstituents[jtyp]->getRootObject() ) {
208 QReport_JetConstituents[jtyp][0] = meJetConstituents[jtyp]->
getQReport(
"meanJetConstituentsTest");
209 QReport_JetConstituents[jtyp][1] = meJetConstituents[jtyp]->
getQReport(
"KolmogorovTest");
211 if (meJetEMFrac[jtyp]&& meJetEMFrac[jtyp]->getRootObject() ) {
212 QReport_JetEFrac[jtyp][0] = meJetEMFrac[jtyp]->
getQReport(
"meanEMFractionTest");
213 QReport_JetEFrac[jtyp][1] = meJetEMFrac[jtyp]->
getQReport(
"KolmogorovTest");
215 if (meJetPt[jtyp] && meJetPt[jtyp]->getRootObject() ) {
216 QReport_JetPt[jtyp][0] = meJetPt[jtyp]->
getQReport(
"meanJetPtTest");
217 QReport_JetPt[jtyp][1] = meJetPt[jtyp]->
getQReport(
"KolmogorovTest");
219 if (meJetPhi[jtyp] && meJetPhi[jtyp]->getRootObject()){
220 QReport_JetPhi[jtyp] = meJetPhi[jtyp]->
getQReport(
"KolmogorovTest");
222 if (meJetEta[jtyp] && meJetEta[jtyp]->getRootObject()){
223 QReport_JetEta[jtyp] = meJetEta[jtyp]->
getQReport(
"KolmogorovTest");
227 if (QReport_JetPt[jtyp][0]){
229 if (QReport_JetPt[jtyp][0]->getStatus()==100 ||
230 QReport_JetPt[jtyp][0]->getStatus()==200)
231 qr_Jet_Pt[jtyp][0] = 1;
232 else if (QReport_JetPt[jtyp][0]->getStatus()==300)
233 qr_Jet_Pt[jtyp][0] = 0;
235 qr_Jet_Pt[jtyp][0] = -1;
237 else{ qr_Jet_Pt[jtyp][0] = -2;
240 if (QReport_JetPt[jtyp][1]){
241 if (QReport_JetPt[jtyp][1]->getStatus()==100 ||
242 QReport_JetPt[jtyp][1]->getStatus()==200)
243 qr_Jet_Pt[jtyp][1] = 1;
244 else if (QReport_JetPt[jtyp][1]->getStatus()==300)
245 qr_Jet_Pt[jtyp][1] = 0;
247 qr_Jet_Pt[jtyp][1] = -1;
249 else{ qr_Jet_Pt[jtyp][1] = -2;
253 if (QReport_JetPhi[jtyp]){
254 if (QReport_JetPhi[jtyp]->getStatus()==100 ||
255 QReport_JetPhi[jtyp]->getStatus()==200)
256 qr_Jet_Phi[jtyp] = 1;
257 else if (QReport_JetPhi[jtyp]->getStatus()==300)
258 qr_Jet_Phi[jtyp] = 0;
260 qr_Jet_Phi[jtyp] = -1;
262 else{ qr_Jet_Phi[jtyp] = -2;
265 if (QReport_JetEta[jtyp]){
266 if (QReport_JetEta[jtyp]->getStatus()==100 ||
267 QReport_JetEta[jtyp]->getStatus()==200)
268 qr_Jet_Eta[jtyp] = 1;
269 else if (QReport_JetEta[jtyp]->getStatus()==300)
270 qr_Jet_Eta[jtyp] = 0;
272 qr_Jet_Eta[jtyp] = -1;
275 qr_Jet_Eta[jtyp] = -2;
278 if (QReport_JetConstituents[jtyp][0]){
279 if (QReport_JetConstituents[jtyp][0]->getStatus()==100 ||
280 QReport_JetConstituents[jtyp][0]->getStatus()==200)
281 qr_Jet_Constituents[jtyp][0] = 1;
282 else if (QReport_JetConstituents[jtyp][0]->getStatus()==300)
283 qr_Jet_Constituents[jtyp][0] = 0;
285 qr_Jet_Constituents[jtyp][0] = -1;
287 else{ qr_Jet_Constituents[jtyp][0] = -2;
290 if (QReport_JetConstituents[jtyp][1]){
291 if (QReport_JetConstituents[jtyp][1]->getStatus()==100 ||
292 QReport_JetConstituents[jtyp][1]->getStatus()==200)
293 qr_Jet_Constituents[jtyp][1] = 1;
294 else if (QReport_JetConstituents[jtyp][1]->getStatus()==300)
295 qr_Jet_Constituents[jtyp][1] = 0;
297 qr_Jet_Constituents[jtyp][1] = -1;
299 else{ qr_Jet_Constituents[jtyp][1] = -2;
302 if (QReport_JetEFrac[jtyp][0]){
303 if (QReport_JetEFrac[jtyp][0]->getStatus()==100 ||
304 QReport_JetEFrac[jtyp][0]->getStatus()==200)
305 qr_Jet_EFrac[jtyp][0] = 1;
306 else if (QReport_JetEFrac[jtyp][0]->getStatus()==300)
307 qr_Jet_EFrac[jtyp][0] = 0;
309 qr_Jet_EFrac[jtyp][0] = -1;
311 else{ qr_Jet_EFrac[jtyp][0] = -2;
314 if (QReport_JetEFrac[jtyp][1]){
315 if (QReport_JetEFrac[jtyp][1]->getStatus()==100 ||
316 QReport_JetEFrac[jtyp][1]->getStatus()==200)
317 qr_Jet_EFrac[jtyp][1] = 1;
318 else if (QReport_JetEFrac[jtyp][1]->getStatus()==300)
319 qr_Jet_EFrac[jtyp][1] = 0;
321 qr_Jet_EFrac[jtyp][1] = -1;
323 else{ qr_Jet_EFrac[jtyp][1] = -2;
327 printf(
"====================Jet Type %d QTest Report Summary========================\n",jtyp);
328 printf(
"Eta: Phi: Pt 1: 2: Const/Ntracks 1: 2: EFrac/tracknhits 1: 2:\n");
330 printf(
"%2.2f %2.2f %2.2f %2.2f %2.2f %2.2f %2.2f %2.2f\n", \
333 qr_Jet_Pt[jtyp][0], \
334 qr_Jet_Pt[jtyp][1], \
335 qr_Jet_Constituents[jtyp][0], \
336 qr_Jet_Constituents[jtyp][1], \
337 qr_Jet_EFrac[jtyp][0], \
338 qr_Jet_EFrac[jtyp][1]);
344 for (
int ttyp = 0; ttyp < 2; ++ttyp) {
346 qr_Jet_Pt[jtyp][ttyp] = 1;
348 qr_Jet_Eta[jtyp] = 1;
349 qr_Jet_Phi[jtyp] = 1;
351 qr_Jet_EFrac[jtyp][ttyp] = 1;
352 qr_Jet_Constituents[jtyp][ttyp] = 1;
358 if ( (qr_Jet_EFrac[jtyp][0] == 0) ||
359 (qr_Jet_EFrac[jtyp][1] == 0) ||
360 (qr_Jet_Constituents[jtyp][1] == 0) ||
361 (qr_Jet_Constituents[jtyp][0] == 0) ||
362 (qr_Jet_Eta[jtyp] == 0) ||
363 (qr_Jet_Phi[jtyp] == 0) ||
364 (qr_Jet_Pt[jtyp][0] == 0) ||
365 (qr_Jet_Pt[jtyp][1] == 0)
368 else if ( (qr_Jet_EFrac[jtyp][0] == -1) &&
369 (qr_Jet_EFrac[jtyp][1] == -1) &&
370 (qr_Jet_Constituents[jtyp][1] == -1) &&
371 (qr_Jet_Constituents[jtyp][0] == -1) &&
372 (qr_Jet_Eta[jtyp] == -1) &&
373 (qr_Jet_Phi[jtyp] == -1) &&
374 (qr_Jet_Pt[jtyp][0] == -1) &&
375 (qr_Jet_Pt[jtyp][1] == -1 )
378 else if ( (qr_Jet_EFrac[jtyp][0] == -2) &&
379 (qr_Jet_EFrac[jtyp][1] == -2) &&
380 (qr_Jet_Constituents[jtyp][1] == -2) &&
381 (qr_Jet_Constituents[jtyp][0] == -2) &&
382 (qr_Jet_Eta[jtyp] == -2) &&
383 (qr_Jet_Phi[jtyp] == -2) &&
384 (qr_Jet_Pt[jtyp][0] == -2) &&
385 (qr_Jet_Pt[jtyp][1] == -2)
391 if (
verbose_)
std::cout<<
"Certifying Jet algo: "<<jtyp<<
" with value: "<<dc_Jet[jtyp]<<std::endl;
410 if (RunDir ==
"") newHistoName =
"JetMET/MET/";
411 else newHistoName = RunDir+
"/JetMET/Runsummary/MET/";
419 meMExy[0][0] = iget_.
get(newHistoName+
"met/"+
metFolder+
"/MEx");
420 meMExy[0][1] = iget_.
get(newHistoName+
"met/"+
metFolder+
"/MEy");
421 meMExy[1][0] = iget_.
get(newHistoName+
"pfMet/"+
metFolder+
"/MEx");
422 meMExy[1][1] = iget_.
get(newHistoName+
"pfMet/"+
metFolder+
"/MEy");
425 meMETPhi[0] = iget_.
get(newHistoName+
"met/"+
metFolder+
"/METPhi");
426 meMETPhi[1] = iget_.
get(newHistoName+
"pfMet/"+
metFolder+
"/METPhi");
428 meMEt[0] = iget_.
get(newHistoName+
"met/"+
metFolder+
"/MET");
429 meMEt[1] = iget_.
get(newHistoName+
"pfMet/"+
metFolder+
"/MET");
431 meSumEt[0] = iget_.
get(newHistoName+
"met/"+
metFolder+
"/SumET");
432 meSumEt[1] = iget_.
get(newHistoName+
"pfMet/"+
metFolder+
"/SumET");
441 const QReport * QReport_MExy[2][2][2]={{{0}}};
442 const QReport * QReport_MEt[2][2]={{0}};
443 const QReport * QReport_SumEt[2][2]={{0}};
445 const QReport * QReport_METPhi[2][2]={{0}};
448 float qr_MET_MExy[2][2][2] = {{{-999.}}};
449 float qr_MET_MEt[2][2] = {{-999.}};
450 float qr_MET_SumEt[2][2] = {{-999.}};
451 float qr_MET_METPhi[2][2] = {{-999.}};
452 float dc_MET[2] = {-999.};
457 for (
int mtyp = 0; mtyp < 2; ++mtyp){
459 if (meMExy[mtyp][0] && meMExy[mtyp][0]->getRootObject()) {
460 QReport_MExy[mtyp][0][0] = meMExy[mtyp][0]->
getQReport(
"meanMExyTest");
461 QReport_MExy[mtyp][1][0] = meMExy[mtyp][0]->
getQReport(
"KolmogorovTest");
463 if (meMExy[mtyp][1]&& meMExy[mtyp][1]->getRootObject()) {
464 QReport_MExy[mtyp][0][1] = meMExy[mtyp][1]->
getQReport(
"meanMExyTest");
465 QReport_MExy[mtyp][1][1] = meMExy[mtyp][1]->
getQReport(
"KolmogorovTest");
467 if (meMEt[mtyp] && meMEt[mtyp]->getRootObject()) {
468 QReport_MEt[mtyp][0] = meMEt[mtyp]->
getQReport(
"meanMETTest");
469 QReport_MEt[mtyp][1] = meMEt[mtyp]->
getQReport(
"KolmogorovTest");
472 if (meSumEt[mtyp] && meSumEt[mtyp]->getRootObject()) {
473 QReport_SumEt[mtyp][0] = meSumEt[mtyp]->
getQReport(
"meanSumETTest");
474 QReport_SumEt[mtyp][1] = meSumEt[mtyp]->
getQReport(
"KolmogorovTest");
477 if (meMETPhi[mtyp] && meMETPhi[mtyp]->getRootObject()) {
478 QReport_METPhi[mtyp][0] = meMETPhi[mtyp]->
getQReport(
"phiQTest");
479 QReport_METPhi[mtyp][1] = meMETPhi[mtyp]->
getQReport(
"KolmogorovTest");
481 for (
int testtyp = 0; testtyp < 2; ++testtyp) {
483 if (QReport_MExy[mtyp][testtyp][0]){
484 if (QReport_MExy[mtyp][testtyp][0]->getStatus()==100 ||
485 QReport_MExy[mtyp][testtyp][0]->getStatus()==200)
486 qr_MET_MExy[mtyp][testtyp][0] = 1;
487 else if (QReport_MExy[mtyp][testtyp][0]->getStatus()==300)
488 qr_MET_MExy[mtyp][testtyp][0] = 0;
490 qr_MET_MExy[mtyp][testtyp][0] = -1;
492 else qr_MET_MExy[mtyp][testtyp][0] = -2;
494 if (QReport_MExy[mtyp][testtyp][1]){
495 if (QReport_MExy[mtyp][testtyp][1]->getStatus()==100 ||
496 QReport_MExy[mtyp][testtyp][1]->getStatus()==200)
497 qr_MET_MExy[mtyp][testtyp][1] = 1;
498 else if (QReport_MExy[mtyp][testtyp][1]->getStatus()==300)
499 qr_MET_MExy[mtyp][testtyp][1] = 0;
501 qr_MET_MExy[mtyp][testtyp][1] = -1;
503 else qr_MET_MExy[mtyp][testtyp][1] = -2;
506 if (QReport_MEt[mtyp][testtyp]){
507 if (QReport_MEt[mtyp][testtyp]->getStatus()==100 ||
508 QReport_MEt[mtyp][testtyp]->getStatus()==200)
509 qr_MET_MEt[mtyp][testtyp] = 1;
510 else if (QReport_MEt[mtyp][testtyp]->getStatus()==300)
511 qr_MET_MEt[mtyp][testtyp] = 0;
513 qr_MET_MEt[mtyp][testtyp] = -1;
516 qr_MET_MEt[mtyp][testtyp] = -2;
519 if (QReport_SumEt[mtyp][testtyp]){
520 if (QReport_SumEt[mtyp][testtyp]->getStatus()==100 ||
521 QReport_SumEt[mtyp][testtyp]->getStatus()==200)
522 qr_MET_SumEt[mtyp][testtyp] = 1;
523 else if (QReport_SumEt[mtyp][testtyp]->getStatus()==300)
524 qr_MET_SumEt[mtyp][testtyp] = 0;
526 qr_MET_SumEt[mtyp][testtyp] = -1;
529 qr_MET_SumEt[mtyp][testtyp] = -2;
532 if (QReport_METPhi[mtyp][testtyp]){
533 if (QReport_METPhi[mtyp][testtyp]->getStatus()==100 ||
534 QReport_METPhi[mtyp][testtyp]->getStatus()==200)
535 qr_MET_METPhi[mtyp][testtyp] = 1;
536 else if (QReport_METPhi[mtyp][testtyp]->getStatus()==300)
537 qr_MET_METPhi[mtyp][testtyp] = 0;
539 qr_MET_METPhi[mtyp][testtyp] = -1;
542 qr_MET_METPhi[mtyp][testtyp] = -2;
549 printf(
"====================MET Type %d QTest Report Summary========================\n",mtyp);
550 printf(
"MEx test MEy test MEt test: SumEt test: METPhi test:\n");
551 for (
int tt = 0;
tt < 2; ++
tt) {
552 printf(
"%2.2f %2.2f %2.2f %2.2f %2.2f\n",qr_MET_MExy[mtyp][
tt][0], \
553 qr_MET_MExy[mtyp][tt][1], \
554 qr_MET_MEt[mtyp][tt], \
555 qr_MET_SumEt[mtyp][tt], \
556 qr_MET_METPhi[mtyp][tt]);
558 printf(
"===========================================================================\n");
563 for (
int ttyp = 0; ttyp < 2; ++ttyp) {
565 qr_MET_MExy[mtyp][ttyp][0] = 1;
566 qr_MET_MExy[mtyp][ttyp][1] = 1;
567 qr_MET_MEt[mtyp][ttyp] = 1;
568 qr_MET_SumEt[mtyp][ttyp] = 1;
569 qr_MET_METPhi[mtyp][ttyp] = 1;
575 (qr_MET_MExy[mtyp][0][0] == 0) ||
576 (qr_MET_MExy[mtyp][0][1] == 0) ||
577 (qr_MET_MEt[mtyp][0] == 0) ||
578 (qr_MET_SumEt[mtyp][0] == 0) ||
579 (qr_MET_METPhi[mtyp][0] == 0) ||
580 (qr_MET_MExy[mtyp][1][0] == 0) ||
581 (qr_MET_MExy[mtyp][1][1] == 0) ||
582 (qr_MET_MEt[mtyp][1] == 0) ||
583 (qr_MET_SumEt[mtyp][1] == 0) ||
584 (qr_MET_METPhi[mtyp][1] == 0)
588 (qr_MET_MExy[mtyp][0][0] == -1) &&
589 (qr_MET_MExy[mtyp][0][1] == -1) &&
590 (qr_MET_MEt[mtyp][0] == -1) &&
591 (qr_MET_SumEt[mtyp][0] == -1) &&
592 (qr_MET_METPhi[mtyp][0] == -1) &&
593 (qr_MET_MExy[mtyp][1][0] == -1) &&
594 (qr_MET_MExy[mtyp][1][1] == -1) &&
595 (qr_MET_MEt[mtyp][1] == -1) &&
596 (qr_MET_SumEt[mtyp][1] == -1) &&
597 (qr_MET_METPhi[mtyp][1] == -1)
601 (qr_MET_MExy[mtyp][0][0] == -2) &&
602 (qr_MET_MExy[mtyp][0][1] == -2) &&
603 (qr_MET_MEt[mtyp][0] == -2) &&
604 (qr_MET_SumEt[mtyp][0] == -2) &&
605 (qr_MET_METPhi[mtyp][0] == -2) &&
606 (qr_MET_MExy[mtyp][1][0] == -2) &&
607 (qr_MET_MExy[mtyp][1][1] == -2) &&
608 (qr_MET_MEt[mtyp][1] == -2) &&
609 (qr_MET_SumEt[mtyp][1] == -2) &&
610 (qr_MET_METPhi[mtyp][1] == -2)
616 if (
verbose_)
std::cout<<
"Certifying MET algo: "<<mtyp<<
" with value: "<<dc_MET[mtyp]<<std::endl;
626 float dc_CT[3] = {-2.};
631 for (
int cttyp = 0; cttyp < 3; ++cttyp) {
633 if (
verbose_)
std::cout<<
"Certifying CaloTowers with value: "<<dc_CT[cttyp]<<std::endl;
T getUntrackedParameter(std::string const &, T const &) const
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
MonitorElement * CertificationSummaryMap
MonitorElement * get(const std::string &path)
MonitorElement * reportSummary
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * reportSummaryMap
MonitorElement * CertificationSummary
TObject * getRootObject(void) const
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
virtual void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
MonitorElement * bookFloat(Args &&...args)
TH2F * getTH2F(void) const
~DataCertificationJetMET()
DataCertificationJetMET(const edm::ParameterSet &)