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, bool dopedsubtr=true)
 
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.

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

Referenced by aveTSDB(), and sumQDB().

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

◆ aveADC()

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

Definition at line 148 of file Utilities.h.

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

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

◆ aveQ()

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

Definition at line 135 of file Utilities.h.

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

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

◆ aveTS()

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

Definition at line 115 of file Utilities.h.

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

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

115  {
116  double sumQ = 0;
117  double sumQT = 0;
118  for (int ii = i; ii <= j; ii++) {
119  sumQ += digi.sample(ii).nominal_fC() - ped;
120  sumQT += (ii + 1) * (digi.sample(ii).nominal_fC() - ped);
121  }
122 
123  return sumQ > 0 ? sumQT / sumQ - 1 : constants::GARBAGE_VALUE;
124  }
int const GARBAGE_VALUE
Definition: Constants.h:247
ii
Definition: cuy.py:589
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:127

◆ 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 79 of file Utilities.h.

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

79  {
80  double sumQ = 0;
81  double sumQT = 0;
82  for (int ii = i; ii <= j; ii++) {
83  double q = constants::adc2fC[frame[ii].adc()] - ped;
84  sumQ += q;
85  sumQT += (ii + 1) * q;
86  }
87 
88  return sumQ > 0 ? sumQT / sumQ - 1 : constants::GARBAGE_VALUE;
89  }
int const GARBAGE_VALUE
Definition: Constants.h:247
static const float adc2fC[128]
ii
Definition: cuy.py:589
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:127

◆ 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,
bool  dopedsubtr = true 
)

Definition at line 44 of file Utilities.h.

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

50  {
51  double sumQ = 0;
52  double sumQT = 0;
53  for (unsigned int i = i_start; i <= i_end; ++i) {
54  double q = dopedsubtr ? adc2fCDBMinusPedestal(conditions, calo_samples, did, digi, i) : calo_samples[i];
55  sumQ += q;
56  sumQT += (i + 1) * q;
57  }
58  return (sumQ > 0 ? sumQT / sumQ - 1 : constants::GARBAGE_VALUE);
59  }
double adc2fCDBMinusPedestal(const edm::ESHandle< HcalDbService > &conditions, const CaloSamples &calo_samples, const HcalDetId did, const Digi &digi, unsigned int n)
Definition: Utilities.h:33
int const GARBAGE_VALUE
Definition: Constants.h:247
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:127

◆ crate2fed()

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

Definition at line 29 of file Utilities.cc.

References hcaldqm::constants::crate2fed_map, hcaldqm::constants::crateListuTCA, hcaldqm::constants::crateListVME, 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().

29  {
30  // for the details see Constants.h
31  int fed = 0;
32  auto it_crate2fed = constants::crate2fed_map.find(crate);
33  if (it_crate2fed != constants::crate2fed_map.end()) {
34  fed = it_crate2fed->second;
35  if (fed <= FED_VME_MAX && fed > 0) {
36  if (slot > 10 && (std::find(constants::crateListVME.begin(), constants::crateListVME.end(), crate) !=
38  ++fed;
39  }
40  } else {
41  if (crate == 22 || crate == 29 || crate == 32 || crate == 23 || crate == 27 || crate == 26 ||
42  crate == 38) { // needed to handle dual fed readout for HF and HO
45  ++fed; // hard coded mid slot FED numbering
46  }
47  } else { // needed to handle 3-FED readout for HBHE
50  fed = (fed + 1100) / 2 + 40; // hard coded right slot FED numbering, no better way
51  } else if (slot > 4 &&
54  ++fed; // hard coded mid slot FED numbering
55  }
56  }
57  }
58  }
59  return fed;
60  }
std::vector< unsigned int > const crateListuTCA
Definition: Constants.h:74
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::map< unsigned int, unsigned int > const crate2fed_map
Definition: Constants.h:29
std::vector< unsigned int > const crateListVME
Definition: Constants.h:75

◆ dqmdebug()

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

Definition at line 156 of file Utilities.h.

References gather_cfg::cout, debug, and x.

156  {
157  if (debug == 0)
158  return;
159  std::cout << "%MSG" << std::endl;
160  std::cout << "%MSG-d HCALDQM::" << x;
161  std::cout << std::endl;
162  }
#define debug
Definition: HDRShower.cc:19
float x

◆ fed2crate()

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

Definition at line 10 of file Utilities.cc.

References 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().

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 if ((fed >= 1100 && fed <= 1117) || (fed >= 1140 && fed <= 1148)) {
16  slot = fed >= 1140 ? SLOT_uTCA_MIN + 8 : fed % 2 == 0 ? SLOT_uTCA_MIN : SLOT_uTCA_MIN + 4;
17  } else {
18  slot = fed % 2 == 0 ? SLOT_uTCA_MIN : SLOT_uTCA_MIN + 6;
19  }
20  std::pair<uint16_t, uint16_t> crate_slot = std::make_pair<uint16_t, uint16_t>(0, 0);
21  auto it_fed2crate = constants::fed2crate_map.find(fed);
22  if (it_fed2crate != constants::fed2crate_map.end()) {
23  crate_slot =
24  std::make_pair<uint16_t const, uint16_t const>((uint16_t const)it_fed2crate->second, (uint16_t const)slot);
25  }
26  return crate_slot;
27  }
std::map< unsigned int, unsigned int > const fed2crate_map
Definition: Constants.h:54
int const FED_VME_MAX
Definition: Constants.h:83
int const SLOT_uTCA_MIN
Definition: Constants.h:107

◆ getCrateHashMap()

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

Definition at line 80 of file Utilities.cc.

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().

80  {
81  std::map<int, uint32_t> crateHashMap;
82  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
83  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
85  int this_crate = eid.crateId();
86  uint32_t this_hash =
87  (eid.isVMEid()
90  if (crateHashMap.find(this_crate) == crateHashMap.end()) {
91  crateHashMap[this_crate] = this_hash;
92  }
93  }
94  return crateHashMap;
95  }
int const FIBER_VME_MIN
Definition: Constants.h:125
int const FIBERCH_MIN
Definition: Constants.h:134
int const FIBER_uTCA_MIN1
Definition: Constants.h:128
Readout chain identification for Hcal.

◆ getCrateList()

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

Definition at line 66 of file Utilities.cc.

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

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

66  {
67  std::vector<int> vCrates;
68  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
69  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
71  int crate = eid.crateId();
72  if (std::find(vCrates.begin(), vCrates.end(), crate) == vCrates.end()) {
73  vCrates.push_back(crate);
74  }
75  }
76  std::sort(vCrates.begin(), vCrates.end());
77  return vCrates;
78  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Readout chain identification for Hcal.

◆ getFEDList()

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

Definition at line 97 of file Utilities.cc.

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

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

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

◆ getFEDuTCAList()

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

Definition at line 135 of file Utilities.cc.

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

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

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

◆ getFEDVMEList()

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

Definition at line 115 of file Utilities.cc.

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

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

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

◆ getRBX()

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

Definition at line 242 of file Utilities.cc.

References LEDCalibrationChannels::iphi.

Referenced by LaserTask::_process().

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

◆ 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 63 of file Utilities.cc.

References runTauDisplay::eid.

63 { return eid.rawId(); }

◆ hash() [3/3]

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

Definition at line 64 of file Utilities.cc.

References DetId::rawId().

64 { return tid.rawId(); }

◆ isFEDHBHE()

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

Definition at line 156 of file Utilities.cc.

References crate2fed(), and runTauDisplay::eid.

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

156  {
157  if (eid.isVMEid()) {
158  return false;
159  } else {
160  int fed = crate2fed(eid.crateId(), eid.slot());
161  if ((fed >= 1100 && fed < 1118) || (fed >= 1140 && fed <= 1148))
162  return true;
163  else
164  return false;
165  }
166 
167  return false;
168  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:29

◆ isFEDHF()

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

Definition at line 170 of file Utilities.cc.

References crate2fed(), and runTauDisplay::eid.

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

170  {
171  if (eid.isVMEid())
172  return false;
173  int fed = crate2fed(eid.crateId(), eid.slot());
174  if (fed >= 1118 && fed <= 1123)
175  return true;
176  else
177  return false;
178 
179  return false;
180  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:29

◆ isFEDHO()

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

Definition at line 182 of file Utilities.cc.

References crate2fed(), and runTauDisplay::eid.

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

182  {
183  if (eid.isVMEid())
184  return false;
185  int fed = crate2fed(eid.crateId(), eid.slot());
186  if (fed >= 1124 && fed <= 1135)
187  return true;
188  else
189  return false;
190 
191  return false;
192  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:29

◆ 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.

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

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  }

◆ maxTS()

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

Definition at line 103 of file Utilities.h.

References mps_fire::i.

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

103  {
104  int maxTS = -1;
105  double maxQ = -100;
106  for (int i = 0; i < digi.size(); i++)
107  if ((digi.sample(i).nominal_fC() - ped) > maxQ) {
108  maxQ = digi.sample(i).nominal_fC() - ped;
109  maxTS = i;
110  }
111  return maxTS;
112  }
int maxTS(DIGI const &digi, double ped=0)
Definition: Utilities.h:103

◆ ogtype2string()

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

Definition at line 197 of file Utilities.cc.

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::tMegatile, hcaldqm::constants::tNull, hcaldqm::constants::tPedestal, hcaldqm::constants::tPhysics, hcaldqm::constants::tSafe, hcaldqm::constants::tSiPMPMT, hcaldqm::constants::tUnknown, and hcaldqm::constants::tZDC.

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

197  {
198  switch (type) {
199  case tNull:
200  return "Null";
201  case tPhysics:
202  return "Physics";
203  case tPedestal:
204  return "Pedestal";
205  case tLED:
206  return "LED";
207  case tHFRaddam:
208  return "HFRaddam";
209  case tHBHEHPD:
210  return "HBHEHPD";
211  case tHO:
212  return "HO";
213  case tHF:
214  return "HF";
215  case tZDC:
216  return "ZDC";
217  case tHEPMega:
218  return "HEPMegatile";
219  case tHEMMega:
220  return "HEMMegatile";
221  case tHBPMega:
222  return "HBPMegatile";
223  case tHBMMega:
224  return "HBMMegatile";
225  case tCRF:
226  return "CRF";
227  case tCalib:
228  return "Calib";
229  case tSafe:
230  return "Safe";
231  case tSiPMPMT:
232  return "SiPM-PMT";
233  case tMegatile:
234  return "Megatile";
235  case tUnknown:
236  return "Unknown";
237  default:
238  return "Null";
239  }
240  }

◆ sumADC()

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

Definition at line 140 of file Utilities.h.

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

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

◆ sumQ()

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

Definition at line 127 of file Utilities.h.

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

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

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

◆ sumQ_v10()

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

Definition at line 92 of file Utilities.h.

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

92  {
93  double sumQ = 0;
94  for (int ii = i; ii <= j; ii++)
95  sumQ += constants::adc2fC[frame[ii].adc()] - ped;
96  return sumQ;
97  }
static const float adc2fC[128]
ii
Definition: cuy.py:589
uint16_t *__restrict__ uint16_t const *__restrict__ adc
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:127

◆ 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 62 of file Utilities.h.

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

67  {
68  double sumQ = 0;
69  for (unsigned int i = i_start; i <= i_end; ++i) {
70  sumQ += adc2fCDBMinusPedestal(conditions, calo_samples, did, digi, i);
71  }
72  return sumQ;
73  }
double adc2fCDBMinusPedestal(const edm::ESHandle< HcalDbService > &conditions, const CaloSamples &calo_samples, const HcalDetId did, const Digi &digi, unsigned int n)
Definition: Utilities.h:33
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:127