CMS 3D CMS Logo

Functions
hcaldqm::utilities Namespace Reference

Functions

template<class Digi >
double adc2fCDBMinusPedestal (const edm::ESHandle< HcalDbService > &conditions, const CaloSamples &calo_samples, const HcalDetId did, const Digi &digi, unsigned int n)
 
template<typename DIGI >
double aveADC (DIGI const &digi, double ped, int i=0, int j=3)
 
template<typename DIGI >
double aveQ (DIGI const &digi, double ped, int i=0, int j=3)
 
template<typename DIGI >
double aveTS (DIGI const &digi, double ped=0, int i=0, int j=3)
 
template<typename FRAME >
double aveTS_v10 (FRAME const &frame, double ped=0, int i=0, int j=3)
 
template<class Digi >
double aveTSDB (const edm::ESHandle< HcalDbService > &conditions, const CaloSamples &calo_samples, const HcalDetId did, const Digi &digi, unsigned int i_start, unsigned int i_end)
 
uint16_t crate2fed (int crate, int slot)
 
template<typename STDTYPE >
void dqmdebug (STDTYPE const &x, int debug=0)
 
std::pair< uint16_t, uint16_t > fed2crate (int fed)
 
std::map< int, uint32_t > getCrateHashMap (HcalElectronicsMap const *emap)
 
std::vector< int > getCrateList (HcalElectronicsMap const *emap)
 
std::vector< int > getFEDList (HcalElectronicsMap const *)
 
std::vector< int > getFEDuTCAList (HcalElectronicsMap const *)
 
std::vector< int > getFEDVMEList (HcalElectronicsMap const *)
 
int getRBX (uint32_t iphi)
 
int getTPSubDet (HcalTrigTowerDetId const &)
 
int getTPSubDetPM (HcalTrigTowerDetId const &)
 
uint32_t hash (HcalDetId const &)
 
uint32_t hash (HcalElectronicsId const &)
 
uint32_t hash (HcalTrigTowerDetId const &)
 
bool isFEDHBHE (HcalElectronicsId const &)
 
bool isFEDHF (HcalElectronicsId const &)
 
bool isFEDHO (HcalElectronicsId const &)
 
template<class Digi >
CaloSamples loadADC2fCDB (const edm::ESHandle< HcalDbService > &conditions, const HcalDetId did, const Digi &digi)
 
template<typename DIGI >
int maxTS (DIGI const &digi, double ped=0)
 
std::string ogtype2string (constants::OrbitGapType type)
 
template<typename DIGI >
double sumADC (DIGI const &digi, double ped, int i=0, int j=3)
 
template<typename DIGI >
double sumQ (DIGI const &digi, double ped, int i=0, int j=3)
 
template<typename FRAME >
double sumQ_v10 (FRAME const &frame, double ped, int i=0, int j=3)
 
template<class Digi >
double sumQDB (const edm::ESHandle< HcalDbService > &conditions, const CaloSamples &calo_samples, const HcalDetId did, const Digi &digi, unsigned int i_start, unsigned int i_end)
 

Function Documentation

◆ adc2fCDBMinusPedestal()

template<class Digi >
double hcaldqm::utilities::adc2fCDBMinusPedestal ( const edm::ESHandle< HcalDbService > &  conditions,
const CaloSamples calo_samples,
const HcalDetId  did,
const Digi &  digi,
unsigned int  n 
)

Definition at line 33 of file Utilities.h.

37  {
38  HcalCalibrations calibrations = conditions->getHcalCalibrations(did);
39  int capid = digi[n].capid();
40  return calo_samples[n] - calibrations.pedestal(capid);
41  }

References AlignmentProducer_cff::calibrations, submitPVValidationJobs::conditions, and dqmiodumpmetadata::n.

Referenced by aveTSDB(), and sumQDB().

◆ aveADC()

template<typename DIGI >
double hcaldqm::utilities::aveADC ( DIGI const &  digi,
double  ped,
int  i = 0,
int  j = 3 
)

Definition at line 147 of file Utilities.h.

147  {
148  return sumADC<DIGI>(digi, ped, i, j) / (j - i + 1);
149  }

References mps_fire::i, and dqmiolumiharvest::j.

◆ aveQ()

template<typename DIGI >
double hcaldqm::utilities::aveQ ( DIGI const &  digi,
double  ped,
int  i = 0,
int  j = 3 
)

Definition at line 134 of file Utilities.h.

134  {
135  return sumQ<DIGI>(digi, ped, i, j) / (j - i + 1);
136  }

References mps_fire::i, and dqmiolumiharvest::j.

◆ aveTS()

template<typename DIGI >
double hcaldqm::utilities::aveTS ( DIGI const &  digi,
double  ped = 0,
int  i = 0,
int  j = 3 
)

Definition at line 114 of file Utilities.h.

114  {
115  double sumQ = 0;
116  double sumQT = 0;
117  for (int ii = i; ii <= j; ii++) {
118  sumQ += digi.sample(ii).nominal_fC() - ped;
119  sumQT += (ii + 1) * (digi.sample(ii).nominal_fC() - ped);
120  }
121 
122  return sumQ > 0 ? sumQT / sumQ - 1 : constants::GARBAGE_VALUE;
123  }

References hcaldqm::constants::GARBAGE_VALUE, mps_fire::i, cuy::ii, dqmiolumiharvest::j, and sumQ().

Referenced by LEDTask::_process(), and LaserTask::_process().

◆ aveTS_v10()

template<typename FRAME >
double hcaldqm::utilities::aveTS_v10 ( FRAME const &  frame,
double  ped = 0,
int  i = 0,
int  j = 3 
)

Definition at line 78 of file Utilities.h.

78  {
79  double sumQ = 0;
80  double sumQT = 0;
81  for (int ii = i; ii <= j; ii++) {
82  double q = constants::adc2fC[frame[ii].adc()] - ped;
83  sumQ += q;
84  sumQT += (ii + 1) * q;
85  }
86 
87  return sumQ > 0 ? sumQT / sumQ - 1 : constants::GARBAGE_VALUE;
88  }

References hcaldqm::constants::adc2fC, amptDefault_cfi::frame, hcaldqm::constants::GARBAGE_VALUE, mps_fire::i, cuy::ii, dqmiolumiharvest::j, submitPVResolutionJobs::q, and sumQ().

◆ aveTSDB()

template<class Digi >
double hcaldqm::utilities::aveTSDB ( const edm::ESHandle< HcalDbService > &  conditions,
const CaloSamples calo_samples,
const HcalDetId  did,
const Digi &  digi,
unsigned int  i_start,
unsigned int  i_end 
)

Definition at line 44 of file Utilities.h.

49  {
50  double sumQ = 0;
51  double sumQT = 0;
52  for (unsigned int i = i_start; i <= i_end; ++i) {
53  double q = adc2fCDBMinusPedestal(conditions, calo_samples, did, digi, i);
54  sumQ += q;
55  sumQT += (i + 1) * q;
56  }
57  return (sumQ > 0 ? sumQT / sumQ - 1 : constants::GARBAGE_VALUE);
58  }

References adc2fCDBMinusPedestal(), submitPVValidationJobs::conditions, hcaldqm::constants::GARBAGE_VALUE, mps_fire::i, submitPVResolutionJobs::q, and sumQ().

◆ crate2fed()

uint16_t hcaldqm::utilities::crate2fed ( int  crate,
int  slot 
)

Definition at line 27 of file Utilities.cc.

27  {
28  // for the details see Constants.h
29  int fed = 0;
30  auto it_crate2fed = constants::crate2fed_map.find(crate);
31  if (it_crate2fed != constants::crate2fed_map.end()) {
32  fed = it_crate2fed->second;
33  if (fed <= FED_VME_MAX && fed > 0) {
34  if (slot > 10 && (std::find(constants::crateListVME.begin(), constants::crateListVME.end(), crate) !=
36  ++fed;
37  }
38  } else {
39  if (crate == 22 || crate == 29 || crate == 32 || crate == 23 || crate == 27 || crate == 26 ||
40  crate == 38) { // needed to handle dual fed readout for HF and HO
41  if (slot > 6 && (std::find(constants::crateListuTCA.begin(), constants::crateListuTCA.end(), crate) !=
43  ++fed; // hard coded mid slot FED numbering
44  }
45  } else { // needed to handle 3-FED readout for HBHE
46  if (slot > 8 && (std::find(constants::crateListuTCA.begin(), constants::crateListuTCA.end(), crate) !=
48  fed = (fed + 1100) / 2 + 40; // hard coded right slot FED numbering, no better way
49  } else if (slot > 4 &&
52  ++fed; // hard coded mid slot FED numbering
53  }
54  }
55  }
56  }
57  return fed;
58  }

References hcaldqm::constants::crate2fed_map, hcaldqm::constants::crateListuTCA, hcaldqm::constants::crateListVME, mps_fire::end, and spr::find().

Referenced by getFEDList(), getFEDuTCAList(), getFEDVMEList(), hcaldqm::quantity::getLabels_FED(), hcaldqm::quantity::getLabels_FEDuTCA(), hcaldqm::quantity::getLabels_FEDuTCASlot(), hcaldqm::quantity::FEDQuantity::getValue(), hcaldqm::quantity::getValue_FED(), hcaldqm::quantity::getValue_FEDuTCA(), hcaldqm::quantity::getValue_FEDVME(), isFEDHBHE(), isFEDHF(), isFEDHO(), hcaldqm::hashfunctions::name_FED(), hcaldqm::hashfunctions::name_FEDSlot(), and hcaldqm::hashfunctions::name_FEDSpigot().

◆ dqmdebug()

template<typename STDTYPE >
void hcaldqm::utilities::dqmdebug ( STDTYPE const &  x,
int  debug = 0 
)

Definition at line 155 of file Utilities.h.

155  {
156  if (debug == 0)
157  return;
158  std::cout << "%MSG" << std::endl;
159  std::cout << "%MSG-d HCALDQM::" << x;
160  std::cout << std::endl;
161  }

References gather_cfg::cout, and debug.

◆ fed2crate()

std::pair< uint16_t, uint16_t > hcaldqm::utilities::fed2crate ( int  fed)

Definition at line 10 of file Utilities.cc.

10  {
11  // uTCA Crate is split in half
12  uint16_t slot = 0;
13  if (fed <= FED_VME_MAX) {
14  slot = fed % 2 == 0 ? SLOT_uTCA_MIN : SLOT_uTCA_MIN + 6;
15  } else {
16  slot = fed % 2 == 0 ? SLOT_uTCA_MIN : SLOT_uTCA_MIN + 6;
17  }
18  std::pair<uint16_t, uint16_t> crate_slot = std::make_pair<uint16_t, uint16_t>(0, 0);
19  auto it_fed2crate = constants::fed2crate_map.find(fed);
20  if (it_fed2crate != constants::fed2crate_map.end()) {
21  crate_slot =
22  std::make_pair<uint16_t const, uint16_t const>((uint16_t const)it_fed2crate->second, (uint16_t const)slot);
23  }
24  return crate_slot;
25  }

References mps_fire::end, hcaldqm::constants::fed2crate_map, hcaldqm::constants::FED_VME_MAX, and hcaldqm::constants::SLOT_uTCA_MIN.

Referenced by RawTask::_process(), hcaldqm::DQHarvester::beginRun(), hcaldqm::DQClient::beginRun(), PedestalTask::bookHistograms(), TPTask::bookHistograms(), LaserTask::bookHistograms(), RawTask::bookHistograms(), RecHitTask::bookHistograms(), DigiTask::bookHistograms(), hcaldqm::DQTask::bookHistograms(), hcaldqm::quantity::getEid_FED(), hcaldqm::quantity::getEid_FEDuTCA(), hcaldqm::hashfunctions::hash_FED(), hcaldqm::hashfunctions::hash_FEDSlot(), and hcaldqm::hashfunctions::hash_FEDSpigot().

◆ getCrateHashMap()

std::map< int, uint32_t > hcaldqm::utilities::getCrateHashMap ( HcalElectronicsMap const *  emap)

Definition at line 78 of file Utilities.cc.

78  {
79  std::map<int, uint32_t> crateHashMap;
80  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
81  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
83  int this_crate = eid.crateId();
84  uint32_t this_hash =
85  (eid.isVMEid()
88  if (crateHashMap.find(this_crate) == crateHashMap.end()) {
89  crateHashMap[this_crate] = this_hash;
90  }
91  }
92  return crateHashMap;
93  }

References HcalElectronicsMap::allElectronicsIdPrecision(), runTauDisplay::eid, hcaldqm::constants::FIBER_uTCA_MIN1, hcaldqm::constants::FIBER_VME_MIN, hcaldqm::constants::FIBERCH_MIN, and hash().

Referenced by hcaldqm::DQHarvester::beginRun(), hcaldqm::DQClient::beginRun(), and hcaldqm::quantity::CrateQuantity::setup().

◆ getCrateList()

std::vector< int > hcaldqm::utilities::getCrateList ( HcalElectronicsMap const *  emap)

Definition at line 64 of file Utilities.cc.

64  {
65  std::vector<int> vCrates;
66  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
67  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
69  int crate = eid.crateId();
70  if (std::find(vCrates.begin(), vCrates.end(), crate) == vCrates.end()) {
71  vCrates.push_back(crate);
72  }
73  }
74  std::sort(vCrates.begin(), vCrates.end());
75  return vCrates;
76  }

References HcalElectronicsMap::allElectronicsIdPrecision(), runTauDisplay::eid, spr::find(), and jetUpdater_cfi::sort.

Referenced by hcaldqm::DQHarvester::beginRun(), hcaldqm::DQClient::beginRun(), and hcaldqm::quantity::CrateQuantity::setup().

◆ getFEDList()

std::vector< int > hcaldqm::utilities::getFEDList ( HcalElectronicsMap const *  emap)

Definition at line 95 of file Utilities.cc.

95  {
96  std::vector<int> vfeds;
97  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
98  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
99  int fed = it->isVMEid() ? it->dccid() + FED_VME_MIN : crate2fed(it->crateId(), it->slot());
100  uint32_t n = 0;
101  for (std::vector<int>::const_iterator jt = vfeds.begin(); jt != vfeds.end(); ++jt)
102  if (fed == *jt)
103  break;
104  else
105  n++;
106  if (n == vfeds.size())
107  vfeds.push_back(fed);
108  }
109 
110  std::sort(vfeds.begin(), vfeds.end());
111  return vfeds;
112  }

References HcalElectronicsMap::allElectronicsIdPrecision(), crate2fed(), hcaldqm::constants::FED_VME_MIN, dqmiodumpmetadata::n, and jetUpdater_cfi::sort.

Referenced by hcaldqm::DQHarvester::beginRun(), hcaldqm::DQClient::beginRun(), DigiComparisonTask::bookHistograms(), TPComparisonTask::bookHistograms(), PedestalTask::bookHistograms(), TPTask::bookHistograms(), LaserTask::bookHistograms(), RawTask::bookHistograms(), RecHitTask::bookHistograms(), and DigiTask::bookHistograms().

◆ getFEDuTCAList()

std::vector< int > hcaldqm::utilities::getFEDuTCAList ( HcalElectronicsMap const *  emap)

Definition at line 133 of file Utilities.cc.

133  {
134  std::vector<int> vfeds;
135  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
136  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
137  if (it->isVMEid())
138  continue;
139  int fed = it->isVMEid() ? it->dccid() + FED_VME_MIN : crate2fed(it->crateId(), it->slot());
140  uint32_t n = 0;
141  for (std::vector<int>::const_iterator jt = vfeds.begin(); jt != vfeds.end(); ++jt)
142  if (fed == *jt)
143  break;
144  else
145  n++;
146  if (n == vfeds.size())
147  vfeds.push_back(fed);
148  }
149 
150  std::sort(vfeds.begin(), vfeds.end());
151  return vfeds;
152  }

References HcalElectronicsMap::allElectronicsIdPrecision(), crate2fed(), hcaldqm::constants::FED_VME_MIN, dqmiodumpmetadata::n, and jetUpdater_cfi::sort.

Referenced by DigiComparisonTask::bookHistograms(), TPComparisonTask::bookHistograms(), PedestalTask::bookHistograms(), TPTask::bookHistograms(), RawTask::bookHistograms(), LaserTask::bookHistograms(), RecHitTask::bookHistograms(), and DigiTask::bookHistograms().

◆ getFEDVMEList()

std::vector< int > hcaldqm::utilities::getFEDVMEList ( HcalElectronicsMap const *  emap)

Definition at line 113 of file Utilities.cc.

113  {
114  std::vector<int> vfeds;
115  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
116  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
117  if (!it->isVMEid())
118  continue;
119  int fed = it->isVMEid() ? it->dccid() + FED_VME_MIN : crate2fed(it->crateId(), it->slot());
120  uint32_t n = 0;
121  for (std::vector<int>::const_iterator jt = vfeds.begin(); jt != vfeds.end(); ++jt)
122  if (fed == *jt)
123  break;
124  else
125  n++;
126  if (n == vfeds.size())
127  vfeds.push_back(fed);
128  }
129 
130  std::sort(vfeds.begin(), vfeds.end());
131  return vfeds;
132  }

References HcalElectronicsMap::allElectronicsIdPrecision(), crate2fed(), hcaldqm::constants::FED_VME_MIN, dqmiodumpmetadata::n, and jetUpdater_cfi::sort.

Referenced by DigiComparisonTask::bookHistograms(), TPComparisonTask::bookHistograms(), PedestalTask::bookHistograms(), TPTask::bookHistograms(), RawTask::bookHistograms(), LaserTask::bookHistograms(), RecHitTask::bookHistograms(), and DigiTask::bookHistograms().

◆ getRBX()

int hcaldqm::utilities::getRBX ( uint32_t  iphi)

Definition at line 232 of file Utilities.cc.

232 { return (((iphi + 2) % 72) + 4 - 1) / 4; }

References LEDCalibrationChannels::iphi.

Referenced by LaserTask::_process().

◆ getTPSubDet()

int hcaldqm::utilities::getTPSubDet ( HcalTrigTowerDetId const &  )

◆ getTPSubDetPM()

int hcaldqm::utilities::getTPSubDetPM ( HcalTrigTowerDetId const &  )

◆ hash() [1/3]

uint32_t hcaldqm::utilities::hash ( HcalDetId const &  did)

◆ hash() [2/3]

uint32_t hcaldqm::utilities::hash ( HcalElectronicsId const &  eid)

Definition at line 61 of file Utilities.cc.

61 { return eid.rawId(); }

References runTauDisplay::eid.

◆ hash() [3/3]

uint32_t hcaldqm::utilities::hash ( HcalTrigTowerDetId const &  tid)

Definition at line 62 of file Utilities.cc.

62 { return tid.rawId(); }

References DetId::rawId().

◆ isFEDHBHE()

bool hcaldqm::utilities::isFEDHBHE ( HcalElectronicsId const &  eid)

Definition at line 154 of file Utilities.cc.

154  {
155  if (eid.isVMEid()) {
156  return false;
157  } else {
158  int fed = crate2fed(eid.crateId(), eid.slot());
159  if ((fed >= 1100 && fed < 1118) || (fed >= 1140 && fed <= 1148))
160  return true;
161  else
162  return false;
163  }
164 
165  return false;
166  }

References crate2fed(), and runTauDisplay::eid.

Referenced by PedestalTask::_dump(), LaserTask::_dump(), hcaldqm::RawRunSummary::endLuminosityBlock(), TPTask::globalEndLuminosityBlock(), RawTask::globalEndLuminosityBlock(), and DigiTask::globalEndLuminosityBlock().

◆ isFEDHF()

bool hcaldqm::utilities::isFEDHF ( HcalElectronicsId const &  eid)

Definition at line 168 of file Utilities.cc.

168  {
169  if (eid.isVMEid())
170  return false;
171  int fed = crate2fed(eid.crateId(), eid.slot());
172  if (fed >= 1118 && fed <= 1123)
173  return true;
174  else
175  return false;
176 
177  return false;
178  }

References crate2fed(), and runTauDisplay::eid.

Referenced by PedestalTask::_dump(), LaserTask::_dump(), hcaldqm::RawRunSummary::endLuminosityBlock(), TPTask::globalEndLuminosityBlock(), RawTask::globalEndLuminosityBlock(), RecHitTask::globalEndLuminosityBlock(), and DigiTask::globalEndLuminosityBlock().

◆ isFEDHO()

bool hcaldqm::utilities::isFEDHO ( HcalElectronicsId const &  eid)

Definition at line 180 of file Utilities.cc.

180  {
181  if (eid.isVMEid())
182  return false;
183  int fed = crate2fed(eid.crateId(), eid.slot());
184  if (fed >= 1124 && fed <= 1135)
185  return true;
186  else
187  return false;
188 
189  return false;
190  }

References crate2fed(), and runTauDisplay::eid.

Referenced by PedestalTask::_dump(), LaserTask::_dump(), hcaldqm::RawRunSummary::endLuminosityBlock(), RawTask::globalEndLuminosityBlock(), and DigiTask::globalEndLuminosityBlock().

◆ loadADC2fCDB()

template<class Digi >
CaloSamples hcaldqm::utilities::loadADC2fCDB ( const edm::ESHandle< HcalDbService > &  conditions,
const HcalDetId  did,
const Digi &  digi 
)

Definition at line 22 of file Utilities.h.

22  {
23  CaloSamples calo_samples;
24  const HcalQIECoder *channelCoder = conditions->getHcalCoder(did);
25  const HcalQIEShape *shape = conditions->getHcalShape(channelCoder);
26  HcalCoderDb coder(*channelCoder, *shape);
27  coder.adc2fC(digi, calo_samples);
28  return calo_samples;
29  }

References HcalCoderDb::adc2fC(), and submitPVValidationJobs::conditions.

◆ maxTS()

template<typename DIGI >
int hcaldqm::utilities::maxTS ( DIGI const &  digi,
double  ped = 0 
)

Definition at line 102 of file Utilities.h.

102  {
103  int maxTS = -1;
104  double maxQ = -100;
105  for (int i = 0; i < digi.size(); i++)
106  if ((digi.sample(i).nominal_fC() - ped) > maxQ) {
107  maxQ = digi.sample(i).nominal_fC() - ped;
108  maxTS = i;
109  }
110  return maxTS;
111  }

References mps_fire::i.

Referenced by LaserTask::_process(), and HBHEPhase1Reconstructor::processData().

◆ ogtype2string()

std::string hcaldqm::utilities::ogtype2string ( constants::OrbitGapType  type)

Definition at line 195 of file Utilities.cc.

195  {
196  switch (type) {
197  case tNull:
198  return "Null";
199  case tPedestal:
200  return "Pedestal";
201  case tLED:
202  return "LED";
203  case tHFRaddam:
204  return "HFRaddam";
205  case tHBHEHPD:
206  return "HBHEHPD";
207  case tHO:
208  return "HO";
209  case tHF:
210  return "HF";
211  case tZDC:
212  return "ZDC";
213  case tHEPMega:
214  return "HEPMegatile";
215  case tHEMMega:
216  return "HEMMegatile";
217  case tHBPMega:
218  return "HBPMegatile";
219  case tHBMMega:
220  return "HBMMegatile";
221  case tCRF:
222  return "CRF";
223  case tCalib:
224  return "Calib";
225  case tSafe:
226  return "Safe";
227  default:
228  return "Unknown";
229  }
230  }

References hcaldqm::constants::tCalib, hcaldqm::constants::tCRF, hcaldqm::constants::tHBHEHPD, hcaldqm::constants::tHBMMega, hcaldqm::constants::tHBPMega, hcaldqm::constants::tHEMMega, hcaldqm::constants::tHEPMega, hcaldqm::constants::tHF, hcaldqm::constants::tHFRaddam, hcaldqm::constants::tHO, hcaldqm::constants::tLED, hcaldqm::constants::tNull, hcaldqm::constants::tPedestal, hcaldqm::constants::tSafe, and hcaldqm::constants::tZDC.

Referenced by hcaldqm::quantity::EventType::getLabels().

◆ sumADC()

template<typename DIGI >
double hcaldqm::utilities::sumADC ( DIGI const &  digi,
double  ped,
int  i = 0,
int  j = 3 
)

Definition at line 139 of file Utilities.h.

139  {
140  double sum = 0;
141  for (int ii = i; ii <= j; ii++)
142  sum += digi.sample(ii).adc() - ped;
143  return sum;
144  }

References mps_fire::i, cuy::ii, and dqmiolumiharvest::j.

◆ sumQ()

template<typename DIGI >
double hcaldqm::utilities::sumQ ( DIGI const &  digi,
double  ped,
int  i = 0,
int  j = 3 
)

Definition at line 126 of file Utilities.h.

126  {
127  double sum = 0;
128  for (int ii = i; ii <= j; ii++)
129  sum += (digi.sample(ii).nominal_fC() - ped);
130  return sum;
131  }

References mps_fire::i, cuy::ii, and dqmiolumiharvest::j.

Referenced by NoCQTask::_process(), QIE10Task::_process(), LEDTask::_process(), UMNioTask::_process(), DigiTask::_process(), LaserTask::_process(), aveTS(), aveTS_v10(), aveTSDB(), StripCPEgeometric::WrappedCluster::centroid(), StripCPEgeometric::WrappedCluster::eta(), sumQ_v10(), and sumQDB().

◆ sumQ_v10()

template<typename FRAME >
double hcaldqm::utilities::sumQ_v10 ( FRAME const &  frame,
double  ped,
int  i = 0,
int  j = 3 
)

Definition at line 91 of file Utilities.h.

91  {
92  double sumQ = 0;
93  for (int ii = i; ii <= j; ii++)
94  sumQ += constants::adc2fC[frame[ii].adc()] - ped;
95  return sumQ;
96  }

References gpuClustering::adc, hcaldqm::constants::adc2fC, amptDefault_cfi::frame, mps_fire::i, cuy::ii, dqmiolumiharvest::j, and sumQ().

◆ sumQDB()

template<class Digi >
double hcaldqm::utilities::sumQDB ( const edm::ESHandle< HcalDbService > &  conditions,
const CaloSamples calo_samples,
const HcalDetId  did,
const Digi &  digi,
unsigned int  i_start,
unsigned int  i_end 
)

Definition at line 61 of file Utilities.h.

66  {
67  double sumQ = 0;
68  for (unsigned int i = i_start; i <= i_end; ++i) {
69  sumQ += adc2fCDBMinusPedestal(conditions, calo_samples, did, digi, i);
70  }
71  return sumQ;
72  }

References adc2fCDBMinusPedestal(), submitPVValidationJobs::conditions, mps_fire::i, and sumQ().

hcaldqm::constants::tCalib
Definition: Constants.h:310
hcaldqm::constants::fed2crate_map
const std::map< unsigned int, unsigned int > fed2crate_map
Definition: Constants.h:54
hcaldqm::constants::FED_VME_MIN
const int FED_VME_MIN
Definition: Constants.h:82
hcaldqm::constants::tHF
Definition: Constants.h:302
hcaldqm::constants::tHEPMega
Definition: Constants.h:304
mps_fire.i
i
Definition: mps_fire.py:428
hcaldqm::constants::crateListuTCA
const std::vector< unsigned int > crateListuTCA
Definition: Constants.h:74
funct::false
false
Definition: Factorize.h:29
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
hcaldqm::constants::GARBAGE_VALUE
const int GARBAGE_VALUE
Definition: Constants.h:247
hcaldqm::constants::tNull
Definition: Constants.h:296
utilities
Definition: utilities.py:1
cond::hash
Definition: Time.h:19
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
hcaldqm::constants::crate2fed_map
const std::map< unsigned int, unsigned int > crate2fed_map
Definition: Constants.h:29
gather_cfg.cout
cout
Definition: gather_cfg.py:144
hcaldqm::utilities::adc2fCDBMinusPedestal
double adc2fCDBMinusPedestal(const edm::ESHandle< HcalDbService > &conditions, const CaloSamples &calo_samples, const HcalDetId did, const Digi &digi, unsigned int n)
Definition: Utilities.h:33
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
AlignmentProducer_cff.calibrations
calibrations
Definition: AlignmentProducer_cff.py:59
hcaldqm::constants::tCRF
Definition: Constants.h:309
hcaldqm::utilities::maxTS
int maxTS(DIGI const &digi, double ped=0)
Definition: Utilities.h:102
hcaldqm::constants::crateListVME
const std::vector< unsigned int > crateListVME
Definition: Constants.h:75
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
adc2fC
static const float adc2fC[128]
Definition: CMTRawAnalyzer.h:410
hcaldqm::utilities::sumQ
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:126
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
debug
#define debug
Definition: HDRShower.cc:19
hcaldqm::constants::tHFRaddam
Definition: Constants.h:299
hcaldqm::constants::tLED
Definition: Constants.h:298
hcaldqm::constants::tHBPMega
Definition: Constants.h:306
mps_fire.end
end
Definition: mps_fire.py:242
hcaldqm::constants::FIBER_VME_MIN
const int FIBER_VME_MIN
Definition: Constants.h:125
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
hcaldqm::constants::tSafe
Definition: Constants.h:311
hcaldqm::constants::tHO
Definition: Constants.h:301
hcaldqm::constants::FIBERCH_MIN
const int FIBERCH_MIN
Definition: Constants.h:134
HcalCalibrations
Definition: HcalCalibrations.h:9
hcaldqm::constants::tHBHEHPD
Definition: Constants.h:300
hcaldqm::constants::tZDC
Definition: Constants.h:303
hcaldqm::constants::tPedestal
Definition: Constants.h:297
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
hcaldqm::constants::FED_VME_MAX
const int FED_VME_MAX
Definition: Constants.h:83
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
CaloSamples
Definition: CaloSamples.h:14
hcaldqm::constants::tHEMMega
Definition: Constants.h:305
HcalQIECoder
Definition: HcalQIECoder.h:20
submitPVValidationJobs.conditions
list conditions
Definition: submitPVValidationJobs.py:674
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
genVertex_cff.x
x
Definition: genVertex_cff.py:13
hcaldqm::constants::tHBMMega
Definition: Constants.h:307
hcaldqm::utilities::crate2fed
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:27
HcalQIEShape
Definition: HcalQIEShape.h:17
HcalCoderDb
Definition: HcalCoderDb.h:15
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
cuy.ii
ii
Definition: cuy.py:589