CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 HeavyFlavorValidation (const edm::ParameterSet &)
 
 ~HeavyFlavorValidation ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

virtual 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 &)
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

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
 
DQMStoredqmStore
 
vector< pair< string, int > > filterNamesLevels
 
double genGlobDeltaRMatchingCut
 
EDGetTokenT
< GenParticleCollection
genParticlesTag
 
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
 
EDGetTokenT< MuonCollectionrecoMuonsTag
 
string triggerPathName
 
string triggerProcessName
 
EDGetTokenT< TriggerResultstriggerResultsTag
 
EDGetTokenT< TriggerEventtriggerSummaryAODTag
 
EDGetTokenT< TriggerEventWithRefstriggerSummaryRAWTag
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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

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

105  :
106 //get parameters
107  dqmFolder(pset.getUntrackedParameter<string>("DQMFolder")),
108  triggerProcessName(pset.getUntrackedParameter<string>("TriggerProcessName")),
109  triggerPathName(pset.getUntrackedParameter<string>("TriggerPathName")),
110  motherIDs(pset.getUntrackedParameter<vector<int> >("MotherIDs")),
111  genGlobDeltaRMatchingCut(pset.getUntrackedParameter<double>("GenGlobDeltaRMatchingCut")),
112  globL1DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL1DeltaRMatchingCut")),
113  globL2DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL2DeltaRMatchingCut")),
114  globL3DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL3DeltaRMatchingCut")),
115  deltaEtaBins(pset.getUntrackedParameter<vector<double> >("DeltaEtaBins")),
116  deltaPhiBins(pset.getUntrackedParameter<vector<double> >("DeltaPhiBins")),
117  muonPtBins(pset.getUntrackedParameter<vector<double> >("MuonPtBins")),
118  muonEtaBins(pset.getUntrackedParameter<vector<double> >("MuonEtaBins")),
119  muonPhiBins(pset.getUntrackedParameter<vector<double> >("MuonPhiBins")),
120  dimuonPtBins(pset.getUntrackedParameter<vector<double> >("DimuonPtBins")),
121  dimuonEtaBins(pset.getUntrackedParameter<vector<double> >("DimuonEtaBins")),
122  dimuonDRBins(pset.getUntrackedParameter<vector<double> >("DimuonDRBins")),
123  muonMass(0.106)
124 {
125  triggerSummaryRAWTag = consumes<TriggerEventWithRefs>(InputTag( pset.getUntrackedParameter<string>("TriggerSummaryRAW"), "", triggerProcessName));
126  triggerSummaryAODTag = consumes<TriggerEvent>(InputTag( pset.getUntrackedParameter<string>("TriggerSummaryAOD"), "", triggerProcessName));
127  triggerResultsTag = consumes<TriggerResults>(InputTag( pset.getUntrackedParameter<string>("TriggerResults"), "", triggerProcessName));
128  recoMuonsTag = consumes<MuonCollection>(pset.getParameter<InputTag>("RecoMuons"));
129  genParticlesTag = consumes<GenParticleCollection>(pset.getParameter<InputTag>("GenParticles"));
130 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
vector< double > dimuonEtaBins
EDGetTokenT< TriggerEvent > triggerSummaryAODTag
EDGetTokenT< GenParticleCollection > genParticlesTag
EDGetTokenT< TriggerEventWithRefs > triggerSummaryRAWTag
EDGetTokenT< TriggerResults > triggerResultsTag
EDGetTokenT< MuonCollection > recoMuonsTag
HeavyFlavorValidation::~HeavyFlavorValidation ( )

Definition at line 640 of file HeavyFlavorValidation.cc.

640  {
641 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 276 of file HeavyFlavorValidation.cc.

References funct::abs(), DeDxDiscriminatorTools::charge(), eta(), f, filterNamesLevels, spr::find(), first, genGlobDeltaRMatchingCut, genParticleCandidates2GenParticles_cfi::genParticles, genParticlesTag, edm::Event::getByToken(), getMotherId(), globL1DeltaRMatchingCut, globL2DeltaRMatchingCut, globL3DeltaRMatchingCut, i, cmsHarvester::index, edm::HandleBase::isValid(), j, relativeConstraints::keys, LogDebug, match(), motherIDs, muonMass, AlCaHLTBitMon_ParallelJobs::p, phi, RecoTauCleanerPlugins::pt, recoMuonsTag, edm::second(), edm::TriggerNames::size(), findQualityFiles::size, python.multivaluedict::sort(), trigger::TriggerL1Mu, trigger::TriggerMuon, edm::TriggerNames::triggerName(), edm::Event::triggerNames(), triggerPathName, triggerProcessName, triggerResults, triggerResultsTag, triggerSummaryAODTag, triggerSummaryRAWTag, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

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

Implements DQMEDAnalyzer.

Definition at line 177 of file HeavyFlavorValidation.cc.

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

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

Reimplemented from DQMEDAnalyzer.

Definition at line 132 of file HeavyFlavorValidation.cc.

References filterNamesLevels, HltComparatorCreateWorkflow::hltConfig, i, HLTConfigProvider::init(), j, testEve_cfg::level, LogDebug, HLTConfigProvider::moduleLabels(), mergeVDriftHistosByStation::name, HLTConfigProvider::triggerNames(), triggerPathName, and triggerProcessName.

132  {
133  //discover HLT configuration
135  bool isChanged;
136  if(hltConfig.init(iRun, iSetup, triggerProcessName, isChanged)){
137  LogDebug("HLTriggerOfflineHeavyFlavor") << "Successfully initialized HLTConfigProvider with process name: "<<triggerProcessName<<endl;
138  }else{
139  LogWarning("HLTriggerOfflineHeavyFlavor") << "Could not initialize HLTConfigProvider with process name: "<<triggerProcessName<<endl;
140  return;
141  }
142  stringstream os;
143  vector<string> triggerNames = hltConfig.triggerNames();
144  for( size_t i = 0; i < triggerNames.size(); i++) {
145  TString triggerName = triggerNames[i];
146  if (triggerName.Contains(triggerPathName)){
147  vector<string> moduleNames = hltConfig.moduleLabels( triggerNames[i] );
148  for( size_t j = 0; j < moduleNames.size(); j++) {
149  TString name = moduleNames[j];
150  if(name.Contains("Filter")){
151  int level = 0;
152  if(name.Contains("L1"))
153  level = 1;
154  else if(name.Contains("L2"))
155  level = 2;
156  else if(name.Contains("L3"))
157  level = 3;
158  else if(name.Contains("mumuFilter") || name.Contains("JpsiTrackMass"))
159  level = 4;
160  filterNamesLevels.push_back( pair<string,int>(moduleNames[j],level) );
161  os<<" "<<moduleNames[j];
162  }
163  }
164  break;
165  }
166  }
167  if(filterNamesLevels.size()==0){
168  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Bad Trigger Path: "<<triggerPathName<<endl;
169  return;
170  }else{
171  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Trigger Path: "<<triggerPathName<<" has filters:"<<os.str();
172  }
173 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
const std::vector< std::string > & triggerNames() const
names of trigger paths
vector< pair< string, int > > filterNamesLevels
int j
Definition: DBlmapReader.cc:9
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:34
int HeavyFlavorValidation::getMotherId ( const Candidate p)
private

Definition at line 533 of file HeavyFlavorValidation.cc.

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

Referenced by analyze().

533  {
534  const Candidate* mother = p->mother();
535  if( mother ){
536  if( mother->pdgId() == p->pdgId() ){
537  return getMotherId(mother);
538  }else{
539  return mother->pdgId();
540  }
541  }else{
542  return 0;
543  }
544 }
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 546 of file HeavyFlavorValidation.cc.

References PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, eta(), MonitorElement::Fill(), i, j, gen::k, and phi.

Referenced by analyze().

546  {
547  vector<double> dR(from.size());
548  for(size_t i=0; i<from.size(); i++){
549  map[i] = -1;
550  dR[i] = 10.;
551  //find closest
552  for(size_t j=0; j<to.size(); j++){
553  double dRtmp = deltaR<double>(from[i].eta(), from[i].phi(), to[j].eta(), to[j].phi());
554  if( dRtmp < dR[i] ){
555  dR[i] = dRtmp;
556  map[i] = j;
557  }
558  }
559  //fill matching histo
560  if( map[i] != -1 ){
561  me->Fill( to[map[i]].eta()-from[i].eta(), deltaPhi<double>(to[map[i]].phi(), from[i].phi()) );
562  }
563  //apply matching cut
564  if( dR[i] > dRMatchingCut ){
565  map[i] = -1;
566  }
567  //remove duplication
568  if( map[i] != -1 ){
569  for(size_t k=0; k<i; k++){
570  if( map[k] != -1 && map[i] == map[k] ){
571  if( dR[i] < dR[k] ){
572  map[k] = -1;
573  }else{
574  map[i] = -1;
575  }
576  break;
577  }
578  }
579  }
580  }
581 }
int i
Definition: DBlmapReader.cc:9
T eta() const
void Fill(long long x)
int j
Definition: DBlmapReader.cc:9
int k[5][pyjets_maxn]
Definition: DDAxes.h:10
void HeavyFlavorValidation::myBook1D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  label,
TString  title 
)
private

Definition at line 625 of file HeavyFlavorValidation.cc.

References DQMStore::IBooker::book1D(), h, i, and mergeVDriftHistosByStation::name.

Referenced by bookHistograms().

626 {
627 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
628  int binsN = bins.size()==3 ? (int)bins[0]+1 : bins.size();
629  Double_t *myBins = new Double_t[ binsN ];
630  for(int i=0; i<binsN; i++){
631  myBins[i] = bins.size()==3 ? bins[1] + i*(bins[2]-bins[1])/bins[0] : bins[i] ;
632  }
633  TH1F *h = new TH1F( name, name, binsN-1, myBins );
634  h->SetXTitle(label);
635  h->SetTitle(title);
636  ME[name] = ibooker.book1D( name.Data(), h );
637  delete h;
638 }
int i
Definition: DBlmapReader.cc:9
Definition: ME.h:11
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:113
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 73 of file HeavyFlavorValidation.cc.

73  {
74  myBook1D(ibooker, name, xBins, label, name );
75  }
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 583 of file HeavyFlavorValidation.cc.

References DQMStore::IBooker::book2D(), eta(), h, i, mergeVDriftHistosByStation::name, and RecoTauCleanerPlugins::pt.

Referenced by bookHistograms().

584 {
585 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
586  int ptN = ptBins.size()==3 ? (int)ptBins[0]+1 : ptBins.size();
587  Double_t *pt = new Double_t[ ptN ];
588  for(int i=0; i<ptN; i++){
589  pt[i] = ptBins.size()==3 ? ptBins[1] + i*(ptBins[2]-ptBins[1])/ptBins[0] : ptBins[i] ;
590  }
591  int etaN = etaBins.size()==3 ? (int)etaBins[0]+1 : etaBins.size();
592  Double_t *eta = new Double_t[ etaN ];
593  for(int i=0; i<etaN; i++){
594  eta[i] = etaBins.size()==3 ? etaBins[1] + i*(etaBins[2]-etaBins[1])/etaBins[0] : etaBins[i] ;
595  }
596  TH2F *h = new TH2F( name, name, ptN-1, pt, etaN-1, eta );
597  h->SetXTitle(ptLabel);
598  h->SetYTitle(etaLabel);
599  h->SetTitle(title);
600  ME[name] = ibooker.book2D( name.Data(), h );
601  delete h;
602 }
int i
Definition: DBlmapReader.cc:9
T eta() const
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
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:131
void HeavyFlavorValidation::myBook2D ( DQMStore::IBooker ibooker,
TString  name,
vector< double > &  xBins,
TString  xLabel,
vector< double > &  yBins,
TString  yLabel 
)
inlineprivate

Definition at line 65 of file HeavyFlavorValidation.cc.

65  {
66  myBook2D(ibooker, name, xBins, xLabel, yBins, yLabel, name);
67  }
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 604 of file HeavyFlavorValidation.cc.

References DQMStore::IBooker::bookProfile2D(), eta(), h, i, mergeVDriftHistosByStation::name, and RecoTauCleanerPlugins::pt.

Referenced by bookHistograms().

605 {
606 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
607  int ptN = ptBins.size()==3 ? (int)ptBins[0]+1 : ptBins.size();
608  Double_t *pt = new Double_t[ ptN ];
609  for(int i=0; i<ptN; i++){
610  pt[i] = ptBins.size()==3 ? ptBins[1] + i*(ptBins[2]-ptBins[1])/ptBins[0] : ptBins[i] ;
611  }
612  int etaN = etaBins.size()==3 ? (int)etaBins[0]+1 : etaBins.size();
613  Double_t *eta = new Double_t[ etaN ];
614  for(int i=0; i<etaN; i++){
615  eta[i] = etaBins.size()==3 ? etaBins[1] + i*(etaBins[2]-etaBins[1])/etaBins[0] : etaBins[i] ;
616  }
617  TProfile2D *h = new TProfile2D( name, name, ptN-1, pt, etaN-1, eta );
618  h->SetXTitle(ptLabel);
619  h->SetYTitle(etaLabel);
620  h->SetTitle(title);
621  ME[name] = ibooker.bookProfile2D( name.Data(), h );
622  delete h;
623 }
int i
Definition: DBlmapReader.cc:9
T eta() const
Definition: ME.h:11
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:161
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 69 of file HeavyFlavorValidation.cc.

69  {
70  myBookProfile2D(ibooker, name, xBins, xLabel, yBins, yLabel, name);
71  }
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 91 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::deltaPhiBins
private

Definition at line 92 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::dimuonDRBins
private

Definition at line 98 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::dimuonEtaBins
private

Definition at line 97 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::dimuonPtBins
private

Definition at line 96 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

string HeavyFlavorValidation::dqmFolder
private

Definition at line 76 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

DQMStore* HeavyFlavorValidation::dqmStore
private

Definition at line 99 of file HeavyFlavorValidation.cc.

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

Definition at line 101 of file HeavyFlavorValidation.cc.

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

double HeavyFlavorValidation::genGlobDeltaRMatchingCut
private

Definition at line 87 of file HeavyFlavorValidation.cc.

Referenced by analyze().

EDGetTokenT<GenParticleCollection> HeavyFlavorValidation::genParticlesTag
private

Definition at line 84 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

double HeavyFlavorValidation::globL1DeltaRMatchingCut
private

Definition at line 88 of file HeavyFlavorValidation.cc.

Referenced by analyze().

double HeavyFlavorValidation::globL2DeltaRMatchingCut
private

Definition at line 89 of file HeavyFlavorValidation.cc.

Referenced by analyze().

double HeavyFlavorValidation::globL3DeltaRMatchingCut
private

Definition at line 90 of file HeavyFlavorValidation.cc.

Referenced by analyze().

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

Definition at line 100 of file HeavyFlavorValidation.cc.

vector<int> HeavyFlavorValidation::motherIDs
private

Definition at line 86 of file HeavyFlavorValidation.cc.

Referenced by analyze().

vector<double> HeavyFlavorValidation::muonEtaBins
private

Definition at line 94 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

const double HeavyFlavorValidation::muonMass
private

Definition at line 102 of file HeavyFlavorValidation.cc.

Referenced by analyze().

vector<double> HeavyFlavorValidation::muonPhiBins
private

Definition at line 95 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

vector<double> HeavyFlavorValidation::muonPtBins
private

Definition at line 93 of file HeavyFlavorValidation.cc.

Referenced by bookHistograms().

EDGetTokenT<MuonCollection> HeavyFlavorValidation::recoMuonsTag
private

Definition at line 83 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

string HeavyFlavorValidation::triggerPathName
private

Definition at line 78 of file HeavyFlavorValidation.cc.

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

string HeavyFlavorValidation::triggerProcessName
private
EDGetTokenT<TriggerResults> HeavyFlavorValidation::triggerResultsTag
private

Definition at line 82 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<TriggerEvent> HeavyFlavorValidation::triggerSummaryAODTag
private

Definition at line 81 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<TriggerEventWithRefs> HeavyFlavorValidation::triggerSummaryRAWTag
private

Definition at line 80 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().