CMS 3D CMS Logo

DQHarvester.cc
Go to the documentation of this file.
3 
4 namespace hcaldqm {
5  using namespace constants;
6 
8  : DQModule(ps),
9  hcalDbServiceToken_(esConsumes<HcalDbService, HcalDbRecord, edm::Transition::BeginRun>()),
10  runInfoToken_(esConsumes<RunInfo, RunInfoRcd, edm::Transition::BeginRun>()),
11  hcalChannelQualityToken_(
13  edm::ESInputTag("", "withTopo"))) {}
14 
15  void DQHarvester::beginRun(edm::Run const &r, edm::EventSetup const &es) {
16  if (_ptype == fLocal)
17  if (r.runAuxiliary().run() == 1)
18  return;
19 
20  // TEMPORARY FIX
21  if (_ptype != fOffline) { // hidefed2crate
22  _vhashFEDs.clear();
23  _vcdaqEids.clear();
24  }
25 
26  // - get the Hcal Electronics Map
27  // - collect all the FED numbers and FED's rawIds
29  _emap = dbs->getHcalMapping();
30 
31  if (_ptype != fOffline) { // hidefed2crate
33  for (std::vector<int>::const_iterator it = _vFEDs.begin(); it != _vFEDs.end(); ++it) {
34  //
35  // FIXME
36  // until there exists a map of FED2Crate and Crate2FED,
37  // all the unknown Crates will be mapped to 0...
38  //
39  if (*it == 0) {
41  continue;
42  }
43 
44  if (*it > FED_VME_MAX) {
45  std::pair<uint16_t, uint16_t> cspair = utilities::fed2crate(*it);
46  _vhashFEDs.push_back(
47  HcalElectronicsId(cspair.first, cspair.second, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
48  } else
50  }
51 
52  // get the FEDs registered at cDAQ
53  if (auto runInfoRec = es.tryToGet<RunInfoRcd>()) {
54  const RunInfo &runInfo = es.getData(runInfoToken_);
55  std::vector<int> vfeds = runInfo.m_fed_in;
56  for (std::vector<int>::const_iterator it = vfeds.begin(); it != vfeds.end(); ++it) {
57  if (*it >= constants::FED_VME_MIN && *it <= FED_VME_MAX)
58  _vcdaqEids.push_back(
60  .rawId());
61  else if (*it >= constants::FED_uTCA_MIN && *it <= FEDNumbering::MAXHCALuTCAFEDID) {
62  std::pair<uint16_t, uint16_t> cspair = utilities::fed2crate(*it);
63  _vcdaqEids.push_back(
64  HcalElectronicsId(cspair.first, cspair.second, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
65  }
66  }
67  }
68  } else {
70  std::map<int, uint32_t> crateHashMap = utilities::getCrateHashMap(_emap);
71  for (auto &it_crate : _vCrates) {
72  _vhashCrates.push_back(crateHashMap[it_crate]);
73  }
74  }
75 
76  // Initialize channel quality masks, but do not load (changed for 10_4_X,
77  // moving to LS granularity)
79  }
80 
83  edm::LuminosityBlock const &lb,
84  edm::EventSetup const &es) {
85  // get the Hcal Channels Quality for channels that are not 0
87  std::vector<DetId> detids = cq->getAllChannels();
88  for (std::vector<DetId>::const_iterator it = detids.begin(); it != detids.end(); ++it) {
90  continue;
91 
92  if (HcalGenericDetId(*it).isHcalDetId()) {
93  HcalDetId did(*it);
94  uint32_t mask = (cq->getValues(did))->getValue();
95  if (mask != 0)
96  _xQuality.push(did, mask);
97  }
98  }
99  }
100 
102  DQMStore::IGetter &ig,
103  edm::LuminosityBlock const &lb,
104  edm::EventSetup const &es) {
105  // should be the same - just in case!
107  _totalLS++;
108  _dqmEndLuminosityBlock(ib, ig, lb, es);
109  }
111 } // namespace hcaldqm
hcaldqm::constants::FED_VME_MIN
const int FED_VME_MIN
Definition: Constants.h:82
hcaldqm::DQHarvester::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: DQHarvester.cc:101
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:80
hcaldqm::DQModule
Definition: DQModule.h:30
hcaldqm::DQHarvester::hcalChannelQualityToken_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > hcalChannelQualityToken_
Definition: DQHarvester.h:55
HcalGenericDetId
Definition: HcalGenericDetId.h:15
ESInputTag
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
edm
HLT enums.
Definition: AlignableModifier.h:19
hcaldqm
Definition: Constants.h:8
hcaldqm::DQHarvester::runInfoToken_
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: DQHarvester.h:54
hcaldqm::DQHarvester::_totalLS
int _totalLS
Definition: DQHarvester.h:38
hcaldqm::constants::SPIGOT_MIN
const int SPIGOT_MIN
Definition: Constants.h:120
hcaldqm::utilities::getCrateList
std::vector< int > getCrateList(HcalElectronicsMap const *emap)
Definition: Utilities.cc:66
hcaldqm::fLocal
Definition: DQModule.h:26
hcaldqm::constants::SLOT_uTCA_MIN
const int SLOT_uTCA_MIN
Definition: Constants.h:107
hcaldqm::constants::FIBER_uTCA_MIN1
const int FIBER_uTCA_MIN1
Definition: Constants.h:128
hcaldqm::DQHarvester::_dqmEndJob
virtual void _dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)=0
FEDNumbering::MAXHCALuTCAFEDID
Definition: FEDNumbering.h:104
HcalChannelQuality
Definition: HcalChannelQuality.h:17
constants
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:44
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:97
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
RunInfo
Definition: RunInfo.h:18
edm::EventSetup::tryToGet
std::optional< T > tryToGet() const
Definition: EventSetup.h:108
hcaldqm::DQModule::_currentLS
int _currentLS
Definition: DQModule.h:53
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:125
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:134
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
edm::Transition
Transition
Definition: Transition.h:12
DQHarvester.h
hcaldqm::hashfunctions::fDChannel
Definition: HashFunctions.h:143
hcaldqm::constants::FED_uTCA_MIN
const int FED_uTCA_MIN
Definition: Constants.h:87
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:83
HcalDetId
Definition: HcalDetId.h:12
hcaldqm::DQHarvester::_vcdaqEids
std::vector< uint32_t > _vcdaqEids
Definition: DQHarvester.h:51
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
hcaldqm::DQHarvester::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: DQHarvester.cc:15
cuy.ib
ib
Definition: cuy.py:661
edm::EventSetup
Definition: EventSetup.h:58
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
alignCSCRings.r
r
Definition: alignCSCRings.py:93
hcaldqm::DQHarvester::_xQuality
ContainerXXX< uint32_t > _xQuality
Definition: DQHarvester.h:48
HcalDbService
Definition: HcalDbService.h:23
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
submitPVValidationJobs.runInfo
dictionary runInfo
Definition: submitPVValidationJobs.py:1013
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:81
HcalDbRecord
Definition: HcalDbRecord.h:30
hcaldqm::DQHarvester::hcalDbServiceToken_
edm::ESGetToken< HcalDbService, HcalDbRecord > hcalDbServiceToken_
Definition: DQHarvester.h:53
hcaldqm::DQHarvester::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: DQHarvester.cc:110
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
hcaldqm::DQHarvester::_vhashCrates
std::vector< uint32_t > _vhashCrates
Definition: DQHarvester.h:42
hcaldqm::fOffline
Definition: DQModule.h:26