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

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

Referenced by aveTSDB(), and sumQDB().

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

References mps_fire::i.

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

Definition at line 108 of file Utilities.h.

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

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

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

Definition at line 67 of file Utilities.h.

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

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

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

43  {
44  double sumQ = 0;
45  double sumQT = 0;
46  for (unsigned int i = i_start; i <+ i_end; ++i) {
47  double q = adc2fCDBMinusPedestal(conditions, calo_samples, did, digi, i);
48  sumQ += q;
49  sumQT += (i+1)*q;
50  }
51  return (sumQ > 0 ? sumQT/sumQ-1 : GARBAGE_VALUE);
52  }
double adc2fCDBMinusPedestal(const edm::ESHandle< HcalDbService > &conditions, const CaloSamples &calo_samples, const HcalDetId did, const Digi &digi, unsigned int n)
Definition: Utilities.h:36
int const GARBAGE_VALUE
Definition: Constants.h:266
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:122
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 155 of file Utilities.h.

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

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
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(), 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(), TPTask::bookHistograms(), PedestalTask::bookHistograms(), RawTask::bookHistograms(), RecHitTask::bookHistograms(), DigiPhase1Task::bookHistograms(), DigiTask::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(), TPTask::bookHistograms(), PedestalTask::bookHistograms(), RawTask::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(), TPTask::bookHistograms(), PedestalTask::bookHistograms(), RawTask::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::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().

Referenced by dqmdebug().

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(), 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(), 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(), 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 25 of file Utilities.h.

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

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

References mps_fire::i.

Referenced by HBHEPhase1Reconstructor::processData().

95  {
96  int maxTS = -1;
97  double maxQ = -100;
98  for (int i=0; i<digi.size(); i++)
99  if((digi.sample(i).nominal_fC()-ped)>maxQ)
100  {
101  maxQ = digi.sample(i).nominal_fC()-ped;
102  maxTS = i;
103  }
104  return maxTS;
105  }
int maxTS(DIGI const &digi, double ped=0)
Definition: Utilities.h:94
std::string hcaldqm::utilities::ogtype2string ( 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::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 "Nill";
234  case tPedestal : return "Pedestal";
235  case tHFRaddam : return "HFRaddam";
236  case tHBHEHPD : return "HBHEHPD";
237  case tHO : return "HO";
238  case tHF : return "HF";
239  case tZDC : return "ZDC";
240  case tHEPMega : return "HEPMegatile";
241  case tHEMMega : return "HEMMegatile";
242  case tHBPMega : return "HBPMegatile";
243  case tHBMMega : return "HBMMegatile";
244  case tCRF : return "CRF";
245  case tCalib : return "Calib";
246  case tSafe : return "Safe";
247  default : return "Unknonw";
248  }
249  }
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 137 of file Utilities.h.

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

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

123  {
124  double sum=0;
125  for (int ii=i; ii<=j; ii++)
126  sum+=(digi.sample(ii).nominal_fC()-ped);
127  return sum;
128  }
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 82 of file Utilities.h.

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

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

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

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