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  double recHitEnergyFailR45(double threshold=1.5) const;
83 
84  // minimum and maximum time for rechits in the RBX with E>threshold
85  double minRecHitTime(double threshold=20.0) const;
86  double maxRecHitTime(double threshold=20.0) const;
87 
88  // total number of rechits above some threshold in the RBX
89  int numRecHits(double threshold=1.5) const;
90  int numRecHitsFailR45(double threshold=1.5) const;
91 
92  // calotower properties integrated over the entire RBX
93  double caloTowerHadE(void) const;
94  double caloTowerEmE(void) const;
95  double caloTowerTotalE(void) const;
96  double caloTowerEmFraction(void) const;
97 
98  // helper function to get the unique calotowers
99  struct twrcomp {
100  inline bool operator() ( const CaloTower & t1, const CaloTower & t2 ) {
101  return t1.id() < t2.id();
102  }
103  };
104  typedef std::set<CaloTower, twrcomp> towerset_t;
105 
106  private:
107 
108  // members
110 
111  // the hpds
112  std::vector<HcalNoiseHPD> hpds_;
113 
114  // the charge
115  std::vector<float> allCharge_;
116 
117  void uniqueTowers(towerset_t& twrs_) const;
118  };
119 
120 } // end of namespace
121 
122 #endif
int numRecHitsFailR45(double threshold=1.5) const
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:112
double caloTowerHadE(void) const
std::set< CaloTower, twrcomp > towerset_t
Definition: HcalNoiseRBX.h:104
double caloTowerEmFraction(void) const
std::vector< float > allCharge_
Definition: HcalNoiseRBX.h:115
CaloTowerDetId id() const
Definition: CaloTower.h:102
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:100
double recHitEnergyFailR45(double threshold=1.5) const
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