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
 
void dqmEndRun (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_
 
boost::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 ( const edm::ParameterSet pset)
explicit

Definition at line 78 of file HLTMuonValidator.cc.

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

79  : pset_(pset),
80  hltProcessName_(pset.getParameter<string>("hltProcessName")),
81  hltPathsToCheck_(pset.getParameter<vstring>("hltPathsToCheck")) {
82  myTokens_ = HLTMuonPlotter::getTokens(pset_, consumesCollector());
83 }
T getParameter(std::string const &) const
vector< string > vstring
Definition: ExoticaDQM.cc:8
boost::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
edm::ParameterSet pset_
std::vector< std::string > hltPathsToCheck_
static boost::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > getTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
std::string hltProcessName_

Member Function Documentation

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

Definition at line 177 of file HLTMuonValidator.cc.

References analyzers_.

177  {
178  vector<HLTMuonPlotter>::iterator iter;
179  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
180  iter->analyze(iEvent, iSetup);
181  }
182 }
std::vector< HLTMuonPlotter > analyzers_
void HLTMuonValidator::bookHistograms ( DQMStore::IBooker &  iBooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 169 of file HLTMuonValidator.cc.

References analyzers_.

169  {
170  // Call the beginRun (which books all the histograms)
171  vector<HLTMuonPlotter>::iterator iter;
172  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
173  iter->beginRun(iBooker, iRun, iSetup);
174  }
175 }
std::vector< HLTMuonPlotter > analyzers_
void HLTMuonValidator::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 133 of file HLTMuonValidator.cc.

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().

133  {
134  // Initialize hltConfig
135  bool changedConfig;
136  if (!hltConfig_.init(iRun, iSetup, hltProcessName_, changedConfig)) {
137  LogError("HLTMuonVal") << "Initialization of HLTConfigProvider failed!!";
138  return;
139  }
140 
141  // Get the set of trigger paths we want to make plots for
142  set<string> hltPaths;
143  for (size_t i = 0; i < hltPathsToCheck_.size(); i++) {
144  TPRegexp pattern(hltPathsToCheck_[i]);
145  for (size_t j = 0; j < hltConfig_.triggerNames().size(); j++)
146  if (TString(hltConfig_.triggerNames()[j]).Contains(pattern))
147  hltPaths.insert(hltConfig_.triggerNames()[j]);
148  }
149 
150  // Initialize the analyzers
151  analyzers_.clear();
152  set<string>::iterator iPath;
153  for (iPath = hltPaths.begin(); iPath != hltPaths.end(); iPath++) {
154  string path = *iPath;
155  string shortpath = path;
156  if (path.rfind("_v") < path.length())
157  shortpath = path.substr(0, path.rfind("_v"));
158 
159  vector<string> labels = moduleLabels(path);
160  vector<string> steps = stepLabels(labels);
161 
162  if (!labels.empty() && !steps.empty()) {
163  HLTMuonPlotter analyzer(pset_, shortpath, labels, steps, myTokens_);
164  analyzers_.push_back(analyzer);
165  }
166  }
167 }
boost::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
std::vector< std::string > stepLabels(const std::vector< std::string > &)
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< HLTMuonPlotter > analyzers_
edm::ParameterSet pset_
std::vector< std::string > hltPathsToCheck_
std::vector< std::string > moduleLabels(std::string)
HLTConfigProvider hltConfig_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
std::string hltProcessName_
void HLTMuonValidator::dqmEndRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 184 of file HLTMuonValidator.cc.

References DEFINE_FWK_MODULE.

184  {
185  // vector<HLTMuonPlotter>::iterator iter;
186  // for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
187  // iter->endRun(iRun, iSetup);
188  // }
189 }
vector< string > HLTMuonValidator::moduleLabels ( std::string  )
private

Definition at line 85 of file HLTMuonValidator.cc.

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

Referenced by dqmBeginRun().

85  {
86  vector<string> modules = hltConfig_.moduleLabels(path);
87  vector<string>::iterator iter = modules.begin();
88 
89  while (iter != modules.end())
90  if (iter->find("Filtered") == string::npos)
91  iter = modules.erase(iter);
92  else
93  ++iter;
94 
95  return modules;
96 }
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
HLTConfigProvider hltConfig_
vector< string > HLTMuonValidator::stepLabels ( const std::vector< std::string > &  )
private

Definition at line 98 of file HLTMuonValidator.cc.

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

Referenced by dqmBeginRun().

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

Member Data Documentation

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

Definition at line 58 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and moduleLabels().

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

Definition at line 54 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

std::string HLTMuonValidator::hltProcessName_
private

Definition at line 53 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

Definition at line 62 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and HLTMuonValidator().

edm::ParameterSet HLTMuonValidator::pset_
private

Definition at line 52 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and HLTMuonValidator().