test
CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQClient.cc
Go to the documentation of this file.
2 
3 namespace hcaldqm
4 {
5  DQClient::DQClient(std::string const& name, std::string const& taskname,
6  edm::ParameterSet const& ps) :
7  DQModule(ps),_taskname(taskname), _maxProcessedLS(0)
8  {
9  // - SET THE TASK NAME YOU REFER TO
10  // - SET THE CLIENT'S NAME AS WELL - RUN SUMMARY PLOTS
11  // WILL BE GENERATED UNDER THAT FOLDER
12  _name = name;
13  }
14 
15  /* virtual */ void DQClient::beginRun(edm::Run const& r,
16  edm::EventSetup const& es)
17  {
18  // TEMPORARY
19  _vhashFEDs.clear(); _vcdaqEids.clear();
20 
21  // get various FED lists
23  es.get<HcalDbRecord>().get(dbs);
24  _emap = dbs->getHcalMapping();
26  for (std::vector<int>::const_iterator it=_vFEDs.begin();
27  it!=_vFEDs.end(); ++it)
28  {
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)
35  {
36  _vhashFEDs.push_back(HcalElectronicsId(
38  FIBERCH_MIN, false).rawId());
39  continue;
40  }
41 
42  if (*it>FED_VME_MAX)
43  _vhashFEDs.push_back(HcalElectronicsId(
45  FIBERCH_MIN, false).rawId());
46  else
48  FIBER_VME_MIN, SPIGOT_MIN, (*it)-FED_VME_MIN).rawId());
49  }
50 
51  // get FEDs registered @cDAQ
54  "RunInfoRcd"));
55  if (es.find(recordKey))
56  {
58  es.get<RunInfoRcd>().get(ri);
59  std::vector<int> vfeds=ri->m_fed_in;
60  for (std::vector<int>::const_iterator it=vfeds.begin();
61  it!=vfeds.end(); ++it)
62  {
63  if (*it>=constants::FED_VME_MIN && *it<=FED_VME_MAX)
64  _vcdaqEids.push_back(HcalElectronicsId(
67  (*it)-FED_VME_MIN).rawId());
68  else if (*it>=constants::FED_uTCA_MIN &&
70  _vcdaqEids.push_back(HcalElectronicsId(
72  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
73  }
74  }
75 
76  // get the Channel Quality masks
79  es.get<HcalChannelQualityRcd>().get("withTopo", hcq);
80  const HcalChannelQuality *cq = hcq.product();
81  std::vector<DetId> detids = cq->getAllChannels();
82  for (std::vector<DetId>::const_iterator it=detids.begin();
83  it!=detids.end(); ++it)
84  {
85  if (HcalGenericDetId(*it).genericSubdet()==
87  continue;
88 
89  if (HcalGenericDetId(*it).isHcalDetId())
90  {
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 
101  edm::EventSetup const&)
102  {
104  _totalLS++;
107  }
108 
109  /* virtual */ std::vector<flag::Flag> DQClient::endJob(DQMStore::IBooker&,
111  {
112  return std::vector<flag::Flag>();
113  }
114 }
std::vector< uint32_t > _vcdaqEids
Definition: DQClient.h:64
uint16_t fed2crate(int fed)
Definition: Utilities.cc:12
std::vector< uint32_t > _vhashFEDs
Definition: DQClient.h:58
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQClient.cc:15
int const SPIGOT_MIN
Definition: Constants.h:85
virtual void push(HcalDetId const &, STDTYPE)
Definition: ContainerXXX.h:285
HcalElectronicsMap const * _emap
Definition: DQClient.h:54
ContainerXXX< uint32_t > _xQuality
Definition: DQClient.h:61
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 endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQClient.cc:99
int const FED_VME_MIN
Definition: Constants.h:47
std::vector< DetId > getAllChannels() const
int const FIBER_uTCA_MIN1
Definition: Constants.h:93
std::string _name
Definition: DQModule.h:57
bool isHcalDetId() const
std::vector< int > _vFEDs
Definition: DQClient.h:57
const T & get() const
Definition: EventSetup.h:56
DQClient(std::string const &, std::string const &, edm::ParameterSet const &)
Definition: DQClient.cc:5
T const * product() const
Definition: ESHandle.h:86
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:47
virtual std::vector< flag::Flag > endJob(DQMStore::IBooker &, DQMStore::IGetter &)
Definition: DQClient.cc:109
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:91
HcalGenericSubdetector genericSubdet() const
int const FED_VME_MAX
Definition: Constants.h:48
Readout chain identification for Hcal.
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