CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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:

Public Member Functions

 HeavyFlavorValidation (const edm::ParameterSet &)
 
 ~HeavyFlavorValidation () override
 

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
< GenParticleCollection
genParticlesToken
 
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 53 of file HeavyFlavorValidation.cc.

Constructor & Destructor Documentation

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

Definition at line 147 of file HeavyFlavorValidation.cc.

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

148  : //get parameters
149  dqmFolder(pset.getUntrackedParameter<string>("DQMFolder")),
150  triggerProcessName(pset.getUntrackedParameter<string>("TriggerProcessName")),
151  triggerPathName(pset.getUntrackedParameter<string>("TriggerPathName")),
152  motherIDs(pset.getUntrackedParameter<vector<int> >("MotherIDs")),
153  genGlobDeltaRMatchingCut(pset.getUntrackedParameter<double>("GenGlobDeltaRMatchingCut")),
154  globL1DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL1DeltaRMatchingCut")),
155  globL2DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL2DeltaRMatchingCut")),
156  globL3DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL3DeltaRMatchingCut")),
157  deltaEtaBins(pset.getUntrackedParameter<vector<double> >("DeltaEtaBins")),
158  deltaPhiBins(pset.getUntrackedParameter<vector<double> >("DeltaPhiBins")),
159  muonPtBins(pset.getUntrackedParameter<vector<double> >("MuonPtBins")),
160  muonEtaBins(pset.getUntrackedParameter<vector<double> >("MuonEtaBins")),
161  muonPhiBins(pset.getUntrackedParameter<vector<double> >("MuonPhiBins")),
162  dimuonPtBins(pset.getUntrackedParameter<vector<double> >("DimuonPtBins")),
163  dimuonEtaBins(pset.getUntrackedParameter<vector<double> >("DimuonEtaBins")),
164  dimuonDRBins(pset.getUntrackedParameter<vector<double> >("DimuonDRBins")),
165  muonMass(0.106) {
166  triggerSummaryRAWTag = consumes<TriggerEventWithRefs>(
167  InputTag(pset.getUntrackedParameter<string>("TriggerSummaryRAW"), "", triggerProcessName));
169  consumes<TriggerEvent>(InputTag(pset.getUntrackedParameter<string>("TriggerSummaryAOD"), "", triggerProcessName));
170  triggerResultsTag = InputTag(pset.getUntrackedParameter<string>("TriggerResults"), "", triggerProcessName);
171  triggerResultsToken = consumes<TriggerResults>(triggerResultsTag);
172  recoMuonsTag = pset.getParameter<InputTag>("RecoMuons");
173  recoMuonsToken = consumes<MuonCollection>(recoMuonsTag);
174  genParticlesTag = pset.getParameter<InputTag>("GenParticles");
175  genParticlesToken = consumes<GenParticleCollection>(genParticlesTag);
176 }
T getUntrackedParameter(std::string const &, T const &) const
EDGetTokenT< TriggerEvent > triggerSummaryAODTag
EDGetTokenT< TriggerEventWithRefs > triggerSummaryRAWTag
EDGetTokenT< MuonCollection > recoMuonsToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EDGetTokenT< GenParticleCollection > genParticlesToken
EDGetTokenT< TriggerResults > triggerResultsToken
HeavyFlavorValidation::~HeavyFlavorValidation ( )
override

Definition at line 930 of file HeavyFlavorValidation.cc.

930 {}

Member Function Documentation

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

Definition at line 434 of file HeavyFlavorValidation.cc.

References funct::abs(), RecoTauCleanerPlugins::charge, PVValHelper::eta, validate-o2o-wbm::f, filterNamesLevels, spr::find(), first, genGlobDeltaRMatchingCut, runTauDisplay::genMuons, genParticleCandidates2GenParticles_cfi::genParticles, genParticlesTag, genParticlesToken, edm::Event::getByToken(), getMotherId(), globL1DeltaRMatchingCut, globL2DeltaRMatchingCut, globL3DeltaRMatchingCut, mps_fire::i, HLT_FULL_cff::InputTag, edm::HandleBase::isValid(), dqmiolumiharvest::j, relativeConstraints::keys, LogDebug, match(), motherIDs, muonMass, AlCaHLTBitMon_ParallelJobs::p, phi, DiDispStaMuonMonitor_cfi::pt, recoMuonsTag, recoMuonsToken, edm::second(), edm::TriggerNames::size(), findQualityFiles::size, HLT_FULL_cff::track, trigger::TriggerL1Mu, trigger::TriggerMuon, edm::TriggerNames::triggerName(), L1TMuonDQMOffline_cfi::triggerNames, edm::Event::triggerNames(), triggerPathName, triggerProcessName, triggerResults, triggerResultsTag, triggerResultsToken, triggerSummaryAODTag, triggerSummaryRAWTag, x, y, and z.

434  {
435  if (filterNamesLevels.empty()) {
436  return;
437  }
438  //access the containers and create LeafCandidate copies
439  vector<LeafCandidate> genMuons;
441  iEvent.getByToken(genParticlesToken, genParticles);
442  if (genParticles.isValid()) {
443  for (GenParticleCollection::const_iterator p = genParticles->begin(); p != genParticles->end(); ++p) {
444  if (p->status() == 1 && std::abs(p->pdgId()) == 13 &&
445  (find(motherIDs.begin(), motherIDs.end(), -1) != motherIDs.end() ||
446  find(motherIDs.begin(), motherIDs.end(), getMotherId(&(*p))) != motherIDs.end())) {
447  genMuons.push_back(*p);
448  }
449  }
450  } else {
451  LogDebug("HLTriggerOfflineHeavyFlavor") << "Could not access GenParticleCollection" << endl;
452  }
453  sort(genMuons.begin(), genMuons.end(), GreaterByPt<LeafCandidate>());
454  ME["genMuon_size"]->Fill(genMuons.size());
455  LogDebug("HLTriggerOfflineHeavyFlavor")
456  << "GenParticleCollection from " << genParticlesTag << " has size: " << genMuons.size() << endl;
457 
458  vector<LeafCandidate> globMuons;
459  vector<LeafCandidate> globMuons_position;
460  Handle<MuonCollection> recoMuonsHandle;
461  iEvent.getByToken(recoMuonsToken, recoMuonsHandle);
462  if (recoMuonsHandle.isValid()) {
463  for (MuonCollection::const_iterator p = recoMuonsHandle->begin(); p != recoMuonsHandle->end(); ++p) {
464  if (p->isGlobalMuon()) {
465  globMuons.push_back(*p);
466  globMuons_position.push_back(LeafCandidate(p->charge(),
467  math::XYZTLorentzVector(p->outerTrack()->innerPosition().x(),
468  p->outerTrack()->innerPosition().y(),
469  p->outerTrack()->innerPosition().z(),
470  0.)));
471  }
472  }
473  } else {
474  LogDebug("HLTriggerOfflineHeavyFlavor") << "Could not access reco Muons" << endl;
475  }
476  ME["globMuon_size"]->Fill(globMuons.size());
477  LogDebug("HLTriggerOfflineHeavyFlavor")
478  << "Global Muons from " << recoMuonsTag << " has size: " << globMuons.size() << endl;
479 
480  // access RAW trigger event
481  vector<vector<LeafCandidate> > muonsAtFilter;
482  vector<vector<LeafCandidate> > muonPositionsAtFilter;
483  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
484  muonsAtFilter.push_back(vector<LeafCandidate>());
485  muonPositionsAtFilter.push_back(vector<LeafCandidate>());
486  }
487  Handle<TriggerEventWithRefs> rawTriggerEvent;
488  iEvent.getByToken(triggerSummaryRAWTag, rawTriggerEvent);
489  if (rawTriggerEvent.isValid()) {
490  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
491  size_t index = rawTriggerEvent->filterIndex(InputTag(filterNamesLevels[i].first, "", triggerProcessName));
492  if (index < rawTriggerEvent->size()) {
493  if (filterNamesLevels[i].second == 1) {
494  vector<L1MuonParticleRef> l1Cands;
495  rawTriggerEvent->getObjects(index, TriggerL1Mu, l1Cands);
496  for (size_t j = 0; j < l1Cands.size(); j++) {
497  muonsAtFilter[i].push_back(*l1Cands[j]);
498  }
499  } else {
500  vector<RecoChargedCandidateRef> hltCands;
501  rawTriggerEvent->getObjects(index, TriggerMuon, hltCands);
502  for (size_t j = 0; j < hltCands.size(); j++) {
503  muonsAtFilter[i].push_back(*hltCands[j]);
504  if (filterNamesLevels[i].second == 2) {
505  muonPositionsAtFilter[i].push_back(
506  LeafCandidate(hltCands[j]->charge(),
507  math::XYZTLorentzVector(hltCands[j]->track()->innerPosition().x(),
508  hltCands[j]->track()->innerPosition().y(),
509  hltCands[j]->track()->innerPosition().z(),
510  0.)));
511  }
512  }
513  }
514  }
515  ME[TString::Format("filt%dMuon_size", int(i + 1))]->Fill(muonsAtFilter[i].size());
516  LogDebug("HLTriggerOfflineHeavyFlavor")
517  << "Filter \"" << filterNamesLevels[i].first << "\" has " << muonsAtFilter[i].size() << " muons" << endl;
518  }
519  } else {
520  LogDebug("HLTriggerOfflineHeavyFlavor") << "Could not access RAWTriggerEvent" << endl;
521  }
522 
523  // access AOD trigger event
524  vector<LeafCandidate> pathMuons;
525  Handle<TriggerEvent> aodTriggerEvent;
526  iEvent.getByToken(triggerSummaryAODTag, aodTriggerEvent);
527  if (aodTriggerEvent.isValid()) {
528  TriggerObjectCollection allObjects = aodTriggerEvent->getObjects();
529  for (int i = 0; i < aodTriggerEvent->sizeFilters(); i++) {
530  if (aodTriggerEvent->filterTag(i) == InputTag((filterNamesLevels.end() - 1)->first, "", triggerProcessName)) {
531  Keys keys = aodTriggerEvent->filterKeys(i);
532  for (size_t j = 0; j < keys.size(); j++) {
533  pathMuons.push_back(LeafCandidate(
534  allObjects[keys[j]].id() > 0 ? 1 : -1,
536  allObjects[keys[j]].pt(), allObjects[keys[j]].eta(), allObjects[keys[j]].phi(), muonMass)));
537  }
538  }
539  }
540  ME["pathMuon_size"]->Fill(pathMuons.size());
541  LogDebug("HLTriggerOfflineHeavyFlavor")
542  << "Path \"" << triggerPathName << "\" has " << pathMuons.size() << " muons at last filter \""
543  << (filterNamesLevels.end() - 1)->first << "\"" << endl;
544  } else {
545  LogDebug("HLTriggerOfflineHeavyFlavor") << "Could not access AODTriggerEvent" << endl;
546  }
547 
548  // access Trigger Results
549  bool triggerFired = false;
551  iEvent.getByToken(triggerResultsToken, triggerResults);
552  if (triggerResults.isValid()) {
553  LogDebug("HLTriggerOfflineHeavyFlavor") << "Successfully initialized " << triggerResultsTag << endl;
554  const edm::TriggerNames &triggerNames = iEvent.triggerNames(*triggerResults);
555  bool hlt_exists = false;
556  for (unsigned int i = 0; i != triggerNames.size(); i++) {
557  TString hlt_name = triggerNames.triggerName(i);
558  if (hlt_name.Contains(triggerPathName)) {
559  triggerFired = triggerResults->accept(i);
560  hlt_exists = true;
561  break;
562  }
563  }
564  if (!hlt_exists) {
565  LogDebug("HLTriggerOfflineHeavyFlavor") << triggerResultsTag << " has no trigger: " << triggerPathName << endl;
566  }
567  } else {
568  LogDebug("HLTriggerOfflineHeavyFlavor") << "Could not initialize " << triggerResultsTag << endl;
569  }
570 
571  //create matching maps
572  vector<int> glob_gen(genMuons.size(), -1);
573  match(ME["globGen_deltaEtaDeltaPhi"], genMuons, globMuons, genGlobDeltaRMatchingCut, glob_gen);
574  vector<vector<int> > filt_glob;
575  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
576  filt_glob.push_back(vector<int>(globMuons.size(), -1));
577  if (filterNamesLevels[i].second == 1) {
578  match(ME[TString::Format("filt%dGlob_deltaEtaDeltaPhi", int(i + 1))],
579  globMuons_position,
580  muonsAtFilter[i],
582  filt_glob[i]);
583  } else if (filterNamesLevels[i].second == 2) {
584  match(ME[TString::Format("filt%dGlob_deltaEtaDeltaPhi", int(i + 1))],
585  globMuons_position,
586  muonPositionsAtFilter[i],
588  filt_glob[i]);
589  } else if (filterNamesLevels[i].second > 2) {
590  match(ME[TString::Format("filt%dGlob_deltaEtaDeltaPhi", int(i + 1))],
591  globMuons,
592  muonsAtFilter[i],
594  filt_glob[i]);
595  }
596  }
597  vector<int> path_glob(globMuons.size(), -1);
598  if ((filterNamesLevels.end() - 1)->second == 1) {
599  match(ME["pathGlob_deltaEtaDeltaPhi"], globMuons_position, pathMuons, globL1DeltaRMatchingCut, path_glob);
600  } else if ((filterNamesLevels.end() - 1)->second == 2) {
601  match(ME["pathGlob_deltaEtaDeltaPhi"], globMuons, pathMuons, globL2DeltaRMatchingCut, path_glob);
602  } else if ((filterNamesLevels.end() - 1)->second > 2) {
603  match(ME["pathGlob_deltaEtaDeltaPhi"], globMuons, pathMuons, globL3DeltaRMatchingCut, path_glob);
604  }
605 
606  //fill histos
607  bool first = true;
608  for (size_t i = 0; i < genMuons.size(); i++) {
609  ME["genMuon_genEtaPt"]->Fill(genMuons[i].eta(), genMuons[i].pt());
610  ME["genMuon_genEtaPhi"]->Fill(genMuons[i].eta(), genMuons[i].phi());
611  if (glob_gen[i] != -1) {
612  ME["resGlobGen_genEtaPt"]->Fill(
613  genMuons[i].eta(), genMuons[i].pt(), (globMuons[glob_gen[i]].pt() - genMuons[i].pt()) / genMuons[i].pt());
614  ME["globMuon_genEtaPt"]->Fill(genMuons[i].eta(), genMuons[i].pt());
615  ME["globMuon_genEtaPhi"]->Fill(genMuons[i].eta(), genMuons[i].phi());
616  ME["globMuon_recoEtaPt"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt());
617  ME["globMuon_recoEtaPhi"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].phi());
618  for (size_t f = 0; f < filterNamesLevels.size(); f++) {
619  if (filt_glob[f][glob_gen[i]] != -1) {
620  ME[TString::Format("resFilt%dGlob_recoEtaPt", int(f + 1))]->Fill(
621  globMuons[glob_gen[i]].eta(),
622  globMuons[glob_gen[i]].pt(),
623  (muonsAtFilter[f][filt_glob[f][glob_gen[i]]].pt() - globMuons[glob_gen[i]].pt()) /
624  globMuons[glob_gen[i]].pt());
625  ME[TString::Format("filt%dMuon_recoEtaPt", int(f + 1))]->Fill(globMuons[glob_gen[i]].eta(),
626  globMuons[glob_gen[i]].pt());
627  ME[TString::Format("filt%dMuon_recoEtaPhi", int(f + 1))]->Fill(globMuons[glob_gen[i]].eta(),
628  globMuons[glob_gen[i]].phi());
629  } else {
630  break;
631  }
632  }
633  if (path_glob[glob_gen[i]] != -1) {
634  ME["resPathGlob_recoEtaPt"]->Fill(
635  globMuons[glob_gen[i]].eta(),
636  globMuons[glob_gen[i]].pt(),
637  (pathMuons[path_glob[glob_gen[i]]].pt() - globMuons[glob_gen[i]].pt()) / globMuons[glob_gen[i]].pt());
638  ME["pathMuon_recoEtaPt"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt());
639  ME["pathMuon_recoEtaPhi"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].phi());
640  }
641  //highest pt muon
642  if (first) {
643  first = false;
644  if (triggerFired) {
645  ME["resultMuon_recoEtaPt"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt());
646  ME["resultMuon_recoEtaPhi"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].phi());
647  }
648  }
649  }
650  }
651 
652  //fill dimuon histograms (highest pT, opposite charge)
653  int secondMuon = 0;
654  for (size_t j = 1; j < genMuons.size(); j++) {
655  if (genMuons[0].charge() * genMuons[j].charge() == -1) {
656  secondMuon = j;
657  break;
658  }
659  }
660  if (secondMuon > 0) {
661  //two generated
662  double genDimuonPt = (genMuons[0].p4() + genMuons[secondMuon].p4()).pt();
663  double genDimuonEta = (genMuons[0].p4() + genMuons[secondMuon].p4()).eta();
664  double genDimuonRap = (genMuons[0].p4() + genMuons[secondMuon].p4()).Rapidity();
665  double genDimuonDR = deltaR<LeafCandidate, LeafCandidate>(genMuons[0], genMuons[secondMuon]);
666  bool highPt = genMuons[0].pt() > 7. && genMuons[secondMuon].pt() > 7;
667  ME["genDimuon_genEtaPt"]->Fill(genDimuonEta, genDimuonPt);
668  ME["genDimuon_genRapPt"]->Fill(genDimuonRap, genDimuonPt);
669  if (highPt)
670  ME["genDimuon_genPtDR"]->Fill(genDimuonPt, genDimuonDR);
671  //two global
672  if (glob_gen[0] != -1 && glob_gen[secondMuon] != -1) {
673  ME["globDimuon_genEtaPt"]->Fill(genDimuonEta, genDimuonPt);
674  ME["globDimuon_genRapPt"]->Fill(genDimuonRap, genDimuonPt);
675  if (highPt)
676  ME["globDimuon_genPtDR"]->Fill(genDimuonPt, genDimuonDR);
677  double globDimuonPt = (globMuons[glob_gen[0]].p4() + globMuons[glob_gen[secondMuon]].p4()).pt();
678  double globDimuonEta = (globMuons[glob_gen[0]].p4() + globMuons[glob_gen[secondMuon]].p4()).eta();
679  double globDimuonRap = (globMuons[glob_gen[0]].p4() + globMuons[glob_gen[secondMuon]].p4()).Rapidity();
680  double globDimuonDR =
681  deltaR<LeafCandidate, LeafCandidate>(globMuons[glob_gen[0]], globMuons[glob_gen[secondMuon]]);
682  double globDimuonDRpos = deltaR<LeafCandidate, LeafCandidate>(globMuons_position[glob_gen[0]],
683  globMuons_position[glob_gen[secondMuon]]);
684  ME["globDimuon_recoEtaPt"]->Fill(globDimuonEta, globDimuonPt);
685  ME["globDimuon_recoRapPt"]->Fill(globDimuonRap, globDimuonPt);
686  if (highPt)
687  ME["globDimuon_recoPtDR"]->Fill(globDimuonPt, globDimuonDR);
688  if (highPt)
689  ME["globDimuon_recoPtDRpos"]->Fill(globDimuonPt, globDimuonDRpos);
690  //two filter objects
691  for (size_t f = 0; f < filterNamesLevels.size(); f++) {
692  if (filt_glob[f][glob_gen[0]] != -1 && filt_glob[f][glob_gen[secondMuon]] != -1) {
693  ME[TString::Format("diFilt%dDimuon_recoEtaPt", int(f + 1))]->Fill(globDimuonEta, globDimuonPt);
694  ME[TString::Format("diFilt%dDimuon_recoRapPt", int(f + 1))]->Fill(globDimuonRap, globDimuonPt);
695  if (highPt)
696  ME[TString::Format("diFilt%dDimuon_recoPtDR", int(f + 1))]->Fill(globDimuonPt, globDimuonDR);
697  if (highPt)
698  ME[TString::Format("diFilt%dDimuon_recoPtDRpos", int(f + 1))]->Fill(globDimuonPt, globDimuonDRpos);
699  } else {
700  break;
701  }
702  }
703  //one filter object
704  for (size_t f = 0; f < filterNamesLevels.size(); f++) {
705  if (filt_glob[f][glob_gen[0]] != -1 || filt_glob[f][glob_gen[secondMuon]] != -1) {
706  ME[TString::Format("filt%dDimuon_recoEtaPt", int(f + 1))]->Fill(globDimuonEta, globDimuonPt);
707  ME[TString::Format("filt%dDimuon_recoRapPt", int(f + 1))]->Fill(globDimuonRap, globDimuonPt);
708  if (highPt)
709  ME[TString::Format("filt%dDimuon_recoPtDR", int(f + 1))]->Fill(globDimuonPt, globDimuonDR);
710  if (highPt)
711  ME[TString::Format("filt%dDimuon_recoPtDRpos", int(f + 1))]->Fill(globDimuonPt, globDimuonDRpos);
712  } else {
713  break;
714  }
715  }
716  //two path objects
717  if (path_glob[glob_gen[0]] != -1 && path_glob[glob_gen[secondMuon]] != -1) {
718  ME["diPathDimuon_recoEtaPt"]->Fill(globDimuonEta, globDimuonPt);
719  ME["diPathDimuon_recoRapPt"]->Fill(globDimuonRap, globDimuonPt);
720  if (highPt)
721  ME["diPathDimuon_recoPtDR"]->Fill(globDimuonPt, globDimuonDR);
722  if (highPt)
723  ME["diPathDimuon_recoPtDRpos"]->Fill(globDimuonPt, globDimuonDRpos);
724  }
725  //one path object
726  if (path_glob[glob_gen[0]] != -1 || path_glob[glob_gen[secondMuon]] != -1) {
727  ME["pathDimuon_recoEtaPt"]->Fill(globDimuonEta, globDimuonPt);
728  ME["pathDimuon_recoRapPt"]->Fill(globDimuonRap, globDimuonPt);
729  if (highPt)
730  ME["pathDimuon_recoPtDR"]->Fill(globDimuonPt, globDimuonDR);
731  if (highPt)
732  ME["pathDimuon_recoPtDRpos"]->Fill(globDimuonPt, globDimuonDRpos);
733  }
734  //trigger result
735  if (triggerFired) {
736  ME["resultDimuon_recoEtaPt"]->Fill(globDimuonEta, globDimuonPt);
737  ME["resultDimuon_recoRapPt"]->Fill(globDimuonRap, globDimuonPt);
738  if (highPt)
739  ME["resultDimuon_recoPtDR"]->Fill(globDimuonPt, globDimuonDR);
740  if (highPt)
741  ME["resultDimuon_recoPtDRpos"]->Fill(globDimuonPt, globDimuonDRpos);
742  }
743  }
744  }
745 }
std::size_t size() const
Definition: TriggerNames.cc:59
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
enum start value shifted to 81 so as to avoid clashes with PDG codes
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
EDGetTokenT< TriggerEvent > triggerSummaryAODTag
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:275
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)
EDGetTokenT< TriggerEventWithRefs > triggerSummaryRAWTag
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static std::string const triggerResults
Definition: EdmProvDump.cc:44
bool isValid() const
Definition: HandleBase.h:70
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
EDGetTokenT< MuonCollection > recoMuonsToken
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:50
std::vector< size_type > Keys
EDGetTokenT< GenParticleCollection > genParticlesToken
EDGetTokenT< TriggerResults > triggerResultsToken
vector< pair< string, int > > filterNamesLevels
tuple size
Write out results.
#define LogDebug(id)
void HeavyFlavorValidation::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 218 of file HeavyFlavorValidation.cc.

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

220  {
221  ibooker.cd();
223 
224  // create Monitor Elements
225  // Eta Pt Single
226  myBook2D(ibooker, "genMuon_genEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
227  myBook2D(ibooker, "globMuon_genEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
228  myBook2D(ibooker, "globMuon_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
229 
230  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
231  myBook2D(ibooker,
232  TString::Format("filt%dMuon_recoEtaPt", int(i + 1)),
233  muonEtaBins,
234  "#mu eta",
235  muonPtBins,
236  " #mu pT (GeV)",
238  }
239  myBook2D(ibooker, "pathMuon_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)", triggerPathName);
240  myBook2D(ibooker, "resultMuon_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
241  // Eta Pt Single Resolution
242  myBookProfile2D(ibooker, "resGlobGen_genEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
243  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
244  myBookProfile2D(ibooker,
245  TString::Format("resFilt%dGlob_recoEtaPt", int(i + 1)),
246  muonEtaBins,
247  "#mu eta",
248  muonPtBins,
249  " #mu pT (GeV)",
251  }
253  ibooker, "resPathGlob_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)", triggerPathName);
254  // Eta Pt Double
255  myBook2D(ibooker, "genDimuon_genEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
256  myBook2D(ibooker, "globDimuon_genEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
257  myBook2D(ibooker, "globDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
258  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
259  myBook2D(ibooker,
260  TString::Format("filt%dDimuon_recoEtaPt", int(i + 1)),
262  "#mu#mu eta",
263  dimuonPtBins,
264  " #mu#mu pT (GeV)",
266  }
267  myBook2D(
268  ibooker, "pathDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)", triggerPathName);
269  myBook2D(ibooker, "resultDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
270  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
271  myBook2D(ibooker,
272  TString::Format("diFilt%dDimuon_recoEtaPt", int(i + 1)),
274  "#mu#mu eta",
275  dimuonPtBins,
276  " #mu#mu pT (GeV)",
278  }
279  myBook2D(
280  ibooker, "diPathDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)", triggerPathName);
281  // Eta Phi Single
282  myBook2D(ibooker, "genMuon_genEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
283  myBook2D(ibooker, "globMuon_genEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
284  myBook2D(ibooker, "globMuon_recoEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
285  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
286  myBook2D(ibooker,
287  TString::Format("filt%dMuon_recoEtaPhi", int(i + 1)),
288  muonEtaBins,
289  "#mu eta",
290  muonPhiBins,
291  "#mu phi",
293  }
294  myBook2D(ibooker, "pathMuon_recoEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi", triggerPathName);
295  myBook2D(ibooker, "resultMuon_recoEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
296  // Rap Pt Double
297  myBook2D(ibooker, "genDimuon_genRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
298  myBook2D(ibooker, "globDimuon_genRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
299  myBook2D(ibooker, "globDimuon_recoRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
300  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
301  myBook2D(ibooker,
302  TString::Format("filt%dDimuon_recoRapPt", int(i + 1)),
304  "#mu#mu rapidity",
305  dimuonPtBins,
306  " #mu#mu pT (GeV)",
308  }
309  myBook2D(ibooker,
310  "pathDimuon_recoRapPt",
312  "#mu#mu rapidity",
313  dimuonPtBins,
314  " #mu#mu pT (GeV)",
316  myBook2D(ibooker, "resultDimuon_recoRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
317  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
318  myBook2D(ibooker,
319  TString::Format("diFilt%dDimuon_recoRapPt", int(i + 1)),
321  "#mu#mu rapidity",
322  dimuonPtBins,
323  " #mu#mu pT (GeV)",
325  }
326  myBook2D(ibooker,
327  "diPathDimuon_recoRapPt",
329  "#mu#mu rapidity",
330  dimuonPtBins,
331  " #mu#mu pT (GeV)",
333  // Pt DR Double
334  myBook2D(ibooker, "genDimuon_genPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
335  myBook2D(ibooker, "globDimuon_genPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
336  myBook2D(ibooker, "globDimuon_recoPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
337  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
338  myBook2D(ibooker,
339  TString::Format("filt%dDimuon_recoPtDR", int(i + 1)),
340  dimuonPtBins,
341  " #mu#mu pT (GeV)",
342  dimuonDRBins,
343  "#mu#mu #Delta R at IP",
345  }
346  myBook2D(ibooker,
347  "pathDimuon_recoPtDR",
348  dimuonPtBins,
349  " #mu#mu pT (GeV)",
350  dimuonDRBins,
351  "#mu#mu #Delta R at IP",
353  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
354  myBook2D(ibooker,
355  TString::Format("diFilt%dDimuon_recoPtDR", int(i + 1)),
356  dimuonPtBins,
357  " #mu#mu pT (GeV)",
358  dimuonDRBins,
359  "#mu#mu #Delta R at IP",
361  }
362  myBook2D(ibooker,
363  "diPathDimuon_recoPtDR",
364  dimuonPtBins,
365  " #mu#mu pT (GeV)",
366  dimuonDRBins,
367  "#mu#mu #Delta R at IP",
369  myBook2D(ibooker, "resultDimuon_recoPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
370  // Pt DRpos Double
371  myBook2D(ibooker, "globDimuon_recoPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS");
372  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
373  myBook2D(ibooker,
374  TString::Format("filt%dDimuon_recoPtDRpos", int(i + 1)),
375  dimuonPtBins,
376  " #mu#mu pT (GeV)",
377  dimuonDRBins,
378  "#mu#mu #Delta R in MS",
380  }
381  myBook2D(ibooker,
382  "pathDimuon_recoPtDRpos",
383  dimuonPtBins,
384  " #mu#mu pT (GeV)",
385  dimuonDRBins,
386  "#mu#mu #Delta R in MS",
388  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
389  myBook2D(ibooker,
390  TString::Format("diFilt%dDimuon_recoPtDRpos", int(i + 1)),
391  dimuonPtBins,
392  " #mu#mu pT (GeV)",
393  dimuonDRBins,
394  "#mu#mu #Delta R in MS",
396  }
397  myBook2D(ibooker,
398  "diPathDimuon_recoPtDRpos",
399  dimuonPtBins,
400  " #mu#mu pT (GeV)",
401  dimuonDRBins,
402  "#mu#mu #Delta R in MS",
404  myBook2D(
405  ibooker, "resultDimuon_recoPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS");
406 
407  // Matching
408  myBook2D(ibooker, "globGen_deltaEtaDeltaPhi", deltaEtaBins, "#Delta eta", deltaPhiBins, "#Delta phi");
409  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
410  myBook2D(ibooker,
411  TString::Format("filt%dGlob_deltaEtaDeltaPhi", int(i + 1)),
412  deltaEtaBins,
413  "#Delta eta",
414  deltaPhiBins,
415  "#Delta phi",
417  }
418  myBook2D(
419  ibooker, "pathGlob_deltaEtaDeltaPhi", deltaEtaBins, "#Delta eta", deltaPhiBins, "#Delta phi", triggerPathName);
420  // Size of containers
421  vector<double> sizeBins;
422  sizeBins.push_back(10);
423  sizeBins.push_back(0);
424  sizeBins.push_back(10);
425  myBook1D(ibooker, "genMuon_size", sizeBins, "container size");
426  myBook1D(ibooker, "globMuon_size", sizeBins, "container size");
427  for (size_t i = 0; i < filterNamesLevels.size(); i++) {
428  myBook1D(
429  ibooker, TString::Format("filt%dMuon_size", int(i + 1)), sizeBins, "container size", filterNamesLevels[i].first);
430  }
431  myBook1D(ibooker, "pathMuon_size", sizeBins, "container size", triggerPathName);
432 }
void myBook2D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
void myBookProfile2D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
void myBook1D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString label, TString title)
vector< pair< string, int > > filterNamesLevels
void HeavyFlavorValidation::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 178 of file HeavyFlavorValidation.cc.

References filterNamesLevels, filters, getFilterLevel(), HltComparatorCreateWorkflow::hltConfig, HLTConfigProvider::init(), testEve_cfg::level, LogDebug, HLTConfigProvider::moduleLabels(), convertParamsToOnlineFormat::moduleName, str, AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::triggerNames(), L1TMuonDQMOffline_cfi::triggerNames, triggerPathName, and triggerProcessName.

178  {
179  //discover HLT configuration
181  bool isChanged;
182  if (hltConfig.init(iRun, iSetup, triggerProcessName, isChanged)) {
183  LogDebug("HLTriggerOfflineHeavyFlavor")
184  << "Successfully initialized HLTConfigProvider with process name: " << triggerProcessName << endl;
185  } else {
186  LogWarning("HLTriggerOfflineHeavyFlavor")
187  << "Could not initialize HLTConfigProvider with process name: " << triggerProcessName << endl;
188  return;
189  }
190  vector<string> triggerNames = hltConfig.triggerNames();
191  for (const auto &trigName : triggerNames) {
192  // TString triggerName = trigName;
193  if (trigName.find(triggerPathName) != std::string::npos) {
194  vector<string> moduleNames = hltConfig.moduleLabels(trigName);
195  for (const auto &moduleName : moduleNames) {
196  const int level = getFilterLevel(moduleName, hltConfig);
197  if (level > 0) {
198  filterNamesLevels.push_back({moduleName, level});
199  }
200  }
201  break;
202  }
203  }
204 
205  if (filterNamesLevels.empty()) {
206  LogDebug("HLTriggerOfflineHeavyFlavor") << "Bad Trigger Path: " << triggerPathName << endl;
207  return;
208  } else {
210  str.reserve(
211  512); // avoid too many realloctions in the following loop (allows for filter names with roughly 100 chars each)
212  for (const auto &filters : filterNamesLevels)
213  str = str + " " + filters.first;
214  LogDebug("HLTriggerOfflineHeavyFlavor") << "Trigger Path: " << triggerPathName << " has filters:" << str;
215  }
216 }
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< TPRegexp > filters
Definition: eve_filter.cc:22
int getFilterLevel(const std::string &moduleName, const HLTConfigProvider &hltConfig)
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
tuple level
Definition: testEve_cfg.py:47
Log< level::Warning, false > LogWarning
vector< pair< string, int > > filterNamesLevels
#define str(s)
#define LogDebug(id)
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 868 of file HeavyFlavorValidation.cc.

References edm::contains(), l1Filter_cfi::l1Filter, visualization-live-secondInstance_cfg::m, HLTConfigProvider::moduleEDMType(), HLTConfigProvider::moduleType(), alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmBeginRun().

868  {
869  // helper lambda to check if a string contains a substring
870  const auto contains = [](const std::string &s, const std::string &sub) -> bool {
871  return s.find(sub) != std::string::npos;
872  };
873 
874  // helper lambda to check if a string contains any of a list of substrings
875  const auto containsAny = [](const std::string &s, const std::vector<std::string> &subs) -> bool {
876  for (const auto &sub : subs) {
877  if (s.find(sub) != std::string::npos)
878  return true;
879  }
880  return false;
881  };
882 
883  // helper lambda to check if string s is any of the strings in vector ms
884  const auto isAnyOf = [](const std::string &s, const std::vector<std::string> &ms) -> bool {
885  for (const auto &m : ms) {
886  if (s == m)
887  return true;
888  }
889  return false;
890  };
891 
892  // tmadlener, 20.08.2017:
893  // define the valid module names for the different "levels", to add a little bit more stability
894  // to the checking compared to just doing some name matching.
895  // Note, that the name matching is not completely remved, since at level 4 and 5 some of the
896  // valid modules are the same, so that the name matching is still needed.
897  // With the current definition this yields the exact same levels as before, but weeds out some
898  // of the "false" positives at level 3 (naming matches also to some HLTMuonL1TFilter modules due to
899  // the 'forIterL3' in the name)
900  const std::string l1Filter = "HLTMuonL1TFilter";
901  const std::string l2Filter = "HLTMuonL2FromL1TPreFilter";
902  const std::vector<std::string> l3Filters = {"HLTMuonDimuonL3Filter", "HLTMuonL3PreFilter"};
903  const std::vector<std::string> l4Filters = {
904  "HLTDisplacedmumuFilter", "HLTDiMuonGlbTrkFilter", "HLTMuonTrackMassFilter"};
905  const std::vector<std::string> l5Filters = {"HLTmumutkFilter", "HLT2MuonMuonDZ", "HLTDisplacedmumuFilter"};
906 
907  if (contains(moduleName, "Filter") && hltConfig.moduleEDMType(moduleName) == "EDFilter") {
908  if (contains(moduleName, "L1") && !contains(moduleName, "ForIterL3") &&
909  hltConfig.moduleType(moduleName) == l1Filter) {
910  return 1;
911  }
912  if (contains(moduleName, "L2") && hltConfig.moduleType(moduleName) == l2Filter) {
913  return 2;
914  }
915  if (contains(moduleName, "L3") && isAnyOf(hltConfig.moduleType(moduleName), l3Filters)) {
916  return 3;
917  }
918  if (containsAny(moduleName, {"DisplacedmumuFilter", "DiMuon", "MuonL3Filtered", "TrackMassFiltered"}) &&
919  isAnyOf(hltConfig.moduleType(moduleName), l4Filters)) {
920  return 4;
921  }
922  if (containsAny(moduleName, {"Vertex", "Dz"}) && isAnyOf(hltConfig.moduleType(moduleName), l5Filters)) {
923  return 5;
924  }
925  }
926 
927  return -1;
928 }
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:37
const std::string moduleEDMType(const std::string &module) const
C++ base class name of module.
tuple l1Filter
Definition: l1Filter_cfi.py:3
int HeavyFlavorValidation::getMotherId ( const Candidate p)
private

Definition at line 747 of file HeavyFlavorValidation.cc.

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

Referenced by analyze().

747  {
748  const Candidate *mother = p->mother();
749  if (mother) {
750  if (mother->pdgId() == p->pdgId()) {
751  return getMotherId(mother);
752  } else {
753  return mother->pdgId();
754  }
755  } else {
756  return 0;
757  }
758 }
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 760 of file HeavyFlavorValidation.cc.

References PVValHelper::eta, dqm::impl::MonitorElement::Fill(), mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, and phi.

Referenced by analyze().

764  {
765  vector<double> dR(from.size());
766  for (size_t i = 0; i < from.size(); i++) {
767  map[i] = -1;
768  dR[i] = 10.;
769  //find closest
770  for (size_t j = 0; j < to.size(); j++) {
771  double dRtmp = deltaR<double>(from[i].eta(), from[i].phi(), to[j].eta(), to[j].phi());
772  if (dRtmp < dR[i]) {
773  dR[i] = dRtmp;
774  map[i] = j;
775  }
776  }
777  //fill matching histo
778  if (map[i] != -1) {
779  me->Fill(to[map[i]].eta() - from[i].eta(), deltaPhi<double>(to[map[i]].phi(), from[i].phi()));
780  }
781  //apply matching cut
782  if (dR[i] > dRMatchingCut) {
783  map[i] = -1;
784  }
785  //remove duplication
786  if (map[i] != -1) {
787  for (size_t k = 0; k < i; k++) {
788  if (map[k] != -1 && map[i] == map[k]) {
789  if (dR[i] < dR[k]) {
790  map[k] = -1;
791  } else {
792  map[i] = -1;
793  }
794  break;
795  }
796  }
797  }
798  }
799 }
void Fill(long long x)
void HeavyFlavorValidation::myBook1D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  label,
TString  title 
)
private

Definition at line 853 of file HeavyFlavorValidation.cc.

References dqm::implementation::IBooker::book1D(), h, mps_fire::i, and mergeVDriftHistosByStation::name.

Referenced by bookHistograms().

854  {
855  // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
856  int binsN = bins.size() == 3 ? (int)bins[0] + 1 : bins.size();
857  Double_t *myBins = new Double_t[binsN];
858  for (int i = 0; i < binsN; i++) {
859  myBins[i] = bins.size() == 3 ? bins[1] + i * (bins[2] - bins[1]) / bins[0] : bins[i];
860  }
861  TH1F *h = new TH1F(name, name, binsN - 1, myBins);
862  h->SetXTitle(label);
863  h->SetTitle(title);
864  ME[name] = ibooker.book1D(name.Data(), h);
865  delete h;
866 }
Definition: ME.h:11
char const * label
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void HeavyFlavorValidation::myBook1D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  label 
)
inlineprivate

Definition at line 101 of file HeavyFlavorValidation.cc.

101  {
102  myBook1D(ibooker, name, xBins, label, name);
103  }
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 801 of file HeavyFlavorValidation.cc.

References dqm::implementation::IBooker::book2D(), PVValHelper::eta, h, mps_fire::i, mergeVDriftHistosByStation::name, and DiDispStaMuonMonitor_cfi::pt.

Referenced by bookHistograms().

807  {
808  // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
809  int ptN = ptBins.size() == 3 ? (int)ptBins[0] + 1 : ptBins.size();
810  Double_t *pt = new Double_t[ptN];
811  for (int i = 0; i < ptN; i++) {
812  pt[i] = ptBins.size() == 3 ? ptBins[1] + i * (ptBins[2] - ptBins[1]) / ptBins[0] : ptBins[i];
813  }
814  int etaN = etaBins.size() == 3 ? (int)etaBins[0] + 1 : etaBins.size();
815  Double_t *eta = new Double_t[etaN];
816  for (int i = 0; i < etaN; i++) {
817  eta[i] = etaBins.size() == 3 ? etaBins[1] + i * (etaBins[2] - etaBins[1]) / etaBins[0] : etaBins[i];
818  }
819  TH2F *h = new TH2F(name, name, ptN - 1, pt, etaN - 1, eta);
820  h->SetXTitle(ptLabel);
821  h->SetYTitle(etaLabel);
822  h->SetTitle(title);
823  ME[name] = ibooker.book2D(name.Data(), h);
824  delete h;
825 }
Definition: ME.h:11
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void HeavyFlavorValidation::myBook2D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  xLabel,
vector< double > &  yBins,
TString  yLabel 
)
inlineprivate

Definition at line 77 of file HeavyFlavorValidation.cc.

82  {
83  myBook2D(ibooker, name, xBins, xLabel, yBins, yLabel, name);
84  }
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 827 of file HeavyFlavorValidation.cc.

References dqm::implementation::IBooker::bookProfile2D(), PVValHelper::eta, h, mps_fire::i, mergeVDriftHistosByStation::name, and DiDispStaMuonMonitor_cfi::pt.

Referenced by bookHistograms().

833  {
834  // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
835  int ptN = ptBins.size() == 3 ? (int)ptBins[0] + 1 : ptBins.size();
836  Double_t *pt = new Double_t[ptN];
837  for (int i = 0; i < ptN; i++) {
838  pt[i] = ptBins.size() == 3 ? ptBins[1] + i * (ptBins[2] - ptBins[1]) / ptBins[0] : ptBins[i];
839  }
840  int etaN = etaBins.size() == 3 ? (int)etaBins[0] + 1 : etaBins.size();
841  Double_t *eta = new Double_t[etaN];
842  for (int i = 0; i < etaN; i++) {
843  eta[i] = etaBins.size() == 3 ? etaBins[1] + i * (etaBins[2] - etaBins[1]) / etaBins[0] : etaBins[i];
844  }
845  TProfile2D *h = new TProfile2D(name, name, ptN - 1, pt, etaN - 1, eta);
846  h->SetXTitle(ptLabel);
847  h->SetYTitle(etaLabel);
848  h->SetTitle(title);
849  ME[name] = ibooker.bookProfile2D(name.Data(), h);
850  delete h;
851 }
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
Definition: ME.h:11
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void HeavyFlavorValidation::myBookProfile2D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  xLabel,
vector< double > &  yBins,
TString  yLabel 
)
inlineprivate

Definition at line 92 of file HeavyFlavorValidation.cc.

97  {
98  myBookProfile2D(ibooker, name, xBins, xLabel, yBins, yLabel, name);
99  }
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 134 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::deltaPhiBins
private

Definition at line 135 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::dimuonDRBins
private

Definition at line 141 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::dimuonEtaBins
private

Definition at line 140 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::dimuonPtBins
private

Definition at line 139 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

string HeavyFlavorValidation::dqmFolder
private

Definition at line 116 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

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

Definition at line 143 of file HeavyFlavorValidation.cc.

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

double HeavyFlavorValidation::genGlobDeltaRMatchingCut
private

Definition at line 130 of file HeavyFlavorValidation.cc.

Referenced by analyze().

InputTag HeavyFlavorValidation::genParticlesTag
private

Definition at line 126 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<GenParticleCollection> HeavyFlavorValidation::genParticlesToken
private

Definition at line 127 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

double HeavyFlavorValidation::globL1DeltaRMatchingCut
private

Definition at line 131 of file HeavyFlavorValidation.cc.

Referenced by analyze().

double HeavyFlavorValidation::globL2DeltaRMatchingCut
private

Definition at line 132 of file HeavyFlavorValidation.cc.

Referenced by analyze().

double HeavyFlavorValidation::globL3DeltaRMatchingCut
private

Definition at line 133 of file HeavyFlavorValidation.cc.

Referenced by analyze().

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

Definition at line 142 of file HeavyFlavorValidation.cc.

vector<int> HeavyFlavorValidation::motherIDs
private

Definition at line 129 of file HeavyFlavorValidation.cc.

Referenced by analyze().

vector<double> HeavyFlavorValidation::muonEtaBins
private

Definition at line 137 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

const double HeavyFlavorValidation::muonMass
private

Definition at line 144 of file HeavyFlavorValidation.cc.

Referenced by analyze().

vector<double> HeavyFlavorValidation::muonPhiBins
private

Definition at line 138 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::muonPtBins
private

Definition at line 136 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

InputTag HeavyFlavorValidation::recoMuonsTag
private

Definition at line 124 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<MuonCollection> HeavyFlavorValidation::recoMuonsToken
private

Definition at line 125 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

string HeavyFlavorValidation::triggerPathName
private

Definition at line 118 of file HeavyFlavorValidation.cc.

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

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

Definition at line 122 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<TriggerResults> HeavyFlavorValidation::triggerResultsToken
private

Definition at line 123 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<TriggerEvent> HeavyFlavorValidation::triggerSummaryAODTag
private

Definition at line 121 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<TriggerEventWithRefs> HeavyFlavorValidation::triggerSummaryRAWTag
private

Definition at line 120 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().