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:

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)
 
void myBook1D (DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString label, TString title)
 
void myBook2D (DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel)
 
void myBook2D (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)
 
void myBookProfile2D (DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
 

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

Constructor & Destructor Documentation

◆ HeavyFlavorValidation()

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

Definition at line 147 of file HeavyFlavorValidation.cc.

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 }

References genParticlesTag, genParticlesToken, HLT_FULL_cff::InputTag, muonDTDigis_cfi::pset, recoMuonsTag, recoMuonsToken, triggerProcessName, triggerResultsTag, triggerResultsToken, triggerSummaryAODTag, and triggerSummaryRAWTag.

◆ ~HeavyFlavorValidation()

HeavyFlavorValidation::~HeavyFlavorValidation ( )
override

Definition at line 930 of file HeavyFlavorValidation.cc.

930 {}

Member Function Documentation

◆ analyze()

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

Definition at line 434 of file HeavyFlavorValidation.cc.

434  {
435  if (filterNamesLevels.empty()) {
436  return;
437  }
438  //access the containers and create LeafCandidate copies
439  vector<LeafCandidate> genMuons;
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  }
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;
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 }

References funct::abs(), ALCARECOTkAlJpsiMuMu_cff::charge, PVValHelper::eta, f, trigger::TriggerEventWithRefs::filterIndex(), trigger::TriggerEvent::filterKeys(), filterNamesLevels, trigger::TriggerEvent::filterTag(), spr::find(), first, genGlobDeltaRMatchingCut, runTauDisplay::genMuons, genParticles2HepMC_cfi::genParticles, genParticlesTag, genParticlesToken, getMotherId(), trigger::TriggerEvent::getObjects(), trigger::TriggerEventWithRefs::getObjects(), globL1DeltaRMatchingCut, globL2DeltaRMatchingCut, globL3DeltaRMatchingCut, mps_fire::i, iEvent, 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(), findQualityFiles::size, trigger::TriggerEvent::sizeFilters(), jetUpdater_cfi::sort, HLT_FULL_cff::track, trigger::TriggerL1Mu, trigger::TriggerMuon, L1TEGammaOffline_cfi::triggerNames, triggerPathName, triggerProcessName, triggerResults, triggerResultsTag, triggerResultsToken, triggerSummaryAODTag, triggerSummaryRAWTag, x, y, and z.

◆ bookHistograms()

void HeavyFlavorValidation::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 218 of file HeavyFlavorValidation.cc.

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 }

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.

◆ dqmBeginRun()

void HeavyFlavorValidation::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 178 of file HeavyFlavorValidation.cc.

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) {
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 }

References filterNamesLevels, filters, getFilterLevel(), HltComparatorCreateWorkflow::hltConfig, personalPlayback::level, LogDebug, EcalCalibMonitorClient_cfi::moduleName, str, AlCaHLTBitMon_QueryRunRegistry::string, L1TEGammaOffline_cfi::triggerNames, triggerPathName, triggerProcessName, and EgHLTOffTrigSelection_cfi::trigName.

◆ getFilterLevel()

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.

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 }

References edm::contains(), HltComparatorCreateWorkflow::hltConfig, l1Filter_cfi::l1Filter, visualization-live-secondInstance_cfg::m, EcalCalibMonitorClient_cfi::moduleName, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmBeginRun().

◆ getMotherId()

int HeavyFlavorValidation::getMotherId ( const Candidate p)
private

Definition at line 747 of file HeavyFlavorValidation.cc.

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 }

References AlCaHLTBitMon_ParallelJobs::p, and reco::Candidate::pdgId().

Referenced by analyze().

◆ match()

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.

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 }

References HGC3DClusterGenMatchSelector_cfi::dR, PVValHelper::eta, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, genParticles_cff::map, hlt_dqm_clientPB-live_cfg::me, and phi.

Referenced by analyze().

◆ myBook1D() [1/2]

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  }

References label, Skims_PA_cff::name, and multiplicitycorr_cfi::xBins.

◆ myBook1D() [2/2]

void HeavyFlavorValidation::myBook1D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  label,
TString  title 
)
private

Definition at line 853 of file HeavyFlavorValidation.cc.

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 }

References trigObjTnPSource_cfi::bins, dqm::implementation::IBooker::book1D(), h, mps_fire::i, createfilelist::int, label, Skims_PA_cff::name, and runGCPTkAlMap::title.

Referenced by bookHistograms().

◆ myBook2D() [1/2]

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  }

References Skims_PA_cff::name, multiplicitycorr_cfi::xBins, and multiplicitycorr_cfi::yBins.

◆ myBook2D() [2/2]

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.

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 }

References dqm::implementation::IBooker::book2D(), PVValHelper::eta, HLT_FULL_cff::etaBins, h, mps_fire::i, createfilelist::int, Skims_PA_cff::name, DiDispStaMuonMonitor_cfi::pt, L1EGammaCrystalsEmulatorProducer_cfi::ptBins, and runGCPTkAlMap::title.

Referenced by bookHistograms().

◆ myBookProfile2D() [1/2]

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  }

References Skims_PA_cff::name, multiplicitycorr_cfi::xBins, and multiplicitycorr_cfi::yBins.

◆ myBookProfile2D() [2/2]

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.

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 }

References dqm::implementation::IBooker::bookProfile2D(), PVValHelper::eta, HLT_FULL_cff::etaBins, h, mps_fire::i, createfilelist::int, Skims_PA_cff::name, DiDispStaMuonMonitor_cfi::pt, L1EGammaCrystalsEmulatorProducer_cfi::ptBins, and runGCPTkAlMap::title.

Referenced by bookHistograms().

Member Data Documentation

◆ deltaEtaBins

vector<double> HeavyFlavorValidation::deltaEtaBins
private

Definition at line 134 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

◆ deltaPhiBins

vector<double> HeavyFlavorValidation::deltaPhiBins
private

Definition at line 135 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

◆ dimuonDRBins

vector<double> HeavyFlavorValidation::dimuonDRBins
private

Definition at line 141 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

◆ dimuonEtaBins

vector<double> HeavyFlavorValidation::dimuonEtaBins
private

Definition at line 140 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

◆ dimuonPtBins

vector<double> HeavyFlavorValidation::dimuonPtBins
private

Definition at line 139 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

◆ dqmFolder

string HeavyFlavorValidation::dqmFolder
private

Definition at line 116 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

◆ filterNamesLevels

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

Definition at line 143 of file HeavyFlavorValidation.cc.

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

◆ genGlobDeltaRMatchingCut

double HeavyFlavorValidation::genGlobDeltaRMatchingCut
private

Definition at line 130 of file HeavyFlavorValidation.cc.

Referenced by analyze().

◆ genParticlesTag

InputTag HeavyFlavorValidation::genParticlesTag
private

Definition at line 126 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

◆ genParticlesToken

EDGetTokenT<GenParticleCollection> HeavyFlavorValidation::genParticlesToken
private

Definition at line 127 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

◆ globL1DeltaRMatchingCut

double HeavyFlavorValidation::globL1DeltaRMatchingCut
private

Definition at line 131 of file HeavyFlavorValidation.cc.

Referenced by analyze().

◆ globL2DeltaRMatchingCut

double HeavyFlavorValidation::globL2DeltaRMatchingCut
private

Definition at line 132 of file HeavyFlavorValidation.cc.

Referenced by analyze().

◆ globL3DeltaRMatchingCut

double HeavyFlavorValidation::globL3DeltaRMatchingCut
private

Definition at line 133 of file HeavyFlavorValidation.cc.

Referenced by analyze().

◆ ME

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

Definition at line 142 of file HeavyFlavorValidation.cc.

◆ motherIDs

vector<int> HeavyFlavorValidation::motherIDs
private

Definition at line 129 of file HeavyFlavorValidation.cc.

Referenced by analyze().

◆ muonEtaBins

vector<double> HeavyFlavorValidation::muonEtaBins
private

Definition at line 137 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

◆ muonMass

const double HeavyFlavorValidation::muonMass
private

Definition at line 144 of file HeavyFlavorValidation.cc.

Referenced by analyze().

◆ muonPhiBins

vector<double> HeavyFlavorValidation::muonPhiBins
private

Definition at line 138 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

◆ muonPtBins

vector<double> HeavyFlavorValidation::muonPtBins
private

Definition at line 136 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

◆ recoMuonsTag

InputTag HeavyFlavorValidation::recoMuonsTag
private

Definition at line 124 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

◆ recoMuonsToken

EDGetTokenT<MuonCollection> HeavyFlavorValidation::recoMuonsToken
private

Definition at line 125 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

◆ triggerPathName

string HeavyFlavorValidation::triggerPathName
private

Definition at line 118 of file HeavyFlavorValidation.cc.

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

◆ triggerProcessName

string HeavyFlavorValidation::triggerProcessName
private

◆ triggerResultsTag

InputTag HeavyFlavorValidation::triggerResultsTag
private

Definition at line 122 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

◆ triggerResultsToken

EDGetTokenT<TriggerResults> HeavyFlavorValidation::triggerResultsToken
private

Definition at line 123 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

◆ triggerSummaryAODTag

EDGetTokenT<TriggerEvent> HeavyFlavorValidation::triggerSummaryAODTag
private

Definition at line 121 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

◆ triggerSummaryRAWTag

EDGetTokenT<TriggerEventWithRefs> HeavyFlavorValidation::triggerSummaryRAWTag
private

Definition at line 120 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

HeavyFlavorValidation::match
void match(MonitorElement *me, vector< LeafCandidate > &from, vector< LeafCandidate > &to, double deltaRMatchingCut, vector< int > &map)
Definition: HeavyFlavorValidation.cc:760
personalPlayback.level
level
Definition: personalPlayback.py:22
HeavyFlavorValidation::getFilterLevel
int getFilterLevel(const std::string &moduleName, const HLTConfigProvider &hltConfig)
Definition: HeavyFlavorValidation.cc:868
DDAxes::y
trigger::TriggerEvent::sizeFilters
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:146
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
mps_fire.i
i
Definition: mps_fire.py:428
GreaterByPt
Definition: PtComparator.h:24
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
HeavyFlavorValidation::myBookProfile2D
void myBookProfile2D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
Definition: HeavyFlavorValidation.cc:827
filters
std::vector< TPRegexp > filters
Definition: eve_filter.cc:22
trigger::TriggerEvent::filterKeys
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:118
genParticles2HepMC_cfi.genParticles
genParticles
Definition: genParticles2HepMC_cfi.py:4
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
HeavyFlavorValidation::triggerResultsToken
EDGetTokenT< TriggerResults > triggerResultsToken
Definition: HeavyFlavorValidation.cc:123
HeavyFlavorValidation::dimuonDRBins
vector< double > dimuonDRBins
Definition: HeavyFlavorValidation.cc:141
dqm::implementation::IBooker::bookProfile2D
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
HeavyFlavorValidation::muonMass
const double muonMass
Definition: HeavyFlavorValidation.cc:144
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
HeavyFlavorValidation::globL2DeltaRMatchingCut
double globL2DeltaRMatchingCut
Definition: HeavyFlavorValidation.cc:132
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
HLT_FULL_cff.etaBins
etaBins
Definition: HLT_FULL_cff.py:15288
to
trigger::TriggerEventWithRefs::getObjects
void getObjects(size_type filter, Vids &ids, VRphoton &photons) const
extract Ref<C>s for a specific filter and of specific physics type
Definition: TriggerEventWithRefs.h:399
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
HeavyFlavorValidation::triggerSummaryRAWTag
EDGetTokenT< TriggerEventWithRefs > triggerSummaryRAWTag
Definition: HeavyFlavorValidation.cc:120
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
DDAxes::x
HeavyFlavorValidation::recoMuonsToken
EDGetTokenT< MuonCollection > recoMuonsToken
Definition: HeavyFlavorValidation.cc:125
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
HeavyFlavorValidation::muonPhiBins
vector< double > muonPhiBins
Definition: HeavyFlavorValidation.cc:138
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
HeavyFlavorValidation::getMotherId
int getMotherId(const Candidate *p)
Definition: HeavyFlavorValidation.cc:747
HeavyFlavorValidation::globL1DeltaRMatchingCut
double globL1DeltaRMatchingCut
Definition: HeavyFlavorValidation.cc:131
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HeavyFlavorValidation::filterNamesLevels
vector< pair< string, int > > filterNamesLevels
Definition: HeavyFlavorValidation.cc:143
h
HeavyFlavorValidation::genParticlesTag
InputTag genParticlesTag
Definition: HeavyFlavorValidation.cc:126
trigger::TriggerEvent::filterTag
const edm::InputTag filterTag(trigger::size_type index) const
Definition: TriggerEvent.h:108
HeavyFlavorValidation::globL3DeltaRMatchingCut
double globL3DeltaRMatchingCut
Definition: HeavyFlavorValidation.cc:133
multiplicitycorr_cfi.yBins
yBins
Definition: multiplicitycorr_cfi.py:6
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition: L1TEGammaOffline_cfi.py:40
PVValHelper::eta
Definition: PVValidationHelpers.h:70
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:79
HeavyFlavorValidation::myBook2D
void myBook2D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
Definition: HeavyFlavorValidation.cc:801
HeavyFlavorValidation::deltaPhiBins
vector< double > deltaPhiBins
Definition: HeavyFlavorValidation.cc:135
DDAxes::z
trigger::TriggerMuon
Definition: TriggerTypeDefs.h:79
str
#define str(s)
Definition: TestProcessor.cc:53
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
multiplicitycorr_cfi.xBins
xBins
Definition: multiplicitycorr_cfi.py:5
HeavyFlavorValidation::genParticlesToken
EDGetTokenT< GenParticleCollection > genParticlesToken
Definition: HeavyFlavorValidation.cc:127
dqmdumpme.k
k
Definition: dqmdumpme.py:60
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
trigger::TriggerEventWithRefs::filterIndex
size_type filterIndex(const edm::InputTag &filterTag) const
index from tag
Definition: TriggerEventWithRefs.h:223
EgHLTOffTrigSelection_cfi.trigName
trigName
Definition: EgHLTOffTrigSelection_cfi.py:8
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
HeavyFlavorValidation::deltaEtaBins
vector< double > deltaEtaBins
Definition: HeavyFlavorValidation.cc:134
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HeavyFlavorValidation::motherIDs
vector< int > motherIDs
Definition: HeavyFlavorValidation.cc:129
trigger::TriggerL1Mu
enum start value shifted to 81 so as to avoid clashes with PDG codes
Definition: TriggerTypeDefs.h:30
HeavyFlavorValidation::triggerResultsTag
InputTag triggerResultsTag
Definition: HeavyFlavorValidation.cc:122
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
trigger::TriggerObjectCollection
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
HeavyFlavorValidation::dqmFolder
string dqmFolder
Definition: HeavyFlavorValidation.cc:116
createfilelist.int
int
Definition: createfilelist.py:10
HeavyFlavorValidation::triggerPathName
string triggerPathName
Definition: HeavyFlavorValidation.cc:118
iEvent
int iEvent
Definition: GenABIO.cc:224
EcalCalibMonitorClient_cfi.moduleName
moduleName
Definition: EcalCalibMonitorClient_cfi.py:17
trigger::Keys
std::vector< size_type > Keys
Definition: TriggerTypeDefs.h:19
HeavyFlavorValidation::triggerSummaryAODTag
EDGetTokenT< TriggerEvent > triggerSummaryAODTag
Definition: HeavyFlavorValidation.cc:121
edm::contains
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:37
trigger::TriggerEvent::getObjects
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:101
reco::Candidate::pdgId
virtual int pdgId() const =0
PDG identifier.
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HeavyFlavorValidation::genGlobDeltaRMatchingCut
double genGlobDeltaRMatchingCut
Definition: HeavyFlavorValidation.cc:130
reco::Candidate
Definition: Candidate.h:27
DDAxes::phi
HeavyFlavorValidation::triggerProcessName
string triggerProcessName
Definition: HeavyFlavorValidation.cc:117
HLTConfigProvider
Definition: HLTConfigProvider.h:29
l1Filter_cfi.l1Filter
l1Filter
Definition: l1Filter_cfi.py:3
HeavyFlavorValidation::dimuonPtBins
vector< double > dimuonPtBins
Definition: HeavyFlavorValidation.cc:139
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
dqm::implementation::IBooker::book2D
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
edm::TriggerNames
Definition: TriggerNames.h:55
ME
Definition: ME.h:11
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
HeavyFlavorValidation::muonEtaBins
vector< double > muonEtaBins
Definition: HeavyFlavorValidation.cc:137
HltComparatorCreateWorkflow.hltConfig
hltConfig
Definition: HltComparatorCreateWorkflow.py:161
runTauDisplay.genMuons
genMuons
Definition: runTauDisplay.py:315
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
reco::LeafCandidate
Definition: LeafCandidate.h:16
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
genParticles_cff.map
map
Definition: genParticles_cff.py:11
trigObjTnPSource_cfi.bins
bins
Definition: trigObjTnPSource_cfi.py:20
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HeavyFlavorValidation::muonPtBins
vector< double > muonPtBins
Definition: HeavyFlavorValidation.cc:136
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
HeavyFlavorValidation::dimuonEtaBins
vector< double > dimuonEtaBins
Definition: HeavyFlavorValidation.cc:140
HeavyFlavorValidation::recoMuonsTag
InputTag recoMuonsTag
Definition: HeavyFlavorValidation.cc:124
L1EGammaCrystalsEmulatorProducer_cfi.ptBins
ptBins
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:9
HeavyFlavorValidation::myBook1D
void myBook1D(DQMStore::IBooker &ibooker, TString name, vector< double > &xBins, TString label, TString title)
Definition: HeavyFlavorValidation.cc:853
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443