CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
HeavyFlavorValidation Class Reference

#include <HLTriggerOfflineHeavyFlavor/src/HeavyFlavorValidation.cc>

Inheritance diagram for HeavyFlavorValidation:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 HeavyFlavorValidation (const edm::ParameterSet &)
 
 ~HeavyFlavorValidation () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 

Private Member Functions

int getFilterLevel (const std::string &moduleName, const HLTConfigProvider &hltConfig)
 
int getMotherId (const Candidate *p)
 
void match (MonitorElement *me, vector< LeafCandidate > &from, vector< LeafCandidate > &to, double deltaRMatchingCut, vector< int > &map)
 
void myBook1D (DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString label, TString title)
 
void myBook1D (DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString label)
 
void myBook2D (DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
 
void myBook2D (DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel)
 
void myBookProfile2D (DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
 
void myBookProfile2D (DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel)
 

Private Attributes

vector< double > deltaEtaBins
 
vector< double > deltaPhiBins
 
vector< double > dimuonDRBins
 
vector< double > dimuonEtaBins
 
vector< double > dimuonPtBins
 
string dqmFolder
 
vector< pair< string, int > > filterNamesLevels
 
double genGlobDeltaRMatchingCut
 
InputTag genParticlesTag
 
EDGetTokenT< GenParticleCollectiongenParticlesToken
 
double globL1DeltaRMatchingCut
 
double globL2DeltaRMatchingCut
 
double globL3DeltaRMatchingCut
 
map< TString, MonitorElement * > ME
 
vector< int > motherIDs
 
vector< double > muonEtaBins
 
const double muonMass
 
vector< double > muonPhiBins
 
vector< double > muonPtBins
 
InputTag recoMuonsTag
 
EDGetTokenT< MuonCollectionrecoMuonsToken
 
string triggerPathName
 
string triggerProcessName
 
InputTag triggerResultsTag
 
EDGetTokenT< TriggerResultstriggerResultsToken
 
EDGetTokenT< TriggerEventtriggerSummaryAODTag
 
EDGetTokenT< TriggerEventWithRefstriggerSummaryRAWTag
 

Detailed Description

Description: Analyzer to fill Monitoring Elements for muon, dimuon and trigger path efficiency studies (HLT/RECO, RECO/GEN)

Implementation: matching is based on closest in delta R, no duplicates allowed. Generated to Global based on momentum at IP; L1, L2, L2v to Global based on position in muon system, L3 to Global based on momentum at IP.

Definition at line 54 of file HeavyFlavorValidation.cc.

Constructor & Destructor Documentation

HeavyFlavorValidation::HeavyFlavorValidation ( const edm::ParameterSet pset)
explicit

Definition at line 120 of file HeavyFlavorValidation.cc.

References genParticlesTag, genParticlesToken, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), recoMuonsTag, recoMuonsToken, triggerProcessName, triggerResultsTag, triggerResultsToken, triggerSummaryAODTag, and triggerSummaryRAWTag.

120  :
121 //get parameters
122  dqmFolder(pset.getUntrackedParameter<string>("DQMFolder")),
123  triggerProcessName(pset.getUntrackedParameter<string>("TriggerProcessName")),
124  triggerPathName(pset.getUntrackedParameter<string>("TriggerPathName")),
125  motherIDs(pset.getUntrackedParameter<vector<int> >("MotherIDs")),
126  genGlobDeltaRMatchingCut(pset.getUntrackedParameter<double>("GenGlobDeltaRMatchingCut")),
127  globL1DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL1DeltaRMatchingCut")),
128  globL2DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL2DeltaRMatchingCut")),
129  globL3DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL3DeltaRMatchingCut")),
130  deltaEtaBins(pset.getUntrackedParameter<vector<double> >("DeltaEtaBins")),
131  deltaPhiBins(pset.getUntrackedParameter<vector<double> >("DeltaPhiBins")),
132  muonPtBins(pset.getUntrackedParameter<vector<double> >("MuonPtBins")),
133  muonEtaBins(pset.getUntrackedParameter<vector<double> >("MuonEtaBins")),
134  muonPhiBins(pset.getUntrackedParameter<vector<double> >("MuonPhiBins")),
135  dimuonPtBins(pset.getUntrackedParameter<vector<double> >("DimuonPtBins")),
136  dimuonEtaBins(pset.getUntrackedParameter<vector<double> >("DimuonEtaBins")),
137  dimuonDRBins(pset.getUntrackedParameter<vector<double> >("DimuonDRBins")),
138  muonMass(0.106)
139 {
140  triggerSummaryRAWTag = consumes<TriggerEventWithRefs>(InputTag( pset.getUntrackedParameter<string>("TriggerSummaryRAW"), "", triggerProcessName));
141  triggerSummaryAODTag = consumes<TriggerEvent>(InputTag( pset.getUntrackedParameter<string>("TriggerSummaryAOD"), "", triggerProcessName));
142  triggerResultsTag = InputTag( pset.getUntrackedParameter<string>("TriggerResults"), "", triggerProcessName);
143  triggerResultsToken = consumes<TriggerResults>(triggerResultsTag);
144  recoMuonsTag = pset.getParameter<InputTag>("RecoMuons");
145  recoMuonsToken = consumes<MuonCollection>(recoMuonsTag);
146  genParticlesTag = pset.getParameter<InputTag>("GenParticles");
147  genParticlesToken = consumes<GenParticleCollection>(genParticlesTag);
148 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
EDGetTokenT< TriggerEvent > triggerSummaryAODTag
EDGetTokenT< TriggerEventWithRefs > triggerSummaryRAWTag
EDGetTokenT< MuonCollection > recoMuonsToken
EDGetTokenT< GenParticleCollection > genParticlesToken
EDGetTokenT< TriggerResults > triggerResultsToken
HeavyFlavorValidation::~HeavyFlavorValidation ( )
override

Definition at line 713 of file HeavyFlavorValidation.cc.

References DEFINE_FWK_MODULE.

713  {
714 }

Member Function Documentation

void HeavyFlavorValidation::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 287 of file HeavyFlavorValidation.cc.

References funct::abs(), edm::HLTGlobalStatus::accept(), ALCARECOTkAlJpsiMuMu_cff::charge, PVValHelper::eta, f, trigger::TriggerEventWithRefs::filterIndex(), trigger::TriggerEvent::filterKeys(), filterNamesLevels, trigger::TriggerEvent::filterTag(), spr::find(), plotBeamSpotDB::first, genGlobDeltaRMatchingCut, runTauDisplay::genMuons, GenHFHadronMatcher_cfi::genParticles, genParticlesTag, genParticlesToken, edm::Event::getByToken(), getMotherId(), trigger::TriggerEvent::getObjects(), trigger::TriggerEventWithRefs::getObjects(), globL1DeltaRMatchingCut, globL2DeltaRMatchingCut, globL3DeltaRMatchingCut, mps_fire::i, edm::HandleBase::isValid(), relativeConstraints::keys, LogDebug, match(), motherIDs, muonMass, AlCaHLTBitMon_ParallelJobs::p, phi, EnergyCorrector::pt, recoMuonsTag, recoMuonsToken, edm::second(), edm::TriggerNames::size(), findQualityFiles::size, trigger::TriggerEvent::sizeFilters(), HiIsolationCommonParameters_cff::track, trigger::TriggerL1Mu, trigger::TriggerMuon, edm::TriggerNames::triggerName(), edm::Event::triggerNames(), triggerPathName, triggerProcessName, triggerResults, triggerResultsTag, triggerResultsToken, triggerSummaryAODTag, triggerSummaryRAWTag, x, y, and z.

287  {
288  if(filterNamesLevels.empty()){
289  return;
290  }
291 //access the containers and create LeafCandidate copies
292  vector<LeafCandidate> genMuons;
294  iEvent.getByToken(genParticlesToken, genParticles);
295  if(genParticles.isValid()){
296  for(GenParticleCollection::const_iterator p=genParticles->begin(); p!= genParticles->end(); ++p){
297  if( p->status() == 1 && std::abs(p->pdgId())==13 &&
298  ( find( motherIDs.begin(), motherIDs.end(), -1 )!=motherIDs.end() || find( motherIDs.begin(), motherIDs.end(), getMotherId(&(*p)) )!=motherIDs.end() ) ){
299  genMuons.push_back( *p );
300  }
301  }
302  }else{
303  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Could not access GenParticleCollection"<<endl;
304  }
305  sort(genMuons.begin(), genMuons.end(), GreaterByPt<LeafCandidate>());
306  ME["genMuon_size"]->Fill(genMuons.size());
307  LogDebug("HLTriggerOfflineHeavyFlavor")<<"GenParticleCollection from "<<genParticlesTag<<" has size: "<<genMuons.size()<<endl;
308 
309  vector<LeafCandidate> globMuons;
310  vector<LeafCandidate> globMuons_position;
311  Handle<MuonCollection> recoMuonsHandle;
312  iEvent.getByToken(recoMuonsToken, recoMuonsHandle);
313  if(recoMuonsHandle.isValid()){
314  for(MuonCollection::const_iterator p=recoMuonsHandle->begin(); p!= recoMuonsHandle->end(); ++p){
315  if(p->isGlobalMuon()){
316  globMuons.push_back(*p);
317  globMuons_position.push_back( LeafCandidate( p->charge(), math::XYZTLorentzVector(p->outerTrack()->innerPosition().x(), p->outerTrack()->innerPosition().y(), p->outerTrack()->innerPosition().z(), 0.) ) );
318  }
319  }
320  }else{
321  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Could not access reco Muons"<<endl;
322  }
323  ME["globMuon_size"]->Fill(globMuons.size());
324  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Global Muons from "<<recoMuonsTag<<" has size: "<<globMuons.size()<<endl;
325 
326 // access RAW trigger event
327  vector<vector<LeafCandidate> > muonsAtFilter;
328  vector<vector<LeafCandidate> > muonPositionsAtFilter;
329  for(size_t i=0; i<filterNamesLevels.size(); i++){
330  muonsAtFilter.push_back(vector<LeafCandidate>());
331  muonPositionsAtFilter.push_back(vector<LeafCandidate>());
332  }
333  Handle<TriggerEventWithRefs> rawTriggerEvent;
334  iEvent.getByToken( triggerSummaryRAWTag, rawTriggerEvent );
335  if( rawTriggerEvent.isValid() ){
336  for(size_t i=0; i<filterNamesLevels.size(); i++){
337  size_t index = rawTriggerEvent->filterIndex(InputTag( filterNamesLevels[i].first, "", triggerProcessName ));
338  if ( index < rawTriggerEvent->size() ){
339  if( filterNamesLevels[i].second==1 ){
340  vector<L1MuonParticleRef> l1Cands;
341  rawTriggerEvent->getObjects( index, TriggerL1Mu, l1Cands );
342  for(size_t j=0; j<l1Cands.size(); j++){
343  muonsAtFilter[i].push_back(*l1Cands[j]);
344  }
345  }else{
346  vector<RecoChargedCandidateRef> hltCands;
347  rawTriggerEvent->getObjects( index, TriggerMuon, hltCands );
348  for(size_t j=0; j<hltCands.size(); j++){
349  muonsAtFilter[i].push_back(*hltCands[j]);
350  if( filterNamesLevels[i].second==2 ){
351  muonPositionsAtFilter[i].push_back( LeafCandidate( hltCands[j]->charge(), math::XYZTLorentzVector(hltCands[j]->track()->innerPosition().x(), hltCands[j]->track()->innerPosition().y(), hltCands[j]->track()->innerPosition().z(), 0.) ) );
352  }
353  }
354  }
355  }
356  ME[TString::Format("filt%dMuon_size",int(i+1))]->Fill(muonsAtFilter[i].size());
357  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Filter \""<<filterNamesLevels[i].first<<"\" has "<<muonsAtFilter[i].size()<<" muons"<<endl;
358  }
359  }else{
360  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Could not access RAWTriggerEvent"<<endl;
361  }
362 
363 // access AOD trigger event
364  vector<LeafCandidate> pathMuons;
365  Handle<TriggerEvent> aodTriggerEvent;
366  iEvent.getByToken(triggerSummaryAODTag,aodTriggerEvent);
367  if(aodTriggerEvent.isValid()){
368  TriggerObjectCollection allObjects = aodTriggerEvent->getObjects();
369  for(int i=0; i<aodTriggerEvent->sizeFilters(); i++){
370  if(aodTriggerEvent->filterTag(i)==InputTag((filterNamesLevels.end()-1)->first,"",triggerProcessName)){
371  Keys keys = aodTriggerEvent->filterKeys(i);
372  for(size_t j=0; j<keys.size(); j++){
373  pathMuons.push_back( LeafCandidate( allObjects[keys[j]].id()>0 ? 1 : -1, math::PtEtaPhiMLorentzVector( allObjects[keys[j]].pt(), allObjects[keys[j]].eta(), allObjects[keys[j]].phi(), muonMass ) ) );
374  }
375  }
376  }
377  ME["pathMuon_size"]->Fill(pathMuons.size());
378  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Path \""<<triggerPathName<<"\" has "<<pathMuons.size()<<" muons at last filter \""<<(filterNamesLevels.end()-1)->first<<"\""<<endl;
379  }else{
380  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Could not access AODTriggerEvent"<<endl;
381  }
382 
383 // access Trigger Results
384  bool triggerFired = false;
386  iEvent.getByToken(triggerResultsToken,triggerResults);
387  if(triggerResults.isValid()){
388  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Successfully initialized "<<triggerResultsTag<<endl;
389  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
390  bool hlt_exists = false;
391  for ( unsigned int i=0; i!=triggerNames.size(); i++) {
392  TString hlt_name = triggerNames.triggerName(i);
393  if (hlt_name.Contains(triggerPathName)) {
394  triggerFired = triggerResults->accept( i );
395  hlt_exists = true;
396  break;
397  }
398  }
399  if (!hlt_exists) {
400  LogDebug("HLTriggerOfflineHeavyFlavor")<<triggerResultsTag<<" has no trigger: "<<triggerPathName<<endl;
401  }
402  }else{
403  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Could not initialize "<<triggerResultsTag<<endl;
404  }
405 
406 //create matching maps
407  vector<int> glob_gen(genMuons.size(),-1);
408  match( ME["globGen_deltaEtaDeltaPhi"], genMuons, globMuons, genGlobDeltaRMatchingCut, glob_gen );
409  vector<vector<int> > filt_glob;
410  for(size_t i=0; i<filterNamesLevels.size(); i++){
411  filt_glob.push_back( vector<int>(globMuons.size(),-1) );
412  if( filterNamesLevels[i].second == 1 ){
413  match( ME[TString::Format("filt%dGlob_deltaEtaDeltaPhi",int(i+1))], globMuons_position, muonsAtFilter[i] ,globL1DeltaRMatchingCut, filt_glob[i] );
414  }else if( filterNamesLevels[i].second == 2 ){
415  match( ME[TString::Format("filt%dGlob_deltaEtaDeltaPhi",int(i+1))], globMuons_position, muonPositionsAtFilter[i] ,globL2DeltaRMatchingCut, filt_glob[i] );
416  }else if( filterNamesLevels[i].second > 2){
417  match( ME[TString::Format("filt%dGlob_deltaEtaDeltaPhi",int(i+1))], globMuons, muonsAtFilter[i] ,globL3DeltaRMatchingCut, filt_glob[i] );
418  }
419  }
420  vector<int> path_glob(globMuons.size(),-1);
421  if( (filterNamesLevels.end()-1)->second == 1 ){
422  match( ME["pathGlob_deltaEtaDeltaPhi"], globMuons_position, pathMuons ,globL1DeltaRMatchingCut, path_glob );
423  }else if( (filterNamesLevels.end()-1)->second == 2 ){
424  match( ME["pathGlob_deltaEtaDeltaPhi"], globMuons, pathMuons ,globL2DeltaRMatchingCut, path_glob );
425  }else if( (filterNamesLevels.end()-1)->second > 2){
426  match( ME["pathGlob_deltaEtaDeltaPhi"], globMuons, pathMuons ,globL3DeltaRMatchingCut, path_glob );
427  }
428 
429 //fill histos
430  bool first = true;
431  for(size_t i=0; i<genMuons.size(); i++){
432  ME["genMuon_genEtaPt"]->Fill(genMuons[i].eta(), genMuons[i].pt());
433  ME["genMuon_genEtaPhi"]->Fill(genMuons[i].eta(), genMuons[i].phi());
434  if(glob_gen[i] != -1) {
435  ME["resGlobGen_genEtaPt"]->Fill(genMuons[i].eta(), genMuons[i].pt(), (globMuons[glob_gen[i]].pt()-genMuons[i].pt())/genMuons[i].pt() );
436  ME["globMuon_genEtaPt"]->Fill(genMuons[i].eta(), genMuons[i].pt());
437  ME["globMuon_genEtaPhi"]->Fill(genMuons[i].eta(), genMuons[i].phi());
438  ME["globMuon_recoEtaPt"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt());
439  ME["globMuon_recoEtaPhi"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].phi());
440  for(size_t f=0; f<filterNamesLevels.size(); f++) {
441  if(filt_glob[f][glob_gen[i]] != -1) {
442  ME[TString::Format("resFilt%dGlob_recoEtaPt",int(f+1))]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt(), (muonsAtFilter[f][filt_glob[f][glob_gen[i]]].pt()-globMuons[glob_gen[i]].pt())/globMuons[glob_gen[i]].pt() );
443  ME[TString::Format("filt%dMuon_recoEtaPt",int(f+1))]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt());
444  ME[TString::Format("filt%dMuon_recoEtaPhi",int(f+1))]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].phi());
445  }else{
446  break;
447  }
448  }
449  if(path_glob[glob_gen[i]] != -1){
450  ME["resPathGlob_recoEtaPt"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt(), (pathMuons[path_glob[glob_gen[i]]].pt()-globMuons[glob_gen[i]].pt())/globMuons[glob_gen[i]].pt() );
451  ME["pathMuon_recoEtaPt"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt());
452  ME["pathMuon_recoEtaPhi"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].phi());
453  }
454 //highest pt muon
455  if( first ){
456  first = false;
457  if( triggerFired ){
458  ME["resultMuon_recoEtaPt"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt());
459  ME["resultMuon_recoEtaPhi"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].phi());
460  }
461  }
462  }
463  }
464 
465 //fill dimuon histograms (highest pT, opposite charge)
466  int secondMuon = 0;
467  for(size_t j=1; j<genMuons.size(); j++){
468  if(genMuons[0].charge()*genMuons[j].charge()==-1){
469  secondMuon = j;
470  break;
471  }
472  }
473  if(secondMuon > 0){
474 //two generated
475  double genDimuonPt = (genMuons[0].p4()+genMuons[secondMuon].p4()).pt();
476  double genDimuonEta = (genMuons[0].p4()+genMuons[secondMuon].p4()).eta();
477  double genDimuonRap = (genMuons[0].p4()+genMuons[secondMuon].p4()).Rapidity();
478  double genDimuonDR = deltaR<LeafCandidate,LeafCandidate>( genMuons[0], genMuons[secondMuon] );
479  bool highPt = genMuons[0].pt()>7. && genMuons[secondMuon].pt()>7;
480  ME["genDimuon_genEtaPt"]->Fill( genDimuonEta, genDimuonPt );
481  ME["genDimuon_genRapPt"]->Fill( genDimuonRap, genDimuonPt );
482  if(highPt) ME["genDimuon_genPtDR"]->Fill( genDimuonPt, genDimuonDR );
483 //two global
484  if(glob_gen[0]!=-1 && glob_gen[secondMuon]!=-1){
485  ME["globDimuon_genEtaPt"]->Fill( genDimuonEta, genDimuonPt );
486  ME["globDimuon_genRapPt"]->Fill( genDimuonRap, genDimuonPt );
487  if(highPt) ME["globDimuon_genPtDR"]->Fill( genDimuonPt, genDimuonDR );
488  double globDimuonPt = (globMuons[glob_gen[0]].p4()+globMuons[glob_gen[secondMuon]].p4()).pt();
489  double globDimuonEta = (globMuons[glob_gen[0]].p4()+globMuons[glob_gen[secondMuon]].p4()).eta();
490  double globDimuonRap = (globMuons[glob_gen[0]].p4()+globMuons[glob_gen[secondMuon]].p4()).Rapidity();
491  double globDimuonDR = deltaR<LeafCandidate,LeafCandidate>( globMuons[glob_gen[0]], globMuons[glob_gen[secondMuon]] );
492  double globDimuonDRpos = deltaR<LeafCandidate,LeafCandidate>( globMuons_position[glob_gen[0]], globMuons_position[glob_gen[secondMuon]] );
493  ME["globDimuon_recoEtaPt"]->Fill( globDimuonEta, globDimuonPt );
494  ME["globDimuon_recoRapPt"]->Fill( globDimuonRap, globDimuonPt );
495  if(highPt) ME["globDimuon_recoPtDR"]->Fill( globDimuonPt, globDimuonDR );
496  if(highPt) ME["globDimuon_recoPtDRpos"]->Fill( globDimuonPt, globDimuonDRpos );
497 //two filter objects
498  for(size_t f=0; f<filterNamesLevels.size(); f++){
499  if(filt_glob[f][glob_gen[0]] != -1 && filt_glob[f][glob_gen[secondMuon]] != -1){
500  ME[TString::Format("diFilt%dDimuon_recoEtaPt",int(f+1))]->Fill( globDimuonEta, globDimuonPt );
501  ME[TString::Format("diFilt%dDimuon_recoRapPt",int(f+1))]->Fill( globDimuonRap, globDimuonPt );
502  if(highPt) ME[TString::Format("diFilt%dDimuon_recoPtDR",int(f+1))]->Fill( globDimuonPt, globDimuonDR );
503  if(highPt) ME[TString::Format("diFilt%dDimuon_recoPtDRpos",int(f+1))]->Fill( globDimuonPt, globDimuonDRpos );
504  }else{
505  break;
506  }
507  }
508 //one filter object
509  for(size_t f=0; f<filterNamesLevels.size(); f++){
510  if(filt_glob[f][glob_gen[0]] != -1 || filt_glob[f][glob_gen[secondMuon]] != -1){
511  ME[TString::Format("filt%dDimuon_recoEtaPt",int(f+1))]->Fill( globDimuonEta, globDimuonPt );
512  ME[TString::Format("filt%dDimuon_recoRapPt",int(f+1))]->Fill( globDimuonRap, globDimuonPt );
513  if(highPt) ME[TString::Format("filt%dDimuon_recoPtDR",int(f+1))]->Fill( globDimuonPt, globDimuonDR );
514  if(highPt) ME[TString::Format("filt%dDimuon_recoPtDRpos",int(f+1))]->Fill( globDimuonPt, globDimuonDRpos );
515  }else{
516  break;
517  }
518  }
519 //two path objects
520  if(path_glob[glob_gen[0]] != -1 && path_glob[glob_gen[secondMuon]] != -1){
521  ME["diPathDimuon_recoEtaPt"]->Fill( globDimuonEta, globDimuonPt );
522  ME["diPathDimuon_recoRapPt"]->Fill( globDimuonRap, globDimuonPt );
523  if(highPt) ME["diPathDimuon_recoPtDR"]->Fill( globDimuonPt, globDimuonDR );
524  if(highPt) ME["diPathDimuon_recoPtDRpos"]->Fill( globDimuonPt, globDimuonDRpos );
525  }
526 //one path object
527  if(path_glob[glob_gen[0]] != -1 || path_glob[glob_gen[secondMuon]] != -1){
528  ME["pathDimuon_recoEtaPt"]->Fill( globDimuonEta, globDimuonPt );
529  ME["pathDimuon_recoRapPt"]->Fill( globDimuonRap, globDimuonPt );
530  if(highPt) ME["pathDimuon_recoPtDR"]->Fill( globDimuonPt, globDimuonDR );
531  if(highPt) ME["pathDimuon_recoPtDRpos"]->Fill( globDimuonPt, globDimuonDRpos );
532  }
533 //trigger result
534  if( triggerFired ){
535  ME["resultDimuon_recoEtaPt"]->Fill( globDimuonEta, globDimuonPt );
536  ME["resultDimuon_recoRapPt"]->Fill( globDimuonRap, globDimuonPt );
537  if(highPt) ME["resultDimuon_recoPtDR"]->Fill( globDimuonPt, globDimuonDR );
538  if(highPt) ME["resultDimuon_recoPtDRpos"]->Fill( globDimuonPt, globDimuonDRpos );
539  }
540  }
541  }
542 }
#define LogDebug(id)
size
Write out results.
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
enum start value shifted to 81 so as to avoid clashes with PDG codes
bool accept() const
Has at least one path accepted the event?
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
vector< pair< string, int > > filterNamesLevels
Strings::size_type size() const
Definition: TriggerNames.cc:31
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
EDGetTokenT< TriggerEvent > triggerSummaryAODTag
U second(std::pair< T, U > const &p)
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Definition: ME.h:11
int getMotherId(const Candidate *p)
void match(MonitorElement *me, vector< LeafCandidate > &from, vector< LeafCandidate > &to, double deltaRMatchingCut, vector< int > &map)
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
EDGetTokenT< TriggerEventWithRefs > triggerSummaryRAWTag
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
static std::string const triggerResults
Definition: EdmProvDump.cc:45
bool isValid() const
Definition: HandleBase.h:74
size_type filterIndex(const edm::InputTag &filterTag) const
index from tag
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
const edm::InputTag filterTag(trigger::size_type index) const
Definition: TriggerEvent.h:103
EDGetTokenT< MuonCollection > recoMuonsToken
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:22
std::vector< size_type > Keys
void getObjects(size_type filter, Vids &ids, VRphoton &photons) const
extract Ref<C>s for a specific filter and of specific physics type
EDGetTokenT< GenParticleCollection > genParticlesToken
EDGetTokenT< TriggerResults > triggerResultsToken
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:256
void HeavyFlavorValidation::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 188 of file HeavyFlavorValidation.cc.

References DQMStore::IBooker::cd(), deltaEtaBins, deltaPhiBins, dimuonDRBins, dimuonEtaBins, dimuonPtBins, dqmFolder, filterNamesLevels, plotBeamSpotDB::first, mps_fire::i, muonEtaBins, muonPhiBins, muonPtBins, myBook1D(), myBook2D(), myBookProfile2D(), DQMStore::IBooker::setCurrentFolder(), triggerPathName, and triggerProcessName.

190  {
191  ibooker.cd();
193 
194  // create Monitor Elements
195  // Eta Pt Single
196  myBook2D(ibooker, "genMuon_genEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
197  myBook2D(ibooker, "globMuon_genEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
198  myBook2D(ibooker, "globMuon_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
199 
200  for(size_t i=0; i<filterNamesLevels.size(); i++){
201  myBook2D(ibooker, TString::Format("filt%dMuon_recoEtaPt",int(i+1)), muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)", filterNamesLevels[i].first);
202  }
203  myBook2D(ibooker, "pathMuon_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)", triggerPathName);
204  myBook2D(ibooker, "resultMuon_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
205  // Eta Pt Single Resolution
206  myBookProfile2D(ibooker, "resGlobGen_genEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
207  for(size_t i=0; i<filterNamesLevels.size(); i++){
208  myBookProfile2D(ibooker, TString::Format("resFilt%dGlob_recoEtaPt",int(i+1)), muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)", filterNamesLevels[i].first);
209  }
210  myBookProfile2D(ibooker, "resPathGlob_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)", triggerPathName);
211  // Eta Pt Double
212  myBook2D(ibooker, "genDimuon_genEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
213  myBook2D(ibooker, "globDimuon_genEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
214  myBook2D(ibooker, "globDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
215  for(size_t i=0; i<filterNamesLevels.size(); i++){
216  myBook2D(ibooker, TString::Format("filt%dDimuon_recoEtaPt",int(i+1)), dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)", filterNamesLevels[i].first);
217  }
218  myBook2D(ibooker, "pathDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)", triggerPathName);
219  myBook2D(ibooker, "resultDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
220  for(size_t i=0; i<filterNamesLevels.size(); i++){
221  myBook2D(ibooker, TString::Format("diFilt%dDimuon_recoEtaPt",int(i+1)), dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)", filterNamesLevels[i].first);
222  }
223  myBook2D(ibooker, "diPathDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)", triggerPathName);
224  // Eta Phi Single
225  myBook2D(ibooker, "genMuon_genEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
226  myBook2D(ibooker, "globMuon_genEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
227  myBook2D(ibooker, "globMuon_recoEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
228  for(size_t i=0; i<filterNamesLevels.size(); i++){
229  myBook2D(ibooker, TString::Format("filt%dMuon_recoEtaPhi",int(i+1)), muonEtaBins, "#mu eta", muonPhiBins, "#mu phi", filterNamesLevels[i].first);
230  }
231  myBook2D(ibooker, "pathMuon_recoEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi", triggerPathName);
232  myBook2D(ibooker, "resultMuon_recoEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
233  // Rap Pt Double
234  myBook2D(ibooker, "genDimuon_genRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
235  myBook2D(ibooker, "globDimuon_genRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
236  myBook2D(ibooker, "globDimuon_recoRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
237  for(size_t i=0; i<filterNamesLevels.size(); i++){
238  myBook2D(ibooker, TString::Format("filt%dDimuon_recoRapPt",int(i+1)), dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)", filterNamesLevels[i].first);
239  }
240  myBook2D(ibooker, "pathDimuon_recoRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)", triggerPathName);
241  myBook2D(ibooker, "resultDimuon_recoRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
242  for(size_t i=0; i<filterNamesLevels.size(); i++){
243  myBook2D(ibooker, TString::Format("diFilt%dDimuon_recoRapPt",int(i+1)), dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)", filterNamesLevels[i].first);
244  }
245  myBook2D(ibooker, "diPathDimuon_recoRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)", triggerPathName);
246  // Pt DR Double
247  myBook2D(ibooker, "genDimuon_genPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
248  myBook2D(ibooker, "globDimuon_genPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
249  myBook2D(ibooker, "globDimuon_recoPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
250  for(size_t i=0; i<filterNamesLevels.size(); i++){
251  myBook2D(ibooker, TString::Format("filt%dDimuon_recoPtDR",int(i+1)), dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP", filterNamesLevels[i].first);
252  }
253  myBook2D(ibooker, "pathDimuon_recoPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP", triggerPathName);
254  for(size_t i=0; i<filterNamesLevels.size(); i++){
255  myBook2D(ibooker, TString::Format("diFilt%dDimuon_recoPtDR",int(i+1)), dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP", filterNamesLevels[i].first);
256  }
257  myBook2D(ibooker, "diPathDimuon_recoPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP", triggerPathName);
258  myBook2D(ibooker, "resultDimuon_recoPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
259  // Pt DRpos Double
260  myBook2D(ibooker, "globDimuon_recoPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS");
261  for(size_t i=0; i<filterNamesLevels.size(); i++){
262  myBook2D(ibooker, TString::Format("filt%dDimuon_recoPtDRpos",int(i+1)), dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS", filterNamesLevels[i].first);
263  }
264  myBook2D(ibooker, "pathDimuon_recoPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS", triggerPathName);
265  for(size_t i=0; i<filterNamesLevels.size(); i++){
266  myBook2D(ibooker, TString::Format("diFilt%dDimuon_recoPtDRpos",int(i+1)), dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS", filterNamesLevels[i].first);
267  }
268  myBook2D(ibooker, "diPathDimuon_recoPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS", triggerPathName);
269  myBook2D(ibooker, "resultDimuon_recoPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS");
270 
271  // Matching
272  myBook2D(ibooker, "globGen_deltaEtaDeltaPhi", deltaEtaBins, "#Delta eta", deltaPhiBins, "#Delta phi");
273  for(size_t i=0; i<filterNamesLevels.size(); i++){
274  myBook2D(ibooker, TString::Format("filt%dGlob_deltaEtaDeltaPhi",int(i+1)), deltaEtaBins, "#Delta eta", deltaPhiBins, "#Delta phi", filterNamesLevels[i].first);
275  }
276  myBook2D(ibooker, "pathGlob_deltaEtaDeltaPhi", deltaEtaBins, "#Delta eta", deltaPhiBins, "#Delta phi", triggerPathName);
277  // Size of containers
278  vector<double> sizeBins; sizeBins.push_back(10); sizeBins.push_back(0); sizeBins.push_back(10);
279  myBook1D(ibooker, "genMuon_size", sizeBins, "container size" );
280  myBook1D(ibooker, "globMuon_size", sizeBins, "container size" );
281  for(size_t i=0; i<filterNamesLevels.size(); i++){
282  myBook1D(ibooker, TString::Format("filt%dMuon_size",int(i+1)), sizeBins, "container size", filterNamesLevels[i].first);
283  }
284  myBook1D(ibooker, "pathMuon_size", sizeBins, "container size", triggerPathName );
285 }
void myBook2D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
vector< pair< string, int > > filterNamesLevels
void myBookProfile2D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
void myBook1D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString label, TString title)
void HeavyFlavorValidation::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 150 of file HeavyFlavorValidation.cc.

References filterNamesLevels, filters, getFilterLevel(), HLTConfigProvider::init(), hcalDigis_cfi::level, LogDebug, HLTConfigProvider::moduleLabels(), edm::moduleName(), str, AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::triggerNames(), triggerPathName, and triggerProcessName.

150  {
151  //discover HLT configuration
152  HLTConfigProvider hltConfig;
153  bool isChanged;
154  if(hltConfig.init(iRun, iSetup, triggerProcessName, isChanged)){
155  LogDebug("HLTriggerOfflineHeavyFlavor") << "Successfully initialized HLTConfigProvider with process name: "<<triggerProcessName<<endl;
156  }else{
157  LogWarning("HLTriggerOfflineHeavyFlavor") << "Could not initialize HLTConfigProvider with process name: "<<triggerProcessName<<endl;
158  return;
159  }
160  vector<string> triggerNames = hltConfig.triggerNames();
161  for (const auto &trigName : triggerNames) {
162  // TString triggerName = trigName;
163  if (trigName.find(triggerPathName) != std::string::npos) {
164  vector<string> moduleNames = hltConfig.moduleLabels( trigName );
165  for (const auto &moduleName : moduleNames) {
166  const int level = getFilterLevel(moduleName, hltConfig);
167  if (level > 0) {
168  filterNamesLevels.push_back( {moduleName, level} );
169  }
170  }
171  break;
172  }
173  }
174 
175  if(filterNamesLevels.empty()){
176  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Bad Trigger Path: "<<triggerPathName<<endl;
177  return;
178  }else{
180  str.reserve(512); // avoid too many realloctions in the following loop (allows for filter names with roughly 100 chars each)
181  for (const auto &filters : filterNamesLevels) str = str + " " + filters.first;
182  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Trigger Path: "<<triggerPathName<<" has filters:"<<str;
183  }
184 }
#define LogDebug(id)
const std::vector< std::string > & triggerNames() const
names of trigger paths
vector< pair< string, int > > filterNamesLevels
std::vector< TPRegexp > filters
Definition: eve_filter.cc:22
int getFilterLevel(const std::string &moduleName, const HLTConfigProvider &hltConfig)
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
#define str(s)
int HeavyFlavorValidation::getFilterLevel ( const std::string &  moduleName,
const HLTConfigProvider hltConfig 
)
private

Get the filter "level" (as it is defined for the use of this module and its corresponding harvesting module).

level 1 - 3 -> more or less synonymously to the the trigger levels level 4 and 5 -> vertex, dz, track, etc.. filters

See the comments in the definition for some more details.

Definition at line 651 of file HeavyFlavorValidation.cc.

References edm::contains(), funct::m, HLTConfigProvider::moduleEDMType(), HLTConfigProvider::moduleType(), AnalysisDataFormats_SUSYBSMObjects::ms, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmBeginRun().

652 {
653  // helper lambda to check if a string contains a substring
654  const auto contains = [](const std::string &s, const std::string &sub) -> bool {
655  return s.find(sub) != std::string::npos;
656  };
657 
658  // helper lambda to check if a string contains any of a list of substrings
659  const auto containsAny = [](const std::string &s, const std::vector<std::string> &subs) -> bool {
660  for (const auto &sub : subs) {
661  if (s.find(sub) != std::string::npos) return true;
662  }
663  return false;
664  };
665 
666  // helper lambda to check if string s is any of the strings in vector ms
667  const auto isAnyOf = [](const std::string &s, const std::vector<std::string>& ms) -> bool {
668  for (const auto &m : ms) {
669  if (s == m) return true;
670  }
671  return false;
672  };
673 
674  // tmadlener, 20.08.2017:
675  // define the valid module names for the different "levels", to add a little bit more stability
676  // to the checking compared to just doing some name matching.
677  // Note, that the name matching is not completely remved, since at level 4 and 5 some of the
678  // valid modules are the same, so that the name matching is still needed.
679  // With the current definition this yields the exact same levels as before, but weeds out some
680  // of the "false" positives at level 3 (naming matches also to some HLTMuonL1TFilter modules due to
681  // the 'forIterL3' in the name)
682  const std::string l1Filter = "HLTMuonL1TFilter";
683  const std::string l2Filter = "HLTMuonL2FromL1TPreFilter";
684  const std::vector<std::string> l3Filters = {"HLTMuonDimuonL3Filter", "HLTMuonL3PreFilter"};
685  const std::vector<std::string> l4Filters = {"HLTDisplacedmumuFilter", "HLTDiMuonGlbTrkFilter",
686  "HLTMuonTrackMassFilter"};
687  const std::vector<std::string> l5Filters = {"HLTmumutkFilter", "HLT2MuonMuonDZ", "HLTDisplacedmumuFilter"};
688 
689  if (contains(moduleName, "Filter") && hltConfig.moduleEDMType(moduleName) == "EDFilter") {
690  if (contains(moduleName, "L1") && !contains(moduleName, "ForIterL3") &&
691  hltConfig.moduleType(moduleName) == l1Filter) {
692  return 1;
693  }
694  if (contains(moduleName, "L2") && hltConfig.moduleType(moduleName) == l2Filter) {
695  return 2;
696  }
697  if (contains(moduleName, "L3") && isAnyOf(hltConfig.moduleType(moduleName), l3Filters)) {
698  return 3;
699  }
700  if (containsAny(moduleName, {"DisplacedmumuFilter", "DiMuon", "MuonL3Filtered", "TrackMassFiltered"}) &&
701  isAnyOf(hltConfig.moduleType(moduleName), l4Filters)) {
702  return 4;
703  }
704  if (containsAny(moduleName, {"Vertex", "Dz"}) &&
705  isAnyOf(hltConfig.moduleType(moduleName), l5Filters)) {
706  return 5;
707  }
708  }
709 
710  return -1;
711 }
const std::string moduleType(const std::string &module) const
C++ class name of module.
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
const std::string moduleEDMType(const std::string &module) const
C++ base class name of module.
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
susybsm::MuonSegment ms
Definition: classes.h:31
int HeavyFlavorValidation::getMotherId ( const Candidate p)
private

Definition at line 544 of file HeavyFlavorValidation.cc.

References reco::Candidate::mother(), and reco::Candidate::pdgId().

Referenced by analyze().

544  {
545  const Candidate* mother = p->mother();
546  if( mother ){
547  if( mother->pdgId() == p->pdgId() ){
548  return getMotherId(mother);
549  }else{
550  return mother->pdgId();
551  }
552  }else{
553  return 0;
554  }
555 }
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
int getMotherId(const Candidate *p)
virtual int pdgId() const =0
PDG identifier.
void HeavyFlavorValidation::match ( MonitorElement me,
vector< LeafCandidate > &  from,
vector< LeafCandidate > &  to,
double  deltaRMatchingCut,
vector< int > &  map 
)
private

Definition at line 557 of file HeavyFlavorValidation.cc.

References PVValHelper::eta, MonitorElement::Fill(), mps_fire::i, gen::k, and phi.

Referenced by analyze().

557  {
558  vector<double> dR(from.size());
559  for(size_t i=0; i<from.size(); i++){
560  map[i] = -1;
561  dR[i] = 10.;
562  //find closest
563  for(size_t j=0; j<to.size(); j++){
564  double dRtmp = deltaR<double>(from[i].eta(), from[i].phi(), to[j].eta(), to[j].phi());
565  if( dRtmp < dR[i] ){
566  dR[i] = dRtmp;
567  map[i] = j;
568  }
569  }
570  //fill matching histo
571  if( map[i] != -1 ){
572  me->Fill( to[map[i]].eta()-from[i].eta(), deltaPhi<double>(to[map[i]].phi(), from[i].phi()) );
573  }
574  //apply matching cut
575  if( dR[i] > dRMatchingCut ){
576  map[i] = -1;
577  }
578  //remove duplication
579  if( map[i] != -1 ){
580  for(size_t k=0; k<i; k++){
581  if( map[k] != -1 && map[i] == map[k] ){
582  if( dR[i] < dR[k] ){
583  map[k] = -1;
584  }else{
585  map[i] = -1;
586  }
587  break;
588  }
589  }
590  }
591  }
592 }
void Fill(long long x)
int k[5][pyjets_maxn]
void HeavyFlavorValidation::myBook1D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  label,
TString  title 
)
private

Definition at line 636 of file HeavyFlavorValidation.cc.

References DQMStore::IBooker::book1D(), h, mps_fire::i, createfilelist::int, and dataset::name.

Referenced by bookHistograms().

637 {
638 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
639  int binsN = bins.size()==3 ? (int)bins[0]+1 : bins.size();
640  Double_t *myBins = new Double_t[ binsN ];
641  for(int i=0; i<binsN; i++){
642  myBins[i] = bins.size()==3 ? bins[1] + i*(bins[2]-bins[1])/bins[0] : bins[i] ;
643  }
644  TH1F *h = new TH1F( name, name, binsN-1, myBins );
645  h->SetXTitle(label);
646  h->SetTitle(title);
647  ME[name] = ibooker.book1D( name.Data(), h );
648  delete h;
649 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: ME.h:11
char const * label
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
void HeavyFlavorValidation::myBook1D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  label 
)
inlineprivate

Definition at line 74 of file HeavyFlavorValidation.cc.

References edm::moduleName(), and AlCaHLTBitMon_QueryRunRegistry::string.

74  {
75  myBook1D(ibooker, name, xBins, label, name );
76  }
char const * label
void myBook1D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString label, TString title)
void HeavyFlavorValidation::myBook2D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  xLabel,
vector< double > &  yBins,
TString  yLabel,
TString  title 
)
private

Definition at line 594 of file HeavyFlavorValidation.cc.

References DQMStore::IBooker::book2D(), PVValHelper::eta, h, mps_fire::i, createfilelist::int, dataset::name, and EnergyCorrector::pt.

Referenced by bookHistograms().

595 {
596 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
597  int ptN = ptBins.size()==3 ? (int)ptBins[0]+1 : ptBins.size();
598  Double_t *pt = new Double_t[ ptN ];
599  for(int i=0; i<ptN; i++){
600  pt[i] = ptBins.size()==3 ? ptBins[1] + i*(ptBins[2]-ptBins[1])/ptBins[0] : ptBins[i] ;
601  }
602  int etaN = etaBins.size()==3 ? (int)etaBins[0]+1 : etaBins.size();
603  Double_t *eta = new Double_t[ etaN ];
604  for(int i=0; i<etaN; i++){
605  eta[i] = etaBins.size()==3 ? etaBins[1] + i*(etaBins[2]-etaBins[1])/etaBins[0] : etaBins[i] ;
606  }
607  TH2F *h = new TH2F( name, name, ptN-1, pt, etaN-1, eta );
608  h->SetXTitle(ptLabel);
609  h->SetYTitle(etaLabel);
610  h->SetTitle(title);
611  ME[name] = ibooker.book2D( name.Data(), h );
612  delete h;
613 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: ME.h:11
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
void HeavyFlavorValidation::myBook2D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  xLabel,
vector< double > &  yBins,
TString  yLabel 
)
inlineprivate

Definition at line 66 of file HeavyFlavorValidation.cc.

66  {
67  myBook2D(ibooker, name, xBins, xLabel, yBins, yLabel, name);
68  }
void myBook2D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
void HeavyFlavorValidation::myBookProfile2D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  xLabel,
vector< double > &  yBins,
TString  yLabel,
TString  title 
)
private

Definition at line 615 of file HeavyFlavorValidation.cc.

References DQMStore::IBooker::bookProfile2D(), PVValHelper::eta, h, mps_fire::i, createfilelist::int, dataset::name, and EnergyCorrector::pt.

Referenced by bookHistograms().

616 {
617 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
618  int ptN = ptBins.size()==3 ? (int)ptBins[0]+1 : ptBins.size();
619  Double_t *pt = new Double_t[ ptN ];
620  for(int i=0; i<ptN; i++){
621  pt[i] = ptBins.size()==3 ? ptBins[1] + i*(ptBins[2]-ptBins[1])/ptBins[0] : ptBins[i] ;
622  }
623  int etaN = etaBins.size()==3 ? (int)etaBins[0]+1 : etaBins.size();
624  Double_t *eta = new Double_t[ etaN ];
625  for(int i=0; i<etaN; i++){
626  eta[i] = etaBins.size()==3 ? etaBins[1] + i*(etaBins[2]-etaBins[1])/etaBins[0] : etaBins[i] ;
627  }
628  TProfile2D *h = new TProfile2D( name, name, ptN-1, pt, etaN-1, eta );
629  h->SetXTitle(ptLabel);
630  h->SetYTitle(etaLabel);
631  h->SetTitle(title);
632  ME[name] = ibooker.bookProfile2D( name.Data(), h );
633  delete h;
634 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: ME.h:11
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:114
void HeavyFlavorValidation::myBookProfile2D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  xLabel,
vector< double > &  yBins,
TString  yLabel 
)
inlineprivate

Definition at line 70 of file HeavyFlavorValidation.cc.

References label.

70  {
71  myBookProfile2D(ibooker, name, xBins, xLabel, yBins, yLabel, name);
72  }
void myBookProfile2D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)

Member Data Documentation

vector<double> HeavyFlavorValidation::deltaEtaBins
private

Definition at line 107 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::deltaPhiBins
private

Definition at line 108 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::dimuonDRBins
private

Definition at line 114 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::dimuonEtaBins
private

Definition at line 113 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::dimuonPtBins
private

Definition at line 112 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

string HeavyFlavorValidation::dqmFolder
private

Definition at line 89 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<pair<string,int> > HeavyFlavorValidation::filterNamesLevels
private

Definition at line 116 of file HeavyFlavorValidation.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

double HeavyFlavorValidation::genGlobDeltaRMatchingCut
private

Definition at line 103 of file HeavyFlavorValidation.cc.

Referenced by analyze().

InputTag HeavyFlavorValidation::genParticlesTag
private

Definition at line 99 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<GenParticleCollection> HeavyFlavorValidation::genParticlesToken
private

Definition at line 100 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

double HeavyFlavorValidation::globL1DeltaRMatchingCut
private

Definition at line 104 of file HeavyFlavorValidation.cc.

Referenced by analyze().

double HeavyFlavorValidation::globL2DeltaRMatchingCut
private

Definition at line 105 of file HeavyFlavorValidation.cc.

Referenced by analyze().

double HeavyFlavorValidation::globL3DeltaRMatchingCut
private

Definition at line 106 of file HeavyFlavorValidation.cc.

Referenced by analyze().

map<TString, MonitorElement *> HeavyFlavorValidation::ME
private

Definition at line 115 of file HeavyFlavorValidation.cc.

vector<int> HeavyFlavorValidation::motherIDs
private

Definition at line 102 of file HeavyFlavorValidation.cc.

Referenced by analyze().

vector<double> HeavyFlavorValidation::muonEtaBins
private

Definition at line 110 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

const double HeavyFlavorValidation::muonMass
private

Definition at line 117 of file HeavyFlavorValidation.cc.

Referenced by analyze().

vector<double> HeavyFlavorValidation::muonPhiBins
private

Definition at line 111 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::muonPtBins
private

Definition at line 109 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

InputTag HeavyFlavorValidation::recoMuonsTag
private

Definition at line 97 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<MuonCollection> HeavyFlavorValidation::recoMuonsToken
private

Definition at line 98 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

string HeavyFlavorValidation::triggerPathName
private

Definition at line 91 of file HeavyFlavorValidation.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

string HeavyFlavorValidation::triggerProcessName
private
InputTag HeavyFlavorValidation::triggerResultsTag
private

Definition at line 95 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<TriggerResults> HeavyFlavorValidation::triggerResultsToken
private

Definition at line 96 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<TriggerEvent> HeavyFlavorValidation::triggerSummaryAODTag
private

Definition at line 94 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<TriggerEventWithRefs> HeavyFlavorValidation::triggerSummaryRAWTag
private

Definition at line 93 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().