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/";
131 cleaningdir =
"Cleaned";
134 meJetPhi[0] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Phi_Barrel");
135 meJetPhi[1] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Phi_EndCap");
136 meJetPhi[2] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Phi_Forward");
137 meJetPhi[3] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"CaloJets/Phi");
141 meJetEta[0] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Eta");
142 meJetEta[1] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Eta");
143 meJetEta[2] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/EtaFirst");
144 meJetEta[3] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"CaloJets/Eta");
148 meJetPt[0] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Pt_Barrel");
149 meJetPt[1] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Pt_EndCap");
150 meJetPt[2] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Pt_Forward");
151 meJetPt[3] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"CaloJets/Pt_2");
154 meJetConstituents[0] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Constituents_Barrel");
155 meJetConstituents[1] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Constituents_EndCap");
156 meJetConstituents[2] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/Constituents_Forward");
157 meJetConstituents[3] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"CaloJets/Constituents");
160 meJetEMFrac[0] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/EFrac_Barrel");
161 meJetEMFrac[1] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/EFrac_EndCap");
162 meJetEMFrac[2] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"PFJets/EFrac_Forward");
163 meJetEMFrac[3] = iget_.
get(newHistoName+cleaningdir+
jetAlgo+
"CaloJets/EFrac");
181 const QReport* QReport_JetEta[4] = {0};
182 const QReport* QReport_JetPhi[4] = {0};
184 const QReport* QReport_JetConstituents[4][2] = {{0}};
185 const QReport* QReport_JetEFrac[4][2] = {{0}};
186 const QReport* QReport_JetPt[4][2] = {{0}};
190 float qr_Jet_Eta[4] = {-1};
191 float qr_Jet_Phi[4] = {-1};
192 float dc_Jet[4] = {-1};
194 float qr_Jet_Constituents[4][2] = {{-1}};
195 float qr_Jet_EFrac[4][2] = {{-1}};
196 float qr_Jet_Pt[4][2] = {{-1}};
201 for (
int jtyp=0; jtyp<4; ++jtyp) {
204 if (meJetConstituents[jtyp] && meJetConstituents[jtyp]->getRootObject() ) {
205 QReport_JetConstituents[jtyp][0] = meJetConstituents[jtyp]->
getQReport(
"meanJetConstituentsTest");
206 QReport_JetConstituents[jtyp][1] = meJetConstituents[jtyp]->
getQReport(
"KolmogorovTest");
208 if (meJetEMFrac[jtyp]&& meJetEMFrac[jtyp]->getRootObject() ) {
209 QReport_JetEFrac[jtyp][0] = meJetEMFrac[jtyp]->
getQReport(
"meanEMFractionTest");
210 QReport_JetEFrac[jtyp][1] = meJetEMFrac[jtyp]->
getQReport(
"KolmogorovTest");
212 if (meJetPt[jtyp] && meJetPt[jtyp]->getRootObject() ) {
213 QReport_JetPt[jtyp][0] = meJetPt[jtyp]->
getQReport(
"meanJetPtTest");
214 QReport_JetPt[jtyp][1] = meJetPt[jtyp]->
getQReport(
"KolmogorovTest");
216 if (meJetPhi[jtyp] && meJetPhi[jtyp]->getRootObject()){
217 QReport_JetPhi[jtyp] = meJetPhi[jtyp]->
getQReport(
"KolmogorovTest");
219 if (meJetEta[jtyp] && meJetEta[jtyp]->getRootObject()){
220 QReport_JetEta[jtyp] = meJetEta[jtyp]->
getQReport(
"KolmogorovTest");
224 if (QReport_JetPt[jtyp][0]){
226 if (QReport_JetPt[jtyp][0]->getStatus()==100 ||
227 QReport_JetPt[jtyp][0]->getStatus()==200)
228 qr_Jet_Pt[jtyp][0] = 1;
229 else if (QReport_JetPt[jtyp][0]->getStatus()==300)
230 qr_Jet_Pt[jtyp][0] = 0;
232 qr_Jet_Pt[jtyp][0] = -1;
234 else{ qr_Jet_Pt[jtyp][0] = -2;
237 if (QReport_JetPt[jtyp][1]){
238 if (QReport_JetPt[jtyp][1]->getStatus()==100 ||
239 QReport_JetPt[jtyp][1]->getStatus()==200)
240 qr_Jet_Pt[jtyp][1] = 1;
241 else if (QReport_JetPt[jtyp][1]->getStatus()==300)
242 qr_Jet_Pt[jtyp][1] = 0;
244 qr_Jet_Pt[jtyp][1] = -1;
246 else{ qr_Jet_Pt[jtyp][1] = -2;
250 if (QReport_JetPhi[jtyp]){
251 if (QReport_JetPhi[jtyp]->getStatus()==100 ||
252 QReport_JetPhi[jtyp]->getStatus()==200)
253 qr_Jet_Phi[jtyp] = 1;
254 else if (QReport_JetPhi[jtyp]->getStatus()==300)
255 qr_Jet_Phi[jtyp] = 0;
257 qr_Jet_Phi[jtyp] = -1;
259 else{ qr_Jet_Phi[jtyp] = -2;
262 if (QReport_JetEta[jtyp]){
263 if (QReport_JetEta[jtyp]->getStatus()==100 ||
264 QReport_JetEta[jtyp]->getStatus()==200)
265 qr_Jet_Eta[jtyp] = 1;
266 else if (QReport_JetEta[jtyp]->getStatus()==300)
267 qr_Jet_Eta[jtyp] = 0;
269 qr_Jet_Eta[jtyp] = -1;
272 qr_Jet_Eta[jtyp] = -2;
275 if (QReport_JetConstituents[jtyp][0]){
276 if (QReport_JetConstituents[jtyp][0]->getStatus()==100 ||
277 QReport_JetConstituents[jtyp][0]->getStatus()==200)
278 qr_Jet_Constituents[jtyp][0] = 1;
279 else if (QReport_JetConstituents[jtyp][0]->getStatus()==300)
280 qr_Jet_Constituents[jtyp][0] = 0;
282 qr_Jet_Constituents[jtyp][0] = -1;
284 else{ qr_Jet_Constituents[jtyp][0] = -2;
287 if (QReport_JetConstituents[jtyp][1]){
288 if (QReport_JetConstituents[jtyp][1]->getStatus()==100 ||
289 QReport_JetConstituents[jtyp][1]->getStatus()==200)
290 qr_Jet_Constituents[jtyp][1] = 1;
291 else if (QReport_JetConstituents[jtyp][1]->getStatus()==300)
292 qr_Jet_Constituents[jtyp][1] = 0;
294 qr_Jet_Constituents[jtyp][1] = -1;
296 else{ qr_Jet_Constituents[jtyp][1] = -2;
299 if (QReport_JetEFrac[jtyp][0]){
300 if (QReport_JetEFrac[jtyp][0]->getStatus()==100 ||
301 QReport_JetEFrac[jtyp][0]->getStatus()==200)
302 qr_Jet_EFrac[jtyp][0] = 1;
303 else if (QReport_JetEFrac[jtyp][0]->getStatus()==300)
304 qr_Jet_EFrac[jtyp][0] = 0;
306 qr_Jet_EFrac[jtyp][0] = -1;
308 else{ qr_Jet_EFrac[jtyp][0] = -2;
311 if (QReport_JetEFrac[jtyp][1]){
312 if (QReport_JetEFrac[jtyp][1]->getStatus()==100 ||
313 QReport_JetEFrac[jtyp][1]->getStatus()==200)
314 qr_Jet_EFrac[jtyp][1] = 1;
315 else if (QReport_JetEFrac[jtyp][1]->getStatus()==300)
316 qr_Jet_EFrac[jtyp][1] = 0;
318 qr_Jet_EFrac[jtyp][1] = -1;
320 else{ qr_Jet_EFrac[jtyp][1] = -2;
324 printf(
"====================Jet Type %d QTest Report Summary========================\n",jtyp);
325 printf(
"Eta: Phi: Pt 1: 2: Const/Ntracks 1: 2: EFrac/tracknhits 1: 2:\n");
327 printf(
"%2.2f %2.2f %2.2f %2.2f %2.2f %2.2f %2.2f %2.2f\n", \
330 qr_Jet_Pt[jtyp][0], \
331 qr_Jet_Pt[jtyp][1], \
332 qr_Jet_Constituents[jtyp][0], \
333 qr_Jet_Constituents[jtyp][1], \
334 qr_Jet_EFrac[jtyp][0], \
335 qr_Jet_EFrac[jtyp][1]);
341 for (
int ttyp = 0; ttyp < 2; ++ttyp) {
343 qr_Jet_Pt[jtyp][ttyp] = 1;
345 qr_Jet_Eta[jtyp] = 1;
346 qr_Jet_Phi[jtyp] = 1;
348 qr_Jet_EFrac[jtyp][ttyp] = 1;
349 qr_Jet_Constituents[jtyp][ttyp] = 1;
355 if ( (qr_Jet_EFrac[jtyp][0] == 0) ||
356 (qr_Jet_EFrac[jtyp][1] == 0) ||
357 (qr_Jet_Constituents[jtyp][1] == 0) ||
358 (qr_Jet_Constituents[jtyp][0] == 0) ||
359 (qr_Jet_Eta[jtyp] == 0) ||
360 (qr_Jet_Phi[jtyp] == 0) ||
361 (qr_Jet_Pt[jtyp][0] == 0) ||
362 (qr_Jet_Pt[jtyp][1] == 0)
365 else if ( (qr_Jet_EFrac[jtyp][0] == -1) &&
366 (qr_Jet_EFrac[jtyp][1] == -1) &&
367 (qr_Jet_Constituents[jtyp][1] == -1) &&
368 (qr_Jet_Constituents[jtyp][0] == -1) &&
369 (qr_Jet_Eta[jtyp] == -1) &&
370 (qr_Jet_Phi[jtyp] == -1) &&
371 (qr_Jet_Pt[jtyp][0] == -1) &&
372 (qr_Jet_Pt[jtyp][1] == -1 )
375 else if ( (qr_Jet_EFrac[jtyp][0] == -2) &&
376 (qr_Jet_EFrac[jtyp][1] == -2) &&
377 (qr_Jet_Constituents[jtyp][1] == -2) &&
378 (qr_Jet_Constituents[jtyp][0] == -2) &&
379 (qr_Jet_Eta[jtyp] == -2) &&
380 (qr_Jet_Phi[jtyp] == -2) &&
381 (qr_Jet_Pt[jtyp][0] == -2) &&
382 (qr_Jet_Pt[jtyp][1] == -2)
388 if (
verbose_)
std::cout<<
"Certifying Jet algo: "<<jtyp<<
" with value: "<<dc_Jet[jtyp]<<std::endl;
407 if (RunDir ==
"") newHistoName =
"JetMET/MET/";
408 else newHistoName = RunDir+
"/JetMET/Runsummary/MET/";
413 meMExy[0][0] = iget_.
get(newHistoName+
"met/"+
metFolder+
"/MEx");
414 meMExy[0][1] = iget_.
get(newHistoName+
"met/"+
metFolder+
"/MEy");
415 meMExy[1][0] = iget_.
get(newHistoName+
"pfMet/"+
metFolder+
"/MEx");
416 meMExy[1][1] = iget_.
get(newHistoName+
"pfMet/"+
metFolder+
"/MEy");
419 meMETPhi[0] = iget_.
get(newHistoName+
"met/"+
metFolder+
"/METPhi");
420 meMETPhi[1] = iget_.
get(newHistoName+
"pfMet/"+
metFolder+
"/METPhi");
422 meMEt[0] = iget_.
get(newHistoName+
"met/"+
metFolder+
"/MET");
423 meMEt[1] = iget_.
get(newHistoName+
"pfMet/"+
metFolder+
"/MET");
425 meSumEt[0] = iget_.
get(newHistoName+
"met/"+
metFolder+
"/SumET");
426 meSumEt[1] = iget_.
get(newHistoName+
"pfMet/"+
metFolder+
"/SumET");
435 const QReport * QReport_MExy[2][2][2]={{{0}}};
436 const QReport * QReport_MEt[2][2]={{0}};
437 const QReport * QReport_SumEt[2][2]={{0}};
439 const QReport * QReport_METPhi[2][2]={{0}};
442 float qr_MET_MExy[2][2][2] = {{{-999.}}};
443 float qr_MET_MEt[2][2] = {{-999.}};
444 float qr_MET_SumEt[2][2] = {{-999.}};
445 float qr_MET_METPhi[2][2] = {{-999.}};
446 float dc_MET[2] = {-999.};
451 for (
int mtyp = 0; mtyp < 2; ++mtyp){
453 if (meMExy[mtyp][0] && meMExy[mtyp][0]->getRootObject()) {
454 QReport_MExy[mtyp][0][0] = meMExy[mtyp][0]->
getQReport(
"meanMExyTest");
455 QReport_MExy[mtyp][1][0] = meMExy[mtyp][0]->
getQReport(
"KolmogorovTest");
457 if (meMExy[mtyp][1]&& meMExy[mtyp][1]->getRootObject()) {
458 QReport_MExy[mtyp][0][1] = meMExy[mtyp][1]->
getQReport(
"meanMExyTest");
459 QReport_MExy[mtyp][1][1] = meMExy[mtyp][1]->
getQReport(
"KolmogorovTest");
461 if (meMEt[mtyp] && meMEt[mtyp]->getRootObject()) {
462 QReport_MEt[mtyp][0] = meMEt[mtyp]->
getQReport(
"meanMETTest");
463 QReport_MEt[mtyp][1] = meMEt[mtyp]->
getQReport(
"KolmogorovTest");
466 if (meSumEt[mtyp] && meSumEt[mtyp]->getRootObject()) {
467 QReport_SumEt[mtyp][0] = meSumEt[mtyp]->
getQReport(
"meanSumETTest");
468 QReport_SumEt[mtyp][1] = meSumEt[mtyp]->
getQReport(
"KolmogorovTest");
471 if (meMETPhi[mtyp] && meMETPhi[mtyp]->getRootObject()) {
472 QReport_METPhi[mtyp][0] = meMETPhi[mtyp]->
getQReport(
"phiQTest");
473 QReport_METPhi[mtyp][1] = meMETPhi[mtyp]->
getQReport(
"KolmogorovTest");
475 for (
int testtyp = 0; testtyp < 2; ++testtyp) {
477 if (QReport_MExy[mtyp][testtyp][0]){
478 if (QReport_MExy[mtyp][testtyp][0]->getStatus()==100 ||
479 QReport_MExy[mtyp][testtyp][0]->getStatus()==200)
480 qr_MET_MExy[mtyp][testtyp][0] = 1;
481 else if (QReport_MExy[mtyp][testtyp][0]->getStatus()==300)
482 qr_MET_MExy[mtyp][testtyp][0] = 0;
484 qr_MET_MExy[mtyp][testtyp][0] = -1;
486 else qr_MET_MExy[mtyp][testtyp][0] = -2;
488 if (QReport_MExy[mtyp][testtyp][1]){
489 if (QReport_MExy[mtyp][testtyp][1]->getStatus()==100 ||
490 QReport_MExy[mtyp][testtyp][1]->getStatus()==200)
491 qr_MET_MExy[mtyp][testtyp][1] = 1;
492 else if (QReport_MExy[mtyp][testtyp][1]->getStatus()==300)
493 qr_MET_MExy[mtyp][testtyp][1] = 0;
495 qr_MET_MExy[mtyp][testtyp][1] = -1;
497 else qr_MET_MExy[mtyp][testtyp][1] = -2;
500 if (QReport_MEt[mtyp][testtyp]){
501 if (QReport_MEt[mtyp][testtyp]->getStatus()==100 ||
502 QReport_MEt[mtyp][testtyp]->getStatus()==200)
503 qr_MET_MEt[mtyp][testtyp] = 1;
504 else if (QReport_MEt[mtyp][testtyp]->getStatus()==300)
505 qr_MET_MEt[mtyp][testtyp] = 0;
507 qr_MET_MEt[mtyp][testtyp] = -1;
510 qr_MET_MEt[mtyp][testtyp] = -2;
513 if (QReport_SumEt[mtyp][testtyp]){
514 if (QReport_SumEt[mtyp][testtyp]->getStatus()==100 ||
515 QReport_SumEt[mtyp][testtyp]->getStatus()==200)
516 qr_MET_SumEt[mtyp][testtyp] = 1;
517 else if (QReport_SumEt[mtyp][testtyp]->getStatus()==300)
518 qr_MET_SumEt[mtyp][testtyp] = 0;
520 qr_MET_SumEt[mtyp][testtyp] = -1;
523 qr_MET_SumEt[mtyp][testtyp] = -2;
526 if (QReport_METPhi[mtyp][testtyp]){
527 if (QReport_METPhi[mtyp][testtyp]->getStatus()==100 ||
528 QReport_METPhi[mtyp][testtyp]->getStatus()==200)
529 qr_MET_METPhi[mtyp][testtyp] = 1;
530 else if (QReport_METPhi[mtyp][testtyp]->getStatus()==300)
531 qr_MET_METPhi[mtyp][testtyp] = 0;
533 qr_MET_METPhi[mtyp][testtyp] = -1;
536 qr_MET_METPhi[mtyp][testtyp] = -2;
543 printf(
"====================MET Type %d QTest Report Summary========================\n",mtyp);
544 printf(
"MEx test MEy test MEt test: SumEt test: METPhi test:\n");
545 for (
int tt = 0;
tt < 2; ++
tt) {
546 printf(
"%2.2f %2.2f %2.2f %2.2f %2.2f\n",qr_MET_MExy[mtyp][
tt][0], \
547 qr_MET_MExy[mtyp][tt][1], \
548 qr_MET_MEt[mtyp][tt], \
549 qr_MET_SumEt[mtyp][tt], \
550 qr_MET_METPhi[mtyp][tt]);
552 printf(
"===========================================================================\n");
557 for (
int ttyp = 0; ttyp < 2; ++ttyp) {
559 qr_MET_MExy[mtyp][ttyp][0] = 1;
560 qr_MET_MExy[mtyp][ttyp][1] = 1;
561 qr_MET_MEt[mtyp][ttyp] = 1;
562 qr_MET_SumEt[mtyp][ttyp] = 1;
563 qr_MET_METPhi[mtyp][ttyp] = 1;
569 (qr_MET_MExy[mtyp][0][0] == 0) ||
570 (qr_MET_MExy[mtyp][0][1] == 0) ||
571 (qr_MET_MEt[mtyp][0] == 0) ||
572 (qr_MET_SumEt[mtyp][0] == 0) ||
573 (qr_MET_METPhi[mtyp][0] == 0) ||
574 (qr_MET_MExy[mtyp][1][0] == 0) ||
575 (qr_MET_MExy[mtyp][1][1] == 0) ||
576 (qr_MET_MEt[mtyp][1] == 0) ||
577 (qr_MET_SumEt[mtyp][1] == 0) ||
578 (qr_MET_METPhi[mtyp][1] == 0)
582 (qr_MET_MExy[mtyp][0][0] == -1) &&
583 (qr_MET_MExy[mtyp][0][1] == -1) &&
584 (qr_MET_MEt[mtyp][0] == -1) &&
585 (qr_MET_SumEt[mtyp][0] == -1) &&
586 (qr_MET_METPhi[mtyp][0] == -1) &&
587 (qr_MET_MExy[mtyp][1][0] == -1) &&
588 (qr_MET_MExy[mtyp][1][1] == -1) &&
589 (qr_MET_MEt[mtyp][1] == -1) &&
590 (qr_MET_SumEt[mtyp][1] == -1) &&
591 (qr_MET_METPhi[mtyp][1] == -1)
595 (qr_MET_MExy[mtyp][0][0] == -2) &&
596 (qr_MET_MExy[mtyp][0][1] == -2) &&
597 (qr_MET_MEt[mtyp][0] == -2) &&
598 (qr_MET_SumEt[mtyp][0] == -2) &&
599 (qr_MET_METPhi[mtyp][0] == -2) &&
600 (qr_MET_MExy[mtyp][1][0] == -2) &&
601 (qr_MET_MExy[mtyp][1][1] == -2) &&
602 (qr_MET_MEt[mtyp][1] == -2) &&
603 (qr_MET_SumEt[mtyp][1] == -2) &&
604 (qr_MET_METPhi[mtyp][1] == -2)
610 if (
verbose_)
std::cout<<
"Certifying MET algo: "<<mtyp<<
" with value: "<<dc_MET[mtyp]<<std::endl;
620 float dc_CT[3] = {-2.};
625 for (
int cttyp = 0; cttyp < 3; ++cttyp) {
627 if (
verbose_)
std::cout<<
"Certifying CaloTowers with value: "<<dc_CT[cttyp]<<std::endl;
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)
MonitorElement * bookFloat(Args &&...args)
TH2F * getTH2F(void) const