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::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > 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 beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule () noexcept(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::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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
 
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdhcalChannelQualityToken_
 
edm::ESGetToken< HcalDbService, HcalDbRecordhcalDbServiceToken_
 
edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
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 DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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)
 
- Static Public Member Functions inherited from hcaldqm::DQModule
static void fillPSetDescription (edm::ParameterSetDescription &desc)
 

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

◆ Summary

Constructor & Destructor Documentation

◆ HcalOfflineHarvesting()

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

Definition at line 7 of file HcalOfflineHarvesting.cc.

References _sumgen, _summarks, _summaryList, _sumnames, edm::EDConsumerBase::consumesCollector(), 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  auto iC = consumesCollector();
21  if (std::find(_summaryList.begin(), _summaryList.end(), fRaw) != _summaryList.end()) {
22  _sumgen[fRaw] = new hcaldqm::RawRunSummary("RawRunHarvesting", _sumnames[fRaw], ps, iC);
23  }
24  if (std::find(_summaryList.begin(), _summaryList.end(), fDigi) != _summaryList.end()) {
25  _sumgen[fDigi] = new hcaldqm::DigiRunSummary("DigiRunHarvesting", _sumnames[fDigi], ps, iC);
26  }
27  if (std::find(_summaryList.begin(), _summaryList.end(), fReco) != _summaryList.end()) {
28  _sumgen[fReco] = new hcaldqm::RecoRunSummary("RecoRunHarvesting", _sumnames[fReco], ps, iC);
29  }
30  if (std::find(_summaryList.begin(), _summaryList.end(), fTP) != _summaryList.end()) {
31  _sumgen[fTP] = new hcaldqm::TPRunSummary("TPRunHarvesting", _sumnames[fTP], ps, iC);
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:19
MonitorElement * _reportSummaryMap
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
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::~HcalOfflineHarvesting ( )
inlineoverride

Definition at line 42 of file HcalOfflineHarvesting.h.

42 {}

Member Function Documentation

◆ _dqmEndJob()

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

Implements hcaldqm::DQHarvester.

Definition at line 68 of file HcalOfflineHarvesting.cc.

References hcaldqm::DQModule::_debug, hcaldqm::DQModule::_name, _reportSummaryMap, hcaldqm::DQModule::_subsystem, _sumgen, _summarks, _summaryList, _sumnames, hcaldqm::DQHarvester::_vCrates, gather_cfg::cout, edm::one::EDProducerBase::endJob(), fDigi, HLT_2024v13_cff::flags, fRaw, fReco, fTP, mps_fire::i, cuy::ib, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, EgammaValidation_cff::num, dqm::impl::MonitorElement::setBinContent(), dqm::impl::MonitorElement::setBinLabel(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

◆ _dqmEndLuminosityBlock()

void HcalOfflineHarvesting::_dqmEndLuminosityBlock ( DQMStore::IBooker ib,
DQMStore::IGetter ig,
edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
overrideprotectedvirtual

Implements hcaldqm::DQHarvester.

Definition at line 46 of file HcalOfflineHarvesting.cc.

References hcaldqm::DQModule::_subsystem, _sumgen, _summarks, _summaryList, _sumnames, DQMEDHarvester::endLuminosityBlock(), dqm::implementation::IGetter::get(), and cuy::ib.

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

◆ beginRun()

void HcalOfflineHarvesting::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
override

Definition at line 35 of file HcalOfflineHarvesting.cc.

References _sumgen, _summaryList, and alignCSCRings::r.

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

Member Data Documentation

◆ _reportSummaryMap

MonitorElement* HcalOfflineHarvesting::_reportSummaryMap
protected

Definition at line 64 of file HcalOfflineHarvesting.h.

Referenced by _dqmEndJob().

◆ _sumgen

std::map<Summary, hcaldqm::DQClient *> HcalOfflineHarvesting::_sumgen
protected

◆ _summarks

std::map<Summary, bool> HcalOfflineHarvesting::_summarks
protected

◆ _summaryList

std::vector<Summary> HcalOfflineHarvesting::_summaryList
protected

◆ _sumnames

std::map<Summary, std::string> HcalOfflineHarvesting::_sumnames
protected

◆ me

MonitorElement* HcalOfflineHarvesting::me
protected

Definition at line 65 of file HcalOfflineHarvesting.h.