CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | 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_
 
HLTMuonPlotter::ESTokens myESTokens_
 
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 ( const edm::ParameterSet pset)
explicit

Definition at line 79 of file HLTMuonValidator.cc.

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

80  : pset_(pset),
81  hltProcessName_(pset.getParameter<string>("hltProcessName")),
82  hltPathsToCheck_(pset.getParameter<vstring>("hltPathsToCheck")) {
83  myTokens_ = HLTMuonPlotter::getTokens(pset_, consumesCollector());
84  myESTokens_ = HLTMuonPlotter::getESTokens(consumesCollector());
85 }
vector< string > vstring
Definition: ExoticaDQM.cc:8
edm::ParameterSet pset_
std::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
std::vector< std::string > hltPathsToCheck_
HLTMuonPlotter::ESTokens myESTokens_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string hltProcessName_
static std::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > getTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
static std::tuple< edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >, edm::ESGetToken< Propagator, TrackingComponentsRecord >, edm::ESGetToken< Propagator, TrackingComponentsRecord >, edm::ESGetToken< Propagator, TrackingComponentsRecord >, edm::ESGetToken< MuonDetLayerGeometry, MuonRecoGeometryRecord > > getESTokens(edm::ConsumesCollector)

Member Function Documentation

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

Definition at line 179 of file HLTMuonValidator.cc.

References analyzers_.

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

Definition at line 171 of file HLTMuonValidator.cc.

References analyzers_.

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

Definition at line 135 of file HLTMuonValidator.cc.

References analyzers_, hltConfig_, HLTSiStripMonitoring_cff::hltPaths, hltPathsToCheck_, hltProcessName_, mps_fire::i, HLTConfigProvider::init(), dqmiolumiharvest::j, HLT_FULL_cff::labels, moduleLabels(), myESTokens_, myTokens_, fed_dqm_sourceclient-live_cfg::path, pset_, stepLabels(), relval_machine::steps, and HLTConfigProvider::triggerNames().

135  {
136  // Initialize hltConfig
137  bool changedConfig;
138  if (!hltConfig_.init(iRun, iSetup, hltProcessName_, changedConfig)) {
139  LogError("HLTMuonVal") << "Initialization of HLTConfigProvider failed!!";
140  return;
141  }
142 
143  // Get the set of trigger paths we want to make plots for
144  set<string> hltPaths;
145  for (size_t i = 0; i < hltPathsToCheck_.size(); i++) {
146  TPRegexp pattern(hltPathsToCheck_[i]);
147  for (size_t j = 0; j < hltConfig_.triggerNames().size(); j++)
148  if (TString(hltConfig_.triggerNames()[j]).Contains(pattern))
149  hltPaths.insert(hltConfig_.triggerNames()[j]);
150  }
151 
152  // Initialize the analyzers
153  analyzers_.clear();
154  set<string>::iterator iPath;
155  for (iPath = hltPaths.begin(); iPath != hltPaths.end(); iPath++) {
156  string path = *iPath;
157  string shortpath = path;
158  if (path.rfind("_v") < path.length())
159  shortpath = path.substr(0, path.rfind("_v"));
160 
161  vector<string> labels = moduleLabels(path);
162  vector<string> steps = stepLabels(labels);
163 
164  if (!labels.empty() && !steps.empty()) {
165  HLTMuonPlotter analyzer(pset_, shortpath, labels, steps, myTokens_, myESTokens_);
166  analyzers_.push_back(analyzer);
167  }
168  }
169 }
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_
Log< level::Error, false > LogError
std::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
std::vector< std::string > hltPathsToCheck_
HLTMuonPlotter::ESTokens myESTokens_
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_
vector< string > HLTMuonValidator::moduleLabels ( std::string  )
private

Definition at line 87 of file HLTMuonValidator.cc.

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

Referenced by dqmBeginRun().

87  {
88  vector<string> modules = hltConfig_.moduleLabels(path);
89  vector<string>::iterator iter = modules.begin();
90 
91  while (iter != modules.end())
92  if (iter->find("Filtered") == string::npos)
93  iter = modules.erase(iter);
94  else
95  ++iter;
96 
97  return modules;
98 }
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 100 of file HLTMuonValidator.cc.

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

Referenced by dqmBeginRun().

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

Referenced by dqmBeginRun(), and moduleLabels().

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

Definition at line 53 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

std::string HLTMuonValidator::hltProcessName_
private

Definition at line 52 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

HLTMuonPlotter::ESTokens HLTMuonValidator::myESTokens_
private

Definition at line 63 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and HLTMuonValidator().

Definition at line 61 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and HLTMuonValidator().

edm::ParameterSet HLTMuonValidator::pset_
private

Definition at line 51 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and HLTMuonValidator().