CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HLTJetMETValidation Class Reference

#include <HLTJetMETValidation.h>

Inheritance diagram for HLTJetMETValidation:
edm::EDAnalyzer

Public Member Functions

 HLTJetMETValidation (const edm::ParameterSet &)
 
 ~HLTJetMETValidation ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
void getHLTResults (const edm::TriggerResults &, const edm::TriggerNames &triggerNames)
 

Private Attributes

std::vector< MonitorElement * > _meGenJetEta
 
std::vector< MonitorElement * > _meGenJetEtaTrg
 
std::vector< MonitorElement * > _meGenJetEtaTrgLow
 
std::vector< MonitorElement * > _meGenJetEtaTrgMC
 
std::vector< MonitorElement * > _meGenJetPhi
 
std::vector< MonitorElement * > _meGenJetPhiTrg
 
std::vector< MonitorElement * > _meGenJetPhiTrgLow
 
std::vector< MonitorElement * > _meGenJetPhiTrgMC
 
std::vector< MonitorElement * > _meGenJetPt
 
std::vector< MonitorElement * > _meGenJetPtTrg
 
std::vector< MonitorElement * > _meGenJetPtTrgLow
 
std::vector< MonitorElement * > _meGenJetPtTrgMC
 
std::vector< MonitorElement * > _meGenMET
 
std::vector< MonitorElement * > _meGenMETTrg
 
std::vector< MonitorElement * > _meGenMETTrgLow
 
std::vector< MonitorElement * > _meGenMETTrgMC
 
std::vector< MonitorElement * > _meRecoJetEta
 
std::vector< MonitorElement * > _meRecoJetEtaTrg
 
std::vector< MonitorElement * > _meRecoJetEtaTrgLow
 
std::vector< MonitorElement * > _meRecoJetEtaTrgMC
 
std::vector< MonitorElement * > _meRecoJetPhi
 
std::vector< MonitorElement * > _meRecoJetPhiTrg
 
std::vector< MonitorElement * > _meRecoJetPhiTrgLow
 
std::vector< MonitorElement * > _meRecoJetPhiTrgMC
 
std::vector< MonitorElement * > _meRecoJetPt
 
std::vector< MonitorElement * > _meRecoJetPtTrg
 
std::vector< MonitorElement * > _meRecoJetPtTrgLow
 
std::vector< MonitorElement * > _meRecoJetPtTrgMC
 
std::vector< MonitorElement * > _meRecoMET
 
std::vector< MonitorElement * > _meRecoMETTrg
 
std::vector< MonitorElement * > _meRecoMETTrgLow
 
std::vector< MonitorElement * > _meRecoMETTrgMC
 
MonitorElement_triggerResults
 
edm::InputTag CaloJetAlgorithm
 
edm::InputTag CaloMETColl
 
int evtCnt
 
edm::InputTag GenJetAlgorithm
 
edm::InputTag GenMETColl
 
HLTConfigProvider hltConfig_
 
bool HLTinit_
 
edm::InputTag HLTriggerResults
 
std::vector< std::string > hltTrgJet
 
std::vector< std::string > hltTrgJetLow
 
std::vector< std::string > hltTrgMet
 
std::vector< std::string > hltTrgMetLow
 
std::map< std::string, bool > hltTriggerMap
 
std::vector< bool > hlttrigs
 
std::string MyTrigger
 
std::string outFile_
 
std::string patternJetTrg_
 
std::string patternMetTrg_
 
std::string patternMuTrg_
 
DQMStorestore
 
std::map< std::string, bool >
::iterator 
trig_iter
 
edm::InputTag triggerEventObject_
 InputTag of TriggerEventWithRefs to analyze. More...
 
std::string triggerTag_
 
bool writeFile_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 62 of file HLTJetMETValidation.h.

Constructor & Destructor Documentation

HLTJetMETValidation::HLTJetMETValidation ( const edm::ParameterSet ps)
explicit

Definition at line 5 of file HLTJetMETValidation.cc.

References evtCnt, and store.

5  :
7  CaloJetAlgorithm( ps.getUntrackedParameter<edm::InputTag>( "CaloJetAlgorithm" ) ),
8  GenJetAlgorithm( ps.getUntrackedParameter<edm::InputTag>( "GenJetAlgorithm" ) ),
9  CaloMETColl( ps.getUntrackedParameter<edm::InputTag>( "CaloMETCollection" ) ),
10  GenMETColl( ps.getUntrackedParameter<edm::InputTag>( "GenMETCollection" ) ),
11  HLTriggerResults( ps.getParameter<edm::InputTag>( "HLTriggerResults" ) ),
12  triggerTag_(ps.getUntrackedParameter<std::string>("DQMFolder","SingleJet")),
13  patternJetTrg_(ps.getUntrackedParameter<std::string>("PatternJetTrg","")),
14  patternMetTrg_(ps.getUntrackedParameter<std::string>("PatternMetTrg","")),
15  patternMuTrg_(ps.getUntrackedParameter<std::string>("PatternMuTrg","")),
16  outFile_(ps.getUntrackedParameter<std::string>("OutputFileName","")),
17  HLTinit_(false),
18  //JL
19  writeFile_(ps.getUntrackedParameter<bool>("WriteFile",false))
20 {
21  evtCnt=0;
22 
24 
25 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag HLTriggerResults
edm::InputTag GenJetAlgorithm
edm::InputTag triggerEventObject_
InputTag of TriggerEventWithRefs to analyze.
edm::InputTag CaloJetAlgorithm
HLTJetMETValidation::~HLTJetMETValidation ( )

Definition at line 27 of file HLTJetMETValidation.cc.

28 {
29 }

Member Function Documentation

void HLTJetMETValidation::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 187 of file HLTJetMETValidation.cc.

References _meGenJetEta, _meGenJetEtaTrg, _meGenJetEtaTrgLow, _meGenJetEtaTrgMC, _meGenJetPhi, _meGenJetPhiTrg, _meGenJetPhiTrgLow, _meGenJetPhiTrgMC, _meGenJetPt, _meGenJetPtTrg, _meGenJetPtTrgLow, _meGenJetPtTrgMC, _meGenMET, _meGenMETTrg, _meGenMETTrgLow, _meGenMETTrgMC, _meRecoJetEta, _meRecoJetEtaTrg, _meRecoJetEtaTrgLow, _meRecoJetEtaTrgMC, _meRecoJetPhi, _meRecoJetPhiTrg, _meRecoJetPhiTrgLow, _meRecoJetPhiTrgMC, _meRecoJetPt, _meRecoJetPtTrg, _meRecoJetPtTrgLow, _meRecoJetPtTrgMC, _meRecoMET, _meRecoMETTrg, _meRecoMETTrgLow, _meRecoMETTrgMC, CaloJetAlgorithm, CaloMETColl, evtCnt, HcalObjRepresent::Fill(), relval_steps::gen(), GenJetAlgorithm, HepMCValidationHelper::genMet(), GenMETColl, edm::Event::getByLabel(), getHLTResults(), HLTriggerResults, hltTrgJet, hltTrgJetLow, hltTrgMet, hltTrgMetLow, hltTriggerMap, i, dt_dqm_sourceclient_common_cff::reco, trig_iter, triggerEventObject_, and edm::Event::triggerNames().

188 {
189  using namespace std;
190  using namespace edm;
191  using namespace reco;
192  using namespace l1extra;
193  using namespace trigger;
194 
195  evtCnt++;
196  //get The triggerEvent
197 
199  iEvent.getByLabel(triggerEventObject_,trigEv);
200 
201 // get TriggerResults object
202 
203  bool gotHLT=true;
204  //bool myTrig=false;
205  //bool myTrigLow=false;
206  std::vector<bool> myTrigJ;
207  for (size_t it=0;it<hltTrgJet.size();it++) myTrigJ.push_back(false);
208  std::vector<bool> myTrigJLow;
209  for (size_t it=0;it<hltTrgJetLow.size();it++) myTrigJLow.push_back(false);
210  std::vector<bool> myTrigM;
211  for (size_t it=0;it<hltTrgMet.size();it++) myTrigM.push_back(false);
212  std::vector<bool> myTrigMLow;
213  for (size_t it=0;it<hltTrgMetLow.size();it++) myTrigMLow.push_back(false);
214 
215 
216  Handle<TriggerResults> hltresults,hltresultsDummy;
217  iEvent.getByLabel(HLTriggerResults,hltresults);
218  if (! hltresults.isValid() ) {
219  //std::cout << " -- No HLTRESULTS";
220  //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << " -- No HLTRESULTS";
221  gotHLT=false;
222  }
223 
224  if (gotHLT) {
225  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*hltresults);
226  getHLTResults(*hltresults, triggerNames);
227  // trig_iter=hltTriggerMap.find(MyTrigger);
228  //trig_iter=hltTriggerMap.find(_HLTPath.label());
229 
230  //---pick-up the jet trigger decisions
231  for (size_t it=0;it<hltTrgJet.size();it++) {
233  if (trig_iter==hltTriggerMap.end()){
234  //std::cout << "Could not find trigger path with name: " << _probefilter.label() << std::endl;
235  //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "Could not find trigger path with name: " << _probefilter.label();
236  }else{
237  myTrigJ[it]=trig_iter->second;
238  }
239  //std::cout<<hltTrgJet[it].c_str()<<" "<<myTrigJ[it]<<std::endl;
240  }
241  for (size_t it=0;it<hltTrgJetLow.size();it++) {
243  if (trig_iter==hltTriggerMap.end()){
244  //std::cout << "Could not find trigger path with name: " << _probefilter.label() << std::endl;
245  //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "Could not find trigger path with name: " << _probefilter.label();
246  }else{
247  myTrigJLow[it]=trig_iter->second;
248  }
249  //std::cout<<hltTrgJetLow[it].c_str()<<" "<<myTrigJLow[it]<<std::endl;
250  }
251  //---pick-up the met trigger decisions
252  for (size_t it=0;it<hltTrgMet.size();it++) {
254  if (trig_iter==hltTriggerMap.end()){
255  //std::cout << "Could not find trigger path with name: " << _probefilter.label() << std::endl;
256  //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "Could not find trigger path with name: " << _probefilter.label();
257  }else{
258  myTrigM[it]=trig_iter->second;
259  }
260  //std::cout<<hltTrgMet[it].c_str()<<" "<<myTrigM[it]<<std::endl;
261  }
262  for (size_t it=0;it<hltTrgMetLow.size();it++) {
264  if (trig_iter==hltTriggerMap.end()){
265  //std::cout << "Could not find trigger path with name: " << _probefilter.label() << std::endl;
266  //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << "Could not find trigger path with name: " << _probefilter.label();
267  }else{
268  myTrigMLow[it]=trig_iter->second;
269  }
270  //std::cout<<hltTrgMetLow[it].c_str()<<" "<<myTrigMLow[it]<<std::endl;
271  }
272  }
273 
274  Handle<PFJetCollection> caloJets,caloJetsDummy;
275  iEvent.getByLabel( CaloJetAlgorithm, caloJets );
276  double calJetPt=-1.;
277  double calJetEta=-999.;
278  double calJetPhi=-999.;
279  //double calHT=0;
280  if (caloJets.isValid()) {
281  //Loop over the CaloJets and fill some histograms
282  int jetInd = 0;
283  for( PFJetCollection::const_iterator cal = caloJets->begin(); cal != caloJets->end(); ++ cal ) {
284  //std::cout << "CALO JET #" << jetInd << std::endl << cal->print() << std::endl;
285  if (jetInd == 0){
286  calJetPt=cal->pt();
287  calJetEta=cal->eta();
288  calJetPhi=cal->phi();
289  for (size_t it=0;it<hltTrgJet.size();it++) {
290  _meRecoJetPt[it]->Fill( calJetPt );
291  _meRecoJetEta[it]->Fill( calJetEta );
292  _meRecoJetPhi[it]->Fill( calJetPhi );
293  if (myTrigJ[it]) _meRecoJetPtTrgMC[it]->Fill( calJetPt );
294  if (myTrigJ[it]) _meRecoJetEtaTrgMC[it]->Fill( calJetEta );
295  if (myTrigJ[it]) _meRecoJetPhiTrgMC[it]->Fill( calJetPhi );
296  if (myTrigJ[it] && myTrigJLow[it]) _meRecoJetPtTrg[it]->Fill( calJetPt );
297  if (myTrigJ[it] && myTrigJLow[it]) _meRecoJetEtaTrg[it]->Fill( calJetEta );
298  if (myTrigJ[it] && myTrigJLow[it]) _meRecoJetPhiTrg[it]->Fill( calJetPhi );
299  if (myTrigJLow[it]) _meRecoJetPtTrgLow[it]->Fill( calJetPt );
300  if (myTrigJLow[it]) _meRecoJetEtaTrgLow[it]->Fill( calJetEta );
301  if (myTrigJLow[it]) _meRecoJetPhiTrgLow[it]->Fill( calJetPhi );
302  }
303  jetInd++;
304  }
305  /*
306  if (cal->pt()>30) {
307  calHT+=cal->pt();
308  }
309  */
310  }
311  /*
312  _meRecoHT->Fill( calHT );
313  if (myTrig) _meRecoHTTrg->Fill( calHT );
314  if (myTrigLow) _meRecoHTTrgLow->Fill( calHT );
315  */
316  }else{
317  //std::cout << " -- No CaloJets" << std::endl;
318  //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << " -- No CaloJets";
319  }
320 
321  Handle<GenJetCollection> genJets,genJetsDummy;
322  iEvent.getByLabel( GenJetAlgorithm, genJets );
323  double genJetPt=-1.;
324  double genJetEta=-999.;
325  double genJetPhi=-999.;
326  //double genHT=0;
327  if (genJets.isValid()) {
328  //Loop over the GenJets and fill some histograms
329  int jetInd = 0;
330  for( GenJetCollection::const_iterator gen = genJets->begin(); gen != genJets->end(); ++ gen ) {
331  // std::cout << "CALO JET #" << jetInd << std::endl << cal->print() << std::endl;
332  if (jetInd == 0){
333  genJetPt=gen->pt();
334  genJetEta=gen->eta();
335  genJetPhi=gen->phi();
336  for (size_t it=0;it<hltTrgJet.size();it++) {
337  _meGenJetPt[it]->Fill( genJetPt );
338  _meGenJetEta[it]->Fill( genJetEta );
339  _meGenJetPhi[it]->Fill( genJetPhi );
340  if (myTrigJ[it]) _meGenJetPtTrgMC[it]->Fill( genJetPt );
341  if (myTrigJ[it]) _meGenJetEtaTrgMC[it]->Fill( genJetEta );
342  if (myTrigJ[it]) _meGenJetPhiTrgMC[it]->Fill( genJetPhi );
343  if (myTrigJ[it] && myTrigJLow[it]) _meGenJetPtTrg[it]->Fill( genJetPt );
344  if (myTrigJ[it] && myTrigJLow[it]) _meGenJetEtaTrg[it]->Fill( genJetEta );
345  if (myTrigJ[it] && myTrigJLow[it]) _meGenJetPhiTrg[it]->Fill( genJetPhi );
346  if (myTrigJLow[it]) _meGenJetPtTrgLow[it]->Fill( genJetPt );
347  if (myTrigJLow[it]) _meGenJetEtaTrgLow[it]->Fill( genJetEta );
348  if (myTrigJLow[it]) _meGenJetPhiTrgLow[it]->Fill( genJetPhi );
349  }
350  jetInd++;
351  }
352  /*
353  if (gen->pt()>30) {
354  genHT+=gen->pt();
355  }
356  */
357  }
358  /*
359  _meGenHT->Fill( genHT );
360  if (myTrig) _meGenHTTrg->Fill( genHT );
361  if (myTrigLow) _meGenHTTrgLow->Fill( genHT );
362  */
363  }else{
364  //std::cout << " -- No GenJets" << std::endl;
365  //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << " -- No GenJets";
366  }
367 
368 
369  edm::Handle<CaloMETCollection> recmet, recmetDummy;
370  iEvent.getByLabel(CaloMETColl,recmet);
371 
372  double calMet=-1;
373  if (recmet.isValid()) {
374  typedef CaloMETCollection::const_iterator cmiter;
375  //std::cout << "Size of MET collection" << recmet.size() << std::endl;
376  for ( cmiter i=recmet->begin(); i!=recmet->end(); i++) {
377  calMet = i->pt();
378  for (size_t it=0;it<hltTrgMet.size();it++) {
379  _meRecoMET[it] -> Fill(calMet);
380  if (myTrigM[it]) _meRecoMETTrgMC[it] -> Fill(calMet);
381  if (myTrigM[it] && myTrigMLow[it]) _meRecoMETTrg[it] -> Fill(calMet);
382  if (myTrigMLow[it]) _meRecoMETTrgLow[it] -> Fill(calMet);
383  }
384  }
385  }else{
386  //std::cout << " -- No MET Collection with name: " << CaloMETColl << std::endl;
387  //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << " -- No MET Collection with name: "<< CaloMETColl;
388  }
389 
390  edm::Handle<GenMETCollection> genmet, genmetDummy;
391  iEvent.getByLabel(GenMETColl,genmet);
392 
393  double genMet=-1;
394  if (genmet.isValid()) {
395  typedef GenMETCollection::const_iterator cmiter;
396  //std::cout << "Size of GenMET collection" << recmet.size() << std::endl;
397  for ( cmiter i=genmet->begin(); i!=genmet->end(); i++) {
398  genMet = i->pt();
399  for (size_t it=0;it<hltTrgMet.size();it++) {
400  _meGenMET[it] -> Fill(genMet);
401  if (myTrigM[it]) _meGenMETTrgMC[it] -> Fill(genMet);
402  if (myTrigM[it] && myTrigMLow[it]) _meGenMETTrg[it] -> Fill(genMet);
403  if (myTrigMLow[it]) _meGenMETTrgLow[it] -> Fill(genMet);
404  }
405  }
406  }else{
407  //std::cout << " -- No GenMET Collection with name: " << GenMETColl << std::endl;
408  //if (evtCnt==1) edm::LogWarning("HLTJetMETValidation") << " -- No GenMET Collection with name: "<< GenMETColl;
409  }
410 
411 }
std::vector< MonitorElement * > _meRecoMET
std::vector< std::string > hltTrgMet
std::vector< MonitorElement * > _meGenJetEtaTrgMC
std::vector< MonitorElement * > _meGenJetPt
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:199
std::vector< MonitorElement * > _meGenJetPhiTrg
std::vector< std::string > hltTrgJet
std::map< std::string, bool > hltTriggerMap
std::vector< MonitorElement * > _meRecoJetPtTrgMC
std::vector< MonitorElement * > _meGenMET
std::vector< MonitorElement * > _meGenJetPtTrgMC
std::vector< MonitorElement * > _meGenMETTrgMC
std::vector< std::string > hltTrgMetLow
std::vector< MonitorElement * > _meGenJetPhiTrgMC
std::vector< MonitorElement * > _meGenMETTrgLow
std::vector< MonitorElement * > _meRecoJetPhiTrgLow
edm::InputTag HLTriggerResults
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
edm::InputTag GenJetAlgorithm
std::vector< MonitorElement * > _meRecoJetPt
std::vector< MonitorElement * > _meGenJetEtaTrg
std::vector< MonitorElement * > _meRecoJetEtaTrgMC
std::vector< MonitorElement * > _meRecoMETTrg
std::vector< MonitorElement * > _meGenJetPtTrg
std::vector< MonitorElement * > _meGenMETTrg
std::vector< MonitorElement * > _meRecoJetPhiTrgMC
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::vector< MonitorElement * > _meGenJetEtaTrgLow
void getHLTResults(const edm::TriggerResults &, const edm::TriggerNames &triggerNames)
std::vector< MonitorElement * > _meRecoJetPtTrg
std::vector< MonitorElement * > _meGenJetEta
std::vector< MonitorElement * > _meRecoJetPhiTrg
edm::InputTag triggerEventObject_
InputTag of TriggerEventWithRefs to analyze.
std::vector< MonitorElement * > _meRecoMETTrgMC
std::vector< MonitorElement * > _meGenJetPhi
std::vector< MonitorElement * > _meGenJetPtTrgLow
TLorentzVector genMet(const HepMC::GenEvent *all, double etamin=-9999., double etamax=9999.)
std::vector< MonitorElement * > _meRecoJetPtTrgLow
std::vector< MonitorElement * > _meRecoMETTrgLow
std::vector< std::string > hltTrgJetLow
std::vector< MonitorElement * > _meRecoJetEta
std::vector< MonitorElement * > _meGenJetPhiTrgLow
std::vector< MonitorElement * > _meRecoJetPhi
std::map< std::string, bool >::iterator trig_iter
std::vector< MonitorElement * > _meRecoJetEtaTrgLow
std::vector< MonitorElement * > _meRecoJetEtaTrg
edm::InputTag CaloJetAlgorithm
void HLTJetMETValidation::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 37 of file HLTJetMETValidation.cc.

References _meGenJetEta, _meGenJetEtaTrg, _meGenJetEtaTrgLow, _meGenJetEtaTrgMC, _meGenJetPhi, _meGenJetPhiTrg, _meGenJetPhiTrgLow, _meGenJetPhiTrgMC, _meGenJetPt, _meGenJetPtTrg, _meGenJetPtTrgLow, _meGenJetPtTrgMC, _meGenMET, _meGenMETTrg, _meGenMETTrgLow, _meGenMETTrgMC, _meRecoJetEta, _meRecoJetEtaTrg, _meRecoJetEtaTrgLow, _meRecoJetEtaTrgMC, _meRecoJetPhi, _meRecoJetPhiTrg, _meRecoJetPhiTrgLow, _meRecoJetPhiTrgMC, _meRecoJetPt, _meRecoJetPtTrg, _meRecoJetPtTrgLow, _meRecoJetPtTrgMC, _meRecoMET, _meRecoMETTrg, _meRecoMETTrgLow, _meRecoMETTrgMC, DQMStore::book1D(), hltConfig_, hltTrgJet, hltTrgJetLow, hltTrgMet, hltTrgMetLow, HLTConfigProvider::init(), j, patternJetTrg_, patternMetTrg_, patternMuTrg_, DQMStore::setCurrentFolder(), store, HLTConfigProvider::triggerNames(), and triggerTag_.

37  {
38 
39 
40  bool foundMuTrg = false;
41  std::string trgMuNm;
42  bool changedConfig;
43  //--define search patterns
44  /*
45  TPRegexp patternJet("HLT_Jet([0-9]*)?(_v[0-9]*)?$");
46  TPRegexp patternMet("HLT_(PF*)?M([E,H]*)?T([0-9]*)?(_v[0-9]*)?$");
47  TPRegexp patternMu("HLT_Mu([0-9]*)?(_v[0-9]*)?$");
48  */
49  TPRegexp patternJet(patternJetTrg_);
50  TPRegexp patternMet(patternMetTrg_);
51  TPRegexp patternMu(patternMuTrg_);
52 
53  if (!hltConfig_.init(iRun, iSetup, "HLT", changedConfig)) {
54  edm::LogError("HLTJetMET") << "Initialization of HLTConfigProvider failed!!";
55  return;
56  }
57  std::vector<std::string> validTriggerNames = hltConfig_.triggerNames();
58  for (size_t j = 0; j < validTriggerNames.size(); j++) {
59  //---find the muon path
60  if (TString(validTriggerNames[j]).Contains(patternMu)) {
61  //std::cout <<validTriggerNames[j].c_str()<<std::endl;
62  if (!foundMuTrg) trgMuNm = validTriggerNames[j].c_str();
63  foundMuTrg = true;
64  }
65  //---find the jet paths
66  if (TString(validTriggerNames[j]).Contains(patternJet)) {
67  hltTrgJet.push_back(validTriggerNames[j]);
68  }
69  //---find the met paths
70  if (TString(validTriggerNames[j]).Contains(patternMet)) {
71  hltTrgMet.push_back(validTriggerNames[j]);
72  }
73  }
74 
75  //----set the denominator paths
76  for (size_t it=0;it<hltTrgJet.size();it++) {
77  if (it==0 && foundMuTrg) hltTrgJetLow.push_back(trgMuNm);//--lowest threshold uses muon path
78  if (it==0 && !foundMuTrg) hltTrgJetLow.push_back(hltTrgJet[it]);//---if no muon then itself
79  if (it!=0) hltTrgJetLow.push_back(hltTrgJet[it-1]);
80  //std::cout<<hltTrgJet[it].c_str()<<" "<<hltTrgJetLow[it].c_str()<<std::endl;
81  }
82  int itm(0), itpm(0), itmh(0), itpmh(0);
83  for (size_t it=0;it<hltTrgMet.size();it++) {
84  if (TString(hltTrgMet[it]).Contains("PF")) {
85  if (TString(hltTrgMet[it]).Contains("MHT")) {
86  if( 0 == itpmh ) {
87  if( foundMuTrg ) hltTrgMetLow.push_back(trgMuNm);
88  else hltTrgMetLow.push_back(hltTrgMet[it]);
89  }
90  else hltTrgMetLow.push_back(hltTrgMet[it-1]);
91  itpmh++;
92  }
93  if (TString(hltTrgMet[it]).Contains("MET")) {
94  if( 0 == itpm ) {
95  if( foundMuTrg ) hltTrgMetLow.push_back(trgMuNm);
96  else hltTrgMetLow.push_back(hltTrgMet[it]);
97  }
98  else hltTrgMetLow.push_back(hltTrgMet[it-1]);
99  itpm++;
100  }
101  }
102  else {
103  if (TString(hltTrgMet[it]).Contains("MHT")) {
104  if( 0 == itmh ) {
105  if( foundMuTrg ) hltTrgMetLow.push_back(trgMuNm);
106  else hltTrgMetLow.push_back(hltTrgMet[it]);
107  }
108  else hltTrgMetLow.push_back(hltTrgMet[it-1]);
109  itmh++;
110  }
111  if (TString(hltTrgMet[it]).Contains("MET")) {
112  if( 0 == itm ) {
113  if( foundMuTrg ) hltTrgMetLow.push_back(trgMuNm);
114  else hltTrgMetLow.push_back(hltTrgMet[it]);
115  }
116  else hltTrgMetLow.push_back(hltTrgMet[it-1]);
117  itm++;
118  }
119  }
120  //std::cout<<hltTrgMet[it].c_str()<<" "<<hltTrgMetLow[it].c_str()<<std::endl;
121  }
122 
123  //----define dqm folders and elements
124  for (size_t it=0;it<hltTrgJet.size();it++) {
125  //std::cout<<hltTrgJet[it].c_str()<<" "<<hltTrgJetLow[it].c_str()<<std::endl;
127  //_meRecoJetPt= store->book1D("_meRecoJetPt","Single Reconstructed Jet Pt",100,0,500);
128  _meRecoJetPt.push_back(store->book1D("_meRecoJetPt","Single Reconstructed Jet Pt",100,0,500));
129  _meRecoJetPtTrgMC.push_back(store->book1D("_meRecoJetPtTrgMC","Single Reconstructed Jet Pt -- HLT Triggered",100,0,500));
130  _meRecoJetPtTrg.push_back(store->book1D("_meRecoJetPtTrg","Single Reconstructed Jet Pt -- HLT Triggered",100,0,500));
131  _meRecoJetPtTrgLow.push_back(store->book1D("_meRecoJetPtTrgLow","Single Reconstructed Jet Pt -- HLT Triggered Low",100,0,500));
132 
133  _meRecoJetEta.push_back(store->book1D("_meRecoJetEta","Single Reconstructed Jet Eta",100,-10,10));
134  _meRecoJetEtaTrgMC.push_back(store->book1D("_meRecoJetEtaTrgMC","Single Reconstructed Jet Eta -- HLT Triggered",100,-10,10));
135  _meRecoJetEtaTrg.push_back(store->book1D("_meRecoJetEtaTrg","Single Reconstructed Jet Eta -- HLT Triggered",100,-10,10));
136  _meRecoJetEtaTrgLow.push_back(store->book1D("_meRecoJetEtaTrgLow","Single Reconstructed Jet Eta -- HLT Triggered Low",100,-10,10));
137 
138  _meRecoJetPhi.push_back(store->book1D("_meRecoJetPhi","Single Reconstructed Jet Phi",100,-4.,4.));
139  _meRecoJetPhiTrgMC.push_back(store->book1D("_meRecoJetPhiTrgMC","Single Reconstructed Jet Phi -- HLT Triggered",100,-4.,4.));
140  _meRecoJetPhiTrg.push_back(store->book1D("_meRecoJetPhiTrg","Single Reconstructed Jet Phi -- HLT Triggered",100,-4.,4.));
141  _meRecoJetPhiTrgLow.push_back(store->book1D("_meRecoJetPhiTrgLow","Single Reconstructed Jet Phi -- HLT Triggered Low",100,-4.,4.));
142 
143  _meGenJetPt.push_back(store->book1D("_meGenJetPt","Single Generated Jet Pt",100,0,500));
144  _meGenJetPtTrgMC.push_back(store->book1D("_meGenJetPtTrgMC","Single Generated Jet Pt -- HLT Triggered",100,0,500));
145  _meGenJetPtTrg.push_back(store->book1D("_meGenJetPtTrg","Single Generated Jet Pt -- HLT Triggered",100,0,500));
146  _meGenJetPtTrgLow.push_back(store->book1D("_meGenJetPtTrgLow","Single Generated Jet Pt -- HLT Triggered Low",100,0,500));
147 
148  _meGenJetEta.push_back(store->book1D("_meGenJetEta","Single Generated Jet Eta",100,-10,10));
149  _meGenJetEtaTrgMC.push_back(store->book1D("_meGenJetEtaTrgMC","Single Generated Jet Eta -- HLT Triggered",100,-10,10));
150  _meGenJetEtaTrg.push_back(store->book1D("_meGenJetEtaTrg","Single Generated Jet Eta -- HLT Triggered",100,-10,10));
151  _meGenJetEtaTrgLow.push_back(store->book1D("_meGenJetEtaTrgLow","Single Generated Jet Eta -- HLT Triggered Low",100,-10,10));
152 
153  _meGenJetPhi.push_back(store->book1D("_meGenJetPhi","Single Generated Jet Phi",100,-4.,4.));
154  _meGenJetPhiTrgMC.push_back(store->book1D("_meGenJetPhiTrgMC","Single Generated Jet Phi -- HLT Triggered",100,-4.,4.));
155  _meGenJetPhiTrg.push_back(store->book1D("_meGenJetPhiTrg","Single Generated Jet Phi -- HLT Triggered",100,-4.,4.));
156  _meGenJetPhiTrgLow.push_back(store->book1D("_meGenJetPhiTrgLow","Single Generated Jet Phi -- HLT Triggered Low",100,-4.,4.));
157 
158  }
159  for (size_t it=0;it<hltTrgMet.size();it++) {
160  //std::cout<<hltTrgMet[it].c_str()<<" "<<hltTrgMetLow[it].c_str()<<std::endl;
162  _meRecoMET.push_back(store->book1D("_meRecoMET","Reconstructed Missing ET",100,0,500));
163  _meRecoMETTrgMC.push_back(store->book1D("_meRecoMETTrgMC","Reconstructed Missing ET -- HLT Triggered",100,0,500));
164  _meRecoMETTrg.push_back(store->book1D("_meRecoMETTrg","Reconstructed Missing ET -- HLT Triggered",100,0,500));
165  _meRecoMETTrgLow.push_back(store->book1D("_meRecoMETTrgLow","Reconstructed Missing ET -- HLT Triggered Low",100,0,500));
166 
167  _meGenMET.push_back(store->book1D("_meGenMET","Generated Missing ET",100,0,500));
168  _meGenMETTrgMC.push_back(store->book1D("_meGenMETTrgMC","Generated Missing ET -- HLT Triggered",100,0,500));
169  _meGenMETTrg.push_back(store->book1D("_meGenMETTrg","Generated Missing ET -- HLT Triggered",100,0,500));
170  _meGenMETTrgLow.push_back(store->book1D("_meGenMETTrgLow","Generated Missing ET -- HLT Triggered Low",100,0,500));
171  }
172 }
std::vector< MonitorElement * > _meRecoMET
std::vector< std::string > hltTrgMet
std::vector< MonitorElement * > _meGenJetEtaTrgMC
std::vector< MonitorElement * > _meGenJetPt
std::vector< MonitorElement * > _meGenJetPhiTrg
std::vector< std::string > hltTrgJet
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< MonitorElement * > _meRecoJetPtTrgMC
std::vector< MonitorElement * > _meGenMET
std::vector< MonitorElement * > _meGenJetPtTrgMC
std::vector< MonitorElement * > _meGenMETTrgMC
std::vector< std::string > hltTrgMetLow
std::vector< MonitorElement * > _meGenJetPhiTrgMC
std::vector< MonitorElement * > _meGenMETTrgLow
std::vector< MonitorElement * > _meRecoJetPhiTrgLow
std::vector< MonitorElement * > _meRecoJetPt
int j
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > _meGenJetEtaTrg
std::vector< MonitorElement * > _meRecoJetEtaTrgMC
std::vector< MonitorElement * > _meRecoMETTrg
std::vector< MonitorElement * > _meGenJetPtTrg
std::vector< MonitorElement * > _meGenMETTrg
std::vector< MonitorElement * > _meRecoJetPhiTrgMC
std::vector< MonitorElement * > _meGenJetEtaTrgLow
std::vector< MonitorElement * > _meRecoJetPtTrg
std::vector< MonitorElement * > _meGenJetEta
std::vector< MonitorElement * > _meRecoJetPhiTrg
std::vector< MonitorElement * > _meRecoMETTrgMC
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
std::vector< MonitorElement * > _meGenJetPhi
std::vector< MonitorElement * > _meGenJetPtTrgLow
std::vector< MonitorElement * > _meRecoJetPtTrgLow
HLTConfigProvider hltConfig_
std::vector< MonitorElement * > _meRecoMETTrgLow
std::vector< std::string > hltTrgJetLow
std::vector< MonitorElement * > _meRecoJetEta
std::vector< MonitorElement * > _meGenJetPhiTrgLow
std::vector< MonitorElement * > _meRecoJetPhi
std::vector< MonitorElement * > _meRecoJetEtaTrgLow
std::vector< MonitorElement * > _meRecoJetEtaTrg
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void HLTJetMETValidation::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 175 of file HLTJetMETValidation.cc.

References outFile_, and writeFile_.

176 {
177 
178  //Write DQM thing..
179  if(outFile_.size()>0)
180  if (&*edm::Service<DQMStore>() && writeFile_) {
182  }
183 
184 }
void HLTJetMETValidation::getHLTResults ( const edm::TriggerResults hltresults,
const edm::TriggerNames triggerNames 
)
private

Definition at line 413 of file HLTJetMETValidation.cc.

References accept(), edm::HLTGlobalStatus::accept(), HLTinit_, hltTriggerMap, edm::HLTGlobalStatus::size(), trig_iter, and edm::TriggerNames::triggerName().

Referenced by analyze().

414  {
415 
416  int ntrigs=hltresults.size();
417  if (! HLTinit_){
418  HLTinit_=true;
419 
420  //if (writeFile_) std::cout << "Number of HLT Paths: " << ntrigs << std::endl;
421  for (int itrig = 0; itrig != ntrigs; ++itrig){
422  std::string trigName = triggerNames.triggerName(itrig);
423  // std::cout << "trigger " << itrig << ": " << trigName << std::endl;
424  }
425  }
426 
427  for (int itrig = 0; itrig != ntrigs; ++itrig){
428  std::string trigName = triggerNames.triggerName(itrig);
429  bool accept=hltresults.accept(itrig);
430 
431  //if (accept) _triggerResults->Fill(float(itrig));
432 
433  // fill the trigger map
435  trig_iter=hltTriggerMap.find(trigName);
436  if (trig_iter==hltTriggerMap.end())
437  hltTriggerMap.insert(valType(trigName,accept));
438  else
439  trig_iter->second=accept;
440  }
441 }
std::map< std::string, bool > hltTriggerMap
bool accept() const
Has at least one path accepted the event?
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:22
unsigned int size() const
Get number of paths stored.
Container::value_type value_type
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
std::map< std::string, bool >::iterator trig_iter

Member Data Documentation

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetEta
private

Definition at line 106 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetEtaTrg
private

Definition at line 108 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetEtaTrgLow
private

Definition at line 109 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetEtaTrgMC
private

Definition at line 107 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetPhi
private

Definition at line 110 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetPhiTrg
private

Definition at line 112 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetPhiTrgLow
private

Definition at line 113 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetPhiTrgMC
private

Definition at line 111 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetPt
private

Definition at line 102 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetPtTrg
private

Definition at line 104 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetPtTrgLow
private

Definition at line 105 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenJetPtTrgMC
private

Definition at line 103 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenMET
private

Definition at line 119 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenMETTrg
private

Definition at line 121 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenMETTrgLow
private

Definition at line 122 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meGenMETTrgMC
private

Definition at line 120 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetEta
private

Definition at line 93 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetEtaTrg
private

Definition at line 95 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetEtaTrgLow
private

Definition at line 96 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetEtaTrgMC
private

Definition at line 94 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetPhi
private

Definition at line 97 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetPhiTrg
private

Definition at line 99 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetPhiTrgLow
private

Definition at line 100 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetPhiTrgMC
private

Definition at line 98 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetPt
private

Definition at line 89 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetPtTrg
private

Definition at line 91 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetPtTrgLow
private

Definition at line 92 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoJetPtTrgMC
private

Definition at line 90 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoMET
private

Definition at line 115 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoMETTrg
private

Definition at line 117 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoMETTrgLow
private

Definition at line 118 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<MonitorElement*> HLTJetMETValidation::_meRecoMETTrgMC
private

Definition at line 116 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

MonitorElement* HLTJetMETValidation::_triggerResults
private

Definition at line 126 of file HLTJetMETValidation.h.

edm::InputTag HLTJetMETValidation::CaloJetAlgorithm
private

Definition at line 77 of file HLTJetMETValidation.h.

Referenced by analyze().

edm::InputTag HLTJetMETValidation::CaloMETColl
private

Definition at line 77 of file HLTJetMETValidation.h.

Referenced by analyze().

int HLTJetMETValidation::evtCnt
private

Definition at line 130 of file HLTJetMETValidation.h.

Referenced by analyze(), and HLTJetMETValidation().

edm::InputTag HLTJetMETValidation::GenJetAlgorithm
private

Definition at line 77 of file HLTJetMETValidation.h.

Referenced by analyze().

edm::InputTag HLTJetMETValidation::GenMETColl
private

Definition at line 77 of file HLTJetMETValidation.h.

Referenced by analyze().

HLTConfigProvider HLTJetMETValidation::hltConfig_
private

Definition at line 132 of file HLTJetMETValidation.h.

Referenced by beginRun().

bool HLTJetMETValidation::HLTinit_
private

Definition at line 143 of file HLTJetMETValidation.h.

Referenced by getHLTResults().

edm::InputTag HLTJetMETValidation::HLTriggerResults
private

Definition at line 77 of file HLTJetMETValidation.h.

Referenced by analyze().

std::vector<std::string> HLTJetMETValidation::hltTrgJet
private

Definition at line 133 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<std::string> HLTJetMETValidation::hltTrgJetLow
private

Definition at line 134 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<std::string> HLTJetMETValidation::hltTrgMet
private

Definition at line 135 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::vector<std::string> HLTJetMETValidation::hltTrgMetLow
private

Definition at line 136 of file HLTJetMETValidation.h.

Referenced by analyze(), and beginRun().

std::map<std::string,bool> HLTJetMETValidation::hltTriggerMap
private

Definition at line 140 of file HLTJetMETValidation.h.

Referenced by analyze(), and getHLTResults().

std::vector<bool> HLTJetMETValidation::hlttrigs
private

Definition at line 139 of file HLTJetMETValidation.h.

std::string HLTJetMETValidation::MyTrigger
private

Definition at line 80 of file HLTJetMETValidation.h.

std::string HLTJetMETValidation::outFile_
private

Definition at line 85 of file HLTJetMETValidation.h.

Referenced by endJob().

std::string HLTJetMETValidation::patternJetTrg_
private

Definition at line 80 of file HLTJetMETValidation.h.

Referenced by beginRun().

std::string HLTJetMETValidation::patternMetTrg_
private

Definition at line 80 of file HLTJetMETValidation.h.

Referenced by beginRun().

std::string HLTJetMETValidation::patternMuTrg_
private

Definition at line 80 of file HLTJetMETValidation.h.

Referenced by beginRun().

DQMStore* HLTJetMETValidation::store
private

Definition at line 87 of file HLTJetMETValidation.h.

Referenced by beginRun(), and HLTJetMETValidation().

std::map<std::string,bool>::iterator HLTJetMETValidation::trig_iter
private

Definition at line 141 of file HLTJetMETValidation.h.

Referenced by analyze(), and getHLTResults().

edm::InputTag HLTJetMETValidation::triggerEventObject_
private

InputTag of TriggerEventWithRefs to analyze.

Definition at line 76 of file HLTJetMETValidation.h.

Referenced by analyze().

std::string HLTJetMETValidation::triggerTag_
private

Definition at line 80 of file HLTJetMETValidation.h.

Referenced by beginRun().

bool HLTJetMETValidation::writeFile_
private

Definition at line 146 of file HLTJetMETValidation.h.

Referenced by endJob().