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::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer > 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 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 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 endRun (edm::Run const &, edm::EventSetup const &) override
 
void produce (edm::Event &, edm::EventSetup const &) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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)
 
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 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 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.

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

Definition at line 43 of file HcalOfflineHarvesting.h.

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

43 {}

Member Function Documentation

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

Implements hcaldqm::DQHarvester.

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

73 {
74  // OBTAIN/SET WHICH MODULES ARE PRESENT
75  std::map<Summary, std::string> datatier_names;
76  datatier_names[fRaw] = "RAW";
77  datatier_names[fDigi] = "DIGI";
78  datatier_names[fReco] = "RECO";
79  datatier_names[fTP] = "TP";
80 
81  int num=0; std::map<std::string, int> datatiers;
82  for (auto& it_sum : _summaryList) {
83  if (_summarks[it_sum]) {
84  datatiers.insert(std::pair<std::string, int>(datatier_names[it_sum], num));
85  ++num;
86  }
87  }
88 
89  // CREATE THE REPORT SUMMARY MAP
90  // num is #modules
91  // datatiers - std map [DATATIER_NAME] -> [positional value [0,num-1]]
92  // -> bin wise +1 should be
93  if (!_reportSummaryMap)
94  {
95  ib.setCurrentFolder(_subsystem+"/EventInfo");
96  _reportSummaryMap = ib.book2D("reportSummaryMap", "reportSummaryMap",
97  _vCrates.size(), 0, _vCrates.size(), num,0,num);
98  // x axis labels
99 
100  for (uint32_t i=0; i<_vCrates.size(); i++)
101  {
102  char name[5];
103  sprintf(name, "%d", _vCrates[i]);
104  _reportSummaryMap->setBinLabel(i+1, name, 1);
105  }
106  // y axis lables
107  for (std::map<std::string, int>::const_iterator
108  it=datatiers.begin(); it!=datatiers.end(); ++it)
109  {
110  std::string name = it->first;
111  int value = it->second;
112  _reportSummaryMap->setBinLabel(value+1, name, 2);
113  }
114  }
115 
116  // iterate over all summary generators and get the flags
117  for (auto& it_sum : _summaryList) {
118  // IF MODULE IS NOT PRESENT IN DATA SKIP
119  if (!_summarks[it_sum]) {
120  continue;
121  }
122 
123  // OBTAIN ALL THE FLAGS FOR THIS MODULE
124  // AND SET THE REPORT STATUS MAP
125  // NOTE AGAIN: datatiers map [DATATIER]->[value not bin!]+1 therefore
126  if (_debug>0) {
127  std::cout << _sumnames[it_sum] << std::endl;
128  }
129  std::vector<hcaldqm::flag::Flag> flags = (_sumgen[it_sum])->endJob(ib,ig);
130  if (_debug>0)
131  {
132  std::cout << "********************" << std::endl;
133  std::cout << "SUMMARY" << std::endl;
134  }
135  for (uint32_t icrate=0; icrate<_vCrates.size(); icrate++)
136  {
137  _reportSummaryMap->setBinContent(icrate+1, datatiers[flags[icrate]._name]+1, (int)flags[icrate]._state);
138  if (_debug>0)
139  {
140  std::cout << "Crate=" << _vCrates[icrate] << std::endl;
141  std::cout << flags[icrate]._name << " " << flags[icrate]._state
142  <<std::endl;
143  }
144  }
145  }
146 }
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
MonitorElement * _reportSummaryMap
Definition: value.py:1
std::string _name
Definition: DQModule.h:57
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
std::vector< int > _vCrates
Definition: DQHarvester.h:38
std::map< Summary, hcaldqm::DQClient * > _sumgen
std::string _subsystem
Definition: DQModule.h:64
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 48 of file HcalOfflineHarvesting.cc.

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

Referenced by ~HcalOfflineHarvesting().

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

Definition at line 35 of file HcalOfflineHarvesting.cc.

References _sumgen, and _summaryList.

Referenced by ~HcalOfflineHarvesting().

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

Member Data Documentation

MonitorElement* HcalOfflineHarvesting::_reportSummaryMap
protected

Definition at line 73 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 74 of file HcalOfflineHarvesting.h.