test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
hcaldqm::utilities Namespace Reference

Functions

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)
 
uint16_t crate2fed (int crate)
 
template<typename STDTYPE >
void dqmdebug (STDTYPE const &x, int debug=0)
 
uint16_t fed2crate (int fed)
 
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<typename DIGI >
int maxTS (DIGI const &digi, double ped=0)
 
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)
 

Function Documentation

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

Definition at line 76 of file Utilities.h.

References i, and j.

77  {
78  return sumADC<DIGI>(digi, ped, i, j)/(j-i+1);
79  }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
template<typename DIGI >
double hcaldqm::utilities::aveQ ( DIGI const &  digi,
double  ped,
int  i = 0,
int  j = 3 
)

Definition at line 61 of file Utilities.h.

References i, and j.

62  {
63  return sumQ<DIGI>(digi, ped, i, j)/(j-i+1);
64  }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
template<typename DIGI >
double hcaldqm::utilities::aveTS ( DIGI const &  digi,
double  ped = 0,
int  i = 0,
int  j = 3 
)

Definition at line 38 of file Utilities.h.

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

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

39  {
40  double sumQ = 0;
41  double sumQT = 0;
42  for (int ii=i; ii<=j; ii++)
43  {
44  sumQ+=digi.sample(ii).nominal_fC()-ped;
45  sumQT +=(ii+1)*(digi.sample(ii).nominal_fC()-ped);
46  }
47 
48  return sumQ>0 ? sumQT/sumQ-1 : GARBAGE_VALUE;
49  }
int i
Definition: DBlmapReader.cc:9
int ii
Definition: cuy.py:588
int const GARBAGE_VALUE
Definition: Constants.h:212
int j
Definition: DBlmapReader.cc:9
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:52
uint16_t hcaldqm::utilities::crate2fed ( int  crate)
template<typename STDTYPE >
void hcaldqm::utilities::dqmdebug ( STDTYPE const &  x,
int  debug = 0 
)

Definition at line 85 of file Utilities.h.

References gather_cfg::cout, and debug.

86  {
87  if (debug==0)
88  return;
89  std::cout << "%MSG" << std::endl;
90  std::cout << "%MSG-d HCALDQM::" << x;
91  std::cout << std::endl;
92  }
T x() const
Cartesian x coordinate.
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:145
uint16_t hcaldqm::utilities::fed2crate ( int  fed)
std::vector< int > hcaldqm::utilities::getFEDList ( HcalElectronicsMap const *  emap)

Definition at line 47 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(), RecHitTask::bookHistograms(), and DigiTask::bookHistograms().

48  {
49  std::vector<int> vfeds;
50  std::vector<HcalElectronicsId> vids =
51  emap->allElectronicsIdPrecision();
52  for (std::vector<HcalElectronicsId>::const_iterator
53  it=vids.begin(); it!=vids.end(); ++it)
54  {
55  int fed = it->isVMEid()?it->dccid()+FED_VME_MIN:
56  crate2fed(it->crateId());
57  uint32_t n=0;
58  for (std::vector<int>::const_iterator jt=vfeds.begin();
59  jt!=vfeds.end(); ++jt)
60  if (fed==*jt)
61  break;
62  else
63  n++;
64  if (n==vfeds.size())
65  vfeds.push_back(fed);
66  }
67 
68  std::sort(vfeds.begin(), vfeds.end());
69  return vfeds;
70  }
int const FED_VME_MIN
Definition: Constants.h:47
uint16_t crate2fed(int crate)
Definition: Utilities.cc:23
std::vector< int > hcaldqm::utilities::getFEDuTCAList ( HcalElectronicsMap const *  emap)

Definition at line 97 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(), RecHitTask::bookHistograms(), and DigiTask::bookHistograms().

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

Definition at line 71 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(), RecHitTask::bookHistograms(), and DigiTask::bookHistograms().

72  {
73  std::vector<int> vfeds;
74  std::vector<HcalElectronicsId> vids =
75  emap->allElectronicsIdPrecision();
76  for (std::vector<HcalElectronicsId>::const_iterator
77  it=vids.begin(); it!=vids.end(); ++it)
78  {
79  if (!it->isVMEid())
80  continue;
81  int fed = it->isVMEid()?it->dccid()+FED_VME_MIN:
82  crate2fed(it->crateId());
83  uint32_t n=0;
84  for (std::vector<int>::const_iterator jt=vfeds.begin();
85  jt!=vfeds.end(); ++jt)
86  if (fed==*jt)
87  break;
88  else
89  n++;
90  if (n==vfeds.size())
91  vfeds.push_back(fed);
92  }
93 
94  std::sort(vfeds.begin(), vfeds.end());
95  return vfeds;
96  }
int const FED_VME_MIN
Definition: Constants.h:47
uint16_t crate2fed(int crate)
Definition: Utilities.cc:23
int hcaldqm::utilities::getTPSubDet ( HcalTrigTowerDetId const &  )
int hcaldqm::utilities::getTPSubDetPM ( HcalTrigTowerDetId const &  )
uint32_t hcaldqm::utilities::hash ( HcalDetId const &  did)
uint32_t hcaldqm::utilities::hash ( HcalElectronicsId const &  eid)

Definition at line 38 of file Utilities.cc.

References HcalElectronicsId::rawId().

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

Definition at line 42 of file Utilities.cc.

References DetId::rawId().

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

Definition at line 124 of file Utilities.cc.

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

Referenced by PedestalTask::_dump(), hcaldqm::RecoRunSummary::endJob(), hcaldqm::TPRunSummary::endJob(), hcaldqm::DigiRunSummary::endJob(), hcaldqm::DigiRunSummary::endLuminosityBlock(), hcaldqm::RawRunSummary::endLuminosityBlock(), TPTask::endLuminosityBlock(), RawTask::endLuminosityBlock(), and DigiTask::endLuminosityBlock().

125  {
126  if (eid.isVMEid())
127  {
128  int fed = eid.dccid()+FED_VME_MIN;
129  if (fed>=700 && fed<=717)
130  return true;
131  else
132  return false;
133  }
134  else
135  {
136  int fed = crate2fed(eid.crateId());
137  if (fed>=1100 && fed<1118)
138  return true;
139  else
140  return false;
141  }
142 
143  return false;
144  }
int const FED_VME_MIN
Definition: Constants.h:47
uint16_t crate2fed(int crate)
Definition: Utilities.cc:23
bool hcaldqm::utilities::isFEDHF ( HcalElectronicsId const &  eid)

Definition at line 146 of file Utilities.cc.

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

Referenced by PedestalTask::_dump(), hcaldqm::RecoRunSummary::endJob(), hcaldqm::TPRunSummary::endJob(), hcaldqm::DigiRunSummary::endJob(), hcaldqm::RawRunSummary::endLuminosityBlock(), hcaldqm::DigiRunSummary::endLuminosityBlock(), TPTask::endLuminosityBlock(), RawTask::endLuminosityBlock(), RecHitTask::endLuminosityBlock(), and DigiTask::endLuminosityBlock().

147  {
148  /*
149  if (eid.isVMEid())
150  {
151  int fed = eid.dccid()+FED_VME_MIN;
152  if (fed>=718 && fed<=723)
153  return true;
154  else
155  return false;
156  }*/
157 // else
158 // {
159  if (eid.isVMEid())
160  return false;
161  int fed = crate2fed(eid.crateId());
162  if (fed>=1118 && fed<=1122)
163  return true;
164  else
165  return false;
166 // }
167 
168  return false;
169  }
uint16_t crate2fed(int crate)
Definition: Utilities.cc:23
bool hcaldqm::utilities::isFEDHO ( HcalElectronicsId const &  eid)

Definition at line 171 of file Utilities.cc.

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

Referenced by PedestalTask::_dump(), hcaldqm::DigiRunSummary::endJob(), hcaldqm::DigiRunSummary::endLuminosityBlock(), hcaldqm::RawRunSummary::endLuminosityBlock(), RawTask::endLuminosityBlock(), and DigiTask::endLuminosityBlock().

172  {
173  if (!eid.isVMEid())
174  return false;
175 
176  int fed = eid.dccid()+FED_VME_MIN;
177  if (fed>=724 && fed<=731)
178  return true;
179  else
180  return false;
181 
182  return false;
183  }
int const FED_VME_MIN
Definition: Constants.h:47
template<typename DIGI >
int hcaldqm::utilities::maxTS ( DIGI const &  digi,
double  ped = 0 
)

Definition at line 24 of file Utilities.h.

References i.

25  {
26  int maxTS = -1;
27  double maxQ = -100;
28  for (int i=0; i<digi.size(); i++)
29  if((digi.sample(i).nominal_fC()-ped)>maxQ)
30  {
31  maxQ = digi.sample(i).nominal_fC()-ped;
32  maxTS = i;
33  }
34  return maxTS;
35  }
int i
Definition: DBlmapReader.cc:9
int maxTS(DIGI const &digi, double ped=0)
Definition: Utilities.h:24
template<typename DIGI >
double hcaldqm::utilities::sumADC ( DIGI const &  digi,
double  ped,
int  i = 0,
int  j = 3 
)

Definition at line 67 of file Utilities.h.

References i, cuy::ii, and j.

68  {
69  double sum = 0;
70  for (int ii=i; ii<=j; ii++)
71  sum+=digi.sample(ii).adc()-ped;
72  return sum;
73  }
int i
Definition: DBlmapReader.cc:9
int ii
Definition: cuy.py:588
int j
Definition: DBlmapReader.cc:9
template<typename DIGI >
double hcaldqm::utilities::sumQ ( DIGI const &  digi,
double  ped,
int  i = 0,
int  j = 3 
)

Definition at line 52 of file Utilities.h.

References i, cuy::ii, and j.

Referenced by LaserTask::_process(), LEDTask::_process(), DigiTask::_process(), aveTS(), StripCPEgeometric::WrappedCluster::centroid(), and StripCPEgeometric::WrappedCluster::eta().

53  {
54  double sum=0;
55  for (int ii=i; ii<=j; ii++)
56  sum+=(digi.sample(ii).nominal_fC()-ped);
57  return sum;
58  }
int i
Definition: DBlmapReader.cc:9
int ii
Definition: cuy.py:588
int j
Definition: DBlmapReader.cc:9