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

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, HcalDbService::getHcalCalibrations(), gen::n, and HcalCalibrations::pedestal().

Referenced by aveTSDB(), and sumQDB().

37  {
39  int capid = digi[n].capid();
40  return calo_samples[n] - calibrations.pedestal(capid);
41  }
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
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.

References mps_fire::i.

147  {
148  return sumADC<DIGI>(digi, ped, i, j) / (j - i + 1);
149  }
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.

References mps_fire::i.

134  {
135  return sumQ<DIGI>(digi, ped, i, j) / (j - i + 1);
136  }
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.

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

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

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  }
int const GARBAGE_VALUE
Definition: Constants.h:242
ii
Definition: cuy.py:590
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:126
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.

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

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  }
int const GARBAGE_VALUE
Definition: Constants.h:242
ii
Definition: cuy.py:590
double const adc2fC[256]
Definition: Constants.h:248
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:126
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.

References adc2fCDBMinusPedestal(), hcaldqm::constants::GARBAGE_VALUE, mps_fire::i, lumiQueryAPI::q, and sumQ().

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  }
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:242
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:126
uint16_t hcaldqm::utilities::crate2fed ( int  crate,
int  slot 
)

Definition at line 27 of file Utilities.cc.

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

Referenced by dqmdebug(), 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(), hcaldqm::hashfunctions::name_FED(), hcaldqm::hashfunctions::name_FEDSlot(), and hcaldqm::hashfunctions::name_FEDSpigot().

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 {
40  constants::crateListuTCA.end())) { // needed to handle dual fed readout
41  ++fed;
42  }
43  }
44  }
45  return fed;
46  }
std::vector< unsigned int > const crateListuTCA
Definition: Constants.h:70
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::map< unsigned int, unsigned int > const crate2fed_map
Definition: Constants.h:28
#define end
Definition: vmac.h:39
std::vector< unsigned int > const crateListVME
Definition: Constants.h:72
#define begin
Definition: vmac.h:32
template<typename STDTYPE >
void hcaldqm::utilities::dqmdebug ( STDTYPE const &  x,
int  debug = 0 
)

Definition at line 155 of file Utilities.h.

References gather_cfg::cout, crate2fed(), debug, fed2crate(), getCrateHashMap(), getCrateList(), getFEDList(), getFEDuTCAList(), getFEDVMEList(), getRBX(), getTPSubDet(), getTPSubDetPM(), hash(), isFEDHBHE(), isFEDHF(), isFEDHO(), ogtype2string(), and AlCaHLTBitMon_QueryRunRegistry::string.

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  }
#define debug
Definition: HDRShower.cc:19
std::pair< uint16_t, uint16_t > hcaldqm::utilities::fed2crate ( int  fed)

Definition at line 10 of file Utilities.cc.

References 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(), hcaldqm::DQTask::bookHistograms(), PedestalTask::bookHistograms(), TPTask::bookHistograms(), LaserTask::bookHistograms(), RawTask::bookHistograms(), RecHitTask::bookHistograms(), DigiTask::bookHistograms(), DigiPhase1Task::bookHistograms(), dqmdebug(), 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 {
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  }
std::map< unsigned int, unsigned int > const fed2crate_map
Definition: Constants.h:53
#define end
Definition: vmac.h:39
int const FED_VME_MAX
Definition: Constants.h:79
int const SLOT_uTCA_MIN
Definition: Constants.h:103
std::map< int, uint32_t > hcaldqm::utilities::getCrateHashMap ( HcalElectronicsMap const *  emap)

Definition at line 66 of file Utilities.cc.

References HcalElectronicsMap::allElectronicsIdPrecision(), HcalElectronicsId::crateId(), HcalElectronicsId::dccid(), runTauDisplay::eid, hcaldqm::constants::FIBER_uTCA_MIN1, hcaldqm::constants::FIBER_VME_MIN, hcaldqm::constants::FIBERCH_MIN, hash(), HcalElectronicsId::isVMEid(), HcalElectronicsId::slot(), and HcalElectronicsId::spigot().

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

66  {
67  std::map<int, uint32_t> crateHashMap;
68  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
69  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
71  int this_crate = eid.crateId();
72  uint32_t this_hash =
73  (eid.isVMEid()
75  : utilities::hash(HcalElectronicsId(eid.crateId(), eid.slot(), FIBER_uTCA_MIN1, FIBERCH_MIN, false)));
76  if (crateHashMap.find(this_crate) == crateHashMap.end()) {
77  crateHashMap[this_crate] = this_hash;
78  }
79  }
80  return crateHashMap;
81  }
constexpr int dccid() const
get the (Hcal local) DCC id for VME, crate number for uTCA
int const FIBER_VME_MIN
Definition: Constants.h:121
int const FIBERCH_MIN
Definition: Constants.h:130
constexpr bool isVMEid() const
int const FIBER_uTCA_MIN1
Definition: Constants.h:124
constexpr int spigot() const
get the spigot (input number on DCC, AMC card number for uTCA)
constexpr int crateId() const
get the readout VME crate number
Readout chain identification for Hcal.
std::vector< int > hcaldqm::utilities::getCrateList ( HcalElectronicsMap const *  emap)

Definition at line 52 of file Utilities.cc.

References HcalElectronicsMap::allElectronicsIdPrecision(), HcalElectronicsId::crateId(), runTauDisplay::eid, and spr::find().

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

52  {
53  std::vector<int> vCrates;
54  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
55  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
57  int crate = eid.crateId();
58  if (std::find(vCrates.begin(), vCrates.end(), crate) == vCrates.end()) {
59  vCrates.push_back(crate);
60  }
61  }
62  std::sort(vCrates.begin(), vCrates.end());
63  return vCrates;
64  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
constexpr int crateId() const
get the readout VME crate number
Readout chain identification for Hcal.
std::vector< int > hcaldqm::utilities::getFEDList ( HcalElectronicsMap const *  emap)

Definition at line 83 of file Utilities.cc.

References HcalElectronicsMap::allElectronicsIdPrecision(), crate2fed(), hcaldqm::constants::FED_VME_MIN, and gen::n.

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

83  {
84  std::vector<int> vfeds;
85  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
86  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
87  int fed = it->isVMEid() ? it->dccid() + FED_VME_MIN : crate2fed(it->crateId(), it->slot());
88  uint32_t n = 0;
89  for (std::vector<int>::const_iterator jt = vfeds.begin(); jt != vfeds.end(); ++jt)
90  if (fed == *jt)
91  break;
92  else
93  n++;
94  if (n == vfeds.size())
95  vfeds.push_back(fed);
96  }
97 
98  std::sort(vfeds.begin(), vfeds.end());
99  return vfeds;
100  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:27
int const FED_VME_MIN
Definition: Constants.h:78
std::vector< int > hcaldqm::utilities::getFEDuTCAList ( HcalElectronicsMap const *  emap)

Definition at line 121 of file Utilities.cc.

References HcalElectronicsMap::allElectronicsIdPrecision(), crate2fed(), hcaldqm::constants::FED_VME_MIN, and gen::n.

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

121  {
122  std::vector<int> vfeds;
123  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
124  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
125  if (it->isVMEid())
126  continue;
127  int fed = it->isVMEid() ? it->dccid() + FED_VME_MIN : crate2fed(it->crateId(), it->slot());
128  uint32_t n = 0;
129  for (std::vector<int>::const_iterator jt = vfeds.begin(); jt != vfeds.end(); ++jt)
130  if (fed == *jt)
131  break;
132  else
133  n++;
134  if (n == vfeds.size())
135  vfeds.push_back(fed);
136  }
137 
138  std::sort(vfeds.begin(), vfeds.end());
139  return vfeds;
140  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:27
int const FED_VME_MIN
Definition: Constants.h:78
std::vector< int > hcaldqm::utilities::getFEDVMEList ( HcalElectronicsMap const *  emap)

Definition at line 101 of file Utilities.cc.

References HcalElectronicsMap::allElectronicsIdPrecision(), crate2fed(), hcaldqm::constants::FED_VME_MIN, and gen::n.

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

101  {
102  std::vector<int> vfeds;
103  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
104  for (std::vector<HcalElectronicsId>::const_iterator it = vids.begin(); it != vids.end(); ++it) {
105  if (!it->isVMEid())
106  continue;
107  int fed = it->isVMEid() ? it->dccid() + FED_VME_MIN : crate2fed(it->crateId(), it->slot());
108  uint32_t n = 0;
109  for (std::vector<int>::const_iterator jt = vfeds.begin(); jt != vfeds.end(); ++jt)
110  if (fed == *jt)
111  break;
112  else
113  n++;
114  if (n == vfeds.size())
115  vfeds.push_back(fed);
116  }
117 
118  std::sort(vfeds.begin(), vfeds.end());
119  return vfeds;
120  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:27
int const FED_VME_MIN
Definition: Constants.h:78
int hcaldqm::utilities::getRBX ( uint32_t  iphi)

Definition at line 233 of file Utilities.cc.

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

233 { return (((iphi + 2) % 72) + 4 - 1) / 4; }
int hcaldqm::utilities::getTPSubDet ( HcalTrigTowerDetId const &  )

Referenced by dqmdebug().

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

Referenced by dqmdebug().

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

Definition at line 49 of file Utilities.cc.

References HcalElectronicsId::rawId().

49 { return eid.rawId(); }
uint32_t hcaldqm::utilities::hash ( HcalTrigTowerDetId const &  tid)

Definition at line 50 of file Utilities.cc.

References DetId::rawId().

50 { return tid.rawId(); }
bool hcaldqm::utilities::isFEDHBHE ( HcalElectronicsId const &  eid)

Definition at line 142 of file Utilities.cc.

References crate2fed(), HcalElectronicsId::crateId(), HcalElectronicsId::isVMEid(), and HcalElectronicsId::slot().

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

142  {
143  if (eid.isVMEid()) {
144  return false;
145  } else {
146  int fed = crate2fed(eid.crateId(), eid.slot());
147  if (fed >= 1100 && fed < 1118)
148  return true;
149  else
150  return false;
151  }
152 
153  return false;
154  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:27
bool hcaldqm::utilities::isFEDHF ( HcalElectronicsId const &  eid)

Definition at line 156 of file Utilities.cc.

References crate2fed(), HcalElectronicsId::crateId(), HcalElectronicsId::isVMEid(), and HcalElectronicsId::slot().

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

156  {
157  /*
158  if (eid.isVMEid())
159  {
160  int fed = eid.dccid()+FED_VME_MIN;
161  if (fed>=718 && fed<=723)
162  return true;
163  else
164  return false;
165  }*/
166  // else
167  // {
168  if (eid.isVMEid())
169  return false;
170  int fed = crate2fed(eid.crateId(), eid.slot());
171  if (fed >= 1118 && fed <= 1123)
172  return true;
173  else
174  return false;
175  // }
176 
177  return false;
178  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:27
bool hcaldqm::utilities::isFEDHO ( HcalElectronicsId const &  eid)

Definition at line 180 of file Utilities.cc.

References HcalElectronicsId::dccid(), hcaldqm::constants::FED_VME_MIN, and HcalElectronicsId::isVMEid().

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

180  {
181  if (!eid.isVMEid())
182  return false;
183 
184  int fed = eid.dccid() + FED_VME_MIN;
185  if (fed >= 724 && fed <= 731)
186  return true;
187  else
188  return false;
189 
190  return false;
191  }
int const FED_VME_MIN
Definition: Constants.h:78
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(), HcalDbService::getHcalCoder(), and HcalDbService::getHcalShape().

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  }
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
template<typename DIGI >
int hcaldqm::utilities::maxTS ( DIGI const &  digi,
double  ped = 0 
)

Definition at line 102 of file Utilities.h.

References mps_fire::i.

Referenced by LaserTask::_process().

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  }
int maxTS(DIGI const &digi, double ped=0)
Definition: Utilities.h:102
std::string hcaldqm::utilities::ogtype2string ( constants::OrbitGapType  type)

Definition at line 196 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::tNull, hcaldqm::constants::tPedestal, hcaldqm::constants::tSafe, and hcaldqm::constants::tZDC.

Referenced by dqmdebug(), and hcaldqm::quantity::EventType::getLabels().

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

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

139  {
140  double sum = 0;
141  for (int ii = i; ii <= j; ii++)
142  sum += digi.sample(ii).adc() - ped;
143  return sum;
144  }
ii
Definition: cuy.py:590
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.

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

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

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  }
ii
Definition: cuy.py:590
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.

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

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  }
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
ii
Definition: cuy.py:590
double const adc2fC[256]
Definition: Constants.h:248
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:126
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.

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

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  }
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:126