test
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 210 of file HLTMuonValidator.cc.

References analyzers_, and getDQMSummary::iter.

212 {
213 
214  vector<HLTMuonPlotter>::iterator iter;
215  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
216  iter->analyze(iEvent, iSetup);
217  }
218 
219 }
std::vector< HLTMuonPlotter > analyzers_
void HLTMuonValidator::beginJob ( void  )
privatevirtual

Definition at line 224 of file HLTMuonValidator.cc.

225 {
226 
227 }
void HLTMuonValidator::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 194 of file HLTMuonValidator.cc.

References analyzers_, and getDQMSummary::iter.

197 {
198 
199  // Call the beginRun (which books all the histograms)
200  vector<HLTMuonPlotter>::iterator iter;
201  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
202  iter->beginRun(iBooker, iRun, iSetup);
203  }
204 
205 }
std::vector< HLTMuonPlotter > analyzers_
void HLTMuonValidator::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 152 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().

154 {
155  // Initialize hltConfig
156  bool changedConfig;
157  if (!hltConfig_.init(iRun, iSetup, hltProcessName_, changedConfig)) {
158  LogError("HLTMuonVal") << "Initialization of HLTConfigProvider failed!!";
159  return;
160  }
161 
162  // Get the set of trigger paths we want to make plots for
163  set<string> hltPaths;
164  for (size_t i = 0; i < hltPathsToCheck_.size(); i++) {
165  TPRegexp pattern(hltPathsToCheck_[i]);
166  for (size_t j = 0; j < hltConfig_.triggerNames().size(); j++)
167  if (TString(hltConfig_.triggerNames()[j]).Contains(pattern))
168  hltPaths.insert(hltConfig_.triggerNames()[j]);
169  }
170 
171  // Initialize the analyzers
172  analyzers_.clear();
173  set<string>::iterator iPath;
174  for (iPath = hltPaths.begin(); iPath != hltPaths.end(); iPath++) {
175 
176  string path = * iPath;
177  string shortpath = path;
178  if (path.rfind("_v") < path.length())
179  shortpath = path.substr(0, path.rfind("_v"));
180 
181  vector<string> labels = moduleLabels(path);
182  vector<string> steps = stepLabels(labels);
183 
184  if (labels.size() > 0 && steps.size() > 0) {
185  HLTMuonPlotter analyzer(pset_, shortpath, labels, steps, myTokens_);
186  analyzers_.push_back(analyzer);
187  }
188  }
189 
190 }
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 246 of file HLTMuonValidator.cc.

247 {
248 
249 }
void HLTMuonValidator::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 232 of file HLTMuonValidator.cc.

234 {
235 
236  // vector<HLTMuonPlotter>::iterator iter;
237  // for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
238  // iter->endRun(iRun, iSetup);
239  // }
240 
241 }
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("L3") != string::npos)
135  steps.push_back("L3");
136  else if (modules[i].find("L2") != string::npos)
137  steps.push_back("L2");
138  else if (modules[i].find("L1") != string::npos)
139  steps.push_back("L1");
140  else
141  return vector<string>();
142  }
143  if (steps.size() < 2 || steps[1] != "L1")
144  return vector<string>();
145  return steps;
146 
147 }
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().