CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalNoiseRBX.h
Go to the documentation of this file.
1 #ifndef _DATAFORMATS_METRECO_HCALNOISERBX_H_
2 #define _DATAFORMATS_METRECO_HCALNOISERBX_H_
3 
4 //
5 // HcalNoiseRBX.h
6 //
7 // description: Container class of RBX information to study anomalous noise in the HCAL.
8 // The information for HcalNoiseHPD's are filled in RecoMET/METProducers/HcalNoiseInfoProducer,
9 // but the idnumber is managed by DataFormats/METReco/HcalNoiseRBXArray.
10 // Essentially contains 4 HcalNoiseHPDs.
11 //
12 // author: J.P. Chou, Brown
13 //
14 //
15 
16 #include "boost/array.hpp"
17 
19 
20 namespace reco {
21 
22  //
23  // forward declarations
24  //
25 
26  class HcalNoiseRBX;
27 
28  //
29  // typedefs
30  //
31 
32  typedef std::vector<HcalNoiseRBX> HcalNoiseRBXCollection;
33 
34 
35  class HcalNoiseRBX {
36 
37  friend class HcalNoiseInfoProducer; // allows this class the fill the HPDs with info
38  friend class HcalNoiseRBXArray; // allows this class to manage the idnumber
39 
40  public:
41  // constructors
42  HcalNoiseRBX();
43 
44  // destructor
45  virtual ~HcalNoiseRBX();
46 
47  //
48  // Detector ID accessors
49  //
50 
51  // accessors
52  int idnumber(void) const;
53 
54  //
55  // other accessors
56  //
57 
58  // returns a vector of HcalNoiseHPDs
59  // this is expensive and deprecated. One should use the iterator accessor method instead (provided below)
60  const std::vector<HcalNoiseHPD> HPDs(void) const;
61  inline std::vector<HcalNoiseHPD>::const_iterator HPDsBegin(void) const { return hpds_.begin(); }
62  inline std::vector<HcalNoiseHPD>::const_iterator HPDsEnd(void) const { return hpds_.end(); }
63 
64  // return HPD with the highest rechit energy in the RBX
65  // individual rechits only contribute if they have E>threshold
66  std::vector<HcalNoiseHPD>::const_iterator maxHPD(double threshold=1.5) const;
67 
68  // pedestal subtracted fC information for all of the pixels in the RBX
69  const std::vector<float> allCharge(void) const;
70  float allChargeTotal(void) const;
71  float allChargeHighest2TS(unsigned int firstts=4) const;
72  float allChargeHighest3TS(unsigned int firstts=4) const;
73 
74  // total number of adc zeros in the RBX
75  int totalZeros(void) const;
76 
77  // largest number of adc zeros from a single channel in the RBX
78  int maxZeros(void) const;
79 
80  // sum of the energy of rechits in the RBX with E>threshold
81  double recHitEnergy(double theshold=1.5) const;
82 
83  // minimum and maximum time for rechits in the RBX with E>threshold
84  double minRecHitTime(double threshold=20.0) const;
85  double maxRecHitTime(double threshold=20.0) const;
86 
87  // total number of rechits above some threshold in the RBX
88  int numRecHits(double threshold=1.5) const;
89 
90  // calotower properties integrated over the entire RBX
91  double caloTowerHadE(void) const;
92  double caloTowerEmE(void) const;
93  double caloTowerTotalE(void) const;
94  double caloTowerEmFraction(void) const;
95 
96  private:
97 
98  // members
99  int idnumber_;
100 
101  // the hpds
102  std::vector<HcalNoiseHPD> hpds_;
103 
104  // the charge
105  std::vector<float> allCharge_;
106 
107  // helper function to get the unique calotowers
108  struct twrcomp {
109  inline bool operator() ( const CaloTower & t1, const CaloTower & t2 ) {
110  return t1.id() < t2.id();
111  }
112  };
113  typedef std::set<CaloTower, twrcomp> towerset_t;
114 
115  void uniqueTowers(towerset_t& twrs_) const;
116  };
117 
118 } // end of namespace
119 
120 #endif
std::vector< HcalNoiseRBX > HcalNoiseRBXCollection
Definition: HcalNoiseRBX.h:26
float allChargeHighest3TS(unsigned int firstts=4) const
Definition: HcalNoiseRBX.cc:73
float allChargeHighest2TS(unsigned int firstts=4) const
Definition: HcalNoiseRBX.cc:65
int maxZeros(void) const
Definition: HcalNoiseRBX.cc:90
std::vector< HcalNoiseHPD >::const_iterator HPDsBegin(void) const
Definition: HcalNoiseRBX.h:61
int numRecHits(double threshold=1.5) const
std::vector< HcalNoiseHPD >::const_iterator HPDsEnd(void) const
Definition: HcalNoiseRBX.h:62
virtual ~HcalNoiseRBX()
Definition: HcalNoiseRBX.cc:23
std::vector< HcalNoiseHPD >::const_iterator maxHPD(double threshold=1.5) const
Definition: HcalNoiseRBX.cc:38
double caloTowerEmE(void) const
double caloTowerTotalE(void) const
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:99
float allChargeTotal(void) const
Definition: HcalNoiseRBX.cc:57
std::vector< HcalNoiseHPD > hpds_
Definition: HcalNoiseRBX.h:102
double caloTowerHadE(void) const
std::set< CaloTower, twrcomp > towerset_t
Definition: HcalNoiseRBX.h:113
double caloTowerEmFraction(void) const
std::vector< float > allCharge_
Definition: HcalNoiseRBX.h:105
CaloTowerDetId id() const
Definition: CaloTower.h:72
double minRecHitTime(double threshold=20.0) const
void uniqueTowers(towerset_t &twrs_) const
int totalZeros(void) const
Definition: HcalNoiseRBX.cc:82
bool operator()(const CaloTower &t1, const CaloTower &t2)
Definition: HcalNoiseRBX.h:109
const std::vector< HcalNoiseHPD > HPDs(void) const
Definition: HcalNoiseRBX.cc:33
int idnumber(void) const
Definition: HcalNoiseRBX.cc:28
double maxRecHitTime(double threshold=20.0) const
const std::vector< float > allCharge(void) const
Definition: HcalNoiseRBX.cc:52