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

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
 
- 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::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)
 

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:75
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 218 of file HLTMuonValidator.cc.

References analyzers_, and getDQMSummary::iter.

220 {
221 
222  vector<HLTMuonPlotter>::iterator iter;
223  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
224  iter->analyze(iEvent, iSetup);
225  }
226 
227 }
std::vector< HLTMuonPlotter > analyzers_
void HLTMuonValidator::beginJob ( void  )
privatevirtual

Definition at line 232 of file HLTMuonValidator.cc.

233 {
234 
235 }
void HLTMuonValidator::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 202 of file HLTMuonValidator.cc.

References analyzers_, and getDQMSummary::iter.

205 {
206 
207  // Call the beginRun (which books all the histograms)
208  vector<HLTMuonPlotter>::iterator iter;
209  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
210  iter->beginRun(iBooker, iRun, iSetup);
211  }
212 
213 }
std::vector< HLTMuonPlotter > analyzers_
void HLTMuonValidator::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 160 of file HLTMuonValidator.cc.

References analyzers_, hltConfig_, CreateSqliteForCondDB_cfg::hltPaths, hltPathsToCheck_, hltProcessName_, i, HLTConfigProvider::init(), j, tablePrinter::labels, moduleLabels(), myTokens_, cmsHarvester::path, listBenchmarks::pattern, pset_, stepLabels(), relval_machine::steps, and HLTConfigProvider::triggerNames().

162 {
163  // Initialize hltConfig
164  bool changedConfig;
165  if (!hltConfig_.init(iRun, iSetup, hltProcessName_, changedConfig)) {
166  LogError("HLTMuonVal") << "Initialization of HLTConfigProvider failed!!";
167  return;
168  }
169 
170  // Get the set of trigger paths we want to make plots for
171  set<string> hltPaths;
172  for (size_t i = 0; i < hltPathsToCheck_.size(); i++) {
173  TPRegexp pattern(hltPathsToCheck_[i]);
174  for (size_t j = 0; j < hltConfig_.triggerNames().size(); j++)
175  if (TString(hltConfig_.triggerNames()[j]).Contains(pattern))
176  hltPaths.insert(hltConfig_.triggerNames()[j]);
177  }
178 
179  // Initialize the analyzers
180  analyzers_.clear();
181  set<string>::iterator iPath;
182  for (iPath = hltPaths.begin(); iPath != hltPaths.end(); iPath++) {
183 
184  string path = * iPath;
185  string shortpath = path;
186  if (path.rfind("_v") < path.length())
187  shortpath = path.substr(0, path.rfind("_v"));
188 
189  vector<string> labels = moduleLabels(path);
190  vector<string> steps = stepLabels(labels);
191 
192  if (labels.size() > 0 && steps.size() > 0) {
193  HLTMuonPlotter analyzer(pset_, shortpath, labels, steps, myTokens_);
194  analyzers_.push_back(analyzer);
195  }
196  }
197 
198 }
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_
edm::ParameterSet pset_
std::vector< std::string > hltPathsToCheck_
boost::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
tuple path
else: Piece not in the list, fine.
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 254 of file HLTMuonValidator.cc.

255 {
256 
257 }
void HLTMuonValidator::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 240 of file HLTMuonValidator.cc.

242 {
243 
244  // vector<HLTMuonPlotter>::iterator iter;
245  // for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
246  // iter->endRun(iRun, iSetup);
247  // }
248 
249 }
vector< string > HLTMuonValidator::moduleLabels ( std::string  )
private

Definition at line 107 of file HLTMuonValidator.cc.

References hltConfig_, getDQMSummary::iter, 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 }
tuple path
else: Piece not in the list, fine.
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("L3Iso");
131  else
132  steps.push_back("L2Iso");
133  }
134  else if (modules[i].find("IsoRhoFiltered") != string::npos) {
135  if (modules[i].find("L3") != string::npos)
136  steps.push_back("L3Iso");
137  if (modules[i].find("TkFiltered") != string::npos)
138  steps.push_back("TkIso");
139  }
140  else if (modules[i].find("TkFiltered") != string::npos)
141  steps.push_back("Tk");
142  else if (modules[i].find("L3") != string::npos)
143  steps.push_back("L3");
144  else if (modules[i].find("L2") != string::npos)
145  steps.push_back("L2");
146  else if (modules[i].find("L1") != string::npos)
147  steps.push_back("L1");
148  else
149  return vector<string>();
150  }
151  if (steps.size() < 2 || ((steps[1] != "L1")&&(steps[1] != "Tk")))
152  return vector<string>();
153  return steps;
154 
155 }
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().