CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/HLTriggerOffline/SUSYBSM/src/PlotMakerReco.cc

Go to the documentation of this file.
00001 /*  \class PlotMakerReco
00002 *
00003 *  Class to produce some plots of Off-line variables in the TriggerValidation Code
00004 *
00005 *  Author: Massimiliano Chiorboli      Date: September 2007
00006 //         Maurizio Pierini
00007 //         Maria Spiropulu
00008 *
00009 */
00010 #include "HLTriggerOffline/SUSYBSM/interface/PlotMakerReco.h"
00011 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00012 
00013 
00014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00015 #include "TDirectory.h"
00016 
00017 #include "HLTriggerOffline/SUSYBSM/interface/PtSorter.h"
00018 
00019 
00020 using namespace edm;
00021 using namespace reco;
00022 using namespace std;
00023 using namespace l1extra;
00024 
00025 PlotMakerReco::PlotMakerReco(edm::ParameterSet PlotMakerRecoInput)
00026 {
00027   m_electronSrc          = PlotMakerRecoInput.getParameter<string>("electrons");
00028   m_muonSrc              = PlotMakerRecoInput.getParameter<string>("muons");
00029   m_jetsSrc              = PlotMakerRecoInput.getParameter<string>("jets");
00030   m_photonProducerSrc    = PlotMakerRecoInput.getParameter<string>("photonProducer");
00031   m_photonSrc            = PlotMakerRecoInput.getParameter<string>("photons");
00032   m_calometSrc           = PlotMakerRecoInput.getParameter<string>("calomet");
00033 
00034   def_electronPtMin = PlotMakerRecoInput.getParameter<double>("def_electronPtMin");
00035   def_muonPtMin     = PlotMakerRecoInput.getParameter<double>("def_muonPtMin");
00036   def_jetPtMin      = PlotMakerRecoInput.getParameter<double>("def_jetPtMin");
00037   def_photonPtMin   = PlotMakerRecoInput.getParameter<double>("def_photonPtMin");
00038 
00039   binFactor         = PlotMakerRecoInput.getParameter<int>("BinFactor");
00040 
00041   dirname_          = PlotMakerRecoInput.getParameter<std::string>("dirname");
00042 
00043   edm::LogInfo("PlotMakerRecoObjects") << endl;
00044   edm::LogInfo("PlotMakerRecoObjects") << "Object definition cuts:" << endl;
00045   edm::LogInfo("PlotMakerRecoObjects") << " def_electronPtMin  " << def_electronPtMin << endl;
00046   edm::LogInfo("PlotMakerRecoObjects") << " def_muonPtMin      " << def_muonPtMin     << endl;
00047   edm::LogInfo("PlotMakerRecoObjects") << " def_jetPtMin       " << def_jetPtMin      << endl;
00048   edm::LogInfo("PlotMakerRecoObjects") << " def_photonPtMin    " << def_photonPtMin   << endl;
00049 
00050 
00051 }
00052 
00053 void PlotMakerReco::fillPlots(const edm::Event& iEvent)
00054 {
00055   this->handleObjects(iEvent);
00056 
00057 
00058 
00059   //**********************
00060   // Fill the Reco Object Histos
00061   //**********************
00062   //**********************
00063   // Fill the Jet Histos
00064   //**********************
00065   
00066   int nJets = 0;
00067   std::vector<double> diJetInvMass;
00068   for(unsigned int i=0; i<theCaloJetCollection.size(); i++) {
00069     if(theCaloJetCollection[i].pt() > def_jetPtMin ) {
00070       nJets++;
00071       for(unsigned int j=i+1; j<theCaloJetCollection.size(); j++) {
00072         if(theCaloJetCollection[j].pt() > def_jetPtMin ) {
00073           diJetInvMass.push_back(invariantMass(&theCaloJetCollection[i],&theCaloJetCollection[j]));
00074         }
00075       }
00076     }
00077   } 
00078   
00079   hJetMult->Fill(nJets);
00080   for(unsigned int j=0; j<diJetInvMass.size(); j++) {hDiJetInvMass->Fill(diJetInvMass[j]);}
00081   if(theCaloJetCollection.size()>0) {
00082     hJet1Pt->Fill(theCaloJetCollection[0].pt());
00083     hJet1Eta->Fill(theCaloJetCollection[0].eta());
00084     hJet1Phi->Fill(theCaloJetCollection[0].phi());
00085   }
00086   if(theCaloJetCollection.size()>1) {
00087     hJet2Pt->Fill(theCaloJetCollection[1].pt());
00088     hJet2Eta->Fill(theCaloJetCollection[1].eta());
00089     hJet2Phi->Fill(theCaloJetCollection[1].phi());
00090   }
00091 
00092   for(unsigned int i=0; i<l1bits_->size(); i++) {
00093     if(l1bits_->at(i)) {
00094       hJetMultAfterL1[i]->Fill(nJets);
00095       for(unsigned int j=0; j<diJetInvMass.size(); j++) {hDiJetInvMassAfterL1[i]->Fill(diJetInvMass[j]);}
00096       if(theCaloJetCollection.size()>0) {
00097         hJet1PtAfterL1[i]->Fill(theCaloJetCollection[0].pt());
00098         hJet1EtaAfterL1[i]->Fill(theCaloJetCollection[0].eta());
00099         hJet1PhiAfterL1[i]->Fill(theCaloJetCollection[0].phi());
00100       }
00101       if(theCaloJetCollection.size()>1) {
00102         hJet2PtAfterL1[i]->Fill(theCaloJetCollection[1].pt());
00103         hJet2EtaAfterL1[i]->Fill(theCaloJetCollection[1].eta());
00104         hJet2PhiAfterL1[i]->Fill(theCaloJetCollection[1].phi());
00105       }
00106     }
00107   }
00108   for(unsigned int i=0; i<hltbits_->size(); i++) {
00109     if(hltbits_->at(i)) {
00110       hJetMultAfterHLT[i]->Fill(nJets);
00111       for(unsigned int j=0; j<diJetInvMass.size(); j++) {hDiJetInvMassAfterHLT[i]->Fill(diJetInvMass[j]);}
00112       if(theCaloJetCollection.size()>0) {
00113         hJet1PtAfterHLT[i]->Fill(theCaloJetCollection[0].pt());
00114         hJet1EtaAfterHLT[i]->Fill(theCaloJetCollection[0].eta());
00115         hJet1PhiAfterHLT[i]->Fill(theCaloJetCollection[0].phi());
00116       }
00117       if(theCaloJetCollection.size()>1) {
00118         hJet2PtAfterHLT[i]->Fill(theCaloJetCollection[1].pt());
00119         hJet2EtaAfterHLT[i]->Fill(theCaloJetCollection[1].eta());
00120         hJet2PhiAfterHLT[i]->Fill(theCaloJetCollection[1].phi());
00121       }
00122     }
00123   }
00124 
00125 
00126   //**********************
00127   // Fill the Electron Histos
00128   //**********************
00129   
00130   int nElectrons = 0;
00131   std::vector<double> diElecInvMass;
00132   for(unsigned int i=0; i<theElectronCollection.size(); i++) {
00133     if(theElectronCollection[i].pt() > def_electronPtMin ) {
00134       nElectrons++;
00135       for(unsigned int j=i+1; j<theElectronCollection.size(); j++) {
00136         if(theElectronCollection[j].pt() > def_electronPtMin ) {
00137           if(theElectronCollection[i].charge()*theElectronCollection[j].charge() < 0)
00138             diElecInvMass.push_back(invariantMass(&theElectronCollection[i],&theElectronCollection[j]));
00139         }
00140       }
00141     }
00142   }
00143 
00144   hElecMult->Fill(nElectrons);
00145   for(unsigned int j=0; j<diElecInvMass.size(); j++) {hDiElecInvMass->Fill(diElecInvMass[j]);}
00146   if(theElectronCollection.size()>0) {
00147     hElec1Pt->Fill(theElectronCollection[0].pt());
00148     hElec1Eta->Fill(theElectronCollection[0].eta());
00149     hElec1Phi->Fill(theElectronCollection[0].phi());
00150   }
00151   if(theElectronCollection.size()>1) {
00152     hElec2Pt->Fill(theElectronCollection[1].pt());
00153     hElec2Eta->Fill(theElectronCollection[1].eta());
00154     hElec2Phi->Fill(theElectronCollection[1].phi());
00155   }
00156 
00157   for(unsigned int i=0; i<l1bits_->size(); i++) {
00158     if(l1bits_->at(i)) {
00159       hElecMultAfterL1[i]->Fill(nElectrons);
00160       for(unsigned int j=0; j<diElecInvMass.size(); j++) {hDiElecInvMassAfterL1[i]->Fill(diElecInvMass[j]);}
00161       if(theElectronCollection.size()>0) {
00162         hElec1PtAfterL1[i]->Fill(theElectronCollection[0].pt());
00163         hElec1EtaAfterL1[i]->Fill(theElectronCollection[0].eta());
00164         hElec1PhiAfterL1[i]->Fill(theElectronCollection[0].phi());
00165       }
00166       if(theElectronCollection.size()>1) {
00167         hElec2PtAfterL1[i]->Fill(theElectronCollection[1].pt());
00168         hElec2EtaAfterL1[i]->Fill(theElectronCollection[1].eta());
00169         hElec2PhiAfterL1[i]->Fill(theElectronCollection[1].phi());
00170       }
00171     }
00172   }
00173   for(unsigned int i=0; i<hltbits_->size(); i++) {
00174     if(hltbits_->at(i)) {
00175       hElecMultAfterHLT[i]->Fill(nElectrons);
00176       for(unsigned int j=0; j<diElecInvMass.size(); j++) {hDiElecInvMassAfterHLT[i]->Fill(diElecInvMass[j]);}
00177       if(theElectronCollection.size()>0) {
00178         hElec1PtAfterHLT[i]->Fill(theElectronCollection[0].pt());
00179         hElec1EtaAfterHLT[i]->Fill(theElectronCollection[0].eta());
00180         hElec1PhiAfterHLT[i]->Fill(theElectronCollection[0].phi());
00181       }
00182       if(theElectronCollection.size()>1) {
00183         hElec2PtAfterHLT[i]->Fill(theElectronCollection[1].pt());
00184         hElec2EtaAfterHLT[i]->Fill(theElectronCollection[1].eta());
00185         hElec2PhiAfterHLT[i]->Fill(theElectronCollection[1].phi());
00186       }
00187     }
00188   }
00189 
00190 
00191   //**********************
00192   // Fill the Muon Histos
00193   //**********************
00194   
00195   int nMuons = 0;
00196   std::vector<double> diMuonInvMass;
00197   for(unsigned int i=0; i<theMuonCollection.size(); i++) {
00198     if(theMuonCollection[i].pt() > def_muonPtMin ) {
00199       nMuons++;
00200       for(unsigned int j=i+1; j<theMuonCollection.size(); j++) {
00201         if(theMuonCollection[j].pt() > def_muonPtMin ) {
00202           if(theMuonCollection[i].charge()*theMuonCollection[j].charge() < 0)
00203             diMuonInvMass.push_back(invariantMass(&theMuonCollection[i],&theMuonCollection[j]));
00204         }
00205       }
00206     }
00207   }
00208 
00209 
00210   hMuonMult->Fill(nMuons);
00211   for(unsigned int j=0; j<diMuonInvMass.size(); j++) {hDiMuonInvMass->Fill(diMuonInvMass[j]);}
00212   if(theMuonCollection.size()>0) {
00213     hMuon1Pt->Fill(theMuonCollection[0].pt());
00214     hMuon1Eta->Fill(theMuonCollection[0].eta());
00215     hMuon1Phi->Fill(theMuonCollection[0].phi());
00216   }
00217   if(theMuonCollection.size()>1) {
00218     hMuon2Pt->Fill(theMuonCollection[1].pt());
00219     hMuon2Eta->Fill(theMuonCollection[1].eta());
00220     hMuon2Phi->Fill(theMuonCollection[1].phi());
00221   }
00222 
00223   for(unsigned int i=0; i<l1bits_->size(); i++) {
00224     if(l1bits_->at(i)) {
00225       hMuonMultAfterL1[i]->Fill(nMuons);
00226       for(unsigned int j=0; j<diMuonInvMass.size(); j++) {hDiMuonInvMassAfterL1[i]->Fill(diMuonInvMass[j]);}
00227       if(theMuonCollection.size()>0) {
00228         hMuon1PtAfterL1[i]->Fill(theMuonCollection[0].pt());
00229         hMuon1EtaAfterL1[i]->Fill(theMuonCollection[0].eta());
00230         hMuon1PhiAfterL1[i]->Fill(theMuonCollection[0].phi());
00231       }
00232       if(theMuonCollection.size()>1) {
00233         hMuon2PtAfterL1[i]->Fill(theMuonCollection[1].pt());
00234         hMuon2EtaAfterL1[i]->Fill(theMuonCollection[1].eta());
00235         hMuon2PhiAfterL1[i]->Fill(theMuonCollection[1].phi());
00236       }
00237     }
00238   }
00239   for(unsigned int i=0; i<hltbits_->size(); i++) {
00240     if(hltbits_->at(i)) {
00241       hMuonMultAfterHLT[i]->Fill(nMuons);
00242       for(unsigned int j=0; j<diMuonInvMass.size(); j++) {hDiMuonInvMassAfterHLT[i]->Fill(diMuonInvMass[j]);}
00243       if(theMuonCollection.size()>0) {
00244         hMuon1PtAfterHLT[i]->Fill(theMuonCollection[0].pt());
00245         hMuon1EtaAfterHLT[i]->Fill(theMuonCollection[0].eta());
00246         hMuon1PhiAfterHLT[i]->Fill(theMuonCollection[0].phi());
00247       }
00248       if(theMuonCollection.size()>1) {
00249         hMuon2PtAfterHLT[i]->Fill(theMuonCollection[1].pt());
00250         hMuon2EtaAfterHLT[i]->Fill(theMuonCollection[1].eta());
00251         hMuon2PhiAfterHLT[i]->Fill(theMuonCollection[1].phi());
00252       }
00253     }
00254   }
00255 
00256   //**********************
00257   // Fill the Photon Histos
00258   //**********************
00259   
00260   int nPhotons = 0;
00261   std::vector<double> diPhotonInvMass;
00262   for(unsigned int i=0; i<thePhotonCollection.size(); i++) {
00263     if(thePhotonCollection[i].pt() > def_photonPtMin ) {
00264       nPhotons++;
00265       for(unsigned int j=i+1; j<thePhotonCollection.size(); j++) {
00266         if(thePhotonCollection[j].pt() > def_photonPtMin ) {
00267           diPhotonInvMass.push_back(invariantMass(&thePhotonCollection[i],&thePhotonCollection[j]));
00268         }
00269       }
00270     }
00271   }
00272 
00273   hPhotonMult->Fill(nPhotons);
00274   for(unsigned int j=0; j<diPhotonInvMass.size(); j++) {hDiPhotonInvMass->Fill(diPhotonInvMass[j]);}
00275   if(thePhotonCollection.size()>0) {
00276     hPhoton1Pt->Fill(thePhotonCollection[0].et());
00277     hPhoton1Eta->Fill(thePhotonCollection[0].eta());
00278     hPhoton1Phi->Fill(thePhotonCollection[0].phi());
00279   }
00280   if(thePhotonCollection.size()>1) {
00281     hPhoton2Pt->Fill(thePhotonCollection[1].et());
00282     hPhoton2Eta->Fill(thePhotonCollection[1].eta());
00283     hPhoton2Phi->Fill(thePhotonCollection[1].phi());
00284   }
00285   for(unsigned int i=0; i<l1bits_->size(); i++) {
00286     if(l1bits_->at(i)) {
00287       hPhotonMultAfterL1[i]->Fill(nPhotons);
00288       for(unsigned int j=0; j<diPhotonInvMass.size(); j++) {hDiPhotonInvMassAfterL1[i]->Fill(diPhotonInvMass[j]);}
00289       if(thePhotonCollection.size()>0) {
00290         hPhoton1PtAfterL1[i]->Fill(thePhotonCollection[0].et());
00291         hPhoton1EtaAfterL1[i]->Fill(thePhotonCollection[0].eta());
00292         hPhoton1PhiAfterL1[i]->Fill(thePhotonCollection[0].phi());
00293       }
00294       if(thePhotonCollection.size()>1) {
00295         hPhoton2PtAfterL1[i]->Fill(thePhotonCollection[1].et());
00296         hPhoton2EtaAfterL1[i]->Fill(thePhotonCollection[1].eta());
00297         hPhoton2PhiAfterL1[i]->Fill(thePhotonCollection[1].phi());
00298       }
00299     }
00300   }
00301   for(unsigned int i=0; i<hltbits_->size(); i++) {
00302     if(hltbits_->at(i)) {
00303       hPhotonMultAfterHLT[i]->Fill(nPhotons);
00304       for(unsigned int j=0; j<diPhotonInvMass.size(); j++) {hDiPhotonInvMassAfterHLT[i]->Fill(diPhotonInvMass[j]);}
00305       if(thePhotonCollection.size()>0) {
00306         hPhoton1PtAfterHLT[i]->Fill(thePhotonCollection[0].et());
00307         hPhoton1EtaAfterHLT[i]->Fill(thePhotonCollection[0].eta());
00308         hPhoton1PhiAfterHLT[i]->Fill(thePhotonCollection[0].phi());
00309       }
00310       if(thePhotonCollection.size()>1) {
00311         hPhoton2PtAfterHLT[i]->Fill(thePhotonCollection[1].et());
00312         hPhoton2EtaAfterHLT[i]->Fill(thePhotonCollection[1].eta());
00313         hPhoton2PhiAfterHLT[i]->Fill(thePhotonCollection[1].phi());
00314      }
00315     }
00316   }
00317 
00318 
00319   //**********************
00320   // Fill the MET Histos
00321   //**********************
00322   
00323   hMET->Fill((theCaloMETCollection.front()).pt());
00324   hMETx->Fill((theCaloMETCollection.front()).px());
00325   hMETy->Fill((theCaloMETCollection.front()).py());
00326   hMETphi->Fill((theCaloMETCollection.front()).phi());
00327   hSumEt->Fill((theCaloMETCollection.front()).sumEt());
00328   double RecoMetSig = (theCaloMETCollection.front()).pt() / sqrt( (theCaloMETCollection.front()).sumEt() );
00329   hMETSignificance->Fill(RecoMetSig);
00330   for(unsigned int i=0; i<l1bits_->size(); i++) {
00331     if(l1bits_->at(i)) {
00332       hMETAfterL1[i]->Fill((theCaloMETCollection.front()).pt());
00333       hMETxAfterL1[i]->Fill((theCaloMETCollection.front()).px());
00334       hMETyAfterL1[i]->Fill((theCaloMETCollection.front()).py());
00335       hMETphiAfterL1[i]->Fill((theCaloMETCollection.front()).phi());
00336       hSumEtAfterL1[i]->Fill((theCaloMETCollection.front()).sumEt());
00337       hMETSignificanceAfterL1[i]->Fill(RecoMetSig);
00338     }
00339   }
00340   for(unsigned int i=0; i<hltbits_->size(); i++) {
00341     if(hltbits_->at(i)) {
00342       hMETAfterHLT[i]->Fill((theCaloMETCollection.front()).pt());
00343       hMETxAfterHLT[i]->Fill((theCaloMETCollection.front()).px());
00344       hMETyAfterHLT[i]->Fill((theCaloMETCollection.front()).py());
00345       hMETphiAfterHLT[i]->Fill((theCaloMETCollection.front()).phi());
00346       hSumEtAfterHLT[i]->Fill((theCaloMETCollection.front()).sumEt());
00347       hMETSignificanceAfterHLT[i]->Fill(RecoMetSig);
00348     }
00349   }
00350 
00351 
00352 }
00353 
00354 
00355 
00356 
00357 void PlotMakerReco::bookHistos(DQMStore * dbe_, std::vector<int>* l1bits, std::vector<int>* hltbits, 
00358                            std::vector<std::string>* l1Names_, std::vector<std::string>* hlNames_)
00359 {
00360 
00361   this->setBits(l1bits, hltbits);
00362 
00363 
00364   //******************
00365   //Book histos Reco Objects
00366   //******************
00367 
00368   //******************
00369   //Book Jets
00370   //******************
00371   
00372   dbe_->setCurrentFolder(dirname_+"/RecoJets/General");
00373   hJetMult = dbe_->book1D("JetMult", "Jet Multiplicity", 10, 0, 10);
00374   hJet1Pt  = dbe_->book1D("Jet1Pt",  "Jet 1 Pt ",        100, 0, 1000);
00375   hJet2Pt  = dbe_->book1D("Jet2Pt",  "Jet 2 Pt ",        100, 0, 1000);
00376   hJet1Eta  = dbe_->book1D("Jet1Eta",  "Jet 1 Eta ",        10*binFactor, -3   , 3   );
00377   hJet2Eta  = dbe_->book1D("Jet2Eta",  "Jet 2 Eta ",        10*binFactor, -3   , 3   );
00378   hJet1Phi  = dbe_->book1D("Jet1Phi",  "Jet 1 Phi ",        10*binFactor, -3.2 , 3.2 );
00379   hJet2Phi  = dbe_->book1D("Jet2Phi",  "Jet 2 Phi ",        10*binFactor, -3.2 , 3.2 );
00380   
00381   hDiJetInvMass = dbe_->book1D("DiJetInvMass", "DiJet Invariant Mass", 100*binFactor, 0, 1000);
00382   
00383 
00384   dbe_->setCurrentFolder(dirname_+"/RecoJets/L1");
00385   for(unsigned int i=0; i<l1bits_->size(); i++){
00386     myHistoName = "JetMult_" + (*l1Names_)[i];
00387     myHistoTitle = "Jet Multiplicity for L1 path " + (*l1Names_)[i];
00388     hJetMultAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10, 0, 10));
00389     myHistoName = "Jet1Pt_" + (*l1Names_)[i];
00390     myHistoTitle = "Jet 1 Pt for L1 path " + (*l1Names_)[i];
00391     hJet1PtAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 1000));
00392     myHistoName = "Jet2Pt_" + (*l1Names_)[i];
00393     myHistoTitle = "Jet 2 Pt for L1 path " + (*l1Names_)[i];
00394     hJet2PtAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 1000));
00395     myHistoName = "Jet1Eta_" + (*l1Names_)[i];
00396     myHistoTitle = "Jet 1 Eta for L1 path " + (*l1Names_)[i];
00397     hJet1EtaAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00398     myHistoName = "Jet2Eta_" + (*l1Names_)[i];
00399     myHistoTitle = "Jet 2 Eta for L1 path " + (*l1Names_)[i];
00400     hJet2EtaAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00401     myHistoName = "Jet1Phi_" + (*l1Names_)[i];
00402     myHistoTitle = "Jet 1 Phi for L1 path " + (*l1Names_)[i];
00403     hJet1PhiAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00404     myHistoName = "Jet2Phi_" + (*l1Names_)[i];
00405     myHistoTitle = "Jet 2 Phi for L1 path " + (*l1Names_)[i];
00406     hJet2PhiAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00407     
00408     myHistoName = "DiJetInvMass_" + (*l1Names_)[i];
00409     myHistoTitle = "DiJet Invariant Mass for L1 path " + (*l1Names_)[i];
00410     hDiJetInvMassAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100*binFactor, 0, 1000));
00411 
00412   }
00413 
00414   dbe_->setCurrentFolder(dirname_+"/RecoJets/HLT");
00415   for(unsigned int i=0; i<hltbits_->size(); i++){
00416     myHistoName = "JetMult_" + (*hlNames_)[i];
00417     myHistoTitle = "Jet Multiplicity for HLT path " + (*hlNames_)[i];    
00418     hJetMultAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10, 0, 10));
00419     myHistoName = "Jet1Pt_" + (*hlNames_)[i];
00420     myHistoTitle = "Jet 1 Pt for HLT path " + (*hlNames_)[i];
00421     hJet1PtAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 1000));
00422     myHistoName = "Jet2Pt_" + (*hlNames_)[i];
00423     myHistoTitle = "Jet 2 Pt for HLT path " + (*hlNames_)[i];
00424     hJet2PtAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 1000));
00425     myHistoName = "Jet1Eta_" + (*hlNames_)[i];
00426     myHistoTitle = "Jet 1 Eta for HLT path " + (*hlNames_)[i];
00427     hJet1EtaAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00428     myHistoName = "Jet2Eta_" + (*hlNames_)[i];
00429     myHistoTitle = "Jet 2 Eta for HLT path " + (*hlNames_)[i];
00430     hJet2EtaAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00431     myHistoName = "Jet1Phi_" + (*hlNames_)[i];
00432     myHistoTitle = "Jet 1 Phi for HLT path " + (*hlNames_)[i];
00433     hJet1PhiAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00434     myHistoName = "Jet2Phi_" + (*hlNames_)[i];
00435     myHistoTitle = "Jet 2 Phi for HLT path " + (*hlNames_)[i];
00436     hJet2PhiAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00437 
00438     myHistoName = "DiJetInvMass_" + (*hlNames_)[i];
00439     myHistoTitle = "DiJet Invariant Mass for HLT path " + (*hlNames_)[i];
00440     hDiJetInvMassAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100*binFactor, 0, 1000));
00441 
00442   }
00443   dbe_->setCurrentFolder(dirname_);
00444 
00445 
00446 
00447 
00448   //******************
00449   //Book Electrons
00450   //******************
00451   
00452   dbe_->setCurrentFolder(dirname_+"/RecoElectrons/General");
00453   hElecMult = dbe_->book1D("ElecMult", "Elec Multiplicity", 10, 0, 10);
00454   hElec1Pt  = dbe_->book1D("Elec1Pt",  "Elec 1 Pt ",        100, 0, 100);
00455   hElec2Pt  = dbe_->book1D("Elec2Pt",  "Elec 2 Pt ",        100, 0, 100);
00456   hElec1Eta  = dbe_->book1D("Elec1Eta",  "Elec 1 Eta ",        10*binFactor, -3, 3);
00457   hElec2Eta  = dbe_->book1D("Elec2Eta",  "Elec 2 Eta ",        10*binFactor, -3, 3);
00458   hElec1Phi  = dbe_->book1D("Elec1Phi",  "Elec 1 Phi ",        10*binFactor, -3.2, 3.2);
00459   hElec2Phi  = dbe_->book1D("Elec2Phi",  "Elec 2 Phi ",        10*binFactor, -3.2, 3.2);
00460 
00461   hDiElecInvMass = dbe_->book1D("DiElecInvMass", "DiElec Invariant Mass", 100*binFactor, 0, 1000);
00462   
00463   dbe_->setCurrentFolder(dirname_+"/RecoElectrons/L1");
00464   for(unsigned int i=0; i<l1bits_->size(); i++){
00465     myHistoName = "ElecMult_" + (*l1Names_)[i];
00466     myHistoTitle = "Elec Multiplicity for L1 path " + (*l1Names_)[i];
00467     hElecMultAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10, 0, 10));
00468     myHistoName = "Elec1Pt_" + (*l1Names_)[i];
00469     myHistoTitle = "Elec 1 Pt for L1 path " + (*l1Names_)[i];
00470     hElec1PtAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00471     myHistoName = "Elec2Pt_" + (*l1Names_)[i];
00472     myHistoTitle = "Elec 2 Pt for L1 path " + (*l1Names_)[i];
00473     hElec2PtAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00474     myHistoName = "Elec1Eta_" + (*l1Names_)[i];
00475     myHistoTitle = "Elec 1 Eta for L1 path " + (*l1Names_)[i];
00476     hElec1EtaAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00477     myHistoName = "Elec2Eta_" + (*l1Names_)[i];
00478     myHistoTitle = "Elec 2 Eta for L1 path " + (*l1Names_)[i];
00479     hElec2EtaAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00480     myHistoName = "Elec1Phi_" + (*l1Names_)[i];
00481     myHistoTitle = "Elec 1 Phi for L1 path " + (*l1Names_)[i];
00482     hElec1PhiAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00483     myHistoName = "Elec2Phi_" + (*l1Names_)[i];
00484     myHistoTitle = "Elec 2 Phi for L1 path " + (*l1Names_)[i];
00485     hElec2PhiAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00486 
00487     myHistoName = "DiElecInvMass_" + (*l1Names_)[i];
00488     myHistoTitle = "DiElec Invariant Mass for L1 path " + (*l1Names_)[i];
00489     hDiElecInvMassAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100*binFactor, 0, 1000));
00490 
00491   }
00492 
00493   dbe_->setCurrentFolder(dirname_+"/RecoElectrons/HLT");
00494   for(unsigned int i=0; i<hltbits_->size(); i++){
00495     myHistoName = "ElecMult_" + (*hlNames_)[i];
00496     myHistoTitle = "Elec Multiplicity for HLT path " + (*hlNames_)[i];    
00497     hElecMultAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10, 0, 10));
00498     myHistoName = "Elec1Pt_" + (*hlNames_)[i];
00499     myHistoTitle = "Elec 1 Pt for HLT path " + (*hlNames_)[i];
00500     hElec1PtAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00501     myHistoName = "Elec2Pt_" + (*hlNames_)[i];
00502     myHistoTitle = "Elec 2 Pt for HLT path " + (*hlNames_)[i];
00503     hElec2PtAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00504     myHistoName = "Elec1Eta_" + (*hlNames_)[i];
00505     myHistoTitle = "Elec 1 Eta for HLT path " + (*hlNames_)[i];
00506     hElec1EtaAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00507     myHistoName = "Elec2Eta_" + (*hlNames_)[i];
00508     myHistoTitle = "Elec 2 Eta for HLT path " + (*hlNames_)[i];
00509     hElec2EtaAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00510     myHistoName = "Elec1Phi_" + (*hlNames_)[i];
00511     myHistoTitle = "Elec 1 Phi for HLT path " + (*hlNames_)[i];
00512     hElec1PhiAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00513     myHistoName = "Elec2Phi_" + (*hlNames_)[i];
00514     myHistoTitle = "Elec 2 Phi for HLT path " + (*hlNames_)[i];
00515     hElec2PhiAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00516 
00517     myHistoName = "DiElecInvMass_" + (*hlNames_)[i];
00518     myHistoTitle = "DiElec Invariant Mass for HLT path " + (*hlNames_)[i];
00519     hDiElecInvMassAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100*binFactor, 0, 1000));
00520 
00521   }
00522   dbe_->setCurrentFolder(dirname_);
00523 
00524 
00525   //******************
00526   //Book Muons
00527   //******************
00528   
00529   dbe_->setCurrentFolder(dirname_+"/RecoMuons/General");
00530   hMuonMult = dbe_->book1D("MuonMult", "Muon Multiplicity", 10, 0, 10);
00531   hMuon1Pt  = dbe_->book1D("Muon1Pt",  "Muon 1 Pt ",        100, 0, 100);
00532   hMuon2Pt  = dbe_->book1D("Muon2Pt",  "Muon 2 Pt ",        100, 0, 100);
00533   hMuon1Eta  = dbe_->book1D("Muon1Eta",  "Muon 1 Eta ",        10*binFactor, -3, 3);
00534   hMuon2Eta  = dbe_->book1D("Muon2Eta",  "Muon 2 Eta ",        10*binFactor, -3, 3);
00535   hMuon1Phi  = dbe_->book1D("Muon1Phi",  "Muon 1 Phi ",        10*binFactor, -3.2, 3.2);
00536   hMuon2Phi  = dbe_->book1D("Muon2Phi",  "Muon 2 Phi ",        10*binFactor, -3.2, 3.2);
00537   
00538   hDiMuonInvMass = dbe_->book1D("DiMuonInvMass", "DiMuon Invariant Mass", 100*binFactor, 0, 1000);
00539 
00540   dbe_->setCurrentFolder(dirname_+"/RecoMuons/L1");
00541   for(unsigned int i=0; i<l1bits_->size(); i++){
00542     myHistoName = "MuonMult_" + (*l1Names_)[i];
00543     myHistoTitle = "Muon Multiplicity for L1 path " + (*l1Names_)[i];
00544     hMuonMultAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10, 0, 10));
00545     myHistoName = "Muon1Pt_" + (*l1Names_)[i];
00546     myHistoTitle = "Muon 1 Pt for L1 path " + (*l1Names_)[i];
00547     hMuon1PtAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00548     myHistoName = "Muon2Pt_" + (*l1Names_)[i];
00549     myHistoTitle = "Muon 2 Pt for L1 path " + (*l1Names_)[i];
00550     hMuon2PtAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00551     myHistoName = "Muon1Eta_" + (*l1Names_)[i];
00552     myHistoTitle = "Muon 1 Eta for L1 path " + (*l1Names_)[i];
00553     hMuon1EtaAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00554     myHistoName = "Muon2Eta_" + (*l1Names_)[i];
00555     myHistoTitle = "Muon 2 Eta for L1 path " + (*l1Names_)[i];
00556     hMuon2EtaAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00557     myHistoName = "Muon1Phi_" + (*l1Names_)[i];
00558     myHistoTitle = "Muon 1 Phi for L1 path " + (*l1Names_)[i];
00559     hMuon1PhiAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00560     myHistoName = "Muon2Phi_" + (*l1Names_)[i];
00561     myHistoTitle = "Muon 2 Phi for L1 path " + (*l1Names_)[i];
00562     hMuon2PhiAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00563 
00564     myHistoName = "DiMuonInvMass_" + (*l1Names_)[i];
00565     myHistoTitle = "DiMuon Invariant Mass for L1 path " + (*l1Names_)[i];
00566     hDiMuonInvMassAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100*binFactor, 0, 1000));
00567 
00568   }
00569 
00570   dbe_->setCurrentFolder(dirname_+"/RecoMuons/HLT");
00571   for(unsigned int i=0; i<hltbits_->size(); i++){
00572     myHistoName = "MuonMult_" + (*hlNames_)[i];
00573     myHistoTitle = "Muon Multiplicity for HLT path " + (*hlNames_)[i];    
00574     hMuonMultAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10, 0, 10));
00575     myHistoName = "Muon1Pt_" + (*hlNames_)[i];
00576     myHistoTitle = "Muon 1 Pt for HLT path " + (*hlNames_)[i];
00577     hMuon1PtAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00578     myHistoName = "Muon2Pt_" + (*hlNames_)[i];
00579     myHistoTitle = "Muon 2 Pt for HLT path " + (*hlNames_)[i];
00580     hMuon2PtAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00581     myHistoName = "Muon1Eta_" + (*hlNames_)[i];
00582     myHistoTitle = "Muon 1 Eta for HLT path " + (*hlNames_)[i];
00583     hMuon1EtaAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00584     myHistoName = "Muon2Eta_" + (*hlNames_)[i];
00585     myHistoTitle = "Muon 2 Eta for HLT path " + (*hlNames_)[i];
00586     hMuon2EtaAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00587     myHistoName = "Muon1Phi_" + (*hlNames_)[i];
00588     myHistoTitle = "Muon 1 Phi for HLT path " + (*hlNames_)[i];
00589     hMuon1PhiAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00590     myHistoName = "Muon2Phi_" + (*hlNames_)[i];
00591     myHistoTitle = "Muon 2 Phi for HLT path " + (*hlNames_)[i];
00592     hMuon2PhiAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00593 
00594     myHistoName = "DiMuonInvMass_" + (*hlNames_)[i];
00595     myHistoTitle = "DiMuon Invariant Mass for HLT path " + (*hlNames_)[i];
00596     hDiMuonInvMassAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100*binFactor, 0, 1000));
00597 
00598   }
00599   dbe_->setCurrentFolder(dirname_);
00600 
00601 
00602 
00603   //******************
00604   //Book Photons
00605   //******************
00606   
00607   dbe_->setCurrentFolder(dirname_+"/RecoPhotons/General");
00608   hPhotonMult = dbe_->book1D("PhotonMult", "Photon Multiplicity", 10, 0, 10);
00609   hPhoton1Pt  = dbe_->book1D("Photon1Pt",  "Photon 1 Pt ",        100, 0, 100);
00610   hPhoton2Pt  = dbe_->book1D("Photon2Pt",  "Photon 2 Pt ",        100, 0, 100);
00611   hPhoton1Eta  = dbe_->book1D("Photon1Eta",  "Photon 1 Eta ",        10*binFactor, -3, 3);
00612   hPhoton2Eta  = dbe_->book1D("Photon2Eta",  "Photon 2 Eta ",        10*binFactor, -3, 3);
00613   hPhoton1Phi  = dbe_->book1D("Photon1Phi",  "Photon 1 Phi ",        10*binFactor, -3.2, 3.2);
00614   hPhoton2Phi  = dbe_->book1D("Photon2Phi",  "Photon 2 Phi ",        10*binFactor, -3.2, 3.2);
00615   
00616   hDiPhotonInvMass = dbe_->book1D("DiPhotonInvMass", "DiPhoton Invariant Mass", 100*binFactor, 0, 1000);
00617 
00618   dbe_->setCurrentFolder(dirname_+"/RecoPhotons/L1");
00619   for(unsigned int i=0; i<l1bits_->size(); i++){
00620     myHistoName = "PhotonMult_" + (*l1Names_)[i];
00621     myHistoTitle = "Photon Multiplicity for L1 path " + (*l1Names_)[i];
00622     hPhotonMultAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10, 0, 10));
00623     myHistoName = "Photon1Pt_" + (*l1Names_)[i];
00624     myHistoTitle = "Photon 1 Pt for L1 path " + (*l1Names_)[i];
00625     hPhoton1PtAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00626     myHistoName = "Photon2Pt_" + (*l1Names_)[i];
00627     myHistoTitle = "Photon 2 Pt for L1 path " + (*l1Names_)[i];
00628     hPhoton2PtAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00629     myHistoName = "Photon1Eta_" + (*l1Names_)[i];
00630     myHistoTitle = "Photon 1 Eta for L1 path " + (*l1Names_)[i];
00631     hPhoton1EtaAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00632     myHistoName = "Photon2Eta_" + (*l1Names_)[i];
00633     myHistoTitle = "Photon 2 Eta for L1 path " + (*l1Names_)[i];
00634     hPhoton2EtaAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00635     myHistoName = "Photon1Phi_" + (*l1Names_)[i];
00636     myHistoTitle = "Photon 1 Phi for L1 path " + (*l1Names_)[i];
00637     hPhoton1PhiAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00638     myHistoName = "Photon2Phi_" + (*l1Names_)[i];
00639     myHistoTitle = "Photon 2 Phi for L1 path " + (*l1Names_)[i];
00640     hPhoton2PhiAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00641 
00642     myHistoName = "DiPhotonInvMass_" + (*l1Names_)[i];
00643     myHistoTitle = "DiPhoton Invariant Mass for L1 path " + (*l1Names_)[i];
00644     hDiPhotonInvMassAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100*binFactor, 0, 1000));
00645 
00646   }
00647 
00648   dbe_->setCurrentFolder(dirname_+"/RecoPhotons/HLT");
00649   for(unsigned int i=0; i<hltbits_->size(); i++){
00650     myHistoName = "PhotonMult_" + (*hlNames_)[i];
00651     myHistoTitle = "Photon Multiplicity for HLT path " + (*hlNames_)[i];    
00652     hPhotonMultAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10, 0, 10));
00653     myHistoName = "Photon1Pt_" + (*hlNames_)[i];
00654     myHistoTitle = "Photon 1 Pt for HLT path " + (*hlNames_)[i];
00655     hPhoton1PtAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00656     myHistoName = "Photon2Pt_" + (*hlNames_)[i];
00657     myHistoTitle = "Photon 2 Pt for HLT path " + (*hlNames_)[i];
00658     hPhoton2PtAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100, 0, 100));
00659     myHistoName = "Photon1Eta_" + (*hlNames_)[i];
00660     myHistoTitle = "Photon 1 Eta for HLT path " + (*hlNames_)[i];
00661     hPhoton1EtaAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00662     myHistoName = "Photon2Eta_" + (*hlNames_)[i];
00663     myHistoTitle = "Photon 2 Eta for HLT path " + (*hlNames_)[i];
00664     hPhoton2EtaAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3, 3));
00665     myHistoName = "Photon1Phi_" + (*hlNames_)[i];
00666     myHistoTitle = "Photon 1 Phi for HLT path " + (*hlNames_)[i];
00667     hPhoton1PhiAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00668     myHistoName = "Photon2Phi_" + (*hlNames_)[i];
00669     myHistoTitle = "Photon 2 Phi for HLT path " + (*hlNames_)[i];
00670     hPhoton2PhiAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00671 
00672     myHistoName = "DiPhotonInvMass_" + (*hlNames_)[i];
00673     myHistoTitle = "DiPhoton Invariant Mass for HLT path " + (*hlNames_)[i];
00674     hDiPhotonInvMassAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 100*binFactor, 0, 1000));
00675 
00676   }
00677   dbe_->setCurrentFolder(dirname_);
00678 
00679 
00680 
00681   //******************
00682   //Book MET
00683   //******************
00684   
00685   dbe_->setCurrentFolder(dirname_+"/RecoMET/General");
00686   hMET = dbe_->book1D("MET", "MET", 35, 0, 1050);
00687   hMETx   = dbe_->book1D("METx", "METx", 35, 0, 1050);
00688   hMETy   = dbe_->book1D("METy", "METy", 35, 0, 1050);
00689   hMETphi = dbe_->book1D("METphi", "METphi", 10*binFactor, -3.2, 3.2);
00690   hSumEt  = dbe_->book1D("SumEt" , "SumEt",  35, 0, 1050);
00691   hMETSignificance = dbe_->book1D("METSignificance", "METSignificance", 100, 0, 100);
00692   dbe_->setCurrentFolder(dirname_+"/RecoMET/L1");
00693   for(unsigned int i=0; i<l1bits_->size(); i++){
00694     myHistoName = "MET_" + (*l1Names_)[i];
00695     myHistoTitle = "MET for L1 path " + (*l1Names_)[i];
00696     hMETAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 35, 0, 1050));
00697     myHistoName = "METx_" + (*l1Names_)[i];
00698     myHistoTitle = "METx for L1 path " + (*l1Names_)[i];
00699     hMETxAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 35, 0, 1050));
00700     myHistoName = "METy_" + (*l1Names_)[i];
00701     myHistoTitle = "METy for L1 path " + (*l1Names_)[i];
00702     hMETyAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 35, 0, 1050));
00703     myHistoName = "METPhi_" + (*l1Names_)[i];
00704     myHistoTitle = "METPhi for L1 path " + (*l1Names_)[i];
00705     hMETphiAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2));
00706     myHistoName = "SumEt_" + (*l1Names_)[i];
00707     myHistoTitle = "SumEt for L1 path " + (*l1Names_)[i];
00708     hSumEtAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 35, 0, 1050));
00709     myHistoName = "METSignificance_" + (*l1Names_)[i];
00710     myHistoTitle = "METSignificance for L1 path " + (*l1Names_)[i];
00711     hMETSignificanceAfterL1.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, 0, 100));
00712   }
00713 
00714   dbe_->setCurrentFolder(dirname_+"/RecoMET/HLT");
00715   for(unsigned int i=0; i<hltbits_->size(); i++){
00716     myHistoName = "MET_" + (*hlNames_)[i];
00717     myHistoTitle = "MET for HLT path " + (*hlNames_)[i];    
00718     hMETAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 35, 0, 1050));
00719     myHistoName = "METx_" + (*hlNames_)[i];
00720     myHistoTitle = "METx for HLT path " + (*hlNames_)[i];    
00721     hMETxAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 35, 0, 1050));
00722     myHistoName = "METy_" + (*hlNames_)[i];
00723     myHistoTitle = "METy for HLT path " + (*hlNames_)[i];    
00724     hMETyAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 35, 0, 1050));
00725     myHistoName = "METPhi_" + (*hlNames_)[i];
00726     myHistoTitle = "METPhi for HLT path " + (*hlNames_)[i];    
00727     hMETphiAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, -3.2, 3.2 ));
00728     myHistoName = "SumEt_" + (*hlNames_)[i];
00729     myHistoTitle = "SumEt for HLT path " + (*hlNames_)[i];    
00730     hSumEtAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 35, 0, 1050));
00731     myHistoName = "METSignificance_" + (*hlNames_)[i];
00732     myHistoTitle = "METSignificance for HLT path " + (*hlNames_)[i];    
00733     hMETSignificanceAfterHLT.push_back(dbe_->book1D(myHistoName.c_str(), myHistoTitle.c_str() , 10*binFactor, 0, 100));
00734   }
00735   dbe_->setCurrentFolder(dirname_);
00736 
00737 
00738 
00739 
00740 }
00741 
00742 
00743 
00744 
00745 
00746 
00747 void PlotMakerReco::handleObjects(const edm::Event& iEvent)
00748 {
00749 
00750 
00751   //***********************************************
00752   // Get the RECO Objects
00753   //***********************************************
00754 
00755 
00756   //Get the electrons
00757   Handle<GsfElectronCollection> theElectronCollectionHandle; 
00758   iEvent.getByLabel(m_electronSrc, theElectronCollectionHandle);
00759   theElectronCollection = *theElectronCollectionHandle;
00760   std::sort(theElectronCollection.begin(), theElectronCollection.end(), PtSorter());
00761 
00762   //Get the Muons
00763   Handle<MuonCollection> theMuonCollectionHandle; 
00764   iEvent.getByLabel(m_muonSrc, theMuonCollectionHandle);
00765   theMuonCollection = *theMuonCollectionHandle;
00766   std::sort(theMuonCollection.begin(), theMuonCollection.end(), PtSorter());
00767 
00768   //Get the Photons
00769   Handle<PhotonCollection> thePhotonCollectionHandle; 
00770   iEvent.getByLabel(m_photonProducerSrc, m_photonSrc, thePhotonCollectionHandle);
00771   thePhotonCollection = *thePhotonCollectionHandle;
00772   std::sort(thePhotonCollection.begin(), thePhotonCollection.end(), PtSorter());
00773 
00774   //Get the CaloJets
00775   Handle<CaloJetCollection> theCaloJetCollectionHandle;
00776   iEvent.getByLabel(m_jetsSrc, theCaloJetCollectionHandle);
00777   theCaloJetCollection = *theCaloJetCollectionHandle;
00778   std::sort(theCaloJetCollection.begin(), theCaloJetCollection.end(), PtSorter());
00779 
00780   //Get the CaloMET
00781   Handle<CaloMETCollection> theCaloMETCollectionHandle;
00782   iEvent.getByLabel(m_calometSrc, theCaloMETCollectionHandle);
00783   theCaloMETCollection = *theCaloMETCollectionHandle;
00784 }
00785 
00786 double PlotMakerReco::invariantMass(reco::Candidate* p1, reco::Candidate* p2) {
00787   double mass = sqrt( (p1->energy() + p2->energy())*(p1->energy() + p2->energy()) -
00788                (p1->px() + p2->px())*(p1->px() + p2->px()) -
00789                (p1->py() + p2->py())*(p1->py() + p2->py()) -
00790                (p1->pz() + p2->pz())*(p1->pz() + p2->pz()) );
00791 
00792 
00793 //   cout << "p1->energy() = " << p1->energy() << " p2->energy() = " << p2->energy() << endl;
00794 //   cout << "p1->px() = " << p1->px() << " p2->px() = " << p2->px() << endl;
00795 //   cout << "p1->py() = " << p1->py() << " p2->py() = " << p2->py() << endl;
00796 //   cout << "p1->pz() = " << p1->pz() << " p2->pz() = " << p2->pz() << endl;
00797 //   cout << "invmass = " << mass << endl;
00798 
00799 
00800   return mass;
00801 }
00802