CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HLTMuonValidator Class Reference
Inheritance diagram for HLTMuonValidator:

Public Member Functions

 HLTMuonValidator (const edm::ParameterSet &)
 

Private 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
 
std::vector< std::string > moduleLabels (std::string)
 
std::vector< std::string > stepLabels (const std::vector< std::string > &)
 

Private Attributes

std::vector< HLTMuonPlotteranalyzers_
 
HLTConfigProvider hltConfig_
 
std::vector< std::string > hltPathsToCheck_
 
std::string hltProcessName_
 
std::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
 
edm::ParameterSet pset_
 

Detailed Description

Definition at line 36 of file HLTMuonValidator.cc.

Constructor & Destructor Documentation

◆ HLTMuonValidator()

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

Definition at line 77 of file HLTMuonValidator.cc.

78  : pset_(pset),
79  hltProcessName_(pset.getParameter<string>("hltProcessName")),
80  hltPathsToCheck_(pset.getParameter<vstring>("hltPathsToCheck")) {
81  myTokens_ = HLTMuonPlotter::getTokens(pset_, consumesCollector());
82 }

References HLTMuonPlotter::getTokens(), myTokens_, and pset_.

Member Function Documentation

◆ analyze()

void HLTMuonValidator::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 176 of file HLTMuonValidator.cc.

176  {
177  vector<HLTMuonPlotter>::iterator iter;
178  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
179  iter->analyze(iEvent, iSetup);
180  }
181 }

References analyzers_, and iEvent.

◆ bookHistograms()

void HLTMuonValidator::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 168 of file HLTMuonValidator.cc.

168  {
169  // Call the beginRun (which books all the histograms)
170  vector<HLTMuonPlotter>::iterator iter;
171  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
172  iter->beginRun(iBooker, iRun, iSetup);
173  }
174 }

References analyzers_.

◆ dqmBeginRun()

void HLTMuonValidator::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 132 of file HLTMuonValidator.cc.

132  {
133  // Initialize hltConfig
134  bool changedConfig;
135  if (!hltConfig_.init(iRun, iSetup, hltProcessName_, changedConfig)) {
136  LogError("HLTMuonVal") << "Initialization of HLTConfigProvider failed!!";
137  return;
138  }
139 
140  // Get the set of trigger paths we want to make plots for
141  set<string> hltPaths;
142  for (size_t i = 0; i < hltPathsToCheck_.size(); i++) {
143  TPRegexp pattern(hltPathsToCheck_[i]);
144  for (size_t j = 0; j < hltConfig_.triggerNames().size(); j++)
145  if (TString(hltConfig_.triggerNames()[j]).Contains(pattern))
146  hltPaths.insert(hltConfig_.triggerNames()[j]);
147  }
148 
149  // Initialize the analyzers
150  analyzers_.clear();
151  set<string>::iterator iPath;
152  for (iPath = hltPaths.begin(); iPath != hltPaths.end(); iPath++) {
153  string path = *iPath;
154  string shortpath = path;
155  if (path.rfind("_v") < path.length())
156  shortpath = path.substr(0, path.rfind("_v"));
157 
158  vector<string> labels = moduleLabels(path);
159  vector<string> steps = stepLabels(labels);
160 
161  if (!labels.empty() && !steps.empty()) {
163  analyzers_.push_back(analyzer);
164  }
165  }
166 }

References ramdisk_dqm_sourceclient-live_cfg::analyzer, analyzers_, hltConfig_, HLTSiStripMonitoring_cff::hltPaths, hltPathsToCheck_, hltProcessName_, mps_fire::i, HLTConfigProvider::init(), dqmiolumiharvest::j, SummaryClient_cfi::labels, moduleLabels(), myTokens_, castor_dqm_sourceclient_file_cfg::path, topSingleLeptonDQM_PU_cfi::pattern, pset_, stepLabels(), customisers::steps, and HLTConfigProvider::triggerNames().

◆ moduleLabels()

vector< string > HLTMuonValidator::moduleLabels ( std::string  )
private

Definition at line 84 of file HLTMuonValidator.cc.

84  {
85  vector<string> modules = hltConfig_.moduleLabels(path);
86  vector<string>::iterator iter = modules.begin();
87 
88  while (iter != modules.end())
89  if (iter->find("Filtered") == string::npos)
90  iter = modules.erase(iter);
91  else
92  ++iter;
93 
94  return modules;
95 }

References hltConfig_, HLTConfigProvider::moduleLabels(), LogMessageMonitor_cff::modules, and castor_dqm_sourceclient_file_cfg::path.

Referenced by dqmBeginRun().

◆ stepLabels()

vector< string > HLTMuonValidator::stepLabels ( const std::vector< std::string > &  )
private

Definition at line 97 of file HLTMuonValidator.cc.

97  {
98  vector<string> steps(1, "All");
99  for (size_t i = 0; i < modules.size(); i++) {
100  if ((modules[i].find("IsoFiltered") != string::npos)) {
101  if (modules[i].find("L3") != string::npos)
102  steps.push_back("L3TkIso");
103  else
104  steps.push_back("L2Iso");
105  } else if ((modules[i].find("pfecalIsoRhoFiltered") != string::npos)) {
106  if (modules[i].find("L3") != string::npos)
107  steps.push_back("L3EcalIso");
108  else if (modules[i].find("TkFiltered") != string::npos)
109  steps.push_back("TkEcalIso");
110  } else if ((modules[i].find("pfhcalIsoRhoFiltered") != string::npos)) {
111  if (modules[i].find("L3") != string::npos)
112  steps.push_back("L3HcalIso");
113  else if (modules[i].find("TkFiltered") != string::npos)
114  steps.push_back("TkHcalIso");
115  } else if (modules[i].find("TkFiltered") != string::npos) {
116  steps.push_back("Tk");
117  } else if (modules[i].find("L3") != string::npos)
118  steps.push_back("L3");
119  else if (modules[i].find("L2") != string::npos)
120  steps.push_back("L2");
121  else if (modules[i].find("L1") != string::npos)
122  steps.push_back("L1");
123  else
124  return vector<string>();
125  }
126 
127  if (steps.size() < 2 || ((steps[1] != "L1") && (steps[1] != "Tk")))
128  return vector<string>();
129  return steps;
130 }

References spr::find(), mps_fire::i, and customisers::steps.

Referenced by dqmBeginRun().

Member Data Documentation

◆ analyzers_

std::vector<HLTMuonPlotter> HLTMuonValidator::analyzers_
private

◆ hltConfig_

HLTConfigProvider HLTMuonValidator::hltConfig_
private

Definition at line 57 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and moduleLabels().

◆ hltPathsToCheck_

std::vector<std::string> HLTMuonValidator::hltPathsToCheck_
private

Definition at line 53 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ hltProcessName_

std::string HLTMuonValidator::hltProcessName_
private

Definition at line 52 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ myTokens_

Definition at line 61 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and HLTMuonValidator().

◆ pset_

edm::ParameterSet HLTMuonValidator::pset_
private

Definition at line 51 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and HLTMuonValidator().

HLTMuonValidator::pset_
edm::ParameterSet pset_
Definition: HLTMuonValidator.cc:51
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
HLTMuonValidator::myTokens_
std::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
Definition: HLTMuonValidator.cc:61
HLTMuonValidator::hltProcessName_
std::string hltProcessName_
Definition: HLTMuonValidator.cc:52
HLTMuonValidator::hltPathsToCheck_
std::vector< std::string > hltPathsToCheck_
Definition: HLTMuonValidator.cc:53
mps_fire.i
i
Definition: mps_fire.py:428
LogMessageMonitor_cff.modules
modules
Definition: LogMessageMonitor_cff.py:7
modules
Definition: MuonCleanerBySegments.cc:35
HLTSiStripMonitoring_cff.hltPaths
hltPaths
Definition: HLTSiStripMonitoring_cff.py:252
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
ramdisk_dqm_sourceclient-live_cfg.analyzer
analyzer
Definition: ramdisk_dqm_sourceclient-live_cfg.py:22
HLTConfigProvider::moduleLabels
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
Definition: HLTConfigProvider.h:76
HLTMuonPlotter::getTokens
static std::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > getTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
Definition: HLTMuonPlotter.cc:259
iEvent
int iEvent
Definition: GenABIO.cc:224
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HLTConfigProvider::init
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
Definition: HLTConfigProvider.cc:36
analyzer
Definition: SiPixelLorentzAngle.h:82
vstring
vector< string > vstring
Definition: ExoticaDQM.cc:8
customisers.steps
steps
Definition: customisers.py:39
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
HLTMuonValidator::analyzers_
std::vector< HLTMuonPlotter > analyzers_
Definition: HLTMuonValidator.cc:56
HLTMuonPlotter
Definition: HLTMuonPlotter.h:52
HLTConfigProvider::triggerNames
const std::vector< std::string > & triggerNames() const
names of trigger paths
Definition: HLTConfigProvider.h:69
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HLTMuonValidator::stepLabels
std::vector< std::string > stepLabels(const std::vector< std::string > &)
Definition: HLTMuonValidator.cc:97
HLTMuonValidator::hltConfig_
HLTConfigProvider hltConfig_
Definition: HLTMuonValidator.cc:57
HLTMuonValidator::moduleLabels
std::vector< std::string > moduleLabels(std::string)
Definition: HLTMuonValidator.cc:84
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27