CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
HcalOfflineHarvesting Class Reference

#include <HcalOfflineHarvesting.h>

Inheritance diagram for HcalOfflineHarvesting:
hcaldqm::DQHarvester DQMEDHarvester hcaldqm::DQModule edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 HcalOfflineHarvesting (edm::ParameterSet const &)
 
 ~HcalOfflineHarvesting () override
 
- Public Member Functions inherited from hcaldqm::DQHarvester
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQHarvester (edm::ParameterSet const &)
 
void dqmBeginLuminosityBlock (DQMStore::IBooker &ib, DQMStore::IGetter &ig, edm::LuminosityBlock const &lb, edm::EventSetup const &es)
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 ~DQHarvester () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule ()(false)
 

Protected Types

enum  Summary {
  fRaw = 0, fDigi = 1, fReco = 2, fTP = 3,
  nSummary = 4
}
 

Protected Member Functions

void _dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void _dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 

Protected Attributes

MonitorElement_reportSummaryMap
 
std::map< Summary, hcaldqm::DQClient * > _sumgen
 
std::map< Summary, bool > _summarks
 
std::vector< Summary_summaryList
 
std::map< Summary, std::string > _sumnames
 
MonitorElementme
 
- Protected Attributes inherited from hcaldqm::DQHarvester
HcalElectronicsMap const * _emap
 
int _totalLS
 
std::vector< uint32_t > _vcdaqEids
 
std::vector< int > _vCrates
 
std::vector< int > _vFEDs
 
std::vector< uint32_t > _vhashCrates
 
std::vector< uint32_t > _vhashFEDs
 
ContainerXXX< uint32_t > _xQuality
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
- Protected Attributes inherited from hcaldqm::DQModule
int _currentLS
 
int _debug
 
int _evsPerLS
 
int _evsTotal
 
Logger _logger
 
int _maxLS
 
ModuleType _mtype
 
std::string _name
 
ProcessingType _ptype
 
std::string _runkeyName
 
int _runkeyVal
 
std::string _subsystem
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

file: HcalOffineHarvesting.h Author: VK Date: .. Description: This is DQMEDAnalyzer which is a edm::one module. edm::one enforces that only 1 run is being processed. https://twiki.cern.ch/twiki/bin/view/CMSPublic/FWMultithreadedFrameworkOneModuleInterface - for details.


Offline: For Offline only Run Summary is being generated. As it is meaningless to have current LS information being delivered. Only Total Summary makes sense

Definition at line 39 of file HcalOfflineHarvesting.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

HcalOfflineHarvesting::HcalOfflineHarvesting ( edm::ParameterSet const &  ps)

Definition at line 7 of file HcalOfflineHarvesting.cc.

References _sumgen, _summarks, _summaryList, _sumnames, fDigi, spr::find(), fRaw, fReco, and fTP.

8  : DQHarvester(ps), _reportSummaryMap(nullptr) {
9  _summaryList.push_back(fTP);
10  _summaryList.push_back(fDigi);
11  _summaryList.push_back(fReco);
12  _sumnames[fRaw] = "RawTask";
13  _sumnames[fDigi] = "DigiTask";
14  _sumnames[fReco] = "RecHitTask";
15  _sumnames[fTP] = "TPTask";
16  for (auto& it_sum : _summaryList) {
17  _summarks[it_sum] = false;
18  }
19 
20  if (std::find(_summaryList.begin(), _summaryList.end(), fRaw) != _summaryList.end()) {
21  _sumgen[fRaw] = new hcaldqm::RawRunSummary("RawRunHarvesting", _sumnames[fRaw], ps);
22  }
23  if (std::find(_summaryList.begin(), _summaryList.end(), fDigi) != _summaryList.end()) {
24  _sumgen[fDigi] = new hcaldqm::DigiRunSummary("DigiRunHarvesting", _sumnames[fDigi], ps);
25  }
26  if (std::find(_summaryList.begin(), _summaryList.end(), fReco) != _summaryList.end()) {
27  _sumgen[fReco] = new hcaldqm::RecoRunSummary("RecoRunHarvesting", _sumnames[fReco], ps);
28  }
29  if (std::find(_summaryList.begin(), _summaryList.end(), fTP) != _summaryList.end()) {
30  _sumgen[fTP] = new hcaldqm::TPRunSummary("TPRunHarvesting", _sumnames[fTP], ps);
31  }
32 }
std::map< Summary, std::string > _sumnames
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
MonitorElement * _reportSummaryMap
std::map< Summary, hcaldqm::DQClient * > _sumgen
DQHarvester(edm::ParameterSet const &)
Definition: DQHarvester.cc:7
std::map< Summary, bool > _summarks
std::vector< Summary > _summaryList
HcalOfflineHarvesting::~HcalOfflineHarvesting ( )
inlineoverride

Definition at line 42 of file HcalOfflineHarvesting.h.

References _dqmEndJob(), _dqmEndLuminosityBlock(), and beginRun().

42 {}

Member Function Documentation

void HcalOfflineHarvesting::_dqmEndJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
overrideprotectedvirtual

Implements hcaldqm::DQHarvester.

Definition at line 67 of file HcalOfflineHarvesting.cc.

References hcaldqm::DQModule::_debug, hcaldqm::DQModule::_name, _reportSummaryMap, hcaldqm::DQModule::_subsystem, _sumgen, _summarks, _summaryList, _sumnames, hcaldqm::DQHarvester::_vCrates, DQMStore::IBooker::book2D(), gather_cfg::cout, DEFINE_FWK_MODULE, DQMEDHarvester::endJob(), fDigi, flags, fRaw, fReco, fTP, mps_fire::i, dataset::name, pileupDistInMC::num, MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~HcalOfflineHarvesting().

67  {
68  // OBTAIN/SET WHICH MODULES ARE PRESENT
69  std::map<Summary, std::string> datatier_names;
70  datatier_names[fRaw] = "RAW";
71  datatier_names[fDigi] = "DIGI";
72  datatier_names[fReco] = "RECO";
73  datatier_names[fTP] = "TP";
74 
75  int num = 0;
76  std::map<std::string, int> datatiers;
77  for (auto& it_sum : _summaryList) {
78  if (_summarks[it_sum]) {
79  datatiers.insert(std::pair<std::string, int>(datatier_names[it_sum], num));
80  ++num;
81  }
82  }
83 
84  // CREATE THE REPORT SUMMARY MAP
85  // num is #modules
86  // datatiers - std map [DATATIER_NAME] -> [positional value [0,num-1]]
87  // -> bin wise +1 should be
88  if (!_reportSummaryMap) {
89  ib.setCurrentFolder(_subsystem + "/EventInfo");
91  ib.book2D("reportSummaryMap", "reportSummaryMap", _vCrates.size(), 0, _vCrates.size(), num, 0, num);
92  // x axis labels
93 
94  for (uint32_t i = 0; i < _vCrates.size(); i++) {
95  char name[5];
96  sprintf(name, "%d", _vCrates[i]);
97  _reportSummaryMap->setBinLabel(i + 1, name, 1);
98  }
99  // y axis lables
100  for (std::map<std::string, int>::const_iterator it = datatiers.begin(); it != datatiers.end(); ++it) {
101  std::string name = it->first;
102  int value = it->second;
103  _reportSummaryMap->setBinLabel(value + 1, name, 2);
104  }
105  }
106 
107  // iterate over all summary generators and get the flags
108  for (auto& it_sum : _summaryList) {
109  // IF MODULE IS NOT PRESENT IN DATA SKIP
110  if (!_summarks[it_sum]) {
111  continue;
112  }
113 
114  // OBTAIN ALL THE FLAGS FOR THIS MODULE
115  // AND SET THE REPORT STATUS MAP
116  // NOTE AGAIN: datatiers map [DATATIER]->[value not bin!]+1 therefore
117  if (_debug > 0) {
118  std::cout << _sumnames[it_sum] << std::endl;
119  }
120  std::vector<hcaldqm::flag::Flag> flags = (_sumgen[it_sum])->endJob(ib, ig);
121  if (_debug > 0) {
122  std::cout << "********************" << std::endl;
123  std::cout << "SUMMARY" << std::endl;
124  }
125  for (uint32_t icrate = 0; icrate < _vCrates.size(); icrate++) {
126  _reportSummaryMap->setBinContent(icrate + 1, datatiers[flags[icrate]._name] + 1, (int)flags[icrate]._state);
127  if (_debug > 0) {
128  std::cout << "Crate=" << _vCrates[icrate] << std::endl;
129  std::cout << flags[icrate]._name << " " << flags[icrate]._state << std::endl;
130  }
131  }
132  }
133 }
void setBinContent(int binx, double content)
set content of bin (1-D)
std::map< Summary, std::string > _sumnames
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
void endJob() final
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * _reportSummaryMap
std::map< Summary, hcaldqm::DQClient * > _sumgen
Definition: value.py:1
std::string _name
Definition: DQModule.h:41
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
std::vector< int > _vCrates
Definition: DQHarvester.h:41
std::string _subsystem
Definition: DQModule.h:48
std::map< Summary, bool > _summarks
std::vector< Summary > _summaryList
void HcalOfflineHarvesting::_dqmEndLuminosityBlock ( DQMStore::IBooker ib,
DQMStore::IGetter ig,
edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
overrideprotectedvirtual

Implements hcaldqm::DQHarvester.

Definition at line 45 of file HcalOfflineHarvesting.cc.

References hcaldqm::DQModule::_subsystem, _sumgen, _summarks, _summaryList, _sumnames, DQMEDHarvester::endLuminosityBlock(), and DQMStore::IGetter::get().

Referenced by ~HcalOfflineHarvesting().

48  {
49  for (auto& it_sum : _summaryList) {
50  if (ig.get(_subsystem + "/" + _sumnames[it_sum] + "/EventsTotal") != nullptr) {
51  _summarks[it_sum] = true;
52  }
53  }
54 
55  // CALL ALL THE HARVESTERS
56  for (auto& it_sum : _summaryList) {
57  // run only if have to
58  if (_summarks[it_sum]) {
59  (_sumgen[it_sum])->endLuminosityBlock(ib, ig, lb, es);
60  }
61  }
62 }
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) final
std::map< Summary, std::string > _sumnames
std::map< Summary, hcaldqm::DQClient * > _sumgen
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
std::string _subsystem
Definition: DQModule.h:48
std::map< Summary, bool > _summarks
std::vector< Summary > _summaryList
void HcalOfflineHarvesting::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
override

Definition at line 34 of file HcalOfflineHarvesting.cc.

References _sumgen, and _summaryList.

Referenced by ~HcalOfflineHarvesting().

34  {
35  DQHarvester::beginRun(r, es);
36 
37  for (auto& it_sum : _summaryList) {
38  _sumgen[it_sum]->beginRun(r, es);
39  }
40 }
std::map< Summary, hcaldqm::DQClient * > _sumgen
std::vector< Summary > _summaryList

Member Data Documentation

MonitorElement* HcalOfflineHarvesting::_reportSummaryMap
protected

Definition at line 64 of file HcalOfflineHarvesting.h.

Referenced by _dqmEndJob().

std::map<Summary, hcaldqm::DQClient *> HcalOfflineHarvesting::_sumgen
protected
std::map<Summary, bool> HcalOfflineHarvesting::_summarks
protected
std::vector<Summary> HcalOfflineHarvesting::_summaryList
protected
std::map<Summary, std::string> HcalOfflineHarvesting::_sumnames
protected
MonitorElement* HcalOfflineHarvesting::me
protected

Definition at line 65 of file HcalOfflineHarvesting.h.