CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
hcaldqm::DQHarvester Class Referenceabstract

#include <DQHarvester.h>

Inheritance diagram for 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 HcalOfflineHarvesting HcalOnlineHarvesting

Public Member Functions

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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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 Member Functions

virtual void _dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &)=0
 
virtual void _dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)=0
 
- 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)
 
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

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

Detailed Description

Definition at line 17 of file DQHarvester.h.

Constructor & Destructor Documentation

hcaldqm::DQHarvester::DQHarvester ( edm::ParameterSet const &  ps)

Definition at line 7 of file DQHarvester.cc.

7 : DQModule(ps) {}
DQModule(edm::ParameterSet const &)
Definition: DQModule.cc:5
hcaldqm::DQHarvester::~DQHarvester ( )
inlineoverride

Definition at line 20 of file DQHarvester.h.

References beginRun(), dqmBeginLuminosityBlock(), dqmEndJob(), dqmEndLuminosityBlock(), and cuy::ib.

20 {}

Member Function Documentation

virtual void hcaldqm::DQHarvester::_dqmEndJob ( DQMStore::IBooker ,
DQMStore::IGetter  
)
protectedpure virtual

Implemented in HcalOnlineHarvesting, and HcalOfflineHarvesting.

Referenced by dqmEndJob().

virtual void hcaldqm::DQHarvester::_dqmEndLuminosityBlock ( DQMStore::IBooker ,
DQMStore::IGetter ,
edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
protectedpure virtual
void hcaldqm::DQHarvester::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
override

Definition at line 9 of file DQHarvester.cc.

References _emap, hcaldqm::DQModule::_ptype, _vcdaqEids, _vCrates, _vFEDs, _vhashCrates, _vhashFEDs, _xQuality, hcaldqm::hashfunctions::fDChannel, hcaldqm::utilities::fed2crate(), hcaldqm::constants::FED_uTCA_MIN, hcaldqm::constants::FED_VME_MAX, hcaldqm::constants::FED_VME_MIN, hcaldqm::constants::FIBER_uTCA_MIN1, hcaldqm::constants::FIBER_VME_MIN, hcaldqm::constants::FIBERCH_MIN, hcaldqm::fLocal, hcaldqm::fOffline, edm::EventSetup::get(), hcaldqm::utilities::getCrateHashMap(), hcaldqm::utilities::getCrateList(), hcaldqm::utilities::getFEDList(), HcalDbService::getHcalMapping(), hcaldqm::ContainerXXX< STDTYPE >::initialize(), RunInfo::m_fed_in, FEDNumbering::MAXHCALuTCAFEDID, HcalElectronicsId::rawId(), edm::RunAuxiliary::run(), edm::Run::runAuxiliary(), hcaldqm::constants::SLOT_uTCA_MIN, hcaldqm::constants::SPIGOT_MIN, and edm::EventSetup::tryToGet().

Referenced by ~DQHarvester().

9  {
10  if (_ptype == fLocal)
11  if (r.runAuxiliary().run() == 1)
12  return;
13 
14  // TEMPORARY FIX
15  if (_ptype != fOffline) { // hidefed2crate
16  _vhashFEDs.clear();
17  _vcdaqEids.clear();
18  }
19 
20  // - get the Hcal Electronics Map
21  // - collect all the FED numbers and FED's rawIds
23  es.get<HcalDbRecord>().get(dbs);
24  _emap = dbs->getHcalMapping();
25 
26  if (_ptype != fOffline) { // hidefed2crate
28  for (std::vector<int>::const_iterator it = _vFEDs.begin(); it != _vFEDs.end(); ++it) {
29  //
30  // FIXME
31  // until there exists a map of FED2Crate and Crate2FED,
32  // all the unknown Crates will be mapped to 0...
33  //
34  if (*it == 0) {
36  continue;
37  }
38 
39  if (*it > FED_VME_MAX) {
40  std::pair<uint16_t, uint16_t> cspair = utilities::fed2crate(*it);
41  _vhashFEDs.push_back(
42  HcalElectronicsId(cspair.first, cspair.second, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
43  } else
45  }
46 
47  // get the FEDs registered at cDAQ
48  if (auto runInfoRec = es.tryToGet<RunInfoRcd>()) {
50  runInfoRec->get(ri);
51  std::vector<int> vfeds = ri->m_fed_in;
52  for (std::vector<int>::const_iterator it = vfeds.begin(); it != vfeds.end(); ++it) {
53  if (*it >= constants::FED_VME_MIN && *it <= FED_VME_MAX)
54  _vcdaqEids.push_back(
56  .rawId());
57  else if (*it >= constants::FED_uTCA_MIN && *it <= FEDNumbering::MAXHCALuTCAFEDID) {
58  std::pair<uint16_t, uint16_t> cspair = utilities::fed2crate(*it);
59  _vcdaqEids.push_back(
60  HcalElectronicsId(cspair.first, cspair.second, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
61  }
62  }
63  }
64  } else {
66  std::map<int, uint32_t> crateHashMap = utilities::getCrateHashMap(_emap);
67  for (auto &it_crate : _vCrates) {
68  _vhashCrates.push_back(crateHashMap[it_crate]);
69  }
70  }
71 
72  // Initialize channel quality masks, but do not load (changed for 10_4_X,
73  // moving to LS granularity)
75  }
ContainerXXX< uint32_t > _xQuality
Definition: DQHarvester.h:48
constexpr uint32_t rawId() const
std::vector< uint32_t > _vhashFEDs
Definition: DQHarvester.h:46
std::pair< uint16_t, uint16_t > fed2crate(int fed)
Definition: Utilities.cc:10
int const SPIGOT_MIN
Definition: Constants.h:118
int const FIBER_VME_MIN
Definition: Constants.h:123
int const FED_uTCA_MIN
Definition: Constants.h:85
int const FIBERCH_MIN
Definition: Constants.h:132
ProcessingType _ptype
Definition: DQModule.h:43
int const FED_VME_MIN
Definition: Constants.h:80
std::vector< int > m_fed_in
Definition: RunInfo.h:25
int const FIBER_uTCA_MIN1
Definition: Constants.h:126
std::map< int, uint32_t > getCrateHashMap(HcalElectronicsMap const *emap)
Definition: Utilities.cc:66
std::vector< int > getCrateList(HcalElectronicsMap const *emap)
Definition: Utilities.cc:52
HcalElectronicsMap const * _emap
Definition: DQHarvester.h:35
std::vector< uint32_t > _vhashCrates
Definition: DQHarvester.h:42
std::vector< int > _vCrates
Definition: DQHarvester.h:41
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:83
const HcalElectronicsMap * getHcalMapping() const
std::vector< int > _vFEDs
Definition: DQHarvester.h:45
std::vector< uint32_t > _vcdaqEids
Definition: DQHarvester.h:51
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:81
int const FED_VME_MAX
Definition: Constants.h:81
Readout chain identification for Hcal.
int const SLOT_uTCA_MIN
Definition: Constants.h:105
void hcaldqm::DQHarvester::dqmBeginLuminosityBlock ( DQMStore::IBooker ib,
DQMStore::IGetter ig,
edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)

Definition at line 77 of file DQHarvester.cc.

References _xQuality, HcalGenericDetId::genericSubdet(), edm::EventSetup::get(), HcalCondObjectContainer< Item >::getAllChannels(), reco::JetExtendedAssociation::getValue(), HcalCondObjectContainer< Item >::getValues(), HcalGenericDetId::HcalGenUnknown, HcalGenericDetId::isHcalDetId(), edm::ESHandle< T >::product(), and hcaldqm::ContainerXXX< STDTYPE >::push().

Referenced by ~DQHarvester().

80  {
81  // get the Hcal Channels Quality for channels that are not 0
83  es.get<HcalChannelQualityRcd>().get("withTopo", hcq);
84  const HcalChannelQuality *cq = hcq.product();
85  std::vector<DetId> detids = cq->getAllChannels();
86  for (std::vector<DetId>::const_iterator it = detids.begin(); it != detids.end(); ++it) {
88  continue;
89 
90  if (HcalGenericDetId(*it).isHcalDetId()) {
91  HcalDetId did(*it);
92  uint32_t mask = (cq->getValues(did))->getValue();
93  if (mask != 0)
94  _xQuality.push(did, mask);
95  }
96  }
97  }
ContainerXXX< uint32_t > _xQuality
Definition: DQHarvester.h:48
virtual void push(HcalDetId const &, STDTYPE)
Definition: ContainerXXX.h:227
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< DetId > getAllChannels() const
bool isHcalDetId() const
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
HcalGenericSubdetector genericSubdet() const
T const * product() const
Definition: ESHandle.h:86
void hcaldqm::DQHarvester::dqmEndJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 108 of file DQHarvester.cc.

References _dqmEndJob().

Referenced by ~DQHarvester().

108 { _dqmEndJob(ib, ig); }
virtual void _dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)=0
ib
Definition: cuy.py:662
void hcaldqm::DQHarvester::dqmEndLuminosityBlock ( DQMStore::IBooker ib,
DQMStore::IGetter ig,
edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from DQMEDHarvester.

Definition at line 99 of file DQHarvester.cc.

References hcaldqm::DQModule::_currentLS, _dqmEndLuminosityBlock(), _totalLS, and edm::LuminosityBlockBase::luminosityBlock().

Referenced by ~DQHarvester().

102  {
103  // should be the same - just in case!
104  _currentLS = lb.luminosityBlock();
105  _totalLS++;
106  _dqmEndLuminosityBlock(ib, ig, lb, es);
107  }
virtual void _dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)=0
ib
Definition: cuy.py:662

Member Data Documentation

HcalElectronicsMap const* hcaldqm::DQHarvester::_emap
protected

Definition at line 35 of file DQHarvester.h.

Referenced by HcalOnlineHarvesting::_dqmEndLuminosityBlock(), and beginRun().

int hcaldqm::DQHarvester::_totalLS
protected

Definition at line 38 of file DQHarvester.h.

Referenced by dqmEndLuminosityBlock().

std::vector<uint32_t> hcaldqm::DQHarvester::_vcdaqEids
protected

Definition at line 51 of file DQHarvester.h.

Referenced by beginRun().

std::vector<int> hcaldqm::DQHarvester::_vCrates
protected

Definition at line 41 of file DQHarvester.h.

Referenced by HcalOfflineHarvesting::_dqmEndJob(), and beginRun().

std::vector<int> hcaldqm::DQHarvester::_vFEDs
protected

Definition at line 45 of file DQHarvester.h.

Referenced by HcalOnlineHarvesting::_dqmEndLuminosityBlock(), and beginRun().

std::vector<uint32_t> hcaldqm::DQHarvester::_vhashCrates
protected

Definition at line 42 of file DQHarvester.h.

Referenced by beginRun().

std::vector<uint32_t> hcaldqm::DQHarvester::_vhashFEDs
protected

Definition at line 46 of file DQHarvester.h.

Referenced by HcalOnlineHarvesting::_dqmEndLuminosityBlock(), and beginRun().

ContainerXXX<uint32_t> hcaldqm::DQHarvester::_xQuality
protected