CMS 3D CMS Logo

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 
17 
18 namespace reco {
19 
20  //
21  // forward declarations
22  //
23 
24  class HcalNoiseRBX;
25 
26  //
27  // typedefs
28  //
29 
30  typedef std::vector<HcalNoiseRBX> HcalNoiseRBXCollection;
31 
32  class HcalNoiseRBX {
33  friend class HcalNoiseInfoProducer; // allows this class the fill the HPDs with info
34  friend class HcalNoiseRBXArray; // allows this class to manage the idnumber
35 
36  public:
37  // constructors
38  HcalNoiseRBX();
39 
40  // destructor
41  ~HcalNoiseRBX();
42 
43  //
44  // Detector ID accessors
45  //
46 
47  // accessors
48  int idnumber(void) const;
49 
50  //
51  // other accessors
52  //
53 
54  // returns a vector of HcalNoiseHPDs
55  // this is expensive and deprecated. One should use the iterator accessor method instead (provided below)
56  const std::vector<HcalNoiseHPD> HPDs(void) const;
57  inline std::vector<HcalNoiseHPD>::const_iterator HPDsBegin(void) const { return hpds_.begin(); }
58  inline std::vector<HcalNoiseHPD>::const_iterator HPDsEnd(void) const { return hpds_.end(); }
59 
60  // return HPD with the highest rechit energy in the RBX
61  // individual rechits only contribute if they have E>threshold
62  std::vector<HcalNoiseHPD>::const_iterator maxHPD(double threshold = 1.5) const;
63 
64  // pedestal subtracted fC information for all of the pixels in the RBX
65  const std::vector<float> allCharge(void) const;
66  float allChargeTotal(void) const;
67  float allChargeHighest2TS(unsigned int firstts = 4) const;
68  float allChargeHighest3TS(unsigned int firstts = 4) const;
69 
70  // total number of adc zeros in the RBX
71  int totalZeros(void) const;
72 
73  // largest number of adc zeros from a single channel in the RBX
74  int maxZeros(void) const;
75 
76  // sum of the energy of rechits in the RBX with E>threshold
77  double recHitEnergy(double theshold = 1.5) const;
78  double recHitEnergyFailR45(double threshold = 1.5) const;
79 
80  // minimum and maximum time for rechits in the RBX with E>threshold
81  double minRecHitTime(double threshold = 20.0) const;
82  double maxRecHitTime(double threshold = 20.0) const;
83 
84  // total number of rechits above some threshold in the RBX
85  int numRecHits(double threshold = 1.5) const;
86  int numRecHitsFailR45(double threshold = 1.5) const;
87 
88  // calotower properties integrated over the entire RBX
89  double caloTowerHadE(void) const;
90  double caloTowerEmE(void) const;
91  double caloTowerTotalE(void) const;
92  double caloTowerEmFraction(void) const;
93 
94  // helper function to get the unique calotowers
95  struct twrcomp {
96  inline bool operator()(const CaloTower& t1, const CaloTower& t2) const { return t1.id() < t2.id(); }
97  };
98  typedef std::set<CaloTower, twrcomp> towerset_t;
99 
100  private:
101  // members
103 
104  // the hpds
105  std::vector<HcalNoiseHPD> hpds_;
106 
107  // the charge
108  std::vector<float> allCharge_;
109 
110  void uniqueTowers(towerset_t& twrs_) const;
111  };
112 
113 } // namespace reco
114 
115 #endif
std::vector< HcalNoiseHPD >::const_iterator HPDsBegin(void) const
Definition: HcalNoiseRBX.h:57
std::vector< HcalNoiseRBX > HcalNoiseRBXCollection
Definition: HcalNoiseRBX.h:24
void uniqueTowers(towerset_t &twrs_) const
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:76
double caloTowerEmFraction(void) const
int totalZeros(void) const
Definition: HcalNoiseRBX.cc:61
int numRecHits(double threshold=1.5) const
float allChargeTotal(void) const
Definition: HcalNoiseRBX.cc:40
double minRecHitTime(double threshold=20.0) const
Definition: HcalNoiseRBX.cc:90
double maxRecHitTime(double threshold=20.0) const
float allChargeHighest3TS(unsigned int firstts=4) const
Definition: HcalNoiseRBX.cc:54
std::vector< HcalNoiseHPD > hpds_
Definition: HcalNoiseRBX.h:105
double caloTowerHadE(void) const
float allChargeHighest2TS(unsigned int firstts=4) const
Definition: HcalNoiseRBX.cc:47
std::set< CaloTower, twrcomp > towerset_t
Definition: HcalNoiseRBX.h:98
int maxZeros(void) const
Definition: HcalNoiseRBX.cc:68
std::vector< float > allCharge_
Definition: HcalNoiseRBX.h:108
double caloTowerEmE(void) const
double caloTowerTotalE(void) const
std::vector< HcalNoiseHPD >::const_iterator HPDsEnd(void) const
Definition: HcalNoiseRBX.h:58
int idnumber(void) const
Definition: HcalNoiseRBX.cc:21
int numRecHitsFailR45(double threshold=1.5) const
fixed size matrix
const std::vector< HcalNoiseHPD > HPDs(void) const
Definition: HcalNoiseRBX.cc:23
const std::vector< float > allCharge(void) const
Definition: HcalNoiseRBX.cc:38
std::vector< HcalNoiseHPD >::const_iterator maxHPD(double threshold=1.5) const
Definition: HcalNoiseRBX.cc:25
double recHitEnergyFailR45(double threshold=1.5) const
Definition: HcalNoiseRBX.cc:83
bool operator()(const CaloTower &t1, const CaloTower &t2) const
Definition: HcalNoiseRBX.h:96