CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/HLTriggerOffline/JetMET/src/HLTJetMETValidation.cc

Go to the documentation of this file.
00001 #include "HLTriggerOffline/JetMET/interface/HLTJetMETValidation.h"
00002 #include "Math/GenVector/VectorUtil.h"
00003 #include "FWCore/Common/interface/TriggerNames.h"
00004 
00005 HLTJetMETValidation::HLTJetMETValidation(const edm::ParameterSet& ps) : 
00006   triggerEventObject_(ps.getUntrackedParameter<edm::InputTag>("triggerEventObject")),
00007   CaloJetAlgorithm( ps.getUntrackedParameter<edm::InputTag>( "CaloJetAlgorithm" ) ),
00008   GenJetAlgorithm( ps.getUntrackedParameter<edm::InputTag>( "GenJetAlgorithm" ) ),
00009   CaloMETColl( ps.getUntrackedParameter<edm::InputTag>( "CaloMETCollection" ) ),
00010   GenMETColl( ps.getUntrackedParameter<edm::InputTag>( "GenMETCollection" ) ),
00011   HLTriggerResults( ps.getParameter<edm::InputTag>( "HLTriggerResults" ) ),
00012   triggerTag_(ps.getUntrackedParameter<std::string>("DQMFolder","SingleJet")),
00013   patternJetTrg_(ps.getUntrackedParameter<std::string>("PatternJetTrg","")),
00014   patternMetTrg_(ps.getUntrackedParameter<std::string>("PatternMetTrg","")),
00015   patternMuTrg_(ps.getUntrackedParameter<std::string>("PatternMuTrg","")),
00016   outFile_(ps.getUntrackedParameter<std::string>("OutputFileName","")),
00017   HLTinit_(false),
00018   //JL
00019   writeFile_(ps.getUntrackedParameter<bool>("WriteFile",false))
00020 {
00021   evtCnt=0;
00022 
00023   store = &*edm::Service<DQMStore>();
00024 
00025 }
00026 
00027 HLTJetMETValidation::~HLTJetMETValidation()
00028 {
00029 }
00030 
00031 //
00032 // member functions
00033 //
00034 
00035 
00036 void
00037 HLTJetMETValidation::beginRun(const edm::Run & iRun, const edm::EventSetup & iSetup) {
00038 
00039   
00040   bool foundMuTrg = false;
00041   std::string trgMuNm;
00042   bool changedConfig;
00043   //--define search patterns
00044   /*
00045   TPRegexp patternJet("HLT_Jet([0-9]*)?(_v[0-9]*)?$");
00046   TPRegexp patternMet("HLT_(PF*)?M([E,H]*)?T([0-9]*)?(_v[0-9]*)?$");
00047   TPRegexp patternMu("HLT_Mu([0-9]*)?(_v[0-9]*)?$");
00048   */
00049   TPRegexp patternJet(patternJetTrg_);
00050   TPRegexp patternMet(patternMetTrg_);
00051   TPRegexp patternMu(patternMuTrg_);
00052 
00053   if (!hltConfig_.init(iRun, iSetup, "HLT", changedConfig)) {
00054     edm::LogError("HLTJetMET") << "Initialization of HLTConfigProvider failed!!"; 
00055     return;
00056   }
00057   std::vector<std::string> validTriggerNames = hltConfig_.triggerNames();
00058   for (size_t j = 0; j < validTriggerNames.size(); j++) {
00059     //---find the muon path
00060     if (TString(validTriggerNames[j]).Contains(patternMu)) {
00061       //std::cout <<validTriggerNames[j].c_str()<<std::endl;
00062       if (!foundMuTrg) trgMuNm = validTriggerNames[j].c_str();
00063       foundMuTrg = true;
00064     }
00065     //---find the jet paths
00066     if (TString(validTriggerNames[j]).Contains(patternJet)) {
00067       hltTrgJet.push_back(validTriggerNames[j]);
00068     }
00069     //---find the met paths
00070     if (TString(validTriggerNames[j]).Contains(patternMet)) {
00071       hltTrgMet.push_back(validTriggerNames[j]);
00072     }
00073   }
00074   
00075   //----set the denominator paths
00076   for (size_t it=0;it<hltTrgJet.size();it++) {
00077     if (it==0 && foundMuTrg) hltTrgJetLow.push_back(trgMuNm);//--lowest threshold uses muon path
00078     if (it==0 && !foundMuTrg) hltTrgJetLow.push_back(hltTrgJet[it]);//---if no muon then itself
00079     if (it!=0) hltTrgJetLow.push_back(hltTrgJet[it-1]);
00080     //std::cout<<hltTrgJet[it].c_str()<<" "<<hltTrgJetLow[it].c_str()<<std::endl;
00081   }
00082   int itm(0), itpm(0), itmh(0), itpmh(0);
00083   for (size_t it=0;it<hltTrgMet.size();it++) {
00084     if (TString(hltTrgMet[it]).Contains("PF")) {
00085       if (TString(hltTrgMet[it]).Contains("MHT")) {
00086         if( 0 == itpmh ) {
00087           if( foundMuTrg ) hltTrgMetLow.push_back(trgMuNm);
00088           else hltTrgMetLow.push_back(hltTrgMet[it]);
00089         }
00090         else hltTrgMetLow.push_back(hltTrgMet[it-1]);
00091         itpmh++;
00092       }
00093       if (TString(hltTrgMet[it]).Contains("MET")) {
00094         if( 0 == itpm ) {
00095           if( foundMuTrg ) hltTrgMetLow.push_back(trgMuNm);
00096           else hltTrgMetLow.push_back(hltTrgMet[it]);
00097         }
00098         else hltTrgMetLow.push_back(hltTrgMet[it-1]);
00099         itpm++;
00100       }
00101     }
00102     else {
00103       if (TString(hltTrgMet[it]).Contains("MHT")) {
00104         if( 0 == itmh ) {
00105           if( foundMuTrg ) hltTrgMetLow.push_back(trgMuNm);
00106           else hltTrgMetLow.push_back(hltTrgMet[it]);
00107         }
00108         else hltTrgMetLow.push_back(hltTrgMet[it-1]);
00109         itmh++;
00110       }
00111       if (TString(hltTrgMet[it]).Contains("MET")) {
00112         if( 0 == itm ) {
00113           if( foundMuTrg ) hltTrgMetLow.push_back(trgMuNm);
00114           else hltTrgMetLow.push_back(hltTrgMet[it]);
00115         }
00116         else hltTrgMetLow.push_back(hltTrgMet[it-1]);
00117         itm++;
00118       }
00119     }
00120     //std::cout<<hltTrgMet[it].c_str()<<" "<<hltTrgMetLow[it].c_str()<<std::endl;
00121   }
00122 
00123   //----define dqm folders and elements
00124   for (size_t it=0;it<hltTrgJet.size();it++) {
00125     //std::cout<<hltTrgJet[it].c_str()<<" "<<hltTrgJetLow[it].c_str()<<std::endl;
00126     store->setCurrentFolder(triggerTag_+hltTrgJet[it].c_str());
00127     //_meRecoJetPt= store->book1D("_meRecoJetPt","Single Reconstructed Jet Pt",100,0,500);
00128     _meRecoJetPt.push_back(store->book1D("_meRecoJetPt","Single Reconstructed Jet Pt",100,0,500));
00129     _meRecoJetPtTrgMC.push_back(store->book1D("_meRecoJetPtTrgMC","Single Reconstructed Jet Pt -- HLT Triggered",100,0,500));
00130     _meRecoJetPtTrg.push_back(store->book1D("_meRecoJetPtTrg","Single Reconstructed Jet Pt -- HLT Triggered",100,0,500));
00131     _meRecoJetPtTrgLow.push_back(store->book1D("_meRecoJetPtTrgLow","Single Reconstructed Jet Pt -- HLT Triggered Low",100,0,500));
00132     
00133     _meRecoJetEta.push_back(store->book1D("_meRecoJetEta","Single Reconstructed Jet Eta",100,-10,10));
00134     _meRecoJetEtaTrgMC.push_back(store->book1D("_meRecoJetEtaTrgMC","Single Reconstructed Jet Eta -- HLT Triggered",100,-10,10));
00135     _meRecoJetEtaTrg.push_back(store->book1D("_meRecoJetEtaTrg","Single Reconstructed Jet Eta -- HLT Triggered",100,-10,10));
00136     _meRecoJetEtaTrgLow.push_back(store->book1D("_meRecoJetEtaTrgLow","Single Reconstructed Jet Eta -- HLT Triggered Low",100,-10,10));
00137     
00138     _meRecoJetPhi.push_back(store->book1D("_meRecoJetPhi","Single Reconstructed Jet Phi",100,-4.,4.));
00139     _meRecoJetPhiTrgMC.push_back(store->book1D("_meRecoJetPhiTrgMC","Single Reconstructed Jet Phi -- HLT Triggered",100,-4.,4.));
00140     _meRecoJetPhiTrg.push_back(store->book1D("_meRecoJetPhiTrg","Single Reconstructed Jet Phi -- HLT Triggered",100,-4.,4.));
00141     _meRecoJetPhiTrgLow.push_back(store->book1D("_meRecoJetPhiTrgLow","Single Reconstructed Jet Phi -- HLT Triggered Low",100,-4.,4.));
00142     
00143     _meGenJetPt.push_back(store->book1D("_meGenJetPt","Single Generated Jet Pt",100,0,500));
00144     _meGenJetPtTrgMC.push_back(store->book1D("_meGenJetPtTrgMC","Single Generated Jet Pt -- HLT Triggered",100,0,500));
00145     _meGenJetPtTrg.push_back(store->book1D("_meGenJetPtTrg","Single Generated Jet Pt -- HLT Triggered",100,0,500));
00146     _meGenJetPtTrgLow.push_back(store->book1D("_meGenJetPtTrgLow","Single Generated Jet Pt -- HLT Triggered Low",100,0,500));
00147     
00148     _meGenJetEta.push_back(store->book1D("_meGenJetEta","Single Generated Jet Eta",100,-10,10));
00149     _meGenJetEtaTrgMC.push_back(store->book1D("_meGenJetEtaTrgMC","Single Generated Jet Eta -- HLT Triggered",100,-10,10));
00150     _meGenJetEtaTrg.push_back(store->book1D("_meGenJetEtaTrg","Single Generated Jet Eta -- HLT Triggered",100,-10,10));
00151     _meGenJetEtaTrgLow.push_back(store->book1D("_meGenJetEtaTrgLow","Single Generated Jet Eta -- HLT Triggered Low",100,-10,10));
00152     
00153     _meGenJetPhi.push_back(store->book1D("_meGenJetPhi","Single Generated Jet Phi",100,-4.,4.));
00154     _meGenJetPhiTrgMC.push_back(store->book1D("_meGenJetPhiTrgMC","Single Generated Jet Phi -- HLT Triggered",100,-4.,4.));
00155     _meGenJetPhiTrg.push_back(store->book1D("_meGenJetPhiTrg","Single Generated Jet Phi -- HLT Triggered",100,-4.,4.));
00156     _meGenJetPhiTrgLow.push_back(store->book1D("_meGenJetPhiTrgLow","Single Generated Jet Phi -- HLT Triggered Low",100,-4.,4.));
00157     
00158   }
00159   for (size_t it=0;it<hltTrgMet.size();it++) {
00160     //std::cout<<hltTrgMet[it].c_str()<<" "<<hltTrgMetLow[it].c_str()<<std::endl;
00161     store->setCurrentFolder(triggerTag_+hltTrgMet[it].c_str());
00162     _meRecoMET.push_back(store->book1D("_meRecoMET","Reconstructed Missing ET",100,0,500));
00163     _meRecoMETTrgMC.push_back(store->book1D("_meRecoMETTrgMC","Reconstructed Missing ET -- HLT Triggered",100,0,500));
00164     _meRecoMETTrg.push_back(store->book1D("_meRecoMETTrg","Reconstructed Missing ET -- HLT Triggered",100,0,500));
00165     _meRecoMETTrgLow.push_back(store->book1D("_meRecoMETTrgLow","Reconstructed Missing ET -- HLT Triggered Low",100,0,500));
00166     
00167     _meGenMET.push_back(store->book1D("_meGenMET","Generated Missing ET",100,0,500));
00168     _meGenMETTrgMC.push_back(store->book1D("_meGenMETTrgMC","Generated Missing ET -- HLT Triggered",100,0,500));
00169     _meGenMETTrg.push_back(store->book1D("_meGenMETTrg","Generated Missing ET -- HLT Triggered",100,0,500));
00170     _meGenMETTrgLow.push_back(store->book1D("_meGenMETTrgLow","Generated Missing ET -- HLT Triggered Low",100,0,500));
00171   }
00172 }
00173 
00174 void
00175 HLTJetMETValidation::endJob()
00176 {
00177 
00178   //Write DQM thing..
00179   if(outFile_.size()>0)
00180     if (&*edm::Service<DQMStore>() && writeFile_) {
00181       edm::Service<DQMStore>()->save (outFile_);
00182     }
00183   
00184 }
00185 
00186 void
00187 HLTJetMETValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00188 {
00189   using namespace std;
00190   using namespace edm;
00191   using namespace reco;
00192   using namespace l1extra;
00193   using namespace trigger;
00194   
00195   evtCnt++;
00196   //get The triggerEvent
00197 
00198   Handle<TriggerEventWithRefs> trigEv;
00199   iEvent.getByLabel(triggerEventObject_,trigEv);
00200 
00201 // get TriggerResults object
00202 
00203   bool gotHLT=true;
00204   //bool myTrig=false;
00205   //bool myTrigLow=false;
00206   std::vector<bool> myTrigJ;
00207   for (size_t it=0;it<hltTrgJet.size();it++) myTrigJ.push_back(false);
00208   std::vector<bool> myTrigJLow;
00209   for (size_t it=0;it<hltTrgJetLow.size();it++) myTrigJLow.push_back(false);
00210   std::vector<bool> myTrigM;
00211   for (size_t it=0;it<hltTrgMet.size();it++) myTrigM.push_back(false);
00212   std::vector<bool> myTrigMLow;
00213   for (size_t it=0;it<hltTrgMetLow.size();it++) myTrigMLow.push_back(false);
00214 
00215 
00216   Handle<TriggerResults> hltresults,hltresultsDummy;
00217   iEvent.getByLabel(HLTriggerResults,hltresults);
00218   if (! hltresults.isValid() ) { 
00219     //std::cout << "  -- No HLTRESULTS"; 
00220     //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "  -- No HLTRESULTS";    
00221     gotHLT=false;
00222   }
00223 
00224   if (gotHLT) {
00225     const edm::TriggerNames & triggerNames = iEvent.triggerNames(*hltresults);
00226     getHLTResults(*hltresults, triggerNames);
00227     //    trig_iter=hltTriggerMap.find(MyTrigger);
00228     //trig_iter=hltTriggerMap.find(_HLTPath.label());
00229 
00230     //---pick-up the jet trigger decisions
00231     for (size_t it=0;it<hltTrgJet.size();it++) {
00232       trig_iter=hltTriggerMap.find(hltTrgJet[it]);
00233       if (trig_iter==hltTriggerMap.end()){
00234         //std::cout << "Could not find trigger path with name: " << _probefilter.label() << std::endl;
00235         //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "Could not find trigger path with name: " << _probefilter.label(); 
00236       }else{
00237         myTrigJ[it]=trig_iter->second;
00238       }
00239       //std::cout<<hltTrgJet[it].c_str()<<" "<<myTrigJ[it]<<std::endl;
00240     }
00241     for (size_t it=0;it<hltTrgJetLow.size();it++) {
00242       trig_iter=hltTriggerMap.find(hltTrgJetLow[it]);
00243       if (trig_iter==hltTriggerMap.end()){
00244         //std::cout << "Could not find trigger path with name: " << _probefilter.label() << std::endl;
00245         //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "Could not find trigger path with name: " << _probefilter.label(); 
00246       }else{
00247         myTrigJLow[it]=trig_iter->second;
00248       }
00249       //std::cout<<hltTrgJetLow[it].c_str()<<" "<<myTrigJLow[it]<<std::endl;
00250     }
00251     //---pick-up the met trigger decisions
00252     for (size_t it=0;it<hltTrgMet.size();it++) {
00253       trig_iter=hltTriggerMap.find(hltTrgMet[it]);
00254       if (trig_iter==hltTriggerMap.end()){
00255         //std::cout << "Could not find trigger path with name: " << _probefilter.label() << std::endl;
00256         //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "Could not find trigger path with name: " << _probefilter.label(); 
00257       }else{
00258         myTrigM[it]=trig_iter->second;
00259       }
00260       //std::cout<<hltTrgMet[it].c_str()<<" "<<myTrigM[it]<<std::endl;
00261     }
00262     for (size_t it=0;it<hltTrgMetLow.size();it++) {
00263       trig_iter=hltTriggerMap.find(hltTrgMetLow[it]);
00264       if (trig_iter==hltTriggerMap.end()){
00265         //std::cout << "Could not find trigger path with name: " << _probefilter.label() << std::endl;
00266         //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "Could not find trigger path with name: " << _probefilter.label(); 
00267       }else{
00268         myTrigMLow[it]=trig_iter->second;
00269       }
00270       //std::cout<<hltTrgMetLow[it].c_str()<<" "<<myTrigMLow[it]<<std::endl;
00271     }
00272   }
00273 
00274   Handle<PFJetCollection> caloJets,caloJetsDummy;
00275   iEvent.getByLabel( CaloJetAlgorithm, caloJets );
00276   double calJetPt=-1.;
00277   double calJetEta=-999.;
00278   double calJetPhi=-999.;
00279   //double calHT=0;
00280   if (caloJets.isValid()) { 
00281     //Loop over the CaloJets and fill some histograms
00282     int jetInd = 0;
00283     for( PFJetCollection::const_iterator cal = caloJets->begin(); cal != caloJets->end(); ++ cal ) {
00284       //std::cout << "CALO JET #" << jetInd << std::endl << cal->print() << std::endl;
00285       if (jetInd == 0){
00286         calJetPt=cal->pt();
00287         calJetEta=cal->eta();
00288         calJetPhi=cal->phi();
00289         for (size_t it=0;it<hltTrgJet.size();it++) {
00290           _meRecoJetPt[it]->Fill( calJetPt );
00291           _meRecoJetEta[it]->Fill( calJetEta );
00292           _meRecoJetPhi[it]->Fill( calJetPhi );
00293           if (myTrigJ[it]) _meRecoJetPtTrgMC[it]->Fill( calJetPt );
00294           if (myTrigJ[it]) _meRecoJetEtaTrgMC[it]->Fill( calJetEta );
00295           if (myTrigJ[it]) _meRecoJetPhiTrgMC[it]->Fill( calJetPhi );
00296           if (myTrigJ[it] && myTrigJLow[it]) _meRecoJetPtTrg[it]->Fill( calJetPt );
00297           if (myTrigJ[it] && myTrigJLow[it]) _meRecoJetEtaTrg[it]->Fill( calJetEta );
00298           if (myTrigJ[it] && myTrigJLow[it]) _meRecoJetPhiTrg[it]->Fill( calJetPhi );
00299           if (myTrigJLow[it]) _meRecoJetPtTrgLow[it]->Fill( calJetPt );
00300           if (myTrigJLow[it]) _meRecoJetEtaTrgLow[it]->Fill( calJetEta );
00301           if (myTrigJLow[it]) _meRecoJetPhiTrgLow[it]->Fill( calJetPhi );
00302         }
00303         jetInd++;
00304       }
00305       /*
00306       if (cal->pt()>30) {
00307         calHT+=cal->pt();
00308       }
00309       */
00310     }
00311     /*
00312     _meRecoHT->Fill( calHT );
00313     if (myTrig) _meRecoHTTrg->Fill( calHT );
00314     if (myTrigLow) _meRecoHTTrgLow->Fill( calHT );
00315     */
00316   }else{
00317     //std::cout << "  -- No CaloJets" << std::endl;
00318     //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "  -- No CaloJets"; 
00319   }
00320 
00321   Handle<GenJetCollection> genJets,genJetsDummy;
00322   iEvent.getByLabel( GenJetAlgorithm, genJets );
00323   double genJetPt=-1.;
00324   double genJetEta=-999.;
00325   double genJetPhi=-999.;
00326   //double genHT=0;
00327   if (genJets.isValid()) { 
00328     //Loop over the GenJets and fill some histograms
00329     int jetInd = 0;
00330     for( GenJetCollection::const_iterator gen = genJets->begin(); gen != genJets->end(); ++ gen ) {
00331       // std::cout << "CALO JET #" << jetInd << std::endl << cal->print() << std::endl;
00332       if (jetInd == 0){
00333         genJetPt=gen->pt();
00334         genJetEta=gen->eta();
00335         genJetPhi=gen->phi();
00336         for (size_t it=0;it<hltTrgJet.size();it++) {
00337           _meGenJetPt[it]->Fill( genJetPt );
00338           _meGenJetEta[it]->Fill( genJetEta );
00339           _meGenJetPhi[it]->Fill( genJetPhi );
00340           if (myTrigJ[it]) _meGenJetPtTrgMC[it]->Fill( genJetPt );
00341           if (myTrigJ[it]) _meGenJetEtaTrgMC[it]->Fill( genJetEta );
00342           if (myTrigJ[it]) _meGenJetPhiTrgMC[it]->Fill( genJetPhi );
00343           if (myTrigJ[it] && myTrigJLow[it]) _meGenJetPtTrg[it]->Fill( genJetPt );
00344           if (myTrigJ[it] && myTrigJLow[it]) _meGenJetEtaTrg[it]->Fill( genJetEta );
00345           if (myTrigJ[it] && myTrigJLow[it]) _meGenJetPhiTrg[it]->Fill( genJetPhi );
00346           if (myTrigJLow[it]) _meGenJetPtTrgLow[it]->Fill( genJetPt );
00347           if (myTrigJLow[it]) _meGenJetEtaTrgLow[it]->Fill( genJetEta );
00348           if (myTrigJLow[it]) _meGenJetPhiTrgLow[it]->Fill( genJetPhi );
00349         }
00350         jetInd++;
00351       }
00352       /*
00353       if (gen->pt()>30) {
00354         genHT+=gen->pt();
00355       }
00356       */
00357     }
00358     /*
00359     _meGenHT->Fill( genHT );
00360     if (myTrig) _meGenHTTrg->Fill( genHT );
00361     if (myTrigLow) _meGenHTTrgLow->Fill( genHT );
00362     */
00363   }else{
00364     //std::cout << "  -- No GenJets" << std::endl;
00365     //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "  -- No GenJets"; 
00366   }
00367   
00368 
00369   edm::Handle<CaloMETCollection> recmet, recmetDummy;
00370   iEvent.getByLabel(CaloMETColl,recmet);
00371 
00372   double calMet=-1;
00373   if (recmet.isValid()) { 
00374     typedef CaloMETCollection::const_iterator cmiter;
00375     //std::cout << "Size of MET collection" <<  recmet.size() << std::endl;
00376     for ( cmiter i=recmet->begin(); i!=recmet->end(); i++) {
00377       calMet = i->pt();
00378       for (size_t it=0;it<hltTrgMet.size();it++) {
00379         _meRecoMET[it] -> Fill(calMet);
00380         if (myTrigM[it]) _meRecoMETTrgMC[it] -> Fill(calMet);
00381         if (myTrigM[it] && myTrigMLow[it]) _meRecoMETTrg[it] -> Fill(calMet);
00382         if (myTrigMLow[it]) _meRecoMETTrgLow[it] -> Fill(calMet);
00383       }
00384     }
00385   }else{
00386     //std::cout << "  -- No MET Collection with name: " << CaloMETColl << std::endl;
00387     //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "  -- No MET Collection with name: "<< CaloMETColl; 
00388   }
00389   
00390   edm::Handle<GenMETCollection> genmet, genmetDummy;
00391   iEvent.getByLabel(GenMETColl,genmet);
00392 
00393   double genMet=-1;
00394   if (genmet.isValid()) { 
00395     typedef GenMETCollection::const_iterator cmiter;
00396     //std::cout << "Size of GenMET collection" <<  recmet.size() << std::endl;
00397     for ( cmiter i=genmet->begin(); i!=genmet->end(); i++) {
00398       genMet = i->pt();
00399       for (size_t it=0;it<hltTrgMet.size();it++) {
00400         _meGenMET[it] -> Fill(genMet);
00401         if (myTrigM[it]) _meGenMETTrgMC[it] -> Fill(genMet);
00402         if (myTrigM[it] && myTrigMLow[it]) _meGenMETTrg[it] -> Fill(genMet);
00403         if (myTrigMLow[it]) _meGenMETTrgLow[it] -> Fill(genMet);
00404       }
00405     }
00406   }else{
00407     //std::cout << "  -- No GenMET Collection with name: " << GenMETColl << std::endl;
00408     //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "  -- No GenMET Collection with name: "<< GenMETColl; 
00409   }
00410   
00411 }
00412 
00413 void HLTJetMETValidation::getHLTResults(const edm::TriggerResults& hltresults,
00414                                         const edm::TriggerNames & triggerNames) {
00415 
00416   int ntrigs=hltresults.size();
00417   if (! HLTinit_){
00418     HLTinit_=true;
00419     
00420     //if (writeFile_) std::cout << "Number of HLT Paths: " << ntrigs << std::endl;
00421     for (int itrig = 0; itrig != ntrigs; ++itrig){
00422       std::string trigName = triggerNames.triggerName(itrig);
00423       // std::cout << "trigger " << itrig << ": " << trigName << std::endl; 
00424     }
00425   }
00426   
00427   for (int itrig = 0; itrig != ntrigs; ++itrig){
00428     std::string trigName = triggerNames.triggerName(itrig);
00429      bool accept=hltresults.accept(itrig);
00430 
00431      //if (accept) _triggerResults->Fill(float(itrig));
00432 
00433      // fill the trigger map
00434      typedef std::map<std::string,bool>::value_type valType;
00435      trig_iter=hltTriggerMap.find(trigName);
00436      if (trig_iter==hltTriggerMap.end())
00437        hltTriggerMap.insert(valType(trigName,accept));
00438      else
00439        trig_iter->second=accept;
00440   }
00441 }