CMS 3D CMS Logo

DQHarvester.cc
Go to the documentation of this file.
3 
4 namespace hcaldqm {
5  using namespace constants;
6 
8 
9  void DQHarvester::beginRun(edm::Run const &r, edm::EventSetup const &es) {
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  }
76 
79  edm::LuminosityBlock const &lb,
80  edm::EventSetup const &es) {
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  }
98 
100  DQMStore::IGetter &ig,
101  edm::LuminosityBlock const &lb,
102  edm::EventSetup const &es) {
103  // should be the same - just in case!
105  _totalLS++;
106  _dqmEndLuminosityBlock(ib, ig, lb, es);
107  }
109 } // namespace hcaldqm
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
hcaldqm::constants::FED_VME_MIN
const int FED_VME_MIN
Definition: Constants.h:80
hcaldqm::DQHarvester::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: DQHarvester.cc:99
hcaldqm::ContainerXXX::initialize
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:81
hcaldqm::utilities::getCrateHashMap
std::map< int, uint32_t > getCrateHashMap(HcalElectronicsMap const *emap)
Definition: Utilities.cc:66
hcaldqm::DQModule
Definition: DQModule.h:30
HcalGenericDetId
Definition: HcalGenericDetId.h:15
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
HcalChannelQualityRcd
Definition: HcalChannelQualityRcd.h:8
edm::Run
Definition: Run.h:45
hcaldqm::DQHarvester::_emap
const HcalElectronicsMap * _emap
Definition: DQHarvester.h:35
hcaldqm::DQHarvester::_vFEDs
std::vector< int > _vFEDs
Definition: DQHarvester.h:45
hcaldqm
Definition: Constants.h:8
hcaldqm::DQHarvester::_totalLS
int _totalLS
Definition: DQHarvester.h:38
hcaldqm::constants::SPIGOT_MIN
const int SPIGOT_MIN
Definition: Constants.h:118
hcaldqm::utilities::getCrateList
std::vector< int > getCrateList(HcalElectronicsMap const *emap)
Definition: Utilities.cc:52
hcaldqm::fLocal
Definition: DQModule.h:26
hcaldqm::constants::SLOT_uTCA_MIN
const int SLOT_uTCA_MIN
Definition: Constants.h:105
hcaldqm::constants::FIBER_uTCA_MIN1
const int FIBER_uTCA_MIN1
Definition: Constants.h:126
RunInfo::m_fed_in
std::vector< int > m_fed_in
Definition: RunInfo.h:25
hcaldqm::DQHarvester::_dqmEndJob
virtual void _dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)=0
HcalChannelQuality
Definition: HcalChannelQuality.h:17
constants
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:43
HcalCondObjectContainer::getValues
const Item * getValues(DetId fId, bool throwOnFail=true) const
Definition: HcalCondObjectContainer.h:159
hcaldqm::utilities::getFEDList
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:83
HcalDbService::getHcalMapping
const HcalElectronicsMap * getHcalMapping() const
Definition: HcalDbService.cc:343
hcaldqm::DQHarvester::_vhashFEDs
std::vector< uint32_t > _vhashFEDs
Definition: DQHarvester.h:46
hcaldqm::DQHarvester::DQHarvester
DQHarvester(edm::ParameterSet const &)
Definition: DQHarvester.cc:7
hcaldqm::DQHarvester::_vCrates
std::vector< int > _vCrates
Definition: DQHarvester.h:41
edm::EventSetup::tryToGet
std::optional< T > tryToGet() const
Definition: EventSetup.h:101
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
hcaldqm::DQModule::_currentLS
int _currentLS
Definition: DQModule.h:52
edm::LuminosityBlockBase::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: LuminosityBlockBase.h:40
hcaldqm::ContainerXXX::push
virtual void push(HcalDetId const &, STDTYPE)
Definition: ContainerXXX.h:227
HcalGenericDetId::HcalGenUnknown
Definition: HcalGenericDetId.h:27
hcaldqm::constants::FIBER_VME_MIN
const int FIBER_VME_MIN
Definition: Constants.h:123
Run.h
edm::ESHandle< HcalDbService >
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
hcaldqm::constants::FIBERCH_MIN
const int FIBERCH_MIN
Definition: Constants.h:132
hcaldqm::DQHarvester::_dqmEndLuminosityBlock
virtual void _dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)=0
RunInfoRcd
Definition: RunSummaryRcd.h:26
edm::ParameterSet
Definition: ParameterSet.h:47
DQHarvester.h
hcaldqm::hashfunctions::fDChannel
Definition: HashFunctions.h:134
hcaldqm::constants::FED_uTCA_MIN
const int FED_uTCA_MIN
Definition: Constants.h:85
HcalCondObjectContainer::getAllChannels
std::vector< DetId > getAllChannels() const
Definition: HcalCondObjectContainer.h:312
reco::JetExtendedAssociation::getValue
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
Definition: JetExtendedAssociation.cc:50
hcaldqm::constants::FED_VME_MAX
const int FED_VME_MAX
Definition: Constants.h:81
FEDNumbering::MAXHCALuTCAFEDID
Definition: FEDNumbering.h:104
HcalDetId
Definition: HcalDetId.h:12
hcaldqm::DQHarvester::_vcdaqEids
std::vector< uint32_t > _vcdaqEids
Definition: DQHarvester.h:51
hcaldqm::DQHarvester::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: DQHarvester.cc:9
cuy.ib
ib
Definition: cuy.py:662
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
alignCSCRings.r
r
Definition: alignCSCRings.py:93
hcaldqm::DQHarvester::_xQuality
ContainerXXX< uint32_t > _xQuality
Definition: DQHarvester.h:48
HcalGenericDetId::isHcalDetId
bool isHcalDetId() const
Definition: HcalGenericDetId.cc:64
dqm::implementation::IGetter
Definition: DQMStore.h:484
HcalGenericDetId::genericSubdet
HcalGenericSubdetector genericSubdet() const
Definition: HcalGenericDetId.cc:21
HcalElectronicsId::rawId
constexpr uint32_t rawId() const
Definition: HcalElectronicsId.h:59
hcaldqm::utilities::fed2crate
std::pair< uint16_t, uint16_t > fed2crate(int fed)
Definition: Utilities.cc:10
dqm::implementation::IBooker
Definition: DQMStore.h:43
hcaldqm::DQHarvester::dqmBeginLuminosityBlock
void dqmBeginLuminosityBlock(DQMStore::IBooker &ib, DQMStore::IGetter &ig, edm::LuminosityBlock const &lb, edm::EventSetup const &es)
Definition: DQHarvester.cc:77
HcalDbRecord
Definition: HcalDbRecord.h:30
hcaldqm::DQHarvester::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: DQHarvester.cc:108
hcaldqm::DQHarvester::_vhashCrates
std::vector< uint32_t > _vhashCrates
Definition: DQHarvester.h:42
hcaldqm::fOffline
Definition: DQModule.h:26