CMS 3D CMS Logo

HcalNoiseHPD.h
Go to the documentation of this file.
1 #ifndef _DATAFORMATS_METRECO_HCALNOISEHPD_H_
2 #define _DATAFORMATS_METRECO_HCALNOISEHPD_H_
3 
4 //
5 // HcalNoiseHPD.h
6 //
7 // description: Container class of HPD 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 // Provides relevant digi, rechit, and calotower information.
11 //
12 // author: J.P. Chou, Brown
13 //
14 
15 #include <algorithm>
16 
27 
28 namespace reco {
29 
30  //
31  // forward declarations
32  //
33 
34  class HcalNoiseHPD;
36 
37  //
38  // typdefs
39  //
40 
41  typedef std::vector<HcalNoiseHPD> HcalNoiseHPDCollection;
42 
43  //
44  // RefHBHERecHitEnergyComparison is a class functor to compare energies between Ref<HBHERecHitCollection>
45  //
46  class RefHBHERecHitEnergyComparison : public std::binary_function<HBHERecHit,HBHERecHit,bool> {
47  public:
49  { return x->energy()>y->energy(); }
50  };
51 
52 
53  //
54  // class definition
55  //
56 
57  class HcalNoiseHPD {
58  friend class HcalNoiseInfoProducer; // allows this class the fill the HPDs with info
59  friend class HcalNoiseRBXArray; // allows this class to manage the idnumber
60 
61  public:
62  // constructor
63  HcalNoiseHPD();
64 
65  // destructor
66  virtual ~HcalNoiseHPD();
67 
68  //
69  // Detector ID accessors
70  //
71 
72  // unique integer specifier for the hpd [0,NUM_HPDS-1]
73  // correlates roughly with the detector phi slice
74  int idnumber(void) const;
75 
76  //
77  // Digi accessors
78  //
79 
80  // pedestal subtracted fC information for the highest energy pixel in the HPD by timeslice
81  const std::vector<float> bigCharge(void) const;
82  float bigChargeTotal(void) const;
83  float bigChargeHighest2TS(unsigned int firstts=4) const;
84  float bigChargeHighest3TS(unsigned int firstts=4) const;
85 
86  // same as above but the integral over the 5 highest energy pixels in the HPD
87  const std::vector<float> big5Charge(void) const;
88  float big5ChargeTotal(void) const;
89  float big5ChargeHighest2TS(unsigned int firstts=4) const;
90  float big5ChargeHighest3TS(unsigned int firstts=4) const;
91 
92  // total number of adc zeros
93  int totalZeros(void) const;
94 
95  // largest number of adc zeros in a digi in the HPD
96  int maxZeros(void) const;
97 
98  //
99  // RecHit accessors
100  //
101 
102  // returns a reference to a vector of references to the rechits
103  const edm::RefVector<HBHERecHitCollection> recHits(void) const;
104 
105  // integral of rechit energies in the HPD with E>threshold (default is 1.5 GeV)
106  float recHitEnergy(float threshold=1.5) const;
107  float recHitEnergyFailR45(float threshold=1.5) const;
108 
109  // minimum and maximum time for rechits with E>threshold (default is 10.0 GeV)
110  float minRecHitTime(float threshold=10.0) const;
111  float maxRecHitTime(float threshold=10.0) const;
112 
113  // number of rechits with E>threshold (default is 1.5 GeV)
114  int numRecHits(float threshold=1.5) const;
115  int numRecHitsFailR45(float threshold=1.5) const;
116 
117  //
118  // CaloTower accessors
119  //
120 
121  // returns a reference to a vector of references to the calotowers
123 
124  // calotower properties integrated over the entire HPD
125  double caloTowerHadE(void) const;
126  double caloTowerEmE(void) const;
127  double caloTowerTotalE(void) const;
128  double caloTowerEmFraction(void) const;
129 
130 
131  private:
132 
133  // unique id number specifying the HPD
135 
136  // digi data members
139  std::vector<float> bigCharge_;
140  std::vector<float> big5Charge_;
141 
142  // a vector of references to rechits
144 
145  // a transient set of rechits for sorting purposes
146  // at some point before storing, these get transfered to the RefVector rechits_
147  std::set<edm::Ref<HBHERecHitCollection>, RefHBHERecHitEnergyComparison> refrechitset_;
148 
149  // a vector of references to calotowers
151  };
152 
153 } // end of namespace
154 
155 #endif
std::set< edm::Ref< HBHERecHitCollection >, RefHBHERecHitEnergyComparison > refrechitset_
Definition: HcalNoiseHPD.h:147
std::vector< float > bigCharge_
Definition: HcalNoiseHPD.h:139
std::vector< float > big5Charge_
Definition: HcalNoiseHPD.h:140
edm::RefVector< HBHERecHitCollection > rechits_
Definition: HcalNoiseHPD.h:143
bool operator()(const edm::Ref< HBHERecHitCollection > &x, const edm::Ref< HBHERecHitCollection > &y) const
Definition: HcalNoiseHPD.h:48
edm::RefVector< CaloTowerCollection > calotowers_
Definition: HcalNoiseHPD.h:150
std::vector< HcalNoiseHPD > HcalNoiseHPDCollection
Definition: HcalNoiseHPD.h:35
fixed size matrix