CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | 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< T > 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< T >
 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 final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule () noexcept(false)
 

Public Attributes

tuple hcalOfflineHarvesting
 

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
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< B > consumes (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 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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
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,
HcalChannelQualityRcd
hcalChannelQualityToken_
 
edm::ESGetToken< HcalDbService,
HcalDbRecord
hcalDbServiceToken_
 
edm::ESGetToken< RunInfo,
RunInfoRcd
runInfoToken_
 
- 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
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

Constructor & Destructor Documentation

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 ( )
inlineoverride

Definition at line 42 of file HcalOfflineHarvesting.h.

42 {}

Member Function Documentation

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, dqm::implementation::IBooker::book2D(), gather_cfg::cout, edm::one::EDProducerBase::endJob(), fDigi, fRaw, fReco, fTP, mps_fire::i, mergeVDriftHistosByStation::name, pileupDistInMC::num, dqm::impl::MonitorElement::setBinContent(), dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

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]);
98  _reportSummaryMap->setBinLabel(i + 1, name, 1);
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;
104  _reportSummaryMap->setBinLabel(value + 1, name, 2);
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 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::map< Summary, std::string > _sumnames
MonitorElement * _reportSummaryMap
std::map< Summary, hcaldqm::DQClient * > _sumgen
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
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
std::string _subsystem
Definition: DQModule.h:49
tuple cout
Definition: gather_cfg.py:144
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 46 of file HcalOfflineHarvesting.cc.

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

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
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
std::map< Summary, hcaldqm::DQClient * > _sumgen
std::string _subsystem
Definition: DQModule.h:49
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.

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

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
tuple HcalOfflineHarvesting.hcalOfflineHarvesting
Initial value:
2  "HcalOfflineHarvesting",
3 
4  name = cms.untracked.string("HcalOfflineHarvesting"),
5  debug = cms.untracked.int32(0),
6  runkeyVal = cms.untracked.int32(0),
7  runkeyName = cms.untracked.string('pp_run'),
8  ptype = cms.untracked.int32(1),
9  mtype = cms.untracked.bool(True),
10  subsystem = cms.untracked.string("Hcal"),
11 
12  thresh_EtMsmRate_high = cms.untracked.double(0.2),
13  thresh_EtMsmRate_low = cms.untracked.double(0.1),
14  thresh_FGMsmRate_high = cms.untracked.double(0.2),
15  thresh_FGMsmRate_low = cms.untracked.double(0.1),
16  thresh_unihf = cms.untracked.double(0.2),
17  thresh_tcds = cms.untracked.double(1.5),
18  refDigiSize = digiTask.refDigiSize,
19 )

Definition at line 5 of file HcalOfflineHarvesting.py.

MonitorElement* HcalOfflineHarvesting::me
protected

Definition at line 65 of file HcalOfflineHarvesting.h.