CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQHarvester.cc
Go to the documentation of this file.
2 
3 namespace hcaldqm
4 {
6  DQModule(ps)
7  {}
8 
9  /* virtual */ void DQHarvester::beginRun(edm::Run const& r,
10  edm::EventSetup const& es)
11  {
12  if (_ptype==fLocal)
13  if (r.runAuxiliary().run()==1)
14  return;
15 
16  // TEMPORARY FIX
17  _vhashFEDs.clear(); _vcdaqEids.clear();
18 
19  // - get the Hcal Electronics Map
20  // - collect all the FED numbers and FED's rawIds
22  es.get<HcalDbRecord>().get(dbs);
23  _emap = dbs->getHcalMapping();
24 
26  for (std::vector<int>::const_iterator it=_vFEDs.begin();
27  it!=_vFEDs.end(); ++it)
28  if (*it>FED_VME_MAX)
29  _vhashFEDs.push_back(HcalElectronicsId(
31  FIBERCH_MIN, false).rawId());
32  else
34  FIBER_VME_MIN, SPIGOT_MIN, (*it)-FED_VME_MIN).rawId());
35 
36  // get the FEDs registered at cDAQ
39  "RunInfoRcd"));
40  if (es.find(recordKey))
41  {
43  es.get<RunInfoRcd>().get(ri);
44  std::vector<int> vfeds= ri->m_fed_in;
45  for (std::vector<int>::const_iterator it=vfeds.begin();
46  it!=vfeds.end(); ++it)
47  {
48  if (*it>=constants::FED_VME_MIN && *it<=FED_VME_MAX)
49  _vcdaqEids.push_back(HcalElectronicsId(
52  (*it)-FED_VME_MIN).rawId());
53  else if (*it>=constants::FED_uTCA_MIN &&
55  _vcdaqEids.push_back(HcalElectronicsId(
57  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
58  }
59  }
60 
61  // get the Hcal Channels Quality for channels that are not 0
64  es.get<HcalChannelQualityRcd>().get("withTopo", hcq);
65  const HcalChannelQuality *cq = hcq.product();
66  std::vector<DetId> detids = cq->getAllChannels();
67  for (std::vector<DetId>::const_iterator it=detids.begin();
68  it!=detids.end(); ++it)
69  {
70  if (HcalGenericDetId(*it).genericSubdet()==
72  continue;
73 
74  if (HcalGenericDetId(*it).isHcalDetId())
75  {
76  HcalDetId did(*it);
77  uint32_t mask = (cq->getValues(did))->getValue();
78  if (mask!=0)
79  _xQuality.push(did, mask);
80  }
81  }
82  }
83 
86  edm::LuminosityBlock const& lb, edm::EventSetup const& es)
87  {
88  // should be the same - just in case!
90  _totalLS++;
91  _dqmEndLuminosityBlock(ib, ig, lb, es);
92  }
95  {
96  _dqmEndJob(ib, ig);
97  }
98 }
ContainerXXX< uint32_t > _xQuality
Definition: DQHarvester.h:41
std::vector< uint32_t > _vhashFEDs
Definition: DQHarvester.h:39
int ib
Definition: cuy.py:660
uint16_t fed2crate(int fed)
Definition: Utilities.cc:12
virtual void _dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)=0
int const SPIGOT_MIN
Definition: Constants.h:85
virtual void push(HcalDetId const &, STDTYPE)
Definition: ContainerXXX.h:261
const Item * getValues(DetId fId, bool throwOnFail=true) const
int const FIBER_VME_MIN
Definition: Constants.h:90
int const FED_uTCA_MIN
Definition: Constants.h:52
int const FIBERCH_MIN
Definition: Constants.h:100
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:91
LuminosityBlockNumber_t luminosityBlock() const
virtual void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
Definition: DQHarvester.cc:93
ProcessingType _ptype
Definition: DQModule.h:59
virtual void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQHarvester.cc:84
int const FED_VME_MIN
Definition: Constants.h:47
std::vector< DetId > getAllChannels() const
virtual void _dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)=0
int const FIBER_uTCA_MIN1
Definition: Constants.h:93
bool isHcalDetId() const
HcalElectronicsMap const * _emap
Definition: DQHarvester.h:32
DQHarvester(edm::ParameterSet const &)
Definition: DQHarvester.cc:5
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
RunAuxiliary const & runAuxiliary() const
Definition: Run.h:60
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQHarvester.cc:9
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:47
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
std::vector< int > _vFEDs
Definition: DQHarvester.h:38
std::vector< uint32_t > _vcdaqEids
Definition: DQHarvester.h:44
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:85
HcalGenericSubdetector genericSubdet() const
int const FED_VME_MAX
Definition: Constants.h:48
Readout chain identification for Hcal.
RunNumber_t run() const
Definition: RunAuxiliary.h:41
int const SLOT_uTCA_MIN
Definition: Constants.h:72
Definition: Run.h:43
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:125