CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HLTMuonValidator Class Reference
Inheritance diagram for HLTMuonValidator:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 HLTMuonValidator (const edm::ParameterSet &)
 
- 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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob ()
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
virtual void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
virtual void endJob ()
 
virtual void endRun (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_
 

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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)
 
- 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)
 

Detailed Description

Definition at line 42 of file HLTMuonValidator.cc.

Constructor & Destructor Documentation

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

Definition at line 94 of file HLTMuonValidator.cc.

References edm::EDConsumerBase::consumesCollector(), HLTMuonPlotter::getTokens(), myTokens_, and pset_.

94  :
95  pset_(pset),
96  hltProcessName_(pset.getParameter<string>("hltProcessName")),
97  hltPathsToCheck_(pset.getParameter<vstring>("hltPathsToCheck"))
98 {
99 
101 
102 }
T getParameter(std::string const &) const
vector< string > vstring
Definition: ExoticaDQM.cc:86
edm::ParameterSet pset_
std::vector< std::string > hltPathsToCheck_
boost::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
static boost::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > getTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::string hltProcessName_

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 226 of file HLTMuonValidator.cc.

References analyzers_.

228 {
229 
230  vector<HLTMuonPlotter>::iterator iter;
231  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
232  iter->analyze(iEvent, iSetup);
233  }
234 
235 }
std::vector< HLTMuonPlotter > analyzers_
void HLTMuonValidator::beginJob ( void  )
privatevirtual

Definition at line 240 of file HLTMuonValidator.cc.

241 {
242 
243 }
void HLTMuonValidator::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 210 of file HLTMuonValidator.cc.

References analyzers_.

213 {
214 
215  // Call the beginRun (which books all the histograms)
216  vector<HLTMuonPlotter>::iterator iter;
217  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
218  iter->beginRun(iBooker, iRun, iSetup);
219  }
220 
221 }
std::vector< HLTMuonPlotter > analyzers_
void HLTMuonValidator::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 168 of file HLTMuonValidator.cc.

References analyzers_, hltConfig_, CreateSqliteForCondDB_cfg::hltPaths, hltPathsToCheck_, hltProcessName_, i, HLTConfigProvider::init(), j, HLT_25ns14e33_v1_cff::labels, moduleLabels(), myTokens_, fed_dqm_sourceclient-live_cfg::path, chain::pattern, pset_, stepLabels(), relval_machine::steps, and HLTConfigProvider::triggerNames().

170 {
171  // Initialize hltConfig
172  bool changedConfig;
173  if (!hltConfig_.init(iRun, iSetup, hltProcessName_, changedConfig)) {
174  LogError("HLTMuonVal") << "Initialization of HLTConfigProvider failed!!";
175  return;
176  }
177 
178  // Get the set of trigger paths we want to make plots for
179  set<string> hltPaths;
180  for (size_t i = 0; i < hltPathsToCheck_.size(); i++) {
181  TPRegexp pattern(hltPathsToCheck_[i]);
182  for (size_t j = 0; j < hltConfig_.triggerNames().size(); j++)
183  if (TString(hltConfig_.triggerNames()[j]).Contains(pattern))
184  hltPaths.insert(hltConfig_.triggerNames()[j]);
185  }
186 
187  // Initialize the analyzers
188  analyzers_.clear();
189  set<string>::iterator iPath;
190  for (iPath = hltPaths.begin(); iPath != hltPaths.end(); iPath++) {
191 
192  string path = * iPath;
193  string shortpath = path;
194  if (path.rfind("_v") < path.length())
195  shortpath = path.substr(0, path.rfind("_v"));
196 
197  vector<string> labels = moduleLabels(path);
198  vector<string> steps = stepLabels(labels);
199 
200  if (labels.size() > 0 && steps.size() > 0) {
201  HLTMuonPlotter analyzer(pset_, shortpath, labels, steps, myTokens_);
202  analyzers_.push_back(analyzer);
203  }
204  }
205 
206 }
int i
Definition: DBlmapReader.cc:9
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_
list pattern
Definition: chain.py:104
edm::ParameterSet pset_
std::vector< std::string > hltPathsToCheck_
boost::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
int j
Definition: DBlmapReader.cc:9
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::endJob ( void  )
privatevirtual

Definition at line 262 of file HLTMuonValidator.cc.

263 {
264 
265 }
void HLTMuonValidator::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 248 of file HLTMuonValidator.cc.

250 {
251 
252  // vector<HLTMuonPlotter>::iterator iter;
253  // for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
254  // iter->endRun(iRun, iSetup);
255  // }
256 
257 }
vector< string > HLTMuonValidator::moduleLabels ( std::string  )
private

Definition at line 107 of file HLTMuonValidator.cc.

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

Referenced by dqmBeginRun().

107  {
108 
109  vector<string> modules = hltConfig_.moduleLabels(path);
110  vector<string>::iterator iter = modules.begin();
111 
112  while (iter != modules.end())
113  if (iter->find("Filtered") == string::npos)
114  iter = modules.erase(iter);
115  else
116  ++iter;
117 
118  return modules;
119 
120 }
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 125 of file HLTMuonValidator.cc.

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

Referenced by dqmBeginRun().

125  {
126  vector<string> steps(1, "All");
127  for (size_t i = 0; i < modules.size(); i++) {
128  if ((modules[i].find("IsoFiltered") != string::npos)){
129  if (modules[i].find("L3") != string::npos)
130  steps.push_back("L3TkIso");
131  else
132  steps.push_back("L2Iso");
133  }
134  else if ((modules[i].find("pfecalIsoRhoFiltered") != string::npos)||(modules[i].find("pfecalOldIsoRhoFiltered") != string::npos)) {
135  if (modules[i].find("L3") != string::npos)
136  steps.push_back("L3EcalIso");
137  else if (modules[i].find("TkFiltered") != string::npos)
138  steps.push_back("TkEcalIso");
139  }
140  else if ((modules[i].find("pfhcalIsoRhoFiltered") != string::npos)||(modules[i].find("pfhcalOldIsoRhoFiltered") != string::npos)) {
141  if (modules[i].find("L3") != string::npos)
142  steps.push_back("L3HcalIso");
143  else if (modules[i].find("TkFiltered") != string::npos)
144  steps.push_back("TkHcalIso");
145  }
146  else if (modules[i].find("TkFiltered") != string::npos){
147  steps.push_back("Tk");
148  }
149  else if (modules[i].find("L3") != string::npos)
150  steps.push_back("L3");
151  else if (modules[i].find("L2") != string::npos)
152  steps.push_back("L2");
153  else if (modules[i].find("L1") != string::npos)
154  steps.push_back("L1");
155  else
156  return vector<string>();
157  }
158 
159  if (steps.size() < 2 || ((steps[1] != "L1")&&(steps[1] != "Tk")))
160  return vector<string>();
161  return steps;
162 
163 }
int i
Definition: DBlmapReader.cc:9
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7

Member Data Documentation

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

Definition at line 69 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and moduleLabels().

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

Definition at line 65 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

std::string HLTMuonValidator::hltProcessName_
private

Definition at line 64 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

Definition at line 73 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and HLTMuonValidator().

edm::ParameterSet HLTMuonValidator::pset_
private

Definition at line 63 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and HLTMuonValidator().