Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:12:55

0001 //-------------------------------
0002 // Usage: .L plot_METDQM.C
0003 //        plot_METDQM("DQM_V0001_R000123575__JetMET__CMSSW_3_3_4__Harvesting.root",
0004 //                    "DQM_reference.root",
0005 //                    123575,
0006 //                    "path-to-web-space",
0007 //                    "CaloMET",
0008 //                    "png");
0009 //-------------------------------
0010 
0011 #include <stdio.h>
0012 #include <stdlib.h>
0013 
0014 void plot_METDQM(std::string filename, std::string reffile, int run, std::string outdir, std::string METName="CaloMET", std::string imgformat="png"){
0015 
0016   //-------------------------------
0017 
0018   gStyle->SetCanvasBorderMode(0);
0019   gStyle->SetPadBorderMode(0);
0020   gStyle->SetCanvasColor(0);
0021   gStyle->SetFrameLineWidth(2);
0022   gStyle->SetPadColor(0);
0023   gStyle->SetTitleFillColor(0);
0024   gStyle->SetStatColor(0);
0025   gStyle->SetPalette(1,0);
0026   //gStyle->SetPalette(51,0);
0027 
0028   gStyle->SetOptStat(111110);
0029   gStyle->SetOptFit(1100);
0030 
0031   gStyle->SetStatX(0.92);
0032   gStyle->SetStatY(0.86);
0033   gStyle->SetStatW(0.60);
0034   gStyle->SetStatH(0.20);
0035 
0036   gStyle->SetTitleX(0.15);
0037   gStyle->SetTitleY(0.98);
0038   gStyle->SetTitleW(0.5);
0039   gStyle->SetTitleH(0.06);
0040 
0041   //-------------------------------
0042 
0043   std::cout << filename << std::endl;
0044   TFile *_file    = TFile::Open(filename.c_str());
0045   //TFile *_fileRef = new TFile("/uscms_data/d2/sturdy07/DQM/Dec19thReReco/DQM_V0001_R000000001__JetMET__CMSSW_3_3_4__Harvesting.root");
0046   TFile *_fileRef = new TFile(reffile.c_str());
0047 
0048   char crun[10];
0049   sprintf(crun,"%d",run);
0050 
0051   char cprefix[3000];
0052   sprintf(cprefix,"DQMData/Run %d/JetMET/Run summary",run);  
0053   printf("%s\n",cprefix);
0054 
0055   char cprefixRef[3000];
0056   sprintf(cprefixRef,"DQMData/Run 1/JetMET/Run summary");
0057   printf("%s\n",cprefixRef);
0058 
0059   char ctitle[3000];
0060   char ctitleRef[3000];
0061   char cjpgname[3000];
0062 
0063   std::string METClass;
0064   if (METName=="CaloMET")     METClass="Calo";
0065   if (METName=="CaloMETNoHF") METClass="Calo";
0066   if (METName=="PfMET")       METClass="Pf";
0067   if (METName=="TcMET")       METClass="";
0068 
0069   //--------------------------------
0070   //--- CaloTower
0071   //--------------------------------
0072   
0073   char title[100];
0074   char name[100];
0075 
0076   if (METName=="CaloMET") {
0077 
0078     sprintf(ctitle,"%s/CaloTowers/SchemeB/METTask_CT_et_ieta_iphi",cprefix);
0079     TH1F *CT_et_ieta_iphi = (TH1F*) _file->Get(ctitle);    //
0080     CT_et_ieta_iphi->SetStats(kFALSE);
0081     CT_et_ieta_iphi->SetTitle("CaloTower Et");
0082 
0083     sprintf(ctitle,"%s/CaloTowers/SchemeB/METTask_CT_hadEt_ieta_iphi",cprefix);
0084     TH1F *CT_hadEt_ieta_iphi = (TH1F*) _file->Get(ctitle);    //
0085     CT_hadEt_ieta_iphi->SetStats(kFALSE);
0086     CT_hadEt_ieta_iphi->SetTitle("CaloTower hadEt");
0087 
0088     sprintf(ctitle,"%s/CaloTowers/SchemeB/METTask_CT_emEt_ieta_iphi",cprefix);
0089     TH1F *CT_emEt_ieta_iphi = (TH1F*) _file->Get(ctitle);    //
0090     CT_emEt_ieta_iphi->SetStats(kFALSE);
0091     CT_emEt_ieta_iphi->SetTitle("CaloTower emEt");
0092 
0093     sprintf(ctitle,"%s/CaloTowers/SchemeB/METTask_CT_Occ_ieta_iphi",cprefix);
0094     TH1F *CT_Occ_ieta_iphi = (TH1F*) _file->Get(ctitle);    //
0095     CT_Occ_ieta_iphi->SetStats(kFALSE);
0096     CT_Occ_ieta_iphi->SetTitle("CaloTower Occupancy");
0097 
0098     //-----
0099     sprintf(title,"CaloTower_Et_run=%d",run);
0100     sprintf(name,"CaloTower_Et_%d",run);
0101     TCanvas *c_CT_Et = new TCanvas(title,name,600.,400.);
0102   
0103     CT_et_ieta_iphi->SetMinimum(0.0);
0104     CT_et_ieta_iphi->Draw("colz");
0105 
0106     sprintf(cjpgname,"%s%d/CaloTowers/CT_Et.%s",outdir.c_str(),run,imgformat.c_str());
0107     c_CT_Et->SaveAs(cjpgname);
0108 
0109     //-----
0110     sprintf(title,"CaloTower_hadEt_run=%d",run);
0111     sprintf(name,"CaloTower_hadEt_%d",run);
0112     TCanvas *c_CT_hadEt = new TCanvas(title,name,600.,400.);
0113   
0114     CT_hadEt_ieta_iphi->SetMinimum(0.0);
0115     CT_hadEt_ieta_iphi->Draw("colz");
0116 
0117     sprintf(cjpgname,"%s%d/CaloTowers/CT_hadEt.%s",outdir.c_str(),run,imgformat.c_str());
0118     c_CT_hadEt->SaveAs(cjpgname);
0119 
0120     //-----
0121     sprintf(title,"CaloTower_emEt_run=%d",run);
0122     sprintf(name,"CaloTower_emEt_%d",run);
0123     TCanvas *c_CT_emEt = new TCanvas(title,name,600.,400.);
0124   
0125     CT_emEt_ieta_iphi->SetMinimum(0.0);
0126     CT_emEt_ieta_iphi->Draw("colz");
0127 
0128     sprintf(cjpgname,"%s%d/CaloTowers/CT_emEt.%s",outdir.c_str(),run,imgformat.c_str());
0129     c_CT_emEt->SaveAs(cjpgname);
0130 
0131     //-----
0132     sprintf(title,"CaloTower_Occupancy_run=%d",run);
0133     sprintf(name,"CaloTower_Occupancy_%d",run);
0134     TCanvas *c_CT_Occ = new TCanvas(title,name,600.,400.);
0135   
0136     CT_Occ_ieta_iphi->SetMinimum(0.0);
0137     CT_Occ_ieta_iphi->Draw("colz");
0138 
0139     sprintf(cjpgname,"%s%d/CaloTowers/CT_Occ.%s",outdir.c_str(),run,imgformat.c_str());
0140     c_CT_Occ->SaveAs(cjpgname);
0141 
0142   }
0143 
0144 
0145   //--------------------------------
0146   //--- METRate
0147   //--------------------------------
0148 
0149   sprintf(ctitle,"%s/MET/%s/All/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0150   TH1F *METRate = (TH1F*) _file->Get(ctitle);    //
0151   METRate->SetTitleSize(0.065,"X");
0152   METRate->SetTitleSize(0.065,"Y");
0153   METRate->SetTitle("METRate");
0154   METRate->GetXaxis()->SetTitle("MET Threshold (GeV)");
0155   METRate->GetYaxis()->SetTitle("Rate (Hz)");
0156 
0157   sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0158   TH1F *METRate_JetID                = (TH1F*) _file->Get(ctitle);    //
0159   sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0160   TH1F *METRate_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
0161   sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0162   TH1F *METRate_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
0163   sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0164   TH1F *METRate_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
0165   sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0166   TH1F *METRate_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
0167   sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0168   TH1F *METRate_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
0169   sprintf(ctitle,"%s/MET/%s/PV/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0170   TH1F *METRate_PV                   = (TH1F*) _file->Get(ctitle);    //
0171   sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0172   TH1F *METRate_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
0173   sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0174   TH1F *METRate_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
0175 
0176   sprintf(ctitle,"%s/MET/%s/All/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0177   TH1F *METRate_IonFeedbck = (TH1F*) _file->Get(ctitle);    //
0178   sprintf(ctitle,"%s/MET/%s/All/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0179   TH1F *METRate_RBXNoise   = (TH1F*) _file->Get(ctitle);    //
0180   sprintf(ctitle,"%s/MET/%s/All/METTask_%sMETRate",cprefix,METName.c_str(),METClass.c_str());
0181   TH1F *METRate_HPDNoise   = (TH1F*) _file->Get(ctitle);    //
0182 
0183   const int n = 3;
0184   Double_t x[n]  = {35., 60., 100.};
0185   Double_t y[n]  = {6.6, 0.5, 0.00001};
0186   METRate_QCD = new TGraphErrors(n,x,y);
0187   METRate_QCD->SetTitle("MET rate QCD 1E31");
0188   METRate_QCD->SetMarkerColor(4);
0189   METRate_QCD->SetMarkerStyle(21);
0190 
0191   const int n2 = 1;
0192   Double_t x2[n]  = {100.};
0193   Double_t y2[n]  = {0.2};
0194   METRate_QCD2 = new TGraphErrors(n2,x2,y2);
0195   METRate_QCD2->SetTitle("MET rate QCD 10E33");
0196   METRate_QCD2->SetMarkerColor(2);
0197   METRate_QCD2->SetMarkerStyle(21);
0198 
0199   //-------------------------------
0200 
0201   sprintf(title,"%s_Rate_run=%d",METName.c_str(),run);
0202   sprintf(name,"%s_Rate_%d",METName.c_str(),run);
0203   TCanvas *c_METRate = new TCanvas(title,name,600.,400.);
0204 
0205   gPad->SetBottomMargin(0.15);
0206   gPad->SetLeftMargin(0.15);
0207   gPad->SetLogy(1);
0208   gPad->SetGrid(1);
0209 
0210   METRate->SetLineColor(1);
0211   METRate->SetLineWidth(3);
0212   METRate_JetID->SetLineColor(2);
0213   METRate_JetID->SetLineWidth(3);
0214   METRate_JetIDTight->SetLineColor(9);
0215   METRate_JetIDTight->SetLineStyle(2);
0216   METRate_HcalNoiseFilter->SetLineColor(4);
0217   METRate_BeamHaloIDLoosePass->SetLineColor(3);
0218   METRate_BeamHaloIDTightPass->SetLineColor(11);
0219   METRate_TechTrigs->SetLineColor(14);
0220   METRate_PV->SetLineColor(12);
0221   METRate_BasicCleanup->SetLineColor(8);
0222   METRate_ExtraCleanup->SetLineColor(13);
0223 
0224   METRate->SetStats(kFALSE);
0225   METRate->SetTitle(title);
0226   METRate->GetXaxis()->SetRange(1,75);
0227   METRate->SetMaximum(100.);
0228   METRate->SetMinimum(0.0001);
0229   METRate->DrawCopy();
0230   METRate_JetID->Draw("same");
0231   METRate_JetIDTight->Draw("same");
0232   METRate_HcalNoiseFilter->Draw("same");
0233   METRate_BeamHaloIDTightPass->Draw("same");
0234   METRate_BeamHaloIDLoosePass->Draw("same");
0235   METRate_TechTrigs->Draw("same");
0236   METRate_PV->Draw("same");
0237   METRate_BasicCleanup->Draw("same");
0238   METRate_ExtraCleanup->Draw("same");
0239   //METRate_QCD->Draw("P,same");
0240   //METRate_QCD2->Draw("P,same");
0241 
0242   TLegend *tl_METRate = new TLegend(0.5,0.6,0.88,0.86);
0243   tl_METRate->AddEntry(METRate,"All triggers (data)","l");
0244   tl_METRate->AddEntry(METRate_JetID,"JetID cuts Minimal","l");
0245   tl_METRate->AddEntry(METRate_JetIDTight,"JetID cuts Tight","l");
0246   tl_METRate->AddEntry(METRate_HcalNoiseFilter,"Hcal Noise Filter","l");
0247   tl_METRate->AddEntry(METRate_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
0248   tl_METRate->AddEntry(METRate_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
0249   tl_METRate->AddEntry(METRate_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
0250   tl_METRate->AddEntry(METRate_PV,"Primary Vertex","l");
0251   tl_METRate->AddEntry(METRate_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
0252   tl_METRate->AddEntry(METRate_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
0253   //tl_METRate->AddEntry(METRate_QCD,"QCD 1E31","p");
0254   //tl_METRate->AddEntry(METRate_QCD2,"QCD 10E33","p");
0255   tl_METRate->SetFillColor(0);
0256   tl_METRate->Draw();
0257 
0258   sprintf(cjpgname,"%s%d/METDQM/%s/METRate.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str(),imgformat.c_str());
0259   c_METRate->SaveAs(cjpgname);
0260 
0261   //-------------------------------
0262   // MET
0263   //-------------------------------
0264 
0265   sprintf(ctitle,"%s/MET/%s/All/METTask_%sMET",cprefix,METName.c_str(),METClass.c_str());
0266   std::cout << ctitle << std::endl;
0267   TH1F *MET = (TH1F*) _file->Get(ctitle);    //
0268   MET->SetTitleSize(0.065,"X");
0269   MET->SetTitleSize(0.065,"Y");
0270   MET->SetTitle("MET");
0271   MET->GetXaxis()->SetTitle("MET (GeV)");
0272   MET->GetYaxis()->SetTitle("Events");
0273 
0274   sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sMET",cprefix,METName.c_str(),METClass.c_str());
0275   TH1F *MET_JetID                = (TH1F*) _file->Get(ctitle);    //
0276   sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sMET",cprefix,METName.c_str(),METClass.c_str());
0277   TH1F *MET_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
0278   sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sMET",cprefix,METName.c_str(),METClass.c_str());
0279   TH1F *MET_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
0280   sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sMET",cprefix,METName.c_str(),METClass.c_str());
0281   TH1F *MET_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
0282   sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sMET",cprefix,METName.c_str(),METClass.c_str());
0283   TH1F *MET_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
0284   sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sMET",cprefix,METName.c_str(),METClass.c_str());
0285   TH1F *MET_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
0286   sprintf(ctitle,"%s/MET/%s/PV/METTask_%sMET",cprefix,METName.c_str(),METClass.c_str());
0287   TH1F *MET_PV                   = (TH1F*) _file->Get(ctitle);    //
0288   sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sMET",cprefix,METName.c_str(),METClass.c_str());
0289   TH1F *MET_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
0290   sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sMET",cprefix,METName.c_str(),METClass.c_str());
0291   TH1F *MET_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
0292 
0293   sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sMET",cprefixRef,METName.c_str(),METClass.c_str());
0294   TH1F *MET_Ref = _fileRef->Get(ctitleRef);
0295 
0296   double SF=1.;
0297 
0298   if (MET_Ref->GetEntries()>0){
0299     if (MET_ExtraCleanup->GetEntries()>5.)  SF = (MET_ExtraCleanup->GetEntries())/(MET_Ref->GetEntries());
0300     else                                    SF = (MET_BasicCleanup->GetEntries())/(MET_Ref->GetEntries());
0301   }
0302   MET_Ref->Scale(SF);
0303 
0304   //-------------------------------
0305 
0306   sprintf(title,"%s_run=%d",METName.c_str(),run);
0307   sprintf(name,"%s_%d",METName.c_str(),run);
0308   TCanvas *c_MET = new TCanvas(title,name,600.,400.);
0309 
0310   gPad->SetBottomMargin(0.15);
0311   gPad->SetLeftMargin(0.15);
0312   gPad->SetLogy(1);
0313   gPad->SetGrid(1);
0314 
0315   MET->SetLineColor(1);
0316   MET_JetID->SetLineColor(2);
0317   MET_JetID->SetLineWidth(3);
0318   MET_JetIDTight->SetLineColor(9);
0319   MET_JetIDTight->SetLineWidth(2);
0320   MET_HcalNoiseFilter->SetLineColor(4);
0321   MET_HcalNoiseFilter->SetLineWidth(2);
0322   MET_BeamHaloIDLoosePass->SetLineColor(2);
0323   MET_BeamHaloIDTightPass->SetLineColor(9);
0324   MET_BeamHaloIDLoosePass->SetLineWidth(2);
0325   MET_BeamHaloIDTightPass->SetLineWidth(2);
0326   MET_TechTrigs->SetLineColor(14);
0327   MET_TechTrigs->SetLineWidth(2);
0328   MET_PV->SetLineColor(12);
0329   MET_PV->SetLineWidth(2);
0330   MET_BasicCleanup->SetLineColor(8);
0331   MET_ExtraCleanup->SetLineColor(4);
0332   MET_BasicCleanup->SetLineWidth(2);
0333   MET_ExtraCleanup->SetLineWidth(2);
0334 
0335   MET->SetStats(kFALSE);
0336   MET->SetTitle(title);
0337   MET->GetXaxis()->SetRange(1,25);
0338   //MET->SetMaximum(1000.);
0339   MET->SetMinimum(0.5);
0340   MET->DrawCopy();
0341   //MET_JetID->Draw("same");
0342   //MET_JetIDTight->Draw("same");
0343   //MET_HcalNoiseFilter->Draw("same");
0344   //MET_BeamHaloIDTightPass->Draw("same");
0345   //MET_BeamHaloIDLoosePass->Draw("same");
0346   //MET_TechTrigs->Draw("same");
0347   //MET_PV->Draw("same");
0348   MET_BasicCleanup->DrawCopy("same");
0349 
0350   MET_Ref->SetLineColor(2);
0351   MET_Ref->SetFillColor(2);
0352   MET_Ref->SetLineWidth(3);
0353   MET_Ref->DrawCopy("same");
0354 
0355   MET->DrawCopy("same,s");
0356   MET->DrawCopy("same,e");
0357   MET_BasicCleanup->DrawCopy("same,s");
0358   MET_BasicCleanup->DrawCopy("same,e");
0359   MET_ExtraCleanup->DrawCopy("same,s");
0360   MET_ExtraCleanup->DrawCopy("same,e");
0361 
0362   TLegend *tl_MET = new TLegend(0.5,0.65,0.88,0.86);
0363   tl_MET->AddEntry(MET,"All triggers (data)","l");
0364   //tl_MET->AddEntry(MET_JetID,"JetID cuts Minimal","l");
0365   //tl_MET->AddEntry(MET_JetIDTight,"JetID cuts Tight","l");
0366   //tl_MET->AddEntry(MET_HcalNoiseFilter,"Hcal Noise Filter","l");
0367   //tl_MET->AddEntry(MET_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
0368   //tl_MET->AddEntry(MET_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
0369   //tl_MET->AddEntry(MET_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
0370   //tl_MET->AddEntry(MET_PV,"Primary Vertex","l");
0371   //tl_MET->AddEntry(MET_HLTPhysicsOn,"HLT Physics Declared","l");
0372   tl_MET->AddEntry(MET_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
0373   tl_MET->AddEntry(MET_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
0374   tl_MET->AddEntry(MET_Ref,"MinBias MC","l");
0375   tl_MET->SetFillColor(0);
0376   tl_MET->Draw();
0377 
0378   sprintf(cjpgname,"%s%d/METDQM/%s/MET.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
0379   c_MET->SaveAs(cjpgname);
0380 
0381   //-------------------------------
0382   // MET_logx
0383   //-------------------------------
0384 
0385   sprintf(ctitle,"%s/MET/%s/All/METTask_%sMET_logx",cprefix,METName.c_str(),METClass.c_str());
0386   std::cout << ctitle << std::endl;
0387   TH1F *MET_logx = (TH1F*) _file->Get(ctitle);    //
0388   MET_logx->SetTitleSize(0.065,"X");
0389   MET_logx->SetTitleSize(0.065,"Y");
0390   MET_logx->SetTitle("MET");
0391   MET_logx->GetXaxis()->SetTitle("log10(MET [GeV])");
0392   MET_logx->GetYaxis()->SetTitle("Events");
0393 
0394   sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sMET_logx",cprefix,METName.c_str(),METClass.c_str());
0395   TH1F *MET_JetID_logx                = (TH1F*) _file->Get(ctitle);    //
0396   sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sMET_logx",cprefix,METName.c_str(),METClass.c_str());
0397   TH1F *MET_JetIDTight_logx           = (TH1F*) _file->Get(ctitle);    //
0398   sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sMET_logx",cprefix,METName.c_str(),METClass.c_str());
0399   TH1F *MET_HcalNoiseFilter_logx      = (TH1F*) _file->Get(ctitle);    //
0400   sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sMET_logx",cprefix,METName.c_str(),METClass.c_str());
0401   TH1F *MET_BeamHaloIDLoosePass_logx  = (TH1F*) _file->Get(ctitle);    //
0402   sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sMET_logx",cprefix,METName.c_str(),METClass.c_str());
0403   TH1F *MET_BeamHaloIDTightPass_logx  = (TH1F*) _file->Get(ctitle);    //
0404   sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sMET_logx",cprefix,METName.c_str(),METClass.c_str());
0405   TH1F *MET_TechTrigs_logx            = (TH1F*) _file->Get(ctitle);    //
0406   sprintf(ctitle,"%s/MET/%s/PV/METTask_%sMET_logx",cprefix,METName.c_str(),METClass.c_str());
0407   TH1F *MET_PV_logx                   = (TH1F*) _file->Get(ctitle);    //
0408   sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sMET_logx",cprefix,METName.c_str(),METClass.c_str());
0409   TH1F *MET_BasicCleanup_logx         = (TH1F*) _file->Get(ctitle);    //
0410   sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sMET_logx",cprefix,METName.c_str(),METClass.c_str());
0411   TH1F *MET_ExtraCleanup_logx         = (TH1F*) _file->Get(ctitle);    //
0412 
0413   sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sMET_logx",cprefixRef,METName.c_str(),METClass.c_str());
0414   TH1F *MET_Ref_logx = _fileRef->Get(ctitleRef);
0415   MET_Ref_logx->Scale(SF);
0416 
0417   //-------------------------------
0418 
0419   sprintf(title,"%s_logx_run=%d",METName.c_str(),run);
0420   sprintf(name,"%s_logx_%d",METName.c_str(),run);
0421   TCanvas *c_MET_logx = new TCanvas(title,name,600.,400.);
0422 
0423   gPad->SetBottomMargin(0.15);
0424   gPad->SetLeftMargin(0.15);
0425   gPad->SetLogy(1);
0426   gPad->SetGrid(1);
0427 
0428   MET_logx->SetLineColor(1);
0429   MET_JetID_logx->SetLineColor(2);
0430   MET_JetID_logx->SetLineWidth(3);
0431   MET_JetIDTight_logx->SetLineColor(9);
0432   MET_HcalNoiseFilter_logx->SetLineColor(4);
0433   MET_BasicCleanup_logx->SetLineColor(8);
0434   MET_ExtraCleanup_logx->SetLineColor(4);
0435   MET_BeamHaloIDLoosePass_logx->SetLineColor(2);
0436   MET_BeamHaloIDTightPass_logx->SetLineColor(9);
0437   MET_BeamHaloIDLoosePass_logx->SetLineWidth(2);
0438   MET_BeamHaloIDTightPass_logx->SetLineWidth(2);
0439   MET_TechTrigs_logx->SetLineColor(14);
0440   MET_TechTrigs_logx->SetLineWidth(2);
0441   MET_PV_logx->SetLineColor(12);
0442   MET_PV_logx->SetLineWidth(2);
0443 
0444   MET_logx->SetStats(kFALSE);
0445   MET_logx->SetTitle(title);
0446   MET_logx->GetXaxis()->SetRange(1,25);
0447   //MET_logx->SetMaximum(1000.);
0448   MET_logx->SetMinimum(0.5);
0449   MET_logx->DrawCopy();
0450   //MET_JetID_logx->Draw("same");
0451   //MET_JetIDTight_logx->Draw("same");
0452   //MET_HcalNoiseFilter_logx->Draw("same");
0453   //MET_BeamHaloIDTightPass_logx->Draw("same");
0454   //MET_BeamHaloIDLoosePass_logx->Draw("same");
0455   //MET_TechTrigs_logx->Draw("same");
0456   //MET_PV_logx->Draw("same");
0457   MET_BasicCleanup_logx->DrawCopy("same");
0458 
0459   MET_Ref_logx->SetLineColor(2);
0460   MET_Ref_logx->SetFillColor(2);
0461   MET_Ref_logx->SetLineWidth(3);
0462   MET_Ref_logx->DrawCopy("same");
0463 
0464   MET_logx->DrawCopy("same,s");
0465   MET_logx->DrawCopy("same,e");
0466   MET_BasicCleanup_logx->DrawCopy("same,s");
0467   MET_BasicCleanup_logx->DrawCopy("same,e");
0468   MET_ExtraCleanup_logx->DrawCopy("same,s");
0469   MET_ExtraCleanup_logx->DrawCopy("same,e");
0470 
0471   TLegend *tl_MET_logx = new TLegend(0.5,0.65,0.88,0.86);
0472   tl_MET_logx->AddEntry(MET_logx,"All triggers (data)","l");
0473   //tl_MET_logx->AddEntry(MET_JetID_logx,"JetID cuts Minimal","l");
0474   //tl_MET_logx->AddEntry(MET_JetIDTight_logx,"JetID cuts Tight","l");
0475   //tl_MET_logx->AddEntry(MET_HcalNoiseFilter_logx,"Hcal Noise Filter","l");
0476   //tl_MET_logx->AddEntry(MET_BeamHaloIDLoosePass_logx,"BeamHalo ID Loose Pass","l");
0477   //tl_MET_logx->AddEntry(MET_BeamHaloIDTightPass_logx,"BeamHalo ID Tight Pass","l");
0478   //tl_MET_logx->AddEntry(MET_TechTrigs_logx,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
0479   //tl_MET_logx->AddEntry(MET_PV_logx,"Primary Vertex","l");
0480   //tl_MET_logx->AddEntry(MET_HLTPhysicsOn_logx,"HLT Physics Declared","l");
0481   tl_MET_logx->AddEntry(MET_BasicCleanup_logx,"Technical Triggers","l");
0482   //tl_MET_logx->AddEntry(MET_BasicCleanup_logx,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
0483   tl_MET_logx->AddEntry(MET_ExtraCleanup_logx," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
0484   tl_MET_logx->AddEntry(MET_Ref_logx,"MinBias MC","l");
0485   tl_MET_logx->SetFillColor(0);
0486   tl_MET_logx->Draw();
0487 
0488   sprintf(cjpgname,"%s%d/METDQM/%s/MET_logx.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
0489   c_MET_logx->SaveAs(cjpgname);
0490 
0491   //-------------------------------
0492   // SumET
0493   //-------------------------------
0494 
0495   sprintf(ctitle,"%s/MET/%s/All/METTask_%sSumET",cprefix,METName.c_str(),METClass.c_str());
0496   std::cout << ctitle << std::endl;
0497   TH1F *SumET = (TH1F*) _file->Get(ctitle);    //
0498   SumET->SetTitleSize(0.065,"X");
0499   SumET->SetTitleSize(0.065,"Y");
0500   SumET->SetTitle("SumET");
0501   SumET->GetXaxis()->SetTitle("SumET (GeV)");
0502   SumET->GetYaxis()->SetTitle("Events");
0503 
0504   sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sSumET",cprefix,METName.c_str(),METClass.c_str());
0505   TH1F *SumET_JetID                = (TH1F*) _file->Get(ctitle);    //
0506   sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sSumET",cprefix,METName.c_str(),METClass.c_str());
0507   TH1F *SumET_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
0508   sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sSumET",cprefix,METName.c_str(),METClass.c_str());
0509   TH1F *SumET_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
0510   sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sSumET",cprefix,METName.c_str(),METClass.c_str());
0511   TH1F *SumET_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
0512   sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sSumET",cprefix,METName.c_str(),METClass.c_str());
0513   TH1F *SumET_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
0514   sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sSumET",cprefix,METName.c_str(),METClass.c_str());
0515   TH1F *SumET_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
0516   sprintf(ctitle,"%s/MET/%s/PV/METTask_%sSumET",cprefix,METName.c_str(),METClass.c_str());
0517   TH1F *SumET_PV                   = (TH1F*) _file->Get(ctitle);    //
0518   sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sSumET",cprefix,METName.c_str(),METClass.c_str());
0519   TH1F *SumET_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
0520   sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sSumET",cprefix,METName.c_str(),METClass.c_str());
0521   TH1F *SumET_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
0522 
0523   sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sSumET",cprefixRef,METName.c_str(),METClass.c_str());
0524   TH1F *SumET_Ref = _fileRef->Get(ctitleRef);
0525   SumET_Ref->Scale(SF);
0526 
0527   //-------------------------------
0528 
0529   sprintf(title,"%s_SumET_run=%d",METName.c_str(),run);
0530   sprintf(name,"%s_SumET_%d",METName.c_str(),run);
0531   TCanvas *c_SumET = new TCanvas(title,name,600.,400.);
0532 
0533   gPad->SetBottomMargin(0.15);
0534   gPad->SetLeftMargin(0.15);
0535   gPad->SetLogy(1);
0536   gPad->SetGrid(1);
0537 
0538   SumET->SetLineColor(1);
0539   SumET_JetID->SetLineColor(2);
0540   SumET_JetID->SetLineWidth(3);
0541   SumET_JetIDTight->SetLineColor(9);
0542   SumET_HcalNoiseFilter->SetLineColor(4);
0543   SumET_BeamHaloIDLoosePass->SetLineColor(2);
0544   SumET_BeamHaloIDTightPass->SetLineColor(9);
0545   SumET_BeamHaloIDLoosePass->SetLineWidth(2);
0546   SumET_BeamHaloIDTightPass->SetLineWidth(2);
0547   SumET_TechTrigs->SetLineColor(14);
0548   SumET_TechTrigs->SetLineWidth(2);
0549   SumET_PV->SetLineColor(12);
0550   SumET_PV->SetLineWidth(2);
0551   SumET_BasicCleanup->SetLineColor(8);
0552   SumET_ExtraCleanup->SetLineColor(4);
0553 
0554   SumET->SetStats(kFALSE);
0555   SumET->SetTitle(title);
0556   SumET->GetXaxis()->SetRange(1,25);
0557   //SumET->SetMaximum(1000.);
0558   SumET->SetMinimum(0.5);
0559   SumET->DrawCopy();
0560   //SumET_JetID->Draw("same");
0561   //SumET_JetIDTight->Draw("same");
0562   //SumET_HcalNoiseFilter->Draw("same");
0563   //SumET_BeamHaloIDTightPass->Draw("same");
0564   //SumET_BeamHaloIDLoosePass->Draw("same");
0565   //SumET_TechTrigs->DrawCopy("same");
0566   //SumET_PV->DrawCopy("same");
0567   SumET_BasicCleanup->DrawCopy("same");
0568 
0569   SumET_Ref->SetLineColor(2);
0570   SumET_Ref->SetFillColor(2);
0571   SumET_Ref->SetLineWidth(3);
0572   SumET_Ref->DrawCopy("same");
0573 
0574   SumET->DrawCopy("same,s");
0575   SumET->DrawCopy("same,e");
0576   SumET_BasicCleanup->DrawCopy("same,s");
0577   SumET_BasicCleanup->DrawCopy("same,e");
0578   SumET_ExtraCleanup->DrawCopy("same,s");
0579   SumET_ExtraCleanup->DrawCopy("same,e");
0580 
0581   TLegend *tl_SumET = new TLegend(0.5,0.65,0.88,0.86);
0582   tl_SumET->AddEntry(SumET,"All triggers (data)","l");
0583   //tl_SumET->AddEntry(SumET_JetID,"JetID cuts Minimal","l");
0584   //tl_SumET->AddEntry(SumET_JetIDTight,"JetID cuts Tight","l");
0585   //tl_SumET->AddEntry(SumET_HcalNoiseFilter,"Hcal Noise Filter","l");
0586   //tl_SumET->AddEntry(SumET_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
0587   //tl_SumET->AddEntry(SumET_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
0588   //tl_SumET->AddEntry(SumET_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
0589   //tl_SumET->AddEntry(SumET_PV,"Primary Vertex","l");
0590   //tl_SumET->AddEntry(SumET_HLTPhysicsOn,"HLT Physics Declared","l");
0591   tl_SumET->AddEntry(SumET_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
0592   tl_SumET->AddEntry(SumET_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
0593   tl_SumET->AddEntry(SumET_Ref,"MinBias MC","l");
0594   tl_SumET->SetFillColor(0);
0595   tl_SumET->Draw();
0596 
0597   sprintf(cjpgname,"%s%d/METDQM/%s/SumET.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
0598   c_SumET->SaveAs(cjpgname);
0599 
0600   //-------------------------------
0601   // SumET_logx
0602   //-------------------------------
0603 
0604   sprintf(ctitle,"%s/MET/%s/All/METTask_%sSumET_logx",cprefix,METName.c_str(),METClass.c_str());
0605   std::cout << ctitle << std::endl;
0606   TH1F *SumET_logx = (TH1F*) _file->Get(ctitle);    //
0607   SumET_logx->SetTitleSize(0.065,"X");
0608   SumET_logx->SetTitleSize(0.065,"Y");
0609   SumET_logx->SetTitle("SumET_logx");
0610   SumET_logx->GetXaxis()->SetTitle("log10(SumET [GeV])");
0611   SumET_logx->GetYaxis()->SetTitle("Events");
0612 
0613   sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sSumET_logx",cprefix,METName.c_str(),METClass.c_str());
0614   TH1F *SumET_JetID_logx                = (TH1F*) _file->Get(ctitle);    //
0615   sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sSumET_logx",cprefix,METName.c_str(),METClass.c_str());
0616   TH1F *SumET_JetIDTight_logx           = (TH1F*) _file->Get(ctitle);    //
0617   sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sSumET_logx",cprefix,METName.c_str(),METClass.c_str());
0618   TH1F *SumET_HcalNoiseFilter_logx      = (TH1F*) _file->Get(ctitle);    //
0619   sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sSumET_logx",cprefix,METName.c_str(),METClass.c_str());
0620   TH1F *SumET_BeamHaloIDLoosePass_logx  = (TH1F*) _file->Get(ctitle);    //
0621   sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sSumET_logx",cprefix,METName.c_str(),METClass.c_str());
0622   TH1F *SumET_BeamHaloIDTightPass_logx  = (TH1F*) _file->Get(ctitle);    //
0623   sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sSumET_logx",cprefix,METName.c_str(),METClass.c_str());
0624   TH1F *SumET_TechTrigs_logx            = (TH1F*) _file->Get(ctitle);    //
0625   sprintf(ctitle,"%s/MET/%s/PV/METTask_%sSumET_logx",cprefix,METName.c_str(),METClass.c_str());
0626   TH1F *SumET_PV_logx                   = (TH1F*) _file->Get(ctitle);    //
0627   sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sSumET_logx",cprefix,METName.c_str(),METClass.c_str());
0628   TH1F *SumET_BasicCleanup_logx         = (TH1F*) _file->Get(ctitle);    //
0629   sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sSumET_logx",cprefix,METName.c_str(),METClass.c_str());
0630   TH1F *SumET_ExtraCleanup_logx         = (TH1F*) _file->Get(ctitle);    //
0631 
0632   sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sSumET_logx",cprefixRef,METName.c_str(),METClass.c_str());
0633   TH1F *SumET_Ref_logx = _fileRef->Get(ctitleRef);
0634   SumET_Ref_logx->Scale(SF);
0635 
0636   //-------------------------------
0637 
0638   sprintf(title,"%s_SumET_logx_run=%d",METName.c_str(),run);
0639   sprintf(name,"%s_SumET_logx_%d",METName.c_str(),run);
0640   TCanvas *c_SumET_logx = new TCanvas(title,name,600.,400.);
0641 
0642   gPad->SetBottomMargin(0.15);
0643   gPad->SetLeftMargin(0.15);
0644   gPad->SetLogy(1);
0645   gPad->SetGrid(1);
0646 
0647   SumET_logx->SetLineColor(1);
0648   SumET_JetID_logx->SetLineColor(2);
0649   SumET_JetID_logx->SetLineWidth(3);
0650   SumET_JetIDTight_logx->SetLineColor(9);
0651   SumET_HcalNoiseFilter_logx->SetLineColor(4);
0652   SumET_BasicCleanup_logx->SetLineColor(8);
0653   SumET_ExtraCleanup_logx->SetLineColor(4);
0654   SumET_BeamHaloIDLoosePass_logx->SetLineColor(2);
0655   SumET_BeamHaloIDTightPass_logx->SetLineColor(9);
0656   SumET_BeamHaloIDLoosePass_logx->SetLineWidth(2);
0657   SumET_BeamHaloIDTightPass_logx->SetLineWidth(2);
0658   SumET_TechTrigs_logx->SetLineColor(14);
0659   SumET_TechTrigs_logx->SetLineWidth(2);
0660   SumET_PV_logx->SetLineColor(12);
0661   SumET_PV_logx->SetLineWidth(2);
0662 
0663   SumET_logx->SetStats(kFALSE);
0664   SumET_logx->SetTitle(title);
0665   SumET_logx->GetXaxis()->SetRange(1,25);
0666   //SumET_logx->SetMaximum(1000.);
0667   SumET_logx->SetMinimum(0.5);
0668   SumET_logx->DrawCopy();
0669   //SumET_JetID_logx->Draw("same");
0670   //SumET_JetIDTight_logx->Draw("same");
0671   //SumET_HcalNoiseFilter_logx->Draw("same");
0672   //SumET_BeamHaloIDTightPass_logx->Draw("same");
0673   //SumET_BeamHaloIDLoosePass_logx->Draw("same");
0674   //SumET_TechTrigs_logx->Draw("same");
0675   //SumET_PV_logx->Draw("same");
0676   SumET_BasicCleanup_logx->DrawCopy("same");
0677 
0678   SumET_Ref_logx->SetLineColor(2);
0679   SumET_Ref_logx->SetFillColor(2);
0680   SumET_Ref_logx->SetLineWidth(3);
0681   SumET_Ref_logx->DrawCopy("same");
0682 
0683   SumET_logx->DrawCopy("same,s");
0684   SumET_logx->DrawCopy("same,e");
0685   SumET_BasicCleanup_logx->DrawCopy("same,s");
0686   SumET_BasicCleanup_logx->DrawCopy("same,e");
0687   SumET_ExtraCleanup_logx->DrawCopy("same,s");
0688   SumET_ExtraCleanup_logx->DrawCopy("same,e");
0689 
0690   TLegend *tl_SumET_logx = new TLegend(0.5,0.65,0.88,0.86);
0691   tl_SumET_logx->AddEntry(SumET_logx,"All triggers (data)","l");
0692   //tl_SumET_logx->AddEntry(SumET_JetID_logx,"JetID cuts Minimal","l");
0693   //tl_SumET_logx->AddEntry(SumET_JetIDTight_logx,"JetID cuts Tight","l");
0694   //tl_SumET_logx->AddEntry(SumET_HcalNoiseFilter_logx,"Hcal Noise Filter","l");
0695   //tl_SumET_logx->AddEntry(SumET_BeamHaloIDLoosePass_logx,"BeamHalo ID Loose Pass","l");
0696   //tl_SumET_logx->AddEntry(SumET_BeamHaloIDTightPass_logx,"BeamHalo ID Tight Pass","l");
0697   //tl_SumET_logx->AddEntry(SumET_TechTrigs_logx,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
0698   //tl_SumET_logx->AddEntry(SumET_PV_logx,"Primary Vertex","l");
0699   //tl_SumET_logx->AddEntry(SumET_HLTPhysicsOn_logx,"HLT Physics Declared","l");
0700   tl_SumET_logx->AddEntry(SumET_BasicCleanup_logx,"Technical Triggers","l");
0701   //tl_SumET_logx->AddEntry(SumET_BasicCleanup_logx,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
0702   tl_SumET_logx->AddEntry(SumET_ExtraCleanup_logx," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
0703   tl_SumET_logx->AddEntry(SumET_Ref_logx,"MinBias MC","l");
0704   tl_SumET_logx->SetFillColor(0);
0705   tl_SumET_logx->Draw();
0706 
0707   sprintf(cjpgname,"%s%d/METDQM/%s/SumET_logx.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
0708   c_SumET_logx->SaveAs(cjpgname);
0709 
0710   //-------------------------------
0711   // MEx
0712   //-------------------------------
0713 
0714   sprintf(ctitle,"%s/MET/%s/All/METTask_%sMEx",cprefix,METName.c_str(),METClass.c_str());
0715   std::cout << ctitle << std::endl;
0716   TH1F *MEx = (TH1F*) _file->Get(ctitle);    //
0717   MEx->SetTitleSize(0.065,"X");
0718   MEx->SetTitleSize(0.065,"Y");
0719   MEx->SetTitle("MEx");
0720   MEx->GetXaxis()->SetTitle("MEx (GeV)");
0721   MEx->GetYaxis()->SetTitle("Events");
0722 
0723   sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sMEx",cprefix,METName.c_str(),METClass.c_str());
0724   TH1F *MEx_JetID                = (TH1F*) _file->Get(ctitle);    //
0725   sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sMEx",cprefix,METName.c_str(),METClass.c_str());
0726   TH1F *MEx_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
0727   sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sMEx",cprefix,METName.c_str(),METClass.c_str());
0728   TH1F *MEx_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
0729   sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sMEx",cprefix,METName.c_str(),METClass.c_str());
0730   TH1F *MEx_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
0731   sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sMEx",cprefix,METName.c_str(),METClass.c_str());
0732   TH1F *MEx_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
0733   sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sMEx",cprefix,METName.c_str(),METClass.c_str());
0734   TH1F *MEx_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
0735   sprintf(ctitle,"%s/MET/%s/PV/METTask_%sMEx",cprefix,METName.c_str(),METClass.c_str());
0736   TH1F *MEx_PV                   = (TH1F*) _file->Get(ctitle);    //
0737   sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sMEx",cprefix,METName.c_str(),METClass.c_str());
0738   TH1F *MEx_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
0739   sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sMEx",cprefix,METName.c_str(),METClass.c_str());
0740   TH1F *MEx_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
0741 
0742   sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sMEx",cprefixRef,METName.c_str(),METClass.c_str());
0743   TH1F *MEx_Ref = _fileRef->Get(ctitleRef);
0744   MEx_Ref->Scale(SF);
0745 
0746   //-------------------------------
0747 
0748   sprintf(title,"%s_MEx_run=%d",METName.c_str(),run);
0749   sprintf(name,"%s_MEy_%d",METName.c_str(),run);
0750   TCanvas *c_MEx = new TCanvas(title,name,600.,400.);
0751 
0752   gPad->SetBottomMargin(0.15);
0753   gPad->SetLeftMargin(0.15);
0754   gPad->SetLogy(1);
0755   gPad->SetGrid(1);
0756 
0757   MEx->SetLineColor(1);
0758   MEx_JetID->SetLineColor(2);
0759   MEx_JetID->SetLineWidth(3);
0760   MEx_JetIDTight->SetLineColor(9);
0761   MEx_HcalNoiseFilter->SetLineColor(4);
0762   MEx_BasicCleanup->SetLineColor(8);
0763   MEx_ExtraCleanup->SetLineColor(4);
0764   MEx_BeamHaloIDLoosePass->SetLineColor(2);
0765   MEx_BeamHaloIDTightPass->SetLineColor(9);
0766   MEx_BeamHaloIDLoosePass->SetLineWidth(2);
0767   MEx_BeamHaloIDTightPass->SetLineWidth(2);
0768   MEx_TechTrigs->SetLineColor(14);
0769   MEx_TechTrigs->SetLineWidth(2);
0770   MEx_PV->SetLineColor(12);
0771   MEx_PV->SetLineWidth(2);
0772 
0773   MEx->SetStats(kFALSE);
0774   MEx->SetTitle(title);
0775   MEx->GetXaxis()->SetRange(221,280);
0776   //MEx->SetMaximum(1000.);
0777   MEx->SetMinimum(0.5);
0778   MEx->DrawCopy();
0779   //MEx_JetID->Draw("same");
0780   //MEx_JetIDTight->Draw("same");
0781   //MEx_HcalNoiseFilter->Draw("same");
0782   //MEx_BeamHaloIDTightPass->Draw("same");
0783   //MEx_BeamHaloIDLoosePass->Draw("same");
0784   //MEx_TechTrigs->Draw("same");
0785   //MEx_PV->Draw("same");
0786   MEx_BasicCleanup->DrawCopy("same");
0787 
0788   MEx_Ref->SetLineColor(2);
0789   MEx_Ref->SetFillColor(2);
0790   MEx_Ref->SetLineWidth(3);
0791   MEx_Ref->DrawCopy("same");
0792 
0793   MEx->DrawCopy("same,s");
0794   MEx->DrawCopy("same,e");
0795   MEx_BasicCleanup->DrawCopy("same,s");
0796   MEx_BasicCleanup->DrawCopy("same,e");
0797   MEx_ExtraCleanup->DrawCopy("same,s");
0798   MEx_ExtraCleanup->DrawCopy("same,e");
0799 
0800   TLegend *tl_MEx = new TLegend(0.60,0.65,0.88,0.86);
0801   tl_MEx->AddEntry(MEx,"All triggers (data)","l");
0802   //tl_MEx->AddEntry(MEx_JetID,"JetID cuts Minimal","l");
0803   //tl_MEx->AddEntry(MEx_JetIDTight,"JetID cuts Tight","l");
0804   //tl_MEx->AddEntry(MEx_HcalNoiseFilter,"Hcal Noise Filter","l");
0805   //tl_MEx->AddEntry(MEx_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
0806   //tl_MEx->AddEntry(MEx_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
0807   //tl_MEx->AddEntry(MEx_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
0808   //tl_MEx->AddEntry(MEx_PV,"Primary Vertex","l");
0809   //tl_MEx->AddEntry(MEx_HLTPhysicsOn,"HLT Physics Declared","l");
0810   tl_MEx->AddEntry(MEx_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
0811   tl_MEx->AddEntry(MEx_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
0812   tl_MEx->AddEntry(MEx_Ref,"MinBias MC","l");
0813   tl_MEx->SetFillColor(0);
0814   tl_MEx->Draw();
0815 
0816   sprintf(cjpgname,"%s%d/METDQM/%s/MEx.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
0817   c_MEx->SaveAs(cjpgname);
0818 
0819   //-------------------------------
0820   // MEy
0821   //-------------------------------
0822 
0823   sprintf(ctitle,"%s/MET/%s/All/METTask_%sMEy",cprefix,METName.c_str(),METClass.c_str());
0824   std::cout << ctitle << std::endl;
0825   TH1F *MEy = (TH1F*) _file->Get(ctitle);    //
0826   MEy->SetTitleSize(0.065,"X");
0827   MEy->SetTitleSize(0.065,"Y");
0828   MEy->SetTitle("MEy");
0829   MEy->GetXaxis()->SetTitle("MEy (GeV)");
0830   MEy->GetYaxis()->SetTitle("Events");
0831 
0832   sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sMEy",cprefix,METName.c_str(),METClass.c_str());
0833   TH1F *MEy_JetID                = (TH1F*) _file->Get(ctitle);    //
0834   sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sMEy",cprefix,METName.c_str(),METClass.c_str());
0835   TH1F *MEy_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
0836   sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sMEy",cprefix,METName.c_str(),METClass.c_str());
0837   TH1F *MEy_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
0838   sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sMEy",cprefix,METName.c_str(),METClass.c_str());
0839   TH1F *MEy_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
0840   sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sMEy",cprefix,METName.c_str(),METClass.c_str());
0841   TH1F *MEy_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
0842   sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sMEy",cprefix,METName.c_str(),METClass.c_str());
0843   TH1F *MEy_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
0844   sprintf(ctitle,"%s/MET/%s/PV/METTask_%sMEy",cprefix,METName.c_str(),METClass.c_str());
0845   TH1F *MEy_PV                   = (TH1F*) _file->Get(ctitle);    //
0846   sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sMEy",cprefix,METName.c_str(),METClass.c_str());
0847   TH1F *MEy_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
0848   sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sMEy",cprefix,METName.c_str(),METClass.c_str());
0849   TH1F *MEy_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
0850 
0851   sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sMEy",cprefixRef,METName.c_str(),METClass.c_str());
0852   TH1F *MEy_Ref = _fileRef->Get(ctitleRef);
0853   MEy_Ref->Scale(SF);
0854 
0855   //-------------------------------
0856 
0857   sprintf(title,"%s_MEy_run=%d",METName.c_str(),run);
0858   sprintf(name,"%s_MEy_%d",METName.c_str(),run);
0859   TCanvas *c_MEy = new TCanvas(title,name,600.,400.);
0860 
0861   gPad->SetBottomMargin(0.15);
0862   gPad->SetLeftMargin(0.15);
0863   gPad->SetLogy(1);
0864   gPad->SetGrid(1);
0865 
0866   MEy->SetLineColor(1);
0867   MEy_JetID->SetLineColor(2);
0868   MEy_JetID->SetLineWidth(3);
0869   MEy_JetIDTight->SetLineColor(9);
0870   MEy_HcalNoiseFilter->SetLineColor(4);
0871   MEy_BasicCleanup->SetLineColor(8);
0872   MEy_ExtraCleanup->SetLineColor(4);
0873   MEy_BeamHaloIDLoosePass->SetLineColor(2);
0874   MEy_BeamHaloIDTightPass->SetLineColor(9);
0875   MEy_BeamHaloIDLoosePass->SetLineWidth(2);
0876   MEy_BeamHaloIDTightPass->SetLineWidth(2);
0877   MEy_TechTrigs->SetLineColor(14);
0878   MEy_TechTrigs->SetLineWidth(2);
0879   MEy_PV->SetLineColor(12);
0880   MEy_PV->SetLineWidth(2);
0881 
0882   MEy->SetStats(kFALSE);
0883   MEy->SetTitle(title);
0884   MEy->GetXaxis()->SetRange(221,280);
0885   //MEy->SetMaximum(1000.);
0886   MEy->SetMinimum(0.5);
0887   MEy->DrawCopy();
0888   //MEy_JetID->Draw("same");
0889   //MEy_JetIDTight->Draw("same");
0890   //MEy_HcalNoiseFilter->Draw("same");
0891   //MEy_BeamHaloIDTightPass->Draw("same");
0892   //MEy_BeamHaloIDLoosePass->Draw("same");
0893   //MEy_TechTrigs->Draw("same");
0894   //MEy_PV->Draw("same");
0895   MEy_BasicCleanup->DrawCopy("same");
0896 
0897   MEy_Ref->SetLineColor(2);
0898   MEy_Ref->SetFillColor(2);
0899   MEy_Ref->SetLineWidth(3);
0900   MEy_Ref->DrawCopy("same");
0901 
0902   MEy->DrawCopy("same,s");
0903   MEy->DrawCopy("same,e");
0904   MEy_BasicCleanup->DrawCopy("same,s");
0905   MEy_BasicCleanup->DrawCopy("same,e");
0906   MEy_ExtraCleanup->DrawCopy("same,s");
0907   MEy_ExtraCleanup->DrawCopy("same,e");
0908 
0909   TLegend *tl_MEy = new TLegend(0.60,0.65,0.88,0.86);
0910   tl_MEy->AddEntry(MEy,"All triggers (data)","l");
0911   //tl_MEy->AddEntry(MEy_JetID,"JetID cuts Minimal","l");
0912   //tl_MEy->AddEntry(MEy_JetIDTight,"JetID cuts Tight","l");
0913   //tl_MEy->AddEntry(MEy_HcalNoiseFilter,"Hcal Noise Filter","l");
0914   //tl_MEy->AddEntry(MEy_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
0915   //tl_MEy->AddEntry(MEy_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
0916   //tl_MEy->AddEntry(MEy_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
0917   //tl_MEy->AddEntry(MEy_PV,"Primary Vertex","l");
0918   //tl_MEy->AddEntry(MEy_HLTPhysicsOn,"HLT Physics Declared","l");
0919   tl_MEy->AddEntry(MEy_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
0920   tl_MEy->AddEntry(MEy_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
0921   tl_MEy->AddEntry(MEy_Ref,"MinBias MC","l");
0922   tl_MEy->SetFillColor(0);
0923   tl_MEy->Draw();
0924 
0925   sprintf(cjpgname,"%s%d/METDQM/%s/MEy.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
0926   c_MEy->SaveAs(cjpgname);
0927 
0928   //-------------------------------
0929 
0930   /*
0931     sprintf(title,"%s_Rate_HcalNoise_run=%d",METName.c_str(),run);
0932     sprintf(name,"%s_Rate_HcalNoise_%d",METName.c_str(),run);
0933     TCanvas *c_METRateHcalNoise = new TCanvas(title,title,600.,400.);
0934 
0935     gPad->SetBottomMargin(0.15);
0936     gPad->SetLeftMargin(0.15);
0937     gPad->SetLogy(1);
0938     gPad->SetGrid(1);
0939 
0940     METRate->SetLineColor(1);
0941     METRate_IonFeedbck->SetLineColor(2);
0942     METRate_IonFeedbck->SetLineWidth(3);
0943     METRate_RBXNoise->SetLineColor(4);
0944     METRate_HPDNoise->SetLineColor(6);
0945 
0946     METRate->SetStats(kFALSE);
0947     METRate->SetTitle(title);
0948     METRate->GetXaxis()->SetRange(1,75);
0949     METRate->SetMinimum(0.001);
0950     METRate->DrawCopy();
0951     METRate_IonFeedbck->Draw("same");
0952     METRate_RBXNoise->Draw("same");
0953     METRate_HPDNoise->Draw("same");
0954 
0955     TLegend *tl_METRate = new TLegend(0.5,0.6,0.88,0.86);
0956     tl_METRate->AddEntry(METRate,"All triggers","l");
0957     tl_METRate->AddEntry(METRate_IonFeedbck,"Ion Feedback","l");
0958     tl_METRate->AddEntry(METRate_RBXNoise,"HPD noise","l");
0959     tl_METRate->AddEntry(METRate_HPDNoise,"RBX noise","l");
0960     tl_METRate->SetFillColor(0);
0961     tl_METRate->Draw();
0962 
0963     sprintf(cjpgname,"%s%d/METDQM/%s/METRateHcalNoise.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
0964     //c_METRateHcalNoise->SaveAs(cjpgname);
0965     */
0966 
0967   //-------------------------------
0968   // METPhi
0969   //-------------------------------
0970 
0971   sprintf(ctitle,"%s/MET/%s/All/METTask_%sMETPhi",cprefix,METName.c_str(),METClass.c_str());
0972   std::cout << ctitle << std::endl;
0973   TH1F *METPhi = (TH1F*) _file->Get(ctitle);    //
0974   METPhi->SetTitleSize(0.065,"X");
0975   METPhi->SetTitleSize(0.065,"Y");
0976   METPhi->SetTitle("METPhi");
0977   METPhi->GetXaxis()->SetTitle("METPhi (rad)");
0978   METPhi->GetYaxis()->SetTitle("Events");
0979 
0980   sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sMETPhi",cprefix,METName.c_str(),METClass.c_str());
0981   TH1F *METPhi_JetID                = (TH1F*) _file->Get(ctitle);    //
0982   sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sMETPhi",cprefix,METName.c_str(),METClass.c_str());
0983   TH1F *METPhi_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
0984   sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sMETPhi",cprefix,METName.c_str(),METClass.c_str());
0985   TH1F *METPhi_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
0986   sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sMETPhi",cprefix,METName.c_str(),METClass.c_str());
0987   TH1F *METPhi_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
0988   sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sMETPhi",cprefix,METName.c_str(),METClass.c_str());
0989   TH1F *METPhi_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
0990   sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sMETPhi",cprefix,METName.c_str(),METClass.c_str());
0991   TH1F *METPhi_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
0992   sprintf(ctitle,"%s/MET/%s/PV/METTask_%sMETPhi",cprefix,METName.c_str(),METClass.c_str());
0993   TH1F *METPhi_PV                   = (TH1F*) _file->Get(ctitle);    //
0994   sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sMETPhi",cprefix,METName.c_str(),METClass.c_str());
0995   TH1F *METPhi_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
0996   sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sMETPhi",cprefix,METName.c_str(),METClass.c_str());
0997   TH1F *METPhi_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
0998 
0999   sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sMETPhi",cprefixRef,METName.c_str(),METClass.c_str());
1000   TH1F *METPhi_Ref = _fileRef->Get(ctitleRef);
1001   METPhi_Ref->Scale(SF);
1002 
1003   //-------------------------------
1004 
1005   sprintf(title,"%s_METPhi_run=%d",METName.c_str(),run);
1006   sprintf(name,"%s_METPhi_%d",METName.c_str(),run);
1007   TCanvas *c_METPhi = new TCanvas(title,name,600.,400.);
1008 
1009   gPad->SetBottomMargin(0.15);
1010   gPad->SetLeftMargin(0.15);
1011   gPad->SetLogy(1);
1012   gPad->SetGrid(1);
1013 
1014   METPhi->SetLineColor(1);
1015   METPhi_JetID->SetLineColor(2);
1016   METPhi_JetID->SetLineWidth(3);
1017   METPhi_JetIDTight->SetLineColor(9);
1018   METPhi_HcalNoiseFilter->SetLineColor(4);
1019   METPhi_BasicCleanup->SetLineColor(8);
1020   METPhi_ExtraCleanup->SetLineColor(4);
1021   METPhi_BeamHaloIDLoosePass->SetLineColor(2);
1022   METPhi_BeamHaloIDTightPass->SetLineColor(9);
1023   METPhi_BeamHaloIDLoosePass->SetLineWidth(2);
1024   METPhi_BeamHaloIDTightPass->SetLineWidth(2);
1025   METPhi_TechTrigs->SetLineColor(14);
1026   METPhi_TechTrigs->SetLineWidth(2);
1027   METPhi_PV->SetLineColor(12);
1028   METPhi_PV->SetLineWidth(2);
1029 
1030   METPhi->SetStats(kFALSE);
1031   METPhi->SetTitle(title);
1032   METPhi->GetXaxis()->SetRange(221,280);
1033   //METPhi->SetMaximum(1000.);
1034   METPhi->SetMinimum(0.1);
1035   METPhi->DrawCopy();
1036   //METPhi_JetID->Draw("same");
1037   //METPhi_JetIDTight->Draw("same");
1038   //METPhi_HcalNoiseFilter->Draw("same");
1039   //METPhi_BeamHaloIDTightPass->Draw("same");
1040   //METPhi_BeamHaloIDLoosePass->Draw("same");
1041   //METPhi_TechTrigs->Draw("same");
1042   //METPhi_PV->Draw("same");
1043   METPhi_BasicCleanup->DrawCopy("same");
1044 
1045   METPhi_Ref->SetLineColor(2);
1046   METPhi_Ref->SetFillColor(2);
1047   METPhi_Ref->SetLineWidth(3);
1048   METPhi_Ref->DrawCopy("same");
1049 
1050   METPhi->DrawCopy("same,s");
1051   METPhi->DrawCopy("same,e");
1052   METPhi_BasicCleanup->DrawCopy("same,s");
1053   METPhi_BasicCleanup->DrawCopy("same,e");
1054   METPhi_ExtraCleanup->DrawCopy("same,s");
1055   METPhi_ExtraCleanup->DrawCopy("same,e");
1056 
1057   TLegend *tl_METPhi = new TLegend(0.20,0.20,0.55,0.40);
1058   tl_METPhi->AddEntry(METPhi,"All triggers (data)","l");
1059   //tl_METPhi->AddEntry(METPhi_JetID,"JetID cuts Minimal","l");
1060   //tl_METPhi->AddEntry(METPhi_JetIDTight,"JetID cuts Tight","l");
1061   //tl_METPhi->AddEntry(METPhi_HcalNoiseFilter,"Hcal Noise Filter","l");
1062   //tl_METPhi->AddEntry(METPhi_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
1063   //tl_METPhi->AddEntry(METPhi_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
1064   //tl_METPhi->AddEntry(METPhi_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
1065   //tl_METPhi->AddEntry(METPhi_PV,"Primary Vertex","l");
1066   //tl_METPhi->AddEntry(METPhi_HLTPhysicsOn,"HLT Physics Declared","l");
1067   tl_METPhi->AddEntry(METPhi_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
1068   tl_METPhi->AddEntry(METPhi_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
1069   tl_METPhi->AddEntry(METPhi_Ref,"MinBias MC","l");
1070   tl_METPhi->SetFillColor(0);
1071   tl_METPhi->Draw();
1072 
1073   sprintf(cjpgname,"%s%d/METDQM/%s/METPhi.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
1074   c_METPhi->SaveAs(cjpgname);
1075 
1076   if (METClass=="Calo") {
1077 
1078     //-------------------------------
1079     // METPhi002
1080     //-------------------------------
1081   
1082     sprintf(ctitle,"%s/MET/%s/All/METTask_%sMETPhi002",cprefix,METName.c_str(),METClass.c_str());
1083     std::cout << ctitle << std::endl;
1084     TH1F *METPhi002 = (TH1F*) _file->Get(ctitle);    //
1085     METPhi002->SetTitleSize(0.065,"X");
1086     METPhi002->SetTitleSize(0.065,"Y");
1087     METPhi002->SetTitle("METPhi");
1088     METPhi002->GetXaxis()->SetTitle("METPhi (rad)");
1089     METPhi002->GetYaxis()->SetTitle("Events");
1090 
1091     sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sMETPhi002",cprefix,METName.c_str(),METClass.c_str());
1092     TH1F *METPhi002_JetID                = (TH1F*) _file->Get(ctitle);    //
1093     sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sMETPhi002",cprefix,METName.c_str(),METClass.c_str());
1094     TH1F *METPhi002_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
1095     sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sMETPhi002",cprefix,METName.c_str(),METClass.c_str());
1096     TH1F *METPhi002_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
1097     sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sMETPhi002",cprefix,METName.c_str(),METClass.c_str());
1098     TH1F *METPhi002_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
1099     sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sMETPhi002",cprefix,METName.c_str(),METClass.c_str());
1100     TH1F *METPhi002_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
1101     sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sMETPhi002",cprefix,METName.c_str(),METClass.c_str());
1102     TH1F *METPhi002_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
1103     sprintf(ctitle,"%s/MET/%s/PV/METTask_%sMETPhi002",cprefix,METName.c_str(),METClass.c_str());
1104     TH1F *METPhi002_PV                   = (TH1F*) _file->Get(ctitle);    //
1105     sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sMETPhi002",cprefix,METName.c_str(),METClass.c_str());
1106     TH1F *METPhi002_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
1107     sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sMETPhi002",cprefix,METName.c_str(),METClass.c_str());
1108     TH1F *METPhi002_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
1109 
1110     sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sMETPhi002",cprefixRef,METName.c_str(),METClass.c_str());
1111     TH1F *METPhi002_Ref = _fileRef->Get(ctitleRef);
1112     METPhi002_Ref->Scale(SF);
1113 
1114     //-------------------------------
1115 
1116     sprintf(title,"%s_METPhi_run=%d (MET>2GeV)",METName.c_str(),run);
1117     sprintf(name,"%s_METPhi002_%d",METName.c_str(),run);
1118     TCanvas *c_METPhi002 = new TCanvas(title,name,600.,400.);
1119 
1120     gPad->SetBottomMargin(0.15);
1121     gPad->SetLeftMargin(0.15);
1122     gPad->SetLogy(1);
1123     gPad->SetGrid(1);
1124 
1125     METPhi002->SetLineColor(1);
1126     METPhi002_JetID->SetLineColor(2);
1127     METPhi002_JetID->SetLineWidth(3);
1128     METPhi002_JetIDTight->SetLineColor(9);
1129     METPhi002_HcalNoiseFilter->SetLineColor(4);
1130     METPhi002_BasicCleanup->SetLineColor(8);
1131     METPhi002_ExtraCleanup->SetLineColor(4);
1132     METPhi002_BeamHaloIDLoosePass->SetLineColor(2);
1133     METPhi002_BeamHaloIDTightPass->SetLineColor(9);
1134     METPhi002_BeamHaloIDLoosePass->SetLineWidth(2);
1135     METPhi002_BeamHaloIDTightPass->SetLineWidth(2);
1136     METPhi002_TechTrigs->SetLineColor(14);
1137     METPhi002_TechTrigs->SetLineWidth(2);
1138     METPhi002_PV->SetLineColor(12);
1139     METPhi002_PV->SetLineWidth(2);
1140 
1141     METPhi002->SetStats(kFALSE);
1142     METPhi002->SetTitle(title);
1143     METPhi002->GetXaxis()->SetRange(221,280);
1144     //METPhi002->SetMaximum(1000.);
1145     METPhi002->SetMinimum(0.1);
1146     METPhi002->DrawCopy();
1147     //METPhi002_JetID->Draw("same");
1148     //METPhi002_JetIDTight->Draw("same");
1149     //METPhi002_HcalNoiseFilter->Draw("same");
1150     //METPhi002_BeamHaloIDTightPass->Draw("same");
1151     //METPhi002_BeamHaloIDLoosePass->Draw("same");
1152     //METPhi002_TechTrigs->Draw("same");
1153     //METPhi002_PV->Draw("same");
1154     METPhi002_BasicCleanup->DrawCopy("same");
1155 
1156     METPhi002_Ref->SetLineColor(2);
1157     METPhi002_Ref->SetFillColor(2);
1158     METPhi002_Ref->SetLineWidth(3);
1159     METPhi002_Ref->DrawCopy("same");
1160 
1161     METPhi002->DrawCopy("same,s");
1162     METPhi002->DrawCopy("same,e");
1163     METPhi002_BasicCleanup->DrawCopy("same,s");
1164     METPhi002_BasicCleanup->DrawCopy("same,e");
1165     METPhi002_ExtraCleanup->DrawCopy("same,s");
1166     METPhi002_ExtraCleanup->DrawCopy("same,e");
1167 
1168     TLegend *tl_METPhi002 = new TLegend(0.20,0.20,0.55,0.40);
1169     tl_METPhi002->AddEntry(METPhi002,"All triggers (data)","l");
1170     //tl_METPhi002->AddEntry(METPhi002_JetID,"JetID cuts Minimal","l");
1171     //tl_METPhi002->AddEntry(METPhi002_JetIDTight,"JetID cuts Tight","l");
1172     //tl_METPhi002->AddEntry(METPhi002_HcalNoiseFilter,"Hcal Noise Filter","l");
1173     //tl_METPhi002->AddEntry(METPhi002_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
1174     //tl_METPhi002->AddEntry(METPhi002_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
1175     //tl_METPhi002->AddEntry(METPhi002_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
1176     //tl_METPhi002->AddEntry(METPhi002_PV,"Primary Vertex","l");
1177     //tl_METPhi002->AddEntry(METPhi002_HLTPhysicsOn,"HLT Physics Declared","l");
1178     tl_METPhi002->AddEntry(METPhi002_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
1179     tl_METPhi002->AddEntry(METPhi002_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
1180     tl_METPhi002->AddEntry(METPhi002_Ref,"MinBias MC","l");
1181     tl_METPhi002->SetFillColor(0);
1182     tl_METPhi002->Draw();
1183 
1184     sprintf(cjpgname,"%s%d/METDQM/%s/METPhi002.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
1185     c_METPhi002->SaveAs(cjpgname);
1186 
1187     //-------------------------------
1188     // METPhi010
1189     //-------------------------------
1190 
1191     sprintf(ctitle,"%s/MET/%s/All/METTask_%sMETPhi010",cprefix,METName.c_str(),METClass.c_str());
1192     std::cout << ctitle << std::endl;
1193     TH1F *METPhi010 = (TH1F*) _file->Get(ctitle);    //
1194     METPhi010->SetTitleSize(0.065,"X");
1195     METPhi010->SetTitleSize(0.065,"Y");
1196     METPhi010->SetTitle("METPhi");
1197     METPhi010->GetXaxis()->SetTitle("METPhi (rad)");
1198     METPhi010->GetYaxis()->SetTitle("Events");
1199 
1200     sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sMETPhi010",cprefix,METName.c_str(),METClass.c_str());
1201     TH1F *METPhi010_JetID                = (TH1F*) _file->Get(ctitle);    //
1202     sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sMETPhi010",cprefix,METName.c_str(),METClass.c_str());
1203     TH1F *METPhi010_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
1204     sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sMETPhi010",cprefix,METName.c_str(),METClass.c_str());
1205     TH1F *METPhi010_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
1206     sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sMETPhi010",cprefix,METName.c_str(),METClass.c_str());
1207     TH1F *METPhi010_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
1208     sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sMETPhi010",cprefix,METName.c_str(),METClass.c_str());
1209     TH1F *METPhi010_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
1210     sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sMETPhi010",cprefix,METName.c_str(),METClass.c_str());
1211     TH1F *METPhi010_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
1212     sprintf(ctitle,"%s/MET/%s/PV/METTask_%sMETPhi010",cprefix,METName.c_str(),METClass.c_str());
1213     TH1F *METPhi010_PV                   = (TH1F*) _file->Get(ctitle);    //
1214     sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sMETPhi010",cprefix,METName.c_str(),METClass.c_str());
1215     TH1F *METPhi010_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
1216     sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sMETPhi010",cprefix,METName.c_str(),METClass.c_str());
1217     TH1F *METPhi010_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
1218 
1219     sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sMETPhi010",cprefixRef,METName.c_str(),METClass.c_str());
1220     TH1F *METPhi010_Ref = _fileRef->Get(ctitleRef);
1221     METPhi010_Ref->Scale(SF);
1222 
1223     //-------------------------------
1224 
1225     sprintf(title,"%s_METPhi_run=%d (MET>10GeV)",METName.c_str(),run);
1226     sprintf(name,"%s_METPhi010_%d",METName.c_str(),run);
1227     TCanvas *c_METPhi010 = new TCanvas(title,name,600.,400.);
1228 
1229     gPad->SetBottomMargin(0.15);
1230     gPad->SetLeftMargin(0.15);
1231     gPad->SetLogy(1);
1232     gPad->SetGrid(1);
1233 
1234     METPhi010->SetLineColor(1);
1235     METPhi010_JetID->SetLineColor(2);
1236     METPhi010_JetID->SetLineWidth(3);
1237     METPhi010_JetIDTight->SetLineColor(9);
1238     METPhi010_HcalNoiseFilter->SetLineColor(4);
1239     METPhi010_BasicCleanup->SetLineColor(8);
1240     METPhi010_ExtraCleanup->SetLineColor(4);
1241     METPhi010_BeamHaloIDLoosePass->SetLineColor(2);
1242     METPhi010_BeamHaloIDTightPass->SetLineColor(9);
1243     METPhi010_BeamHaloIDLoosePass->SetLineWidth(2);
1244     METPhi010_BeamHaloIDTightPass->SetLineWidth(2);
1245     METPhi010_TechTrigs->SetLineColor(14);
1246     METPhi010_TechTrigs->SetLineWidth(2);
1247     METPhi010_PV->SetLineColor(12);
1248     METPhi010_PV->SetLineWidth(2);
1249 
1250     METPhi010->SetStats(kFALSE);
1251     METPhi010->SetTitle(title);
1252     METPhi010->GetXaxis()->SetRange(221,280);
1253     //METPhi010->SetMaximum(1000.);
1254     METPhi010->SetMinimum(0.01);
1255     METPhi010->DrawCopy();
1256     //METPhi010_JetID->Draw("same");
1257     //METPhi010_JetIDTight->Draw("same");
1258     //METPhi010_HcalNoiseFilter->Draw("same");
1259     //METPhi010_BeamHaloIDTightPass->Draw("same");
1260     //METPhi010_BeamHaloIDLoosePass->Draw("same");
1261     //METPhi010_TechTrigs->Draw("same");
1262     //METPhi010_PV->Draw("same");
1263     METPhi010_BasicCleanup->DrawCopy("same");
1264 
1265     METPhi010_Ref->SetLineColor(2);
1266     METPhi010_Ref->SetFillColor(2);
1267     METPhi010_Ref->SetLineWidth(3);
1268     METPhi010_Ref->DrawCopy("same");
1269 
1270     METPhi010->DrawCopy("same,s");
1271     METPhi010->DrawCopy("same,e");
1272     METPhi010_BasicCleanup->DrawCopy("same,s");
1273     METPhi010_BasicCleanup->DrawCopy("same,e");
1274     METPhi010_ExtraCleanup->DrawCopy("same,s");
1275     METPhi010_ExtraCleanup->DrawCopy("same,e");
1276 
1277     TLegend *tl_METPhi010 = new TLegend(0.20,0.65,0.55,0.85);
1278     tl_METPhi010->AddEntry(METPhi010,"All triggers (data)","l");
1279     //tl_METPhi010->AddEntry(METPhi010_JetID,"JetID cuts Minimal","l");
1280     //tl_METPhi010->AddEntry(METPhi010_JetIDTight,"JetID cuts Tight","l");
1281     //tl_METPhi010->AddEntry(METPhi010_HcalNoiseFilter,"Hcal Noise Filter","l");
1282     //tl_METPhi010->AddEntry(METPhi010_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
1283     //tl_METPhi010->AddEntry(METPhi010_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
1284     //tl_METPhi010->AddEntry(METPhi010_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
1285     //tl_METPhi010->AddEntry(METPhi010_PV,"Primary Vertex","l");
1286     //tl_METPhi010->AddEntry(METPhi010_HLTPhysicsOn,"HLT Physics Declared","l");
1287     tl_METPhi010->AddEntry(METPhi010_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
1288     tl_METPhi010->AddEntry(METPhi010_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
1289     tl_METPhi010->AddEntry(METPhi010_Ref,"MinBias MC","l");
1290     tl_METPhi010->SetFillColor(0);
1291     tl_METPhi010->Draw();
1292 
1293     sprintf(cjpgname,"%s%d/METDQM/%s/METPhi010.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
1294     c_METPhi010->SaveAs(cjpgname);
1295 
1296     //-------------------------------
1297     // METPhi020
1298     //-------------------------------
1299 
1300     sprintf(ctitle,"%s/MET/%s/All/METTask_%sMETPhi020",cprefix,METName.c_str(),METClass.c_str());
1301     std::cout << ctitle << std::endl;
1302     TH1F *METPhi020 = (TH1F*) _file->Get(ctitle);    //
1303     METPhi020->SetTitleSize(0.065,"X");
1304     METPhi020->SetTitleSize(0.065,"Y");
1305     METPhi020->SetTitle("METPhi");
1306     METPhi020->GetXaxis()->SetTitle("METPhi (rad)");
1307     METPhi020->GetYaxis()->SetTitle("Events");
1308 
1309     sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sMETPhi020",cprefix,METName.c_str(),METClass.c_str());
1310     TH1F *METPhi020_JetID                = (TH1F*) _file->Get(ctitle);    //
1311     sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sMETPhi020",cprefix,METName.c_str(),METClass.c_str());
1312     TH1F *METPhi020_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
1313     sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sMETPhi020",cprefix,METName.c_str(),METClass.c_str());
1314     TH1F *METPhi020_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
1315     sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sMETPhi020",cprefix,METName.c_str(),METClass.c_str());
1316     TH1F *METPhi020_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
1317     sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sMETPhi020",cprefix,METName.c_str(),METClass.c_str());
1318     TH1F *METPhi020_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
1319     sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sMETPhi020",cprefix,METName.c_str(),METClass.c_str());
1320     TH1F *METPhi020_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
1321     sprintf(ctitle,"%s/MET/%s/PV/METTask_%sMETPhi020",cprefix,METName.c_str(),METClass.c_str());
1322     TH1F *METPhi020_PV                   = (TH1F*) _file->Get(ctitle);    //
1323     sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sMETPhi020",cprefix,METName.c_str(),METClass.c_str());
1324     TH1F *METPhi020_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
1325     sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sMETPhi020",cprefix,METName.c_str(),METClass.c_str());
1326     TH1F *METPhi020_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
1327 
1328     sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sMETPhi020",cprefixRef,METName.c_str(),METClass.c_str());
1329     TH1F *METPhi020_Ref = _fileRef->Get(ctitleRef);
1330     METPhi020_Ref->Scale(SF);
1331 
1332     //-------------------------------
1333 
1334     sprintf(title,"%s_METPhi_run=%d (MET>20GeV)",METName.c_str(),run);
1335     sprintf(name,"%s_METPhi020_%d",METName.c_str(),run);
1336     TCanvas *c_METPhi020 = new TCanvas(title,name,600.,400.);
1337 
1338     gPad->SetBottomMargin(0.15);
1339     gPad->SetLeftMargin(0.15);
1340     gPad->SetLogy(1);
1341     gPad->SetGrid(1);
1342 
1343     METPhi020->SetLineColor(1);
1344     METPhi020_JetID->SetLineColor(2);
1345     METPhi020_JetID->SetLineWidth(3);
1346     METPhi020_JetIDTight->SetLineColor(9);
1347     METPhi020_HcalNoiseFilter->SetLineColor(4);
1348     METPhi020_BasicCleanup->SetLineColor(8);
1349     METPhi020_ExtraCleanup->SetLineColor(4);
1350     METPhi020_BeamHaloIDLoosePass->SetLineColor(2);
1351     METPhi020_BeamHaloIDTightPass->SetLineColor(9);
1352     METPhi020_BeamHaloIDLoosePass->SetLineWidth(2);
1353     METPhi020_BeamHaloIDTightPass->SetLineWidth(2);
1354     METPhi020_TechTrigs->SetLineColor(14);
1355     METPhi020_TechTrigs->SetLineWidth(2);
1356     METPhi020_PV->SetLineColor(12);
1357     METPhi020_PV->SetLineWidth(2);
1358 
1359     METPhi020->SetStats(kFALSE);
1360     METPhi020->SetTitle(title);
1361     METPhi020->GetXaxis()->SetRange(221,280);
1362     //METPhi020->SetMaximum(1000.);
1363     METPhi020->SetMinimum(0.001);
1364     METPhi020->DrawCopy();
1365     //METPhi020_JetID->Draw("same");
1366     //METPhi020_JetIDTight->Draw("same");
1367     //METPhi020_HcalNoiseFilter->Draw("same");
1368     //METPhi020_BeamHaloIDTightPass->Draw("same");
1369     //METPhi020_BeamHaloIDLoosePass->Draw("same");
1370     //METPhi020_TechTrigs->Draw("same");
1371     //METPhi020_PV->Draw("same");
1372     METPhi020_BasicCleanup->DrawCopy("same");
1373 
1374     METPhi020_Ref->SetLineColor(2);
1375     METPhi020_Ref->SetFillColor(2);
1376     METPhi020_Ref->SetLineWidth(3);
1377     METPhi020_Ref->DrawCopy("same");
1378 
1379     METPhi020->DrawCopy("same,s");
1380     METPhi020->DrawCopy("same,e");
1381     METPhi020_BasicCleanup->DrawCopy("same,s");
1382     METPhi020_BasicCleanup->DrawCopy("same,e");
1383     METPhi020_ExtraCleanup->DrawCopy("same,s");
1384     METPhi020_ExtraCleanup->DrawCopy("same,e");
1385 
1386     TLegend *tl_METPhi020 = new TLegend(0.20,0.65,0.55,0.85);
1387     tl_METPhi020->AddEntry(METPhi020,"All triggers (data)","l");
1388     //tl_METPhi020->AddEntry(METPhi020_JetID,"JetID cuts Minimal","l");
1389     //tl_METPhi020->AddEntry(METPhi020_JetIDTight,"JetID cuts Tight","l");
1390     //tl_METPhi020->AddEntry(METPhi020_HcalNoiseFilter,"Hcal Noise Filter","l");
1391     //tl_METPhi020->AddEntry(METPhi020_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
1392     //tl_METPhi020->AddEntry(METPhi020_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
1393     //tl_METPhi020->AddEntry(METPhi020_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
1394     //tl_METPhi020->AddEntry(METPhi020_PV,"Primary Vertex","l");
1395     //tl_METPhi020->AddEntry(METPhi020_HLTPhysicsOn,"HLT Physics Declared","l");
1396     tl_METPhi020->AddEntry(METPhi020_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
1397     tl_METPhi020->AddEntry(METPhi020_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
1398     tl_METPhi020->AddEntry(METPhi020_Ref,"MinBias MC","l");
1399     tl_METPhi020->SetFillColor(0);
1400     tl_METPhi020->Draw();
1401 
1402     sprintf(cjpgname,"%s%d/METDQM/%s/METPhi020.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
1403     c_METPhi020->SaveAs(cjpgname);
1404 
1405   }
1406 
1407   if (METName=="CaloMET") {
1408 
1409     //-------------------------------
1410     // EmEtFraction
1411     //-------------------------------
1412 
1413     sprintf(ctitle,"%s/MET/%s/All/METTask_%sEmEtFraction",cprefix,METName.c_str(),METClass.c_str());
1414     std::cout << ctitle << std::endl;
1415     TH1F *EmEtFraction = (TH1F*) _file->Get(ctitle);    //
1416     EmEtFraction->SetTitleSize(0.065,"X");
1417     EmEtFraction->SetTitleSize(0.065,"Y");
1418     EmEtFraction->SetTitle("EmEtFraction");
1419     EmEtFraction->GetXaxis()->SetTitle("EmEtFraction");
1420     EmEtFraction->GetYaxis()->SetTitle("Events");
1421 
1422     sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sEmEtFraction",cprefix,METName.c_str(),METClass.c_str());
1423     TH1F *EmEtFraction_JetID                = (TH1F*) _file->Get(ctitle);    //
1424     sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sEmEtFraction",cprefix,METName.c_str(),METClass.c_str());
1425     TH1F *EmEtFraction_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
1426     sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sEmEtFraction",cprefix,METName.c_str(),METClass.c_str());
1427     TH1F *EmEtFraction_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
1428     sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sEmEtFraction",cprefix,METName.c_str(),METClass.c_str());
1429     TH1F *EmEtFraction_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
1430     sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sEmEtFraction",cprefix,METName.c_str(),METClass.c_str());
1431     TH1F *EmEtFraction_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
1432     sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sEmEtFraction",cprefix,METName.c_str(),METClass.c_str());
1433     TH1F *EmEtFraction_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
1434     sprintf(ctitle,"%s/MET/%s/PV/METTask_%sEmEtFraction",cprefix,METName.c_str(),METClass.c_str());
1435     TH1F *EmEtFraction_PV                   = (TH1F*) _file->Get(ctitle);    //
1436     sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sEmEtFraction",cprefix,METName.c_str(),METClass.c_str());
1437     TH1F *EmEtFraction_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
1438     sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sEmEtFraction",cprefix,METName.c_str(),METClass.c_str());
1439     TH1F *EmEtFraction_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
1440 
1441     sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sEmEtFraction",cprefixRef,METName.c_str(),METClass.c_str());
1442     TH1F *EmEtFraction_Ref = _fileRef->Get(ctitleRef);
1443     EmEtFraction_Ref->Scale(SF);
1444 
1445     //-------------------------------
1446 
1447     sprintf(title,"%s_EmEtFraction_run=%d",METName.c_str(),run);
1448     sprintf(name,"%s_EmEtFraction_%d",METName.c_str(),run);
1449     TCanvas *c_EmEtFraction = new TCanvas(title,name,600.,400.);
1450 
1451     gPad->SetBottomMargin(0.15);
1452     gPad->SetLeftMargin(0.15);
1453     gPad->SetLogy(1);
1454     gPad->SetGrid(1);
1455 
1456     EmEtFraction->SetLineColor(1);
1457     EmEtFraction_JetID->SetLineColor(2);
1458     EmEtFraction_JetID->SetLineWidth(3);
1459     EmEtFraction_JetIDTight->SetLineColor(9);
1460     EmEtFraction_HcalNoiseFilter->SetLineColor(4);
1461     EmEtFraction_BasicCleanup->SetLineColor(8);
1462     EmEtFraction_ExtraCleanup->SetLineColor(4);
1463     EmEtFraction_BeamHaloIDLoosePass->SetLineColor(2);
1464     EmEtFraction_BeamHaloIDTightPass->SetLineColor(9);
1465     EmEtFraction_BeamHaloIDLoosePass->SetLineWidth(2);
1466     EmEtFraction_BeamHaloIDTightPass->SetLineWidth(2);
1467     EmEtFraction_TechTrigs->SetLineColor(14);
1468     EmEtFraction_TechTrigs->SetLineWidth(2);
1469     EmEtFraction_PV->SetLineColor(12);
1470     EmEtFraction_PV->SetLineWidth(2);
1471 
1472     EmEtFraction->SetStats(kFALSE);
1473     EmEtFraction->SetTitle(title);
1474     EmEtFraction->GetXaxis()->SetRange(221,280);
1475     //EmEtFraction->SetMaximum(1000.);
1476     EmEtFraction->SetMinimum(0.1);
1477     EmEtFraction->DrawCopy();
1478     //EmEtFraction_JetID->Draw("same");
1479     //EmEtFraction_JetIDTight->Draw("same");
1480     //EmEtFraction_HcalNoiseFilter->Draw("same");
1481     //EmEtFraction_BeamHaloIDTightPass->Draw("same");
1482     //EmEtFraction_BeamHaloIDLoosePass->Draw("same");
1483     //EmEtFraction_TechTrigs->Draw("same");
1484     //EmEtFraction_PV->Draw("same");
1485     EmEtFraction_BasicCleanup->DrawCopy("same");
1486 
1487     EmEtFraction_Ref->SetLineColor(2);
1488     EmEtFraction_Ref->SetFillColor(2);
1489     EmEtFraction_Ref->SetLineWidth(3);
1490     EmEtFraction_Ref->DrawCopy("same");
1491 
1492     EmEtFraction->DrawCopy("same,s");
1493     EmEtFraction->DrawCopy("same,e");
1494     EmEtFraction_BasicCleanup->DrawCopy("same,s");
1495     EmEtFraction_BasicCleanup->DrawCopy("same,e");
1496     EmEtFraction_ExtraCleanup->DrawCopy("same,s");
1497     EmEtFraction_ExtraCleanup->DrawCopy("same,e");
1498 
1499     //TLegend *tl_EmEtFraction = new TLegend(0.20,0.20,0.55,0.40);
1500     TLegend *tl_EmEtFraction = new TLegend(0.50,0.65,0.85,0.85);
1501     tl_EmEtFraction->AddEntry(EmEtFraction,"All triggers (data)","l");
1502     //tl_EmEtFraction->AddEntry(EmEtFraction_JetID,"JetID cuts Minimal","l");
1503     //tl_EmEtFraction->AddEntry(EmEtFraction_JetIDTight,"JetID cuts Tight","l");
1504     //tl_EmEtFraction->AddEntry(EmEtFraction_HcalNoiseFilter,"Hcal Noise Filter","l");
1505     //tl_EmEtFraction->AddEntry(EmEtFraction_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
1506     //tl_EmEtFraction->AddEntry(EmEtFraction_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
1507     //tl_EmEtFraction->AddEntry(EmEtFraction_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
1508     //tl_EmEtFraction->AddEntry(EmEtFraction_PV,"Primary Vertex","l");
1509     //tl_EmEtFraction->AddEntry(EmEtFraction_HLTPhysicsOn,"HLT Physics Declared","l");
1510     tl_EmEtFraction->AddEntry(EmEtFraction_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
1511     tl_EmEtFraction->AddEntry(EmEtFraction_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
1512     tl_EmEtFraction->AddEntry(EmEtFraction_Ref,"MinBias MC","l");
1513     tl_EmEtFraction->SetFillColor(0);
1514     tl_EmEtFraction->Draw();
1515 
1516     sprintf(cjpgname,"%s%d/METDQM/%s/EmEtFraction.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
1517     c_EmEtFraction->SaveAs(cjpgname);
1518 
1519     //-------------------------------
1520     // EmEtFraction002
1521     //-------------------------------
1522 
1523     sprintf(ctitle,"%s/MET/%s/All/METTask_%sEmEtFraction002",cprefix,METName.c_str(),METClass.c_str());
1524     std::cout << ctitle << std::endl;
1525     TH1F *EmEtFraction002 = (TH1F*) _file->Get(ctitle);    //
1526     EmEtFraction002->SetTitleSize(0.065,"X");
1527     EmEtFraction002->SetTitleSize(0.065,"Y");
1528     EmEtFraction002->SetTitle("EmEtFraction");
1529     EmEtFraction002->GetXaxis()->SetTitle("EmEtFraction");
1530     EmEtFraction002->GetYaxis()->SetTitle("Events");
1531 
1532     sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sEmEtFraction002",cprefix,METName.c_str(),METClass.c_str());
1533     TH1F *EmEtFraction002_JetID                = (TH1F*) _file->Get(ctitle);    //
1534     sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sEmEtFraction002",cprefix,METName.c_str(),METClass.c_str());
1535     TH1F *EmEtFraction002_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
1536     sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sEmEtFraction002",cprefix,METName.c_str(),METClass.c_str());
1537     TH1F *EmEtFraction002_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
1538     sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sEmEtFraction002",cprefix,METName.c_str(),METClass.c_str());
1539     TH1F *EmEtFraction002_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
1540     sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sEmEtFraction002",cprefix,METName.c_str(),METClass.c_str());
1541     TH1F *EmEtFraction002_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
1542     sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sEmEtFraction002",cprefix,METName.c_str(),METClass.c_str());
1543     TH1F *EmEtFraction002_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
1544     sprintf(ctitle,"%s/MET/%s/PV/METTask_%sEmEtFraction002",cprefix,METName.c_str(),METClass.c_str());
1545     TH1F *EmEtFraction002_PV                   = (TH1F*) _file->Get(ctitle);    //
1546     sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sEmEtFraction002",cprefix,METName.c_str(),METClass.c_str());
1547     TH1F *EmEtFraction002_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
1548     sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sEmEtFraction002",cprefix,METName.c_str(),METClass.c_str());
1549     TH1F *EmEtFraction002_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
1550 
1551     sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sEmEtFraction002",cprefixRef,METName.c_str(),METClass.c_str());
1552     TH1F *EmEtFraction002_Ref = _fileRef->Get(ctitleRef);
1553     EmEtFraction002_Ref->Scale(SF);
1554 
1555     //-------------------------------
1556 
1557     sprintf(title,"%s_EmEtFraction_run=%d (MET>2GeV)",METName.c_str(),run);
1558     sprintf(name,"%s_EmEtFraction002_%d",METName.c_str(),run);
1559     TCanvas *c_EmEtFraction002 = new TCanvas(title,name,600.,400.);
1560 
1561     gPad->SetBottomMargin(0.15);
1562     gPad->SetLeftMargin(0.15);
1563     gPad->SetLogy(1);
1564     gPad->SetGrid(1);
1565 
1566     EmEtFraction002->SetLineColor(1);
1567     EmEtFraction002_JetID->SetLineColor(2);
1568     EmEtFraction002_JetID->SetLineWidth(3);
1569     EmEtFraction002_JetIDTight->SetLineColor(9);
1570     EmEtFraction002_HcalNoiseFilter->SetLineColor(4);
1571     EmEtFraction002_BasicCleanup->SetLineColor(8);
1572     EmEtFraction002_ExtraCleanup->SetLineColor(4);
1573     EmEtFraction002_BeamHaloIDLoosePass->SetLineColor(2);
1574     EmEtFraction002_BeamHaloIDTightPass->SetLineColor(9);
1575     EmEtFraction002_BeamHaloIDLoosePass->SetLineWidth(2);
1576     EmEtFraction002_BeamHaloIDTightPass->SetLineWidth(2);
1577     EmEtFraction002_TechTrigs->SetLineColor(14);
1578     EmEtFraction002_TechTrigs->SetLineWidth(2);
1579     EmEtFraction002_PV->SetLineColor(12);
1580     EmEtFraction002_PV->SetLineWidth(2);
1581 
1582     EmEtFraction002->SetStats(kFALSE);
1583     EmEtFraction002->SetTitle(title);
1584     EmEtFraction002->GetXaxis()->SetRange(221,280);
1585     //EmEtFraction002->SetMaximum(1000.);
1586     EmEtFraction002->SetMinimum(0.1);
1587     EmEtFraction002->DrawCopy();
1588     //EmEtFraction002_JetID->Draw("same");
1589     //EmEtFraction002_JetIDTight->Draw("same");
1590     //EmEtFraction002_HcalNoiseFilter->Draw("same");
1591     //EmEtFraction002_BeamHaloIDTightPass->Draw("same");
1592     //EmEtFraction002_BeamHaloIDLoosePass->Draw("same");
1593     //EmEtFraction002_TechTrigs->Draw("same");
1594     //EmEtFraction002_PV->Draw("same");
1595     EmEtFraction002_BasicCleanup->DrawCopy("same");
1596 
1597     EmEtFraction002_Ref->SetLineColor(2);
1598     EmEtFraction002_Ref->SetFillColor(2);
1599     EmEtFraction002_Ref->SetLineWidth(3);
1600     EmEtFraction002_Ref->DrawCopy("same");
1601 
1602     EmEtFraction002->DrawCopy("same,s");
1603     EmEtFraction002->DrawCopy("same,e");
1604     EmEtFraction002_BasicCleanup->DrawCopy("same,s");
1605     EmEtFraction002_BasicCleanup->DrawCopy("same,e");
1606     EmEtFraction002_ExtraCleanup->DrawCopy("same,s");
1607     EmEtFraction002_ExtraCleanup->DrawCopy("same,e");
1608 
1609     TLegend *tl_EmEtFraction002 = new TLegend(0.50,0.65,0.85,0.85);
1610     tl_EmEtFraction002->AddEntry(EmEtFraction002,"All triggers (data)","l");
1611     //tl_EmEtFraction002->AddEntry(EmEtFraction002_JetID,"JetID cuts Minimal","l");
1612     //tl_EmEtFraction002->AddEntry(EmEtFraction002_JetIDTight,"JetID cuts Tight","l");
1613     //tl_EmEtFraction002->AddEntry(EmEtFraction002_HcalNoiseFilter,"Hcal Noise Filter","l");
1614     //tl_EmEtFraction002->AddEntry(EmEtFraction002_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
1615     //tl_EmEtFraction002->AddEntry(EmEtFraction002_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
1616     //tl_EmEtFraction002->AddEntry(EmEtFraction002_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
1617     //tl_EmEtFraction002->AddEntry(EmEtFraction002_PV,"Primary Vertex","l");
1618     //tl_EmEtFraction002->AddEntry(EmEtFraction002_HLTPhysicsOn,"HLT Physics Declared","l");
1619     tl_EmEtFraction002->AddEntry(EmEtFraction002_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
1620     tl_EmEtFraction002->AddEntry(EmEtFraction002_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
1621     tl_EmEtFraction002->AddEntry(EmEtFraction002_Ref,"MinBias MC","l");
1622     tl_EmEtFraction002->SetFillColor(0);
1623     tl_EmEtFraction002->Draw();
1624 
1625     sprintf(cjpgname,"%s%d/METDQM/%s/EmEtFraction002.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
1626     c_EmEtFraction002->SaveAs(cjpgname);
1627 
1628     //-------------------------------
1629     // EmEtFraction010
1630     //-------------------------------
1631 
1632     sprintf(ctitle,"%s/MET/%s/All/METTask_%sEmEtFraction010",cprefix,METName.c_str(),METClass.c_str());
1633     std::cout << ctitle << std::endl;
1634     TH1F *EmEtFraction010 = (TH1F*) _file->Get(ctitle);    //
1635     EmEtFraction010->SetTitleSize(0.065,"X");
1636     EmEtFraction010->SetTitleSize(0.065,"Y");
1637     EmEtFraction010->SetTitle("EmEtFraction");
1638     EmEtFraction010->GetXaxis()->SetTitle("EmEtFraction");
1639     EmEtFraction010->GetYaxis()->SetTitle("Events");
1640 
1641     sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sEmEtFraction010",cprefix,METName.c_str(),METClass.c_str());
1642     TH1F *EmEtFraction010_JetID                = (TH1F*) _file->Get(ctitle);    //
1643     sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sEmEtFraction010",cprefix,METName.c_str(),METClass.c_str());
1644     TH1F *EmEtFraction010_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
1645     sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sEmEtFraction010",cprefix,METName.c_str(),METClass.c_str());
1646     TH1F *EmEtFraction010_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
1647     sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sEmEtFraction010",cprefix,METName.c_str(),METClass.c_str());
1648     TH1F *EmEtFraction010_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
1649     sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sEmEtFraction010",cprefix,METName.c_str(),METClass.c_str());
1650     TH1F *EmEtFraction010_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
1651     sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sEmEtFraction010",cprefix,METName.c_str(),METClass.c_str());
1652     TH1F *EmEtFraction010_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
1653     sprintf(ctitle,"%s/MET/%s/PV/METTask_%sEmEtFraction010",cprefix,METName.c_str(),METClass.c_str());
1654     TH1F *EmEtFraction010_PV                   = (TH1F*) _file->Get(ctitle);    //
1655     sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sEmEtFraction010",cprefix,METName.c_str(),METClass.c_str());
1656     TH1F *EmEtFraction010_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
1657     sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sEmEtFraction010",cprefix,METName.c_str(),METClass.c_str());
1658     TH1F *EmEtFraction010_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
1659 
1660     sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sEmEtFraction010",cprefixRef,METName.c_str(),METClass.c_str());
1661     TH1F *EmEtFraction010_Ref = _fileRef->Get(ctitleRef);
1662     EmEtFraction010_Ref->Scale(SF);
1663 
1664     //-------------------------------
1665 
1666     sprintf(title,"%s_EmEtFraction_run=%d (MET>10GeV)",METName.c_str(),run);
1667     sprintf(name,"%s_EmEtFraction010_%d",METName.c_str(),run);
1668     TCanvas *c_EmEtFraction010 = new TCanvas(title,name,600.,400.);
1669 
1670     gPad->SetBottomMargin(0.15);
1671     gPad->SetLeftMargin(0.15);
1672     gPad->SetLogy(1);
1673     gPad->SetGrid(1);
1674 
1675     EmEtFraction010->SetLineColor(1);
1676     EmEtFraction010_JetID->SetLineColor(2);
1677     EmEtFraction010_JetID->SetLineWidth(3);
1678     EmEtFraction010_JetIDTight->SetLineColor(9);
1679     EmEtFraction010_HcalNoiseFilter->SetLineColor(4);
1680     EmEtFraction010_BasicCleanup->SetLineColor(8);
1681     EmEtFraction010_ExtraCleanup->SetLineColor(4);
1682     EmEtFraction010_BeamHaloIDLoosePass->SetLineColor(2);
1683     EmEtFraction010_BeamHaloIDTightPass->SetLineColor(9);
1684     EmEtFraction010_BeamHaloIDLoosePass->SetLineWidth(2);
1685     EmEtFraction010_BeamHaloIDTightPass->SetLineWidth(2);
1686     EmEtFraction010_TechTrigs->SetLineColor(14);
1687     EmEtFraction010_TechTrigs->SetLineWidth(2);
1688     EmEtFraction010_PV->SetLineColor(12);
1689     EmEtFraction010_PV->SetLineWidth(2);
1690     
1691     EmEtFraction010->SetStats(kFALSE);
1692     EmEtFraction010->SetTitle(title);
1693     EmEtFraction010->GetXaxis()->SetRange(221,280);
1694     //EmEtFraction010->SetMaximum(1000.);
1695     EmEtFraction010->SetMinimum(0.001);
1696     EmEtFraction010->DrawCopy();
1697     //EmEtFraction010_JetID->Draw("same");
1698     //EmEtFraction010_JetIDTight->Draw("same");
1699     //EmEtFraction010_HcalNoiseFilter->Draw("same");
1700     //EmEtFraction010_BeamHaloIDTightPass->Draw("same");
1701     //EmEtFraction010_BeamHaloIDLoosePass->Draw("same");
1702     //EmEtFraction010_TechTrigs->Draw("same");
1703     //EmEtFraction010_PV->Draw("same");
1704     EmEtFraction010_BasicCleanup->DrawCopy("same");
1705 
1706     EmEtFraction010_Ref->SetLineColor(2);
1707     EmEtFraction010_Ref->SetFillColor(2);
1708     EmEtFraction010_Ref->SetLineWidth(3);
1709     EmEtFraction010_Ref->DrawCopy("same");
1710 
1711     EmEtFraction010->DrawCopy("same,s");
1712     EmEtFraction010->DrawCopy("same,e");
1713     EmEtFraction010_BasicCleanup->DrawCopy("same,s");
1714     EmEtFraction010_BasicCleanup->DrawCopy("same,e");
1715     EmEtFraction010_ExtraCleanup->DrawCopy("same,s");
1716     EmEtFraction010_ExtraCleanup->DrawCopy("same,e");
1717 
1718     TLegend *tl_EmEtFraction010 = new TLegend(0.50,0.65,0.85,0.85);
1719     tl_EmEtFraction010->AddEntry(EmEtFraction010,"All triggers (data)","l");
1720     //tl_EmEtFraction010->AddEntry(EmEtFraction010_JetID,"JetID cuts Minimal","l");
1721     //tl_EmEtFraction010->AddEntry(EmEtFraction010_JetIDTight,"JetID cuts Tight","l");
1722     //tl_EmEtFraction010->AddEntry(EmEtFraction010_HcalNoiseFilter,"Hcal Noise Filter","l");
1723     //tl_EmEtFraction010->AddEntry(EmEtFraction010_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
1724     //tl_EmEtFraction010->AddEntry(EmEtFraction010_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
1725     //tl_EmEtFraction010->AddEntry(EmEtFraction010_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
1726     //tl_EmEtFraction010->AddEntry(EmEtFraction010_PV,"Primary Vertex","l");
1727     //tl_EmEtFraction010->AddEntry(EmEtFraction010_HLTPhysicsOn,"HLT Physics Declared","l");
1728     tl_EmEtFraction010->AddEntry(EmEtFraction010_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
1729     tl_EmEtFraction010->AddEntry(EmEtFraction010_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
1730     tl_EmEtFraction010->AddEntry(EmEtFraction010_Ref,"MinBias MC","l");
1731     tl_EmEtFraction010->SetFillColor(0);
1732     tl_EmEtFraction010->Draw();
1733 
1734     sprintf(cjpgname,"%s%d/METDQM/%s/EmEtFraction010.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
1735     c_EmEtFraction010->SaveAs(cjpgname);
1736 
1737     //-------------------------------
1738     // EmEtFraction020
1739     //-------------------------------
1740 
1741     sprintf(ctitle,"%s/MET/%s/All/METTask_%sEmEtFraction020",cprefix,METName.c_str(),METClass.c_str());
1742     std::cout << ctitle << std::endl;
1743     TH1F *EmEtFraction020 = (TH1F*) _file->Get(ctitle);    //
1744     EmEtFraction020->SetTitleSize(0.065,"X");
1745     EmEtFraction020->SetTitleSize(0.065,"Y");
1746     EmEtFraction020->SetTitle("EmEtFraction");
1747     EmEtFraction020->GetXaxis()->SetTitle("EmEtFraction");
1748     EmEtFraction020->GetYaxis()->SetTitle("Events");
1749 
1750     sprintf(ctitle,"%s/MET/%s/JetIDMinimal/METTask_%sEmEtFraction020",cprefix,METName.c_str(),METClass.c_str());
1751     TH1F *EmEtFraction020_JetID                = (TH1F*) _file->Get(ctitle);    //
1752     sprintf(ctitle,"%s/MET/%s/JetIDTight/METTask_%sEmEtFraction020",cprefix,METName.c_str(),METClass.c_str());
1753     TH1F *EmEtFraction020_JetIDTight           = (TH1F*) _file->Get(ctitle);    //
1754     sprintf(ctitle,"%s/MET/%s/HcalNoiseFilter/METTask_%sEmEtFraction020",cprefix,METName.c_str(),METClass.c_str());
1755     TH1F *EmEtFraction020_HcalNoiseFilter      = (TH1F*) _file->Get(ctitle);    //
1756     sprintf(ctitle,"%s/MET/%s/BeamHaloIDLoosePass/METTask_%sEmEtFraction020",cprefix,METName.c_str(),METClass.c_str());
1757     TH1F *EmEtFraction020_BeamHaloIDLoosePass  = (TH1F*) _file->Get(ctitle);    //
1758     sprintf(ctitle,"%s/MET/%s/BeamHaloIDTightPass/METTask_%sEmEtFraction020",cprefix,METName.c_str(),METClass.c_str());
1759     TH1F *EmEtFraction020_BeamHaloIDTightPass  = (TH1F*) _file->Get(ctitle);    //
1760     sprintf(ctitle,"%s/MET/%s/Triggers/METTask_%sEmEtFraction020",cprefix,METName.c_str(),METClass.c_str());
1761     TH1F *EmEtFraction020_TechTrigs            = (TH1F*) _file->Get(ctitle);    //
1762     sprintf(ctitle,"%s/MET/%s/PV/METTask_%sEmEtFraction020",cprefix,METName.c_str(),METClass.c_str());
1763     TH1F *EmEtFraction020_PV                   = (TH1F*) _file->Get(ctitle);    //
1764     sprintf(ctitle,"%s/MET/%s/BasicCleanup/METTask_%sEmEtFraction020",cprefix,METName.c_str(),METClass.c_str());
1765     TH1F *EmEtFraction020_BasicCleanup         = (TH1F*) _file->Get(ctitle);    //
1766     sprintf(ctitle,"%s/MET/%s/ExtraCleanup/METTask_%sEmEtFraction020",cprefix,METName.c_str(),METClass.c_str());
1767     TH1F *EmEtFraction020_ExtraCleanup         = (TH1F*) _file->Get(ctitle);    //
1768 
1769     sprintf(ctitleRef,"%s/MET/%s/All/METTask_%sEmEtFraction020",cprefixRef,METName.c_str(),METClass.c_str());
1770     TH1F *EmEtFraction020_Ref = _fileRef->Get(ctitleRef);
1771     EmEtFraction020_Ref->Scale(SF);
1772 
1773     //-------------------------------
1774 
1775     sprintf(title,"%s_EmEtFraction_run=%d (MET>20GeV)",METName.c_str(),run);
1776     sprintf(name,"%s_EmEtFraction020_%d",METName.c_str(),run);
1777     TCanvas *c_EmEtFraction020 = new TCanvas(title,name,600.,400.);
1778 
1779     gPad->SetBottomMargin(0.15);
1780     gPad->SetLeftMargin(0.15);
1781     gPad->SetLogy(1);
1782     gPad->SetGrid(1);
1783 
1784     EmEtFraction020->SetLineColor(1);
1785     EmEtFraction020_JetID->SetLineColor(2);
1786     EmEtFraction020_JetID->SetLineWidth(3);
1787     EmEtFraction020_JetIDTight->SetLineColor(9);
1788     EmEtFraction020_HcalNoiseFilter->SetLineColor(4);
1789     EmEtFraction020_BasicCleanup->SetLineColor(8);
1790     EmEtFraction020_ExtraCleanup->SetLineColor(4);
1791     EmEtFraction020_BeamHaloIDLoosePass->SetLineColor(2);
1792     EmEtFraction020_BeamHaloIDTightPass->SetLineColor(9);
1793     EmEtFraction020_BeamHaloIDLoosePass->SetLineWidth(2);
1794     EmEtFraction020_BeamHaloIDTightPass->SetLineWidth(2);
1795     EmEtFraction020_TechTrigs->SetLineColor(14);
1796     EmEtFraction020_TechTrigs->SetLineWidth(2);
1797     EmEtFraction020_PV->SetLineColor(12);
1798     EmEtFraction020_PV->SetLineWidth(2);
1799     
1800     EmEtFraction020->SetStats(kFALSE);
1801     EmEtFraction020->SetTitle(title);
1802     EmEtFraction020->GetXaxis()->SetRange(221,280);
1803     //EmEtFraction020->SetMaximum(1000.);
1804     EmEtFraction020->SetMinimum(0.001);
1805     EmEtFraction020->DrawCopy();
1806     //EmEtFraction020_JetID->Draw("same");
1807     //EmEtFraction020_JetIDTight->Draw("same");
1808     //EmEtFraction020_HcalNoiseFilter->Draw("same");
1809     //EmEtFraction020_BeamHaloIDTightPass->Draw("same");
1810     //EmEtFraction020_BeamHaloIDLoosePass->Draw("same");
1811     //EmEtFraction020_TechTrigs->Draw("same");
1812     //EmEtFraction020_PV->Draw("same");
1813     EmEtFraction020_BasicCleanup->DrawCopy("same");
1814 
1815     EmEtFraction020_Ref->SetLineColor(2);
1816     EmEtFraction020_Ref->SetFillColor(2);
1817     EmEtFraction020_Ref->SetLineWidth(3);
1818     EmEtFraction020_Ref->DrawCopy("same");
1819 
1820     EmEtFraction020->DrawCopy("same,s");
1821     EmEtFraction020->DrawCopy("same,e");
1822     EmEtFraction020_BasicCleanup->DrawCopy("same,s");
1823     EmEtFraction020_BasicCleanup->DrawCopy("same,e");
1824     EmEtFraction020_ExtraCleanup->DrawCopy("same,s");
1825     EmEtFraction020_ExtraCleanup->DrawCopy("same,e");
1826 
1827     TLegend *tl_EmEtFraction020 = new TLegend(0.50,0.65,0.85,0.85);
1828     tl_EmEtFraction020->AddEntry(EmEtFraction020,"All triggers (data)","l");
1829     //tl_EmEtFraction020->AddEntry(EmEtFraction020_JetID,"JetID cuts Minimal","l");
1830     //tl_EmEtFraction020->AddEntry(EmEtFraction020_JetIDTight,"JetID cuts Tight","l");
1831     //tl_EmEtFraction020->AddEntry(EmEtFraction020_HcalNoiseFilter,"Hcal Noise Filter","l");
1832     //tl_EmEtFraction020->AddEntry(EmEtFraction020_BeamHaloIDLoosePass,"BeamHalo ID Loose Pass","l");
1833     //tl_EmEtFraction020->AddEntry(EmEtFraction020_BeamHaloIDTightPass,"BeamHalo ID Tight Pass","l");
1834     //tl_EmEtFraction020->AddEntry(EmEtFraction020_TechTrigs,"Technical Triggers (0 & (40 or 41) & ~(36 or 37 or 28 or 39)","l");
1835     //tl_EmEtFraction020->AddEntry(EmEtFraction020_PV,"Primary Vertex","l");
1836     //tl_EmEtFraction020->AddEntry(EmEtFraction020_HLTPhysicsOn,"HLT Physics Declared","l");
1837     tl_EmEtFraction020->AddEntry(EmEtFraction020_BasicCleanup,"Technical Triggers + Primary Vertex (off) + HLT PhysicsDeclared (off)","l");
1838     tl_EmEtFraction020->AddEntry(EmEtFraction020_ExtraCleanup," +JetID (off) + Hcal Noise (Loose) + Halo Filter (Loose)","l");
1839     tl_EmEtFraction020->AddEntry(EmEtFraction020_Ref,"MinBias MC","l");
1840     tl_EmEtFraction020->SetFillColor(0);
1841     tl_EmEtFraction020->Draw();
1842 
1843     sprintf(cjpgname,"%s%d/METDQM/%s/EmEtFraction020.%s",outdir.c_str(),run,METName.c_str(),imgformat.c_str());
1844     c_EmEtFraction020->SaveAs(cjpgname);
1845 
1846   }
1847 
1848   //-------------------------------
1849 
1850   return;
1851 
1852   //-------------------------------
1853 
1854 }