Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-06 05:39:47

0001 #include "OuterTrackerMCHarvester.h"
0002 
0003 OuterTrackerMCHarvester::OuterTrackerMCHarvester(const edm::ParameterSet &iConfig) {}
0004 
0005 OuterTrackerMCHarvester::~OuterTrackerMCHarvester() {}
0006 
0007 // ------------ method called once each job just after ending the event loop
0008 // ------------
0009 void OuterTrackerMCHarvester::dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) {
0010   using namespace edm;
0011 
0012   float eta_bins[] = {0.0, 0.7, 1.0, 1.2, 1.6, 2.0, 2.4};
0013   int eta_binnum = 6;
0014 
0015   dbe = nullptr;
0016   dbe = edm::Service<DQMStore>().operator->();
0017 
0018   if (dbe) {
0019     // Find all monitor elements for histograms
0020     MonitorElement *meN_eta = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_eta");
0021     MonitorElement *meD_eta = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_eta");
0022     MonitorElement *meN_pt = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_pt");
0023     MonitorElement *meD_pt = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_pt");
0024     MonitorElement *meN_pt_zoom = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_pt_zoom");
0025     MonitorElement *meD_pt_zoom = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_pt_zoom");
0026     MonitorElement *meN_d0 = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_d0");
0027     MonitorElement *meD_d0 = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_d0");
0028     MonitorElement *meN_VtxR = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_VtxR");
0029     MonitorElement *meD_VtxR = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_VtxR");
0030     MonitorElement *meN_VtxZ = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_VtxZ");
0031     MonitorElement *meD_VtxZ = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_VtxZ");
0032 
0033     MonitorElement *merespt_eta0to0p7_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0to0p7_pt2to3");
0034     MonitorElement *merespt_eta0p7to1_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0p7to1_pt2to3");
0035     MonitorElement *merespt_eta1to1p2_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1to1p2_pt2to3");
0036     MonitorElement *merespt_eta1p2to1p6_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p2to1p6_pt2to3");
0037     MonitorElement *merespt_eta1p6to2_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p6to2_pt2to3");
0038     MonitorElement *merespt_eta2to2p4_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta2to2p4_pt2to3");
0039     MonitorElement *merespt_eta0to0p7_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0to0p7_pt3to8");
0040     MonitorElement *merespt_eta0p7to1_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0p7to1_pt3to8");
0041     MonitorElement *merespt_eta1to1p2_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1to1p2_pt3to8");
0042     MonitorElement *merespt_eta1p2to1p6_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p2to1p6_pt3to8");
0043     MonitorElement *merespt_eta1p6to2_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p6to2_pt3to8");
0044     MonitorElement *merespt_eta2to2p4_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta2to2p4_pt3to8");
0045     MonitorElement *merespt_eta0to0p7_pt8toInf = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0to0p7_pt8toInf");
0046     MonitorElement *merespt_eta0p7to1_pt8toInf = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0p7to1_pt8toInf");
0047     MonitorElement *merespt_eta1to1p2_pt8toInf = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1to1p2_pt8toInf");
0048     MonitorElement *merespt_eta1p2to1p6_pt8toInf =
0049         dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p2to1p6_pt8toInf");
0050     MonitorElement *merespt_eta1p6to2_pt8toInf = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p6to2_pt8toInf");
0051     MonitorElement *merespt_eta2to2p4_pt8toInf = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta2to2p4_pt8toInf");
0052 
0053     MonitorElement *mereseta_eta0to0p7 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta0to0p7");
0054     MonitorElement *mereseta_eta0p7to1 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta0p7to1");
0055     MonitorElement *mereseta_eta1to1p2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta1to1p2");
0056     MonitorElement *mereseta_eta1p2to1p6 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta1p2to1p6");
0057     MonitorElement *mereseta_eta1p6to2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta1p6to2");
0058     MonitorElement *mereseta_eta2to2p4 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta2to2p4");
0059 
0060     MonitorElement *meresphi_eta0to0p7 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta0to0p7");
0061     MonitorElement *meresphi_eta0p7to1 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta0p7to1");
0062     MonitorElement *meresphi_eta1to1p2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta1to1p2");
0063     MonitorElement *meresphi_eta1p2to1p6 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta1p2to1p6");
0064     MonitorElement *meresphi_eta1p6to2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta1p6to2");
0065     MonitorElement *meresphi_eta2to2p4 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta2to2p4");
0066 
0067     MonitorElement *meresVtxZ_eta0to0p7 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta0to0p7");
0068     MonitorElement *meresVtxZ_eta0p7to1 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta0p7to1");
0069     MonitorElement *meresVtxZ_eta1to1p2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta1to1p2");
0070     MonitorElement *meresVtxZ_eta1p2to1p6 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta1p2to1p6");
0071     MonitorElement *meresVtxZ_eta1p6to2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta1p6to2");
0072     MonitorElement *meresVtxZ_eta2to2p4 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta2to2p4");
0073 
0074     MonitorElement *meresd0_eta0to0p7 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta0to0p7");
0075     MonitorElement *meresd0_eta0p7to1 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta0p7to1");
0076     MonitorElement *meresd0_eta1to1p2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta1to1p2");
0077     MonitorElement *meresd0_eta1p2to1p6 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta1p2to1p6");
0078     MonitorElement *meresd0_eta1p6to2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta1p6to2");
0079     MonitorElement *meresd0_eta2to2p4 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta2to2p4");
0080 
0081     if (meN_eta && meD_eta) {
0082       // Get the numerator and denominator histograms
0083       TH1F *numerator = meN_eta->getTH1F();
0084       TH1F *denominator = meD_eta->getTH1F();
0085       numerator->Sumw2();
0086       denominator->Sumw2();
0087 
0088       // Set the current directory
0089       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
0090 
0091       // Book the new histogram to contain the results
0092       MonitorElement *me_effic_eta = ibooker.book1D("EtaEfficiency",
0093                                                     "#eta efficiency",
0094                                                     numerator->GetNbinsX(),
0095                                                     numerator->GetXaxis()->GetXmin(),
0096                                                     numerator->GetXaxis()->GetXmax());
0097 
0098       // Calculate the efficiency
0099       me_effic_eta->getTH1F()->Divide(numerator, denominator, 1., 1., "B");
0100       me_effic_eta->setAxisTitle("tracking particle #eta");
0101       me_effic_eta->getTH1F()->GetYaxis()->SetTitle("Efficiency");
0102       me_effic_eta->getTH1F()->SetMaximum(1.0);
0103       me_effic_eta->getTH1F()->SetMinimum(0.0);
0104       me_effic_eta->getTH1F()->SetStats(false);
0105     }  // if ME found
0106     else {
0107       edm::LogWarning("DataNotFound") << "Monitor elements for eta efficiency cannot be found!\n";
0108     }
0109 
0110     if (meN_pt && meD_pt) {
0111       // Get the numerator and denominator histograms
0112       TH1F *numerator2 = meN_pt->getTH1F();
0113       numerator2->Sumw2();
0114       TH1F *denominator2 = meD_pt->getTH1F();
0115       denominator2->Sumw2();
0116 
0117       // Set the current directory
0118       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
0119 
0120       // Book the new histogram to contain the results
0121       MonitorElement *me_effic_pt = ibooker.book1D("PtEfficiency",
0122                                                    "p_{T} efficiency",
0123                                                    numerator2->GetNbinsX(),
0124                                                    numerator2->GetXaxis()->GetXmin(),
0125                                                    numerator2->GetXaxis()->GetXmax());
0126 
0127       // Calculate the efficiency
0128       me_effic_pt->getTH1F()->Divide(numerator2, denominator2, 1., 1., "B");
0129       me_effic_pt->setAxisTitle("Tracking particle p_{T} [GeV]");
0130       me_effic_pt->getTH1F()->GetYaxis()->SetTitle("Efficiency");
0131       me_effic_pt->getTH1F()->SetMaximum(1.0);
0132       me_effic_pt->getTH1F()->SetMinimum(0.0);
0133       me_effic_pt->getTH1F()->SetStats(false);
0134     }  // if ME found
0135     else {
0136       edm::LogWarning("DataNotFound") << "Monitor elements for pT efficiency cannot be found!\n";
0137     }
0138 
0139     if (meN_pt_zoom && meD_pt_zoom) {
0140       // Get the numerator and denominator histograms
0141       TH1F *numerator2_zoom = meN_pt_zoom->getTH1F();
0142       numerator2_zoom->Sumw2();
0143       TH1F *denominator2_zoom = meD_pt_zoom->getTH1F();
0144       denominator2_zoom->Sumw2();
0145 
0146       // Set the current directory
0147       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
0148 
0149       // Book the new histogram to contain the results
0150       MonitorElement *me_effic_pt_zoom = ibooker.book1D("PtEfficiency_zoom",
0151                                                         "p_{T} efficiency",
0152                                                         numerator2_zoom->GetNbinsX(),
0153                                                         numerator2_zoom->GetXaxis()->GetXmin(),
0154                                                         numerator2_zoom->GetXaxis()->GetXmax());
0155 
0156       // Calculate the efficiency
0157       me_effic_pt_zoom->getTH1F()->Divide(numerator2_zoom, denominator2_zoom, 1., 1., "B");
0158       me_effic_pt_zoom->setAxisTitle("Tracking particle p_{T} [GeV]");
0159       me_effic_pt_zoom->getTH1F()->GetYaxis()->SetTitle("Efficiency");
0160       me_effic_pt_zoom->getTH1F()->SetMaximum(1.0);
0161       me_effic_pt_zoom->getTH1F()->SetMinimum(0.0);
0162       me_effic_pt_zoom->getTH1F()->SetStats(false);
0163     }  // if ME found
0164     else {
0165       edm::LogWarning("DataNotFound") << "Monitor elements for zoom pT efficiency cannot be found!\n";
0166     }
0167 
0168     if (meN_d0 && meD_d0) {
0169       // Get the numerator and denominator histograms
0170       TH1F *numerator5 = meN_d0->getTH1F();
0171       numerator5->Sumw2();
0172       TH1F *denominator5 = meD_d0->getTH1F();
0173       denominator5->Sumw2();
0174 
0175       // Set the current directory
0176       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
0177 
0178       // Book the new histogram to contain the results
0179       MonitorElement *me_effic_d0 = ibooker.book1D("d0Efficiency",
0180                                                    "d_{0} efficiency",
0181                                                    numerator5->GetNbinsX(),
0182                                                    numerator5->GetXaxis()->GetXmin(),
0183                                                    numerator5->GetXaxis()->GetXmax());
0184 
0185       // Calculate the efficiency
0186       me_effic_d0->getTH1F()->Divide(numerator5, denominator5, 1., 1., "B");
0187       me_effic_d0->setAxisTitle("Tracking particle d_{0} [cm]");
0188       me_effic_d0->getTH1F()->GetYaxis()->SetTitle("Efficiency");
0189       me_effic_d0->getTH1F()->SetMaximum(1.0);
0190       me_effic_d0->getTH1F()->SetMinimum(0.0);
0191       me_effic_d0->getTH1F()->SetStats(false);
0192     }  // if ME found
0193     else {
0194       edm::LogWarning("DataNotFound") << "Monitor elements for d0 efficiency cannot be found!\n";
0195     }
0196 
0197     if (meN_VtxR && meD_VtxR) {
0198       // Get the numerator and denominator histograms
0199       TH1F *numerator6 = meN_VtxR->getTH1F();
0200       numerator6->Sumw2();
0201       TH1F *denominator6 = meD_VtxR->getTH1F();
0202       denominator6->Sumw2();
0203 
0204       // Set the current directory
0205       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
0206 
0207       // Book the new histogram to contain the results
0208       MonitorElement *me_effic_VtxR = ibooker.book1D("VtxREfficiency",
0209                                                      "Vtx R efficiency",
0210                                                      numerator6->GetNbinsX(),
0211                                                      numerator6->GetXaxis()->GetXmin(),
0212                                                      numerator6->GetXaxis()->GetXmax());
0213 
0214       // Calculate the efficiency
0215       me_effic_VtxR->getTH1F()->Divide(numerator6, denominator6, 1., 1., "B");
0216       me_effic_VtxR->setAxisTitle("Tracking particle VtxR [cm]");
0217       me_effic_VtxR->getTH1F()->GetYaxis()->SetTitle("Efficiency");
0218       me_effic_VtxR->getTH1F()->SetMaximum(1.0);
0219       me_effic_VtxR->getTH1F()->SetMinimum(0.0);
0220       me_effic_VtxR->getTH1F()->SetStats(false);
0221     }  // if ME found
0222     else {
0223       edm::LogWarning("DataNotFound") << "Monitor elements for VtxR efficiency cannot be found!\n";
0224     }
0225 
0226     if (meN_VtxZ && meD_VtxZ) {
0227       // Get the numerator and denominator histograms
0228       TH1F *numerator7 = meN_VtxZ->getTH1F();
0229       numerator7->Sumw2();
0230       TH1F *denominator7 = meD_VtxZ->getTH1F();
0231       denominator7->Sumw2();
0232 
0233       // Set the current directory
0234       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
0235 
0236       // Book the new histogram to contain the results
0237       MonitorElement *me_effic_VtxZ = ibooker.book1D("VtxZEfficiency",
0238                                                      "Vtx Z efficiency",
0239                                                      numerator7->GetNbinsX(),
0240                                                      numerator7->GetXaxis()->GetXmin(),
0241                                                      numerator7->GetXaxis()->GetXmax());
0242 
0243       // Calculate the efficiency
0244       me_effic_VtxZ->getTH1F()->Divide(numerator7, denominator7, 1., 1., "B");
0245       me_effic_VtxZ->setAxisTitle("Tracking particle VtxZ [cm]");
0246       me_effic_VtxZ->getTH1F()->GetYaxis()->SetTitle("Efficiency");
0247       me_effic_VtxZ->getTH1F()->SetMaximum(1.0);
0248       me_effic_VtxZ->getTH1F()->SetMinimum(0.0);
0249       me_effic_VtxZ->getTH1F()->SetStats(false);
0250     }  // if ME found
0251     else {
0252       edm::LogWarning("DataNotFound") << "Monitor elements for VtxZ efficiency cannot be found!\n";
0253     }
0254 
0255     if (merespt_eta0to0p7_pt2to3 && merespt_eta0p7to1_pt2to3 && merespt_eta1to1p2_pt2to3 &&
0256         merespt_eta1p2to1p6_pt2to3 && merespt_eta1p6to2_pt2to3 && merespt_eta2to2p4_pt2to3) {
0257       // Set the current directoy
0258       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
0259 
0260       // Grab the histograms
0261       TH1F *resPt1a = merespt_eta0to0p7_pt2to3->getTH1F();
0262       TH1F *resPt2a = merespt_eta0p7to1_pt2to3->getTH1F();
0263       TH1F *resPt3a = merespt_eta1to1p2_pt2to3->getTH1F();
0264       TH1F *resPt4a = merespt_eta1p2to1p6_pt2to3->getTH1F();
0265       TH1F *resPt5a = merespt_eta1p6to2_pt2to3->getTH1F();
0266       TH1F *resPt6a = merespt_eta2to2p4_pt2to3->getTH1F();
0267 
0268       // Book the new histogram to contain the results
0269       MonitorElement *me_res_pt1 =
0270           ibooker.book1D("pTResVsEta_2-3", "p_{T} resolution vs |#eta|, for p_{T}: 2-3 GeV", eta_binnum, eta_bins);
0271       TH1F *resPt1 = me_res_pt1->getTH1F();
0272       resPt1->GetXaxis()->SetTitle("tracking particle |#eta|");
0273       resPt1->GetYaxis()->SetTitle("#sigma(#Deltap_{T}/p_{T})");
0274       resPt1->SetMinimum(0.0);
0275       resPt1->SetStats(false);
0276 
0277       std::vector<TH1F *> vResPt1 = {resPt1a, resPt2a, resPt3a, resPt4a, resPt5a, resPt6a};
0278       for (int i = 0; i < 6; i++) {
0279         resPt1->SetBinContent(i + 1, vResPt1[i]->GetStdDev());
0280         resPt1->SetBinError(i + 1, vResPt1[i]->GetStdDevError());
0281       }
0282     }  // if ME found
0283     else {
0284       edm::LogWarning("DataNotFound") << "Monitor elements for pT resolution (2-3) cannot be found!\n";
0285     }
0286 
0287     if (merespt_eta0to0p7_pt3to8 && merespt_eta0p7to1_pt3to8 && merespt_eta1to1p2_pt3to8 &&
0288         merespt_eta1p2to1p6_pt3to8 && merespt_eta1p6to2_pt3to8 && merespt_eta2to2p4_pt3to8) {
0289       // Set the current directoy
0290       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
0291 
0292       // Grab the histograms
0293       TH1F *resPt1b = merespt_eta0to0p7_pt3to8->getTH1F();
0294       TH1F *resPt2b = merespt_eta0p7to1_pt3to8->getTH1F();
0295       TH1F *resPt3b = merespt_eta1to1p2_pt3to8->getTH1F();
0296       TH1F *resPt4b = merespt_eta1p2to1p6_pt3to8->getTH1F();
0297       TH1F *resPt5b = merespt_eta1p6to2_pt3to8->getTH1F();
0298       TH1F *resPt6b = merespt_eta2to2p4_pt3to8->getTH1F();
0299 
0300       // Book the new histogram to contain the results
0301       MonitorElement *me_res_pt2 =
0302           ibooker.book1D("pTResVsEta_3-8", "p_{T} resolution vs |#eta|, for p_{T}: 3-8 GeV", eta_binnum, eta_bins);
0303       TH1F *resPt2 = me_res_pt2->getTH1F();
0304       resPt2->GetXaxis()->SetTitle("tracking particle |#eta|");
0305       resPt2->GetYaxis()->SetTitle("#sigma(#Deltap_{T}/p_{T})");
0306       resPt2->SetMinimum(0.0);
0307       resPt2->SetStats(false);
0308 
0309       std::vector<TH1F *> vResPt2 = {resPt1b, resPt2b, resPt3b, resPt4b, resPt5b, resPt6b};
0310       for (int i = 0; i < 6; i++) {
0311         resPt2->SetBinContent(i + 1, vResPt2[i]->GetStdDev());
0312         resPt2->SetBinError(i + 1, vResPt2[i]->GetStdDevError());
0313       }
0314     }  // if ME found
0315     else {
0316       edm::LogWarning("DataNotFound") << "Monitor elements for pT resolution (3-8) cannot be found!\n";
0317     }
0318 
0319     if (merespt_eta0to0p7_pt8toInf && merespt_eta0p7to1_pt8toInf && merespt_eta1to1p2_pt8toInf &&
0320         merespt_eta1p2to1p6_pt8toInf && merespt_eta1p6to2_pt8toInf && merespt_eta2to2p4_pt8toInf) {
0321       // Set the current directoy
0322       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
0323 
0324       // Grab the histograms
0325       TH1F *resPt1c = merespt_eta0to0p7_pt8toInf->getTH1F();
0326       TH1F *resPt2c = merespt_eta0p7to1_pt8toInf->getTH1F();
0327       TH1F *resPt3c = merespt_eta1to1p2_pt8toInf->getTH1F();
0328       TH1F *resPt4c = merespt_eta1p2to1p6_pt8toInf->getTH1F();
0329       TH1F *resPt5c = merespt_eta1p6to2_pt8toInf->getTH1F();
0330       TH1F *resPt6c = merespt_eta2to2p4_pt8toInf->getTH1F();
0331 
0332       // Book the new histogram to contain the results
0333       MonitorElement *me_res_pt3 =
0334           ibooker.book1D("pTResVsEta_8-inf", "p_{T} resolution vs |#eta|, for p_{T}: >8 GeV", eta_binnum, eta_bins);
0335       TH1F *resPt3 = me_res_pt3->getTH1F();
0336       resPt3->GetXaxis()->SetTitle("tracking particle |#eta|");
0337       resPt3->GetYaxis()->SetTitle("#sigma(#Deltap_{T}/p_{T})");
0338       resPt3->SetMinimum(0.0);
0339       resPt3->SetStats(false);
0340 
0341       std::vector<TH1F *> vResPt3 = {resPt1c, resPt2c, resPt3c, resPt4c, resPt5c, resPt6c};
0342       for (int i = 0; i < 6; i++) {
0343         resPt3->SetBinContent(i + 1, vResPt3[i]->GetStdDev());
0344         resPt3->SetBinError(i + 1, vResPt3[i]->GetStdDevError());
0345       }
0346     }  // if ME found
0347     else {
0348       edm::LogWarning("DataNotFound") << "Monitor elements for pT resolution (8-inf) cannot be found!\n";
0349     }
0350 
0351     if (mereseta_eta0to0p7 && mereseta_eta0p7to1 && mereseta_eta1to1p2 && mereseta_eta1p2to1p6 && mereseta_eta1p6to2 &&
0352         mereseta_eta2to2p4) {
0353       // Set the current directoy
0354       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
0355 
0356       // Grab the histograms
0357       TH1F *resEta1 = mereseta_eta0to0p7->getTH1F();
0358       TH1F *resEta2 = mereseta_eta0p7to1->getTH1F();
0359       TH1F *resEta3 = mereseta_eta1to1p2->getTH1F();
0360       TH1F *resEta4 = mereseta_eta1p2to1p6->getTH1F();
0361       TH1F *resEta5 = mereseta_eta1p6to2->getTH1F();
0362       TH1F *resEta6 = mereseta_eta2to2p4->getTH1F();
0363 
0364       // Book the new histogram to contain the results
0365       MonitorElement *me_res_eta = ibooker.book1D("EtaResolution", "#eta resolution vs |#eta|", eta_binnum, eta_bins);
0366       TH1F *resEta = me_res_eta->getTH1F();
0367       resEta->GetXaxis()->SetTitle("tracking particle |#eta|");
0368       resEta->GetYaxis()->SetTitle("#sigma(#Delta#eta)");
0369       resEta->SetMinimum(0.0);
0370       resEta->SetStats(false);
0371 
0372       std::vector<TH1F *> vResEta = {resEta1, resEta2, resEta3, resEta4, resEta5, resEta6};
0373       for (int i = 0; i < 6; i++) {
0374         resEta->SetBinContent(i + 1, vResEta[i]->GetStdDev());
0375         resEta->SetBinError(i + 1, vResEta[i]->GetStdDevError());
0376       }
0377     }  // if ME found
0378     else {
0379       edm::LogWarning("DataNotFound") << "Monitor elements for eta resolution cannot be found!\n";
0380     }
0381 
0382     if (meresphi_eta0to0p7 && meresphi_eta0p7to1 && meresphi_eta1to1p2 && meresphi_eta1p2to1p6 && meresphi_eta1p6to2 &&
0383         meresphi_eta2to2p4) {
0384       // Set the current directoy
0385       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
0386 
0387       // Grab the histograms
0388       TH1F *resPhi1 = meresphi_eta0to0p7->getTH1F();
0389       TH1F *resPhi2 = meresphi_eta0p7to1->getTH1F();
0390       TH1F *resPhi3 = meresphi_eta1to1p2->getTH1F();
0391       TH1F *resPhi4 = meresphi_eta1p2to1p6->getTH1F();
0392       TH1F *resPhi5 = meresphi_eta1p6to2->getTH1F();
0393       TH1F *resPhi6 = meresphi_eta2to2p4->getTH1F();
0394 
0395       // Book the new histogram to contain the results
0396       MonitorElement *me_res_phi = ibooker.book1D("PhiResolution", "#phi resolution vs |#eta|", eta_binnum, eta_bins);
0397       TH1F *resPhi = me_res_phi->getTH1F();
0398       resPhi->GetXaxis()->SetTitle("tracking particle |#eta|");
0399       resPhi->GetYaxis()->SetTitle("#sigma(#Delta#phi)");
0400       resPhi->SetMinimum(0.0);
0401       resPhi->SetStats(false);
0402 
0403       std::vector<TH1F *> vResPhi = {resPhi1, resPhi2, resPhi3, resPhi4, resPhi5, resPhi6};
0404       for (int i = 0; i < 6; i++) {
0405         resPhi->SetBinContent(i + 1, vResPhi[i]->GetStdDev());
0406         resPhi->SetBinError(i + 1, vResPhi[i]->GetStdDevError());
0407       }
0408     }  // if ME found
0409     else {
0410       edm::LogWarning("DataNotFound") << "Monitor elements for phi resolution cannot be found!\n";
0411     }
0412 
0413     if (meresVtxZ_eta0to0p7 && meresVtxZ_eta0p7to1 && meresVtxZ_eta1to1p2 && meresVtxZ_eta1p2to1p6 &&
0414         meresVtxZ_eta1p6to2 && meresVtxZ_eta2to2p4) {
0415       // Set the current directoy
0416       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
0417 
0418       // Grab the histograms
0419       TH1F *resVtxZ_1 = meresVtxZ_eta0to0p7->getTH1F();
0420       TH1F *resVtxZ_2 = meresVtxZ_eta0p7to1->getTH1F();
0421       TH1F *resVtxZ_3 = meresVtxZ_eta1to1p2->getTH1F();
0422       TH1F *resVtxZ_4 = meresVtxZ_eta1p2to1p6->getTH1F();
0423       TH1F *resVtxZ_5 = meresVtxZ_eta1p6to2->getTH1F();
0424       TH1F *resVtxZ_6 = meresVtxZ_eta2to2p4->getTH1F();
0425 
0426       // Book the new histogram to contain the results
0427       MonitorElement *me_res_VtxZ = ibooker.book1D("VtxZResolution", "VtxZ resolution vs |#eta|", eta_binnum, eta_bins);
0428       TH1F *resVtxZ = me_res_VtxZ->getTH1F();
0429       resVtxZ->GetXaxis()->SetTitle("tracking particle |#eta|");
0430       resVtxZ->GetYaxis()->SetTitle("#sigma(#DeltaVtxZ) [cm]");
0431       resVtxZ->SetMinimum(0.0);
0432       resVtxZ->SetStats(false);
0433 
0434       std::vector<TH1F *> vResVtxZ = {resVtxZ_1, resVtxZ_2, resVtxZ_3, resVtxZ_4, resVtxZ_5, resVtxZ_6};
0435       for (int i = 0; i < 6; i++) {
0436         resVtxZ->SetBinContent(i + 1, vResVtxZ[i]->GetStdDev());
0437         resVtxZ->SetBinError(i + 1, vResVtxZ[i]->GetStdDevError());
0438       }
0439     }  // if ME found
0440     else {
0441       edm::LogWarning("DataNotFound") << "Monitor elements for VtxZ resolution cannot be found!\n";
0442     }
0443 
0444     if (meresd0_eta0to0p7 && meresd0_eta0p7to1 && meresd0_eta1to1p2 && meresd0_eta1p2to1p6 && meresd0_eta1p6to2 &&
0445         meresd0_eta2to2p4) {
0446       // Set the current directoy
0447       dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
0448 
0449       // Grab the histograms
0450       TH1F *resd0_1 = meresd0_eta0to0p7->getTH1F();
0451       TH1F *resd0_2 = meresd0_eta0p7to1->getTH1F();
0452       TH1F *resd0_3 = meresd0_eta1to1p2->getTH1F();
0453       TH1F *resd0_4 = meresd0_eta1p2to1p6->getTH1F();
0454       TH1F *resd0_5 = meresd0_eta1p6to2->getTH1F();
0455       TH1F *resd0_6 = meresd0_eta2to2p4->getTH1F();
0456 
0457       // Book the new histogram to contain the results
0458       MonitorElement *me_res_d0 = ibooker.book1D("d0Resolution", "d_{0} resolution vs |#eta|", eta_binnum, eta_bins);
0459       TH1F *resd0 = me_res_d0->getTH1F();
0460       resd0->GetXaxis()->SetTitle("tracking particle |#eta|");
0461       resd0->GetYaxis()->SetTitle("#sigma(#Deltad_{0}) [cm]");
0462       resd0->SetMinimum(0.0);
0463       resd0->SetStats(false);
0464 
0465       std::vector<TH1F *> vResD0 = {resd0_1, resd0_2, resd0_3, resd0_4, resd0_5, resd0_6};
0466       for (int i = 0; i < 6; i++) {
0467         resd0->SetBinContent(i + 1, vResD0[i]->GetStdDev());
0468         resd0->SetBinError(i + 1, vResD0[i]->GetStdDevError());
0469       }
0470     }  // if ME found
0471     else {
0472       edm::LogWarning("DataNotFound") << "Monitor elements for d0 resolution cannot be found!\n";
0473     }
0474 
0475   }  // if dbe found
0476   else {
0477     edm::LogWarning("DataNotFound") << "Cannot find valid DQM back end \n";
0478   }
0479 }  // end dqmEndJob
0480 
0481 DEFINE_FWK_MODULE(OuterTrackerMCHarvester);