CMS 3D CMS Logo

DQClient.cc
Go to the documentation of this file.
2 
3 namespace hcaldqm {
4  using namespace constants;
6  std::string const &taskname,
7  edm::ParameterSet const &ps,
9  : DQModule(ps),
10  _taskname(taskname),
11  _maxProcessedLS(0),
12  hcalDbServiceToken_(iC.esConsumes<HcalDbService, HcalDbRecord, edm::Transition::BeginRun>()),
13  runInfoToken_(iC.esConsumes<RunInfo, RunInfoRcd, edm::Transition::BeginRun>()),
14  hcalChannelQualityToken_(
16  edm::ESInputTag("", "withTopo"))) {
17  // - SET THE TASK NAME YOU REFER TO
18  // - SET THE CLIENT'S NAME AS WELL - RUN SUMMARY PLOTS
19  // WILL BE GENERATED UNDER THAT FOLDER
20  _name = name;
21  }
22 
23  void DQClient::beginRun(edm::Run const &r, edm::EventSetup const &es) {
24  // TEMPORARY
25  _vhashFEDs.clear();
26  _vcdaqEids.clear();
27  _vhashCrates.clear();
28 
29  // get various FED lists
31  _emap = dbs->getHcalMapping();
32 
33  if (_ptype != fOffline) { // hidefed2crate
35  for (std::vector<int>::const_iterator it = _vFEDs.begin(); it != _vFEDs.end(); ++it) {
36  //
37  // FIXME
38  // until there exists a map of FED2Crate and Crate2FED,
39  // all the unknown Crates will be mapped to 0...
40  //
41  if (*it == 0) {
43  continue;
44  }
45 
46  if (*it > FED_VME_MAX) {
47  std::pair<uint16_t, uint16_t> cspair = utilities::fed2crate(*it);
48  _vhashFEDs.push_back(
49  HcalElectronicsId(cspair.first, cspair.second, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
50  } else
52  }
53 
54  // get FEDs registered @cDAQ
55  if (auto runInfoRec = es.tryToGet<RunInfoRcd>()) {
56  const RunInfo &runInfo = es.getData(runInfoToken_);
57  std::vector<int> vfeds = runInfo.m_fed_in;
58  for (std::vector<int>::const_iterator it = vfeds.begin(); it != vfeds.end(); ++it) {
59  if (*it >= constants::FED_VME_MIN && *it <= FED_VME_MAX)
60  _vcdaqEids.push_back(
62  .rawId());
63  else if (*it >= constants::FED_uTCA_MIN && *it <= FEDNumbering::MAXHCALuTCAFEDID) {
64  std::pair<uint16_t, uint16_t> cspair = utilities::fed2crate(*it);
65  _vcdaqEids.push_back(
66  HcalElectronicsId(cspair.first, cspair.second, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
67  }
68  }
69  }
70  } else {
72  std::map<int, uint32_t> crateHashMap = utilities::getCrateHashMap(_emap);
73  for (auto &it_crate : _vCrates) {
74  _vhashCrates.push_back(crateHashMap[it_crate]);
75  }
76  }
77 
78  // Initialize channel quality masks, but do not load (changed for 10_4_X,
79  // moving to LS granularity)
81  }
82 
85  edm::LuminosityBlock const &lb,
86  edm::EventSetup const &es) {
87  // get the Channel Quality masks
88  _xQuality.reset();
90  std::vector<DetId> detids = cq->getAllChannels();
91  for (std::vector<DetId>::const_iterator it = detids.begin(); it != detids.end(); ++it) {
93  continue;
94 
95  if (HcalGenericDetId(*it).isHcalDetId()) {
96  HcalDetId did(*it);
97  uint32_t mask = (cq->getValues(did))->getValue();
98  if (mask != 0)
99  _xQuality.push(did, mask);
100  }
101  }
102  }
103 
106  edm::LuminosityBlock const &lb,
107  edm::EventSetup const &) {
109  _totalLS++;
112  }
113 
114  std::vector<flag::Flag> DQClient::endJob(DQMStore::IBooker &, DQMStore::IGetter &) {
115  return std::vector<flag::Flag>();
116  }
117 } // namespace hcaldqm
hcaldqm::constants::FED_VME_MIN
const int FED_VME_MIN
Definition: Constants.h:82
hcaldqm::DQClient::_vcdaqEids
std::vector< uint32_t > _vcdaqEids
Definition: DQClient.h:74
hcaldqm::ContainerXXX::initialize
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:81
hcaldqm::DQClient::_xQuality
ContainerXXX< uint32_t > _xQuality
Definition: DQClient.h:71
hcaldqm::utilities::getCrateHashMap
std::map< int, uint32_t > getCrateHashMap(HcalElectronicsMap const *emap)
Definition: Utilities.cc:80
hcaldqm::DQModule
Definition: DQModule.h:30
HcalGenericDetId
Definition: HcalGenericDetId.h:15
ESInputTag
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
HcalChannelQualityRcd
Definition: HcalChannelQualityRcd.h:8
edm::Run
Definition: Run.h:45
hcaldqm::DQClient::_vhashFEDs
std::vector< uint32_t > _vhashFEDs
Definition: DQClient.h:68
edm
HLT enums.
Definition: AlignableModifier.h:19
hcaldqm
Definition: Constants.h:8
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::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
FEDNumbering::MAXHCALuTCAFEDID
Definition: FEDNumbering.h:104
HcalChannelQuality
Definition: HcalChannelQuality.h:17
constants
hcaldqm::DQClient::endLuminosityBlock
virtual void endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQClient.cc:104
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:44
hcaldqm::DQClient::_vFEDs
std::vector< int > _vFEDs
Definition: DQClient.h:67
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::DQClient::hcalChannelQualityToken_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > hcalChannelQualityToken_
Definition: DQClient.h:59
RunInfo
Definition: RunInfo.h:18
hcaldqm::DQClient::beginLuminosityBlock
virtual void beginLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &lb, edm::EventSetup const &)
Definition: DQClient.cc:83
edm::EventSetup::tryToGet
std::optional< T > tryToGet() const
Definition: EventSetup.h:108
hcaldqm::DQClient::_totalLS
int _totalLS
Definition: DQClient.h:53
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::ContainerXXX::reset
virtual void reset()
Definition: ContainerXXX.h:292
hcaldqm::DQClient::beginRun
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQClient.cc:23
hcaldqm::constants::FIBER_VME_MIN
const int FIBER_VME_MIN
Definition: Constants.h:125
edm::ESHandle< HcalDbService >
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
hcaldqm::DQModule::_name
std::string _name
Definition: DQModule.h:42
DQClient.h
hcaldqm::constants::FIBERCH_MIN
const int FIBERCH_MIN
Definition: Constants.h:134
hcaldqm::DQClient::DQClient
DQClient(std::string const &, std::string const &, edm::ParameterSet const &, edm::ConsumesCollector &iC)
Definition: DQClient.cc:5
hcaldqm::DQClient::_maxProcessedLS
int _maxProcessedLS
Definition: DQClient.h:54
RunInfoRcd
Definition: RunSummaryRcd.h:26
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
hcaldqm::hashfunctions::fDChannel
Definition: HashFunctions.h:143
hcaldqm::constants::FED_uTCA_MIN
const int FED_uTCA_MIN
Definition: Constants.h:87
hcaldqm::DQClient::hcalDbServiceToken_
edm::ESGetToken< HcalDbService, HcalDbRecord > hcalDbServiceToken_
Definition: DQClient.h:57
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
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
edm::EventSetup
Definition: EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
alignCSCRings.r
r
Definition: alignCSCRings.py:93
hcaldqm::DQClient::_vhashCrates
std::vector< uint32_t > _vhashCrates
Definition: DQClient.h:64
HcalDbService
Definition: HcalDbService.h:23
HcalGenericDetId::isHcalDetId
bool isHcalDetId() const
Definition: HcalGenericDetId.cc:64
hcaldqm::DQClient::_emap
const HcalElectronicsMap * _emap
Definition: DQClient.h:60
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
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
submitPVValidationJobs.runInfo
dictionary runInfo
Definition: submitPVValidationJobs.py:1013
dqm::implementation::IBooker
Definition: DQMStore.h:43
hcaldqm::DQClient::endJob
virtual std::vector< flag::Flag > endJob(DQMStore::IBooker &, DQMStore::IGetter &)
Definition: DQClient.cc:114
HcalDbRecord
Definition: HcalDbRecord.h:30
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
hcaldqm::DQClient::runInfoToken_
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: DQClient.h:58
hcaldqm::DQClient::_vCrates
std::vector< int > _vCrates
Definition: DQClient.h:63
hcaldqm::fOffline
Definition: DQModule.h:26