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

References AlignmentProducer_cff::calibrations, HcalDbService::getHcalCalibrations(), gen::n, and HcalCalibrations::pedestal().

Referenced by aveTSDB(), and sumQDB().

35  {
37  int capid = digi[n].capid();
38  return calo_samples[n] - calibrations.pedestal(capid);
39  }
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 145 of file Utilities.h.

References mps_fire::i.

146  {
147  return sumADC<DIGI>(digi, ped, i, j)/(j-i+1);
148  }
template<typename DIGI >
double hcaldqm::utilities::aveQ ( DIGI const &  digi,
double  ped,
int  i = 0,
int  j = 3 
)

Definition at line 130 of file Utilities.h.

References mps_fire::i.

131  {
132  return sumQ<DIGI>(digi, ped, i, j)/(j-i+1);
133  }
template<typename DIGI >
double hcaldqm::utilities::aveTS ( DIGI const &  digi,
double  ped = 0,
int  i = 0,
int  j = 3 
)

Definition at line 107 of file Utilities.h.

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

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

108  {
109  double sumQ = 0;
110  double sumQT = 0;
111  for (int ii=i; ii<=j; ii++)
112  {
113  sumQ+=digi.sample(ii).nominal_fC()-ped;
114  sumQT +=(ii+1)*(digi.sample(ii).nominal_fC()-ped);
115  }
116 
117  return sumQ>0 ? sumQT/sumQ-1 : constants::GARBAGE_VALUE;
118  }
int const GARBAGE_VALUE
Definition: Constants.h:265
ii
Definition: cuy.py:588
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:121
template<typename FRAME >
double hcaldqm::utilities::aveTS_v10 ( FRAME const &  frame,
double  ped = 0,
int  i = 0,
int  j = 3 
)

Definition at line 66 of file Utilities.h.

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

67  {
68  double sumQ = 0;
69  double sumQT = 0;
70  for (int ii=i; ii<=j; ii++)
71  {
72  double q = constants::adc2fC[frame[ii].adc()]-ped;
73  sumQ += q;
74  sumQT += (ii+1)*q;
75  }
76 
77  return sumQ>0 ? sumQT/sumQ-1 : constants::GARBAGE_VALUE;
78  }
int const GARBAGE_VALUE
Definition: Constants.h:265
ii
Definition: cuy.py:588
double const adc2fC[256]
Definition: Constants.h:271
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:121
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 42 of file Utilities.h.

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

42  {
43  double sumQ = 0;
44  double sumQT = 0;
45  for (unsigned int i = i_start; i <= i_end; ++i) {
46  double q = adc2fCDBMinusPedestal(conditions, calo_samples, did, digi, i);
47  sumQ += q;
48  sumQT += (i+1)*q;
49  }
50  return (sumQ > 0 ? sumQT/sumQ-1 : constants::GARBAGE_VALUE);
51  }
double adc2fCDBMinusPedestal(const edm::ESHandle< HcalDbService > &conditions, const CaloSamples &calo_samples, const HcalDetId did, const Digi &digi, unsigned int n)
Definition: Utilities.h:35
int const GARBAGE_VALUE
Definition: Constants.h:265
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:121
uint16_t hcaldqm::utilities::crate2fed ( int  crate,
int  slot 
)

Definition at line 30 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().

31  {
32  // for the details see Constants.h
33  int fed = 0;
34  auto it_crate2fed = constants::crate2fed_map.find(crate);
35  if (it_crate2fed != constants::crate2fed_map.end()) {
36  fed = it_crate2fed->second;
37  if (fed <= FED_VME_MAX && fed > 0) {
39  ++fed;
40  }
41  } else {
42  if (slot > 6 && (std::find(constants::crateListuTCA.begin(), constants::crateListuTCA.end(), crate) != constants::crateListuTCA.end())) { //needed to handle dual fed readout
43  ++fed;
44  }
45  }
46  }
47  return fed;
48  }
std::vector< unsigned int > const crateListuTCA
Definition: Constants.h:91
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:30
#define end
Definition: vmac.h:39
std::vector< unsigned int > const crateListVME
Definition: Constants.h:92
#define begin
Definition: vmac.h:32
template<typename STDTYPE >
void hcaldqm::utilities::dqmdebug ( STDTYPE const &  x,
int  debug = 0 
)

Definition at line 154 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 12 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(), TPTask::bookHistograms(), PedestalTask::bookHistograms(), RawTask::bookHistograms(), LaserTask::bookHistograms(), RecHitTask::bookHistograms(), DigiPhase1Task::bookHistograms(), DigiTask::bookHistograms(), hcaldqm::DQTask::bookHistograms(), dqmdebug(), hcaldqm::quantity::getEid_FED(), hcaldqm::quantity::getEid_FEDuTCA(), hcaldqm::hashfunctions::hash_FED(), hcaldqm::hashfunctions::hash_FEDSlot(), and hcaldqm::hashfunctions::hash_FEDSpigot().

13  {
14 
15  // uTCA Crate is split in half
16  uint16_t slot = 0;
17  if (fed <= FED_VME_MAX) {
18  slot = fed%2==0 ? SLOT_uTCA_MIN : SLOT_uTCA_MIN+6;
19  } else {
20  slot = fed%2==0 ? SLOT_uTCA_MIN : SLOT_uTCA_MIN+6;
21  }
22  std::pair<uint16_t, uint16_t> crate_slot = std::make_pair<uint16_t, uint16_t>(0,0);
23  auto it_fed2crate = constants::fed2crate_map.find(fed);
24  if (it_fed2crate != constants::fed2crate_map.end()) {
25  crate_slot = std::make_pair<uint16_t const, uint16_t const>((uint16_t const)it_fed2crate->second, (uint16_t const)slot);
26  }
27  return crate_slot;
28  }
std::map< unsigned int, unsigned int > const fed2crate_map
Definition: Constants.h:50
#define end
Definition: vmac.h:39
int const FED_VME_MAX
Definition: Constants.h:99
int const SLOT_uTCA_MIN
Definition: Constants.h:123
std::map< int, uint32_t > hcaldqm::utilities::getCrateHashMap ( HcalElectronicsMap const *  emap)

Definition at line 77 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().

77  {
78  std::map<int, uint32_t> crateHashMap;
79  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
80  for (std::vector<HcalElectronicsId>::const_iterator it=vids.begin(); it!=vids.end(); ++it) {
82  int this_crate = eid.crateId();
83  uint32_t this_hash = (eid.isVMEid() ?
85  FIBER_VME_MIN, eid.spigot(), eid.dccid())) :
86  utilities::hash(HcalElectronicsId(eid.crateId(),
87  eid.slot(), FIBER_uTCA_MIN1, FIBERCH_MIN, false)));
88  if (crateHashMap.find(this_crate) == crateHashMap.end()) {
89  crateHashMap[this_crate] = this_hash;
90  }
91  }
92  return crateHashMap;
93  }
int const FIBER_VME_MIN
Definition: Constants.h:141
int crateId() const
get the readout VME crate number
int const FIBERCH_MIN
Definition: Constants.h:151
int dccid() const
get the (Hcal local) DCC id for VME, crate number for uTCA
int const FIBER_uTCA_MIN1
Definition: Constants.h:144
int spigot() const
get the spigot (input number on DCC, AMC card number for uTCA)
bool isVMEid() const
Readout chain identification for Hcal.
std::vector< int > hcaldqm::utilities::getCrateList ( HcalElectronicsMap const *  emap)

Definition at line 63 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().

63  {
64  std::vector<int> vCrates;
65  std::vector<HcalElectronicsId> vids = emap->allElectronicsIdPrecision();
66  for (std::vector<HcalElectronicsId>::const_iterator it=vids.begin(); it!=vids.end(); ++it) {
68  int crate = eid.crateId();
69  if (std::find(vCrates.begin(), vCrates.end(), crate) == vCrates.end()) {
70  vCrates.push_back(crate);
71  }
72  }
73  std::sort(vCrates.begin(), vCrates.end());
74  return vCrates;
75  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
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 95 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().

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

Definition at line 145 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().

146  {
147  std::vector<int> vfeds;
148  std::vector<HcalElectronicsId> vids =
149  emap->allElectronicsIdPrecision();
150  for (std::vector<HcalElectronicsId>::const_iterator
151  it=vids.begin(); it!=vids.end(); ++it)
152  {
153  if (it->isVMEid())
154  continue;
155  int fed = it->isVMEid()?it->dccid()+FED_VME_MIN:
156  crate2fed(it->crateId(),it->slot());
157  uint32_t n=0;
158  for (std::vector<int>::const_iterator jt=vfeds.begin();
159  jt!=vfeds.end(); ++jt)
160  if (fed==*jt)
161  break;
162  else
163  n++;
164  if (n==vfeds.size())
165  vfeds.push_back(fed);
166  }
167 
168  std::sort(vfeds.begin(), vfeds.end());
169  return vfeds;
170  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:30
int const FED_VME_MIN
Definition: Constants.h:98
std::vector< int > hcaldqm::utilities::getFEDVMEList ( HcalElectronicsMap const *  emap)

Definition at line 119 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().

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

Definition at line 252 of file Utilities.cc.

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

252  {
253  return (((iphi + 2) % 72) + 4 - 1) / 4;
254  }
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 54 of file Utilities.cc.

References HcalElectronicsId::rawId().

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

Definition at line 58 of file Utilities.cc.

References DetId::rawId().

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

Definition at line 172 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().

173  {
174  if (eid.isVMEid()) {
175  return false;
176  } else {
177  int fed = crate2fed(eid.crateId(),eid.slot());
178  if (fed>=1100 && fed<1118)
179  return true;
180  else
181  return false;
182  }
183 
184  return false;
185  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:30
bool hcaldqm::utilities::isFEDHF ( HcalElectronicsId const &  eid)

Definition at line 187 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().

188  {
189  /*
190  if (eid.isVMEid())
191  {
192  int fed = eid.dccid()+FED_VME_MIN;
193  if (fed>=718 && fed<=723)
194  return true;
195  else
196  return false;
197  }*/
198 // else
199 // {
200  if (eid.isVMEid())
201  return false;
202  int fed = crate2fed(eid.crateId(),eid.slot());
203  if (fed>=1118 && fed<=1123)
204  return true;
205  else
206  return false;
207 // }
208 
209  return false;
210  }
uint16_t crate2fed(int crate, int slot)
Definition: Utilities.cc:30
bool hcaldqm::utilities::isFEDHO ( HcalElectronicsId const &  eid)

Definition at line 212 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().

213  {
214  if (!eid.isVMEid())
215  return false;
216 
217  int fed = eid.dccid()+FED_VME_MIN;
218  if (fed>=724 && fed<=731)
219  return true;
220  else
221  return false;
222 
223  return false;
224  }
int const FED_VME_MIN
Definition: Constants.h:98
template<class Digi >
CaloSamples hcaldqm::utilities::loadADC2fCDB ( const edm::ESHandle< HcalDbService > &  conditions,
const HcalDetId  did,
const Digi &  digi 
)

Definition at line 24 of file Utilities.h.

References HcalCoderDb::adc2fC(), HcalDbService::getHcalCoder(), and HcalDbService::getHcalShape().

24  {
25  CaloSamples calo_samples;
26  const HcalQIECoder* channelCoder = conditions->getHcalCoder(did);
27  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
28  HcalCoderDb coder(*channelCoder, *shape);
29  coder.adc2fC(digi, calo_samples);
30  return calo_samples;
31  }
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 93 of file Utilities.h.

References mps_fire::i.

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

94  {
95  int maxTS = -1;
96  double maxQ = -100;
97  for (int i=0; i<digi.size(); i++)
98  if((digi.sample(i).nominal_fC()-ped)>maxQ)
99  {
100  maxQ = digi.sample(i).nominal_fC()-ped;
101  maxTS = i;
102  }
103  return maxTS;
104  }
int maxTS(DIGI const &digi, double ped=0)
Definition: Utilities.h:93
std::string hcaldqm::utilities::ogtype2string ( constants::OrbitGapType  type)

Definition at line 229 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().

230  {
231  switch (type)
232  {
233  case tNull : return "Null";
234  case tPedestal : return "Pedestal";
235  case tLED : return "LED";
236  case tHFRaddam : return "HFRaddam";
237  case tHBHEHPD : return "HBHEHPD";
238  case tHO : return "HO";
239  case tHF : return "HF";
240  case tZDC : return "ZDC";
241  case tHEPMega : return "HEPMegatile";
242  case tHEMMega : return "HEMMegatile";
243  case tHBPMega : return "HBPMegatile";
244  case tHBMMega : return "HBMMegatile";
245  case tCRF : return "CRF";
246  case tCalib : return "Calib";
247  case tSafe : return "Safe";
248  default : return "Unknown";
249  }
250  }
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 136 of file Utilities.h.

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

137  {
138  double sum = 0;
139  for (int ii=i; ii<=j; ii++)
140  sum+=digi.sample(ii).adc()-ped;
141  return sum;
142  }
ii
Definition: cuy.py:588
template<typename DIGI >
double hcaldqm::utilities::sumQ ( DIGI const &  digi,
double  ped,
int  i = 0,
int  j = 3 
)

Definition at line 121 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().

122  {
123  double sum=0;
124  for (int ii=i; ii<=j; ii++)
125  sum+=(digi.sample(ii).nominal_fC()-ped);
126  return sum;
127  }
ii
Definition: cuy.py:588
template<typename FRAME >
double hcaldqm::utilities::sumQ_v10 ( FRAME const &  frame,
double  ped,
int  i = 0,
int  j = 3 
)

Definition at line 81 of file Utilities.h.

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

82  {
83  double sumQ = 0;
84  for (int ii=i; ii<=j; ii++)
85  sumQ += constants::adc2fC[frame[ii].adc()]-ped;
86  return sumQ;
87  }
int adc(sample_type sample)
get the ADC sample (12 bits)
ii
Definition: cuy.py:588
double const adc2fC[256]
Definition: Constants.h:271
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:121
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 54 of file Utilities.h.

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

54  {
55  double sumQ = 0;
56  for (unsigned int i = i_start; i <= i_end; ++i) {
57  sumQ += adc2fCDBMinusPedestal(conditions, calo_samples, did, digi, i);
58  }
59  return sumQ;
60  }
double adc2fCDBMinusPedestal(const edm::ESHandle< HcalDbService > &conditions, const CaloSamples &calo_samples, const HcalDetId did, const Digi &digi, unsigned int n)
Definition: Utilities.h:35
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:121