CMS 3D CMS Logo

HLTExoticaValidator.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTExoticaValidator
4 // Class: HLTExoticaValidator
5 //
6 
7 //
8 // Jordi Duarte Campderros (based on the Jason Slaunwhite
9 // and Jeff Klukas coded from the HLTriggerOffline/Muon package
10 //
11 //
12 //
13 
14 // system include files
15 
18 
20 
21 // Constructor
23  : _pset(pset), _analysisnames(pset.getParameter<std::vector<std::string>>("analyses")), _collections(nullptr) {
24  LogDebug("ExoticaValidation") << "In HLTExoticaValidator::constructor()";
25 
26  // Prepare the event collections to be used.
28 
29  // Create a new subanalysis for each of the analysis names.
30  // Notice that the constructor takes the full parameter set,
31  // the analysis name and the consumesCollector() separately.
32  for (size_t i = 0; i < _analysisnames.size(); ++i) {
34  _analyzers.push_back(analyzer);
35  }
36 }
37 
39  if (_collections != nullptr) {
40  delete _collections;
41  _collections = nullptr;
42  }
43 }
44 
45 // 2014-02-03 -- Thiago
46 // Due to the fact that the DQM has to be thread safe now, we have to do things
47 // differently: 1) Implement the bookHistograms method in this class 2) Split
48 // beginRun() into bookHistograms() and dqmBeginRun() 3) Call
49 // subAnalysisBookHistos() for each subAnalysis from inside bookHistograms()
50 // *** IMPORTANT *** notice that now dqmBeginRun() runs before bookHistograms()!
51 void HLTExoticaValidator::dqmBeginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) {
52  LogDebug("ExoticaValidation") << "In HLTExoticaValidator::dqmBeginRun()";
53 
54  // Call the Plotter beginRun (which stores the triggers paths..:)
55  for (std::vector<HLTExoticaSubAnalysis>::iterator iter = _analyzers.begin(); iter != _analyzers.end(); ++iter) {
56  iter->beginRun(iRun, iSetup);
57  }
58 }
59 
61  const edm::Run &iRun,
62  const edm::EventSetup &iSetup) {
63  LogDebug("ExoticaValidation") << "In HLTExoticaValidator::bookHistograms()";
64 
65  // Loop over all sub-analyses and book histograms for all of them.
66  // For this to work, I think we have to pass the iBooker to each of them.
67  // I don't think we have any guarantee that this loop is executed
68  // sequentially, but the booking with iBooker itself has such a guarantee.
69  for (std::vector<HLTExoticaSubAnalysis>::iterator iter = _analyzers.begin(); iter != _analyzers.end(); ++iter) {
70  iter->subAnalysisBookHistos(iBooker, iRun, iSetup);
71  }
72 }
73 
75  LogDebug("ExoticaValidation") << "In HLTExoticaValidator::analyze()";
76 
77  // static int eventNumber = 0;
78  // eventNumber++;
79  // LogDebug("ExoticaValidation") << "In HLTExoticaSubAnalysis::analyze, "
80  // << "Event: " << eventNumber;
81 
82  // Initialize the event collections
83  this->_collections->reset();
84 
85  for (std::vector<HLTExoticaSubAnalysis>::iterator iter = _analyzers.begin(); iter != _analyzers.end(); ++iter) {
86  iter->analyze(iEvent, iSetup, this->_collections);
87  }
88 }
89 
90 void HLTExoticaValidator::beginJob() { LogDebug("ExoticaValidation") << "In HLTExoticaValidator::beginJob()"; }
91 
92 void HLTExoticaValidator::dqmEndRun(const edm::Run &iRun, const edm::EventSetup &iSetup) {
93  for (std::vector<HLTExoticaSubAnalysis>::iterator iter = _analyzers.begin(); iter != _analyzers.end(); ++iter) {
94  iter->endRun();
95  }
96 }
97 
99 
100 // define this as a plug-in
101 // DEFINE_FWK_MODULE(HLTExoticaValidator);
mps_fire.i
i
Definition: mps_fire.py:428
EVTColContainer.cc
edm::Run
Definition: Run.h:45
HLTExoticaValidator::dqmEndRun
void dqmEndRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
Definition: HLTExoticaValidator.cc:92
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
ramdisk_dqm_sourceclient-live_cfg.analyzer
analyzer
Definition: ramdisk_dqm_sourceclient-live_cfg.py:22
HLTExoticaValidator::bookHistograms
void bookHistograms(DQMStore::IBooker &iBooker, const edm::Run &iRun, const edm::EventSetup &iSetup) override
Method called by the framework to book histograms.
Definition: HLTExoticaValidator.cc:60
HLTExoticaValidator::_collections
EVTColContainer * _collections
Centralized point of access to all collections used.
Definition: HLTExoticaValidator.h:65
HLTExoticaValidator::_analysisnames
std::vector< std::string > _analysisnames
The names of the subanalyses.
Definition: HLTExoticaValidator.h:59
HLTExoticaSubAnalysis
Definition: HLTExoticaSubAnalysis.h:65
HLTExoticaValidator.h
HLTExoticaValidator::~HLTExoticaValidator
~HLTExoticaValidator() override
Definition: HLTExoticaValidator.cc:38
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLTExoticaValidator::analyze
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
Method called for each event.
Definition: HLTExoticaValidator.cc:74
HLTExoticaValidator::beginJob
void beginJob() override
Definition: HLTExoticaValidator.cc:90
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
HLTExoticaValidator::_pset
edm::ParameterSet _pset
Copy (to be modified) of the input ParameterSet from configuration file.
Definition: HLTExoticaValidator.h:57
HLTExoticaValidator::HLTExoticaValidator
HLTExoticaValidator(const edm::ParameterSet &)
Constructor and destructor.
Definition: HLTExoticaValidator.cc:22
iEvent
int iEvent
Definition: GenABIO.cc:224
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:58
std
Definition: JetResolutionObject.h:76
HLTExoticaValidator::_analyzers
std::vector< HLTExoticaSubAnalysis > _analyzers
The instances of the class which do the real work.
Definition: HLTExoticaValidator.h:62
analyzer
Definition: SiPixelLorentzAngle.h:82
dqm::implementation::IBooker
Definition: DQMStore.h:43
EVTColContainer::reset
void reset()
Reset: clear all collections.
Definition: EVTColContainer.cc:114
EVTColContainer
container with all the objects needed
Definition: EVTColContainer.cc:46
edm::Event
Definition: Event.h:73
HLTExoticaValidator::endJob
void endJob() override
Definition: HLTExoticaValidator.cc:98
HLTExoticaValidator::dqmBeginRun
void dqmBeginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
Method called by the framework just before dqmBeginRun()
Definition: HLTExoticaValidator.cc:51
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27