CMS 3D CMS Logo

HcalNoiseAlgo.h
Go to the documentation of this file.
1 #ifndef _RECOMET_METALGORITHMS_HCALNOISEALGO_H_
2 #define _RECOMET_METALGORITHMS_HCALNOISEALGO_H_
3 
10 
12 public:
14  double minRecHitE,
15  double minLowHitE,
16  double minHighHitE,
17  double TS4TS5EnergyThreshold,
18  std::vector<std::pair<double, double> > const &TS4TS5UpperCut,
19  std::vector<std::pair<double, double> > const &TS4TS5LowerCut,
20  double MinRBXRechitR45E);
22 
23  // accessors to internal variables
24  inline double energy(void) const { return energy_; }
25  inline double ratio(void) const { return e2ts_ / e10ts_; }
26  inline double e2ts(void) const { return e2ts_; }
27  inline double e10ts(void) const { return e10ts_; }
28  inline bool validRatio(void) const { return e10ts_ != 0.0; }
29  inline int numHPDHits(void) const { return numHPDHits_; }
30  inline int numRBXHits(void) const { return numRBXHits_; }
31  inline int numHPDNoOtherHits(void) const { return numHPDNoOtherHits_; }
32  inline int numZeros(void) const { return numZeros_; }
33  inline double minLowEHitTime(void) const { return minLowEHitTime_; }
34  inline double maxLowEHitTime(void) const { return maxLowEHitTime_; }
35  inline double lowEHitTimeSqrd(void) const { return lowEHitTimeSqrd_; }
36  inline int numLowEHits(void) const { return numLowEHits_; }
37  inline double minHighEHitTime(void) const { return minHighEHitTime_; }
38  inline double maxHighEHitTime(void) const { return maxHighEHitTime_; }
39  inline double highEHitTimeSqrd(void) const { return highEHitTimeSqrd_; }
40  inline int numHighEHits(void) const { return numHighEHits_; }
41  inline double RBXEMF(void) const { return RBXEMF_; }
42  inline double HPDEMF(void) const { return HPDEMF_; }
43  inline bool PassTS4TS5(void) const { return TS4TS5Decision_; }
45  inline int r45Count(void) const { return r45Count_; }
46  inline double r45Fraction(void) const { return r45Fraction_; }
47  inline double r45EnergyFraction(void) const { return r45EnergyFraction_; }
48 
49  bool CheckPassFilter(double Charge,
50  double Discriminant,
51  std::vector<std::pair<double, double> > const &Cuts,
52  int Side);
53 
54 private:
55  // values
56  double energy_; // RBX hadronic energy as determined by the sum of calotowers
57  double e2ts_; // pedestal subtracted charge in two peak TS for RBX
58  double e10ts_; // pedestal subtracted charge in all 10 TS for RBX
59  int numHPDHits_; // largest number of hits in an HPD in the RBX
60  int numRBXHits_; // number of hits in the RBX
61  int numHPDNoOtherHits_; // largest number of hits in an HPD when no other HPD has a hit in the RBX
62  int numZeros_; // number of ADC 0 counts in all hits in all TS in the RBX
63  double minLowEHitTime_; // minimum time found for any low energy hit in the RBX
64  double maxLowEHitTime_; // maximum time found for any low energy hit in the RBX
65  double lowEHitTimeSqrd_; // low energy hit time^2
66  int numLowEHits_; // number of low energy hits
67  double minHighEHitTime_; // minimum time found for any high energy hit in the RBX
68  double maxHighEHitTime_; // maximum time found for any high energy hit in the RBX
69  double highEHitTimeSqrd_; // high energy hit time^2
70  int numHighEHits_; // number of high energy hits
71  double HPDEMF_; // minimum electromagnetic fraction found in an HPD in the RBX
72  double RBXEMF_; // electromagnetic fraction of the RBX
73  bool TS4TS5Decision_; // if this RBX fails TS4TS5 variable or not
74  edm::RefVector<CaloTowerCollection> rbxtowers_; // calotowers associated with the RBX
75  int r45Count_; // Number of rechits above some threshold flagged by R45
76  double r45Fraction_; // Fraction of rechits above some threshold flagged by R45
77  double r45EnergyFraction_; // Energy fraction of rechits above some threshold
78 };
79 
81 public:
82  HcalNoiseAlgo(const edm::ParameterSet &iConfig);
83  virtual ~HcalNoiseAlgo() {}
84 
85  // an rbx is "interesting/problematic" (i.e. is recorded to the event record)
86  bool isProblematic(const CommonHcalNoiseRBXData &) const;
87 
88  // an rbx passes a noise filter
89  bool passLooseNoiseFilter(const CommonHcalNoiseRBXData &) const;
90  bool passTightNoiseFilter(const CommonHcalNoiseRBXData &) const;
92 
93  // loose filter broken down into separate components
94  bool passLooseRatio(const CommonHcalNoiseRBXData &) const;
95  bool passLooseHits(const CommonHcalNoiseRBXData &) const;
96  bool passLooseZeros(const CommonHcalNoiseRBXData &) const;
97  bool passLooseTiming(const CommonHcalNoiseRBXData &) const;
99 
100  // tight filter broken down into separate components
101  bool passTightRatio(const CommonHcalNoiseRBXData &) const;
102  bool passTightHits(const CommonHcalNoiseRBXData &) const;
103  bool passTightZeros(const CommonHcalNoiseRBXData &) const;
104  bool passTightTiming(const CommonHcalNoiseRBXData &) const;
105  bool passTightRBXRechitR45(const CommonHcalNoiseRBXData &) const;
106 
107  // an rbx passes an energy (or other) threshold to test a certain variable
108  // for instance, the EMF cut might require that the RBX have 20 GeV of energy
109  bool passRatioThreshold(const CommonHcalNoiseRBXData &) const;
110  bool passZerosThreshold(const CommonHcalNoiseRBXData &) const;
111  bool passEMFThreshold(const CommonHcalNoiseRBXData &) const;
112 
113 private:
114  // energy thresholds used for problematic cuts
115  double pMinERatio_; // minimum energy to apply ratio cuts
116  double pMinEZeros_; // minimum energy to apply zeros cuts
117  double pMinEEMF_; // minimum energy to apply EMF cuts
118 
119  // energy thresholds used for loose, tight and high level cuts
120  double minERatio_; // minimum energy to apply ratio cuts
121  double minEZeros_; // minimum energy to apply zeros cuts
122  double minEEMF_; // minimum energy to apply EMF cuts
123 
124  // "problematic" cuts
125  // used to determine whether an RBX is stored in the EDM
126  double pMinE_; // minimum energy
127  double pMinRatio_; // minimum ratio
128  double pMaxRatio_; // maximum ratio
129  int pMinHPDHits_; // minimum # of HPD hits
130  int pMinRBXHits_; // minimum # of RBX hits
131  int pMinHPDNoOtherHits_; // minimum # of HPD hits with no other hits in the RBX
132  int pMinZeros_; // minimum # of zeros
133  double pMinLowEHitTime_; // minimum low energy hit time
134  double pMaxLowEHitTime_; // maximum low energy hit time
135  double pMinHighEHitTime_; // minimum high energy hit time
136  double pMaxHighEHitTime_; // maximum high energy hit time
137  double pMaxHPDEMF_; // maximum HPD EMF
138  double pMaxRBXEMF_; // maximum RBX EMF
139  int pMinRBXRechitR45Count_; // number of R45-flagged hits
140  double pMinRBXRechitR45Fraction_; // fraction of R45-flagged hits
141  double pMinRBXRechitR45EnergyFraction_; // energy fraction of R45-flagged hits
142 
143  // "loose" cuts
144  // used to determine whether an RBX fails the loose noise cuts
145  double lMinRatio_; // minimum ratio
146  double lMaxRatio_; // maximum ratio
147  int lMinHPDHits_; // minimum # of HPD hits
148  int lMinRBXHits_; // minimum # of RBX hits
149  int lMinHPDNoOtherHits_; // minimum # of HPD hits with no other hits in the RBX
150  int lMinZeros_; // minimum # of zeros
151  double lMinLowEHitTime_; // minimum low energy hit time
152  double lMaxLowEHitTime_; // maximum low energy hit time
153  double lMinHighEHitTime_; // minimum high energy hit time
154  double lMaxHighEHitTime_; // maximum high energy hit time
155  std::vector<double> lMinRBXRechitR45Cuts_;
156 
157  // "tight" cuts
158  // used to determine whether an RBX fails the tight noise cuts
159  double tMinRatio_; // minimum ratio
160  double tMaxRatio_; // maximum ratio
161  int tMinHPDHits_; // minimum # of HPD hits
162  int tMinRBXHits_; // minimum # of RBX hits
163  int tMinHPDNoOtherHits_; // minimum # of HPD hits with no other hits in the RBX
164  int tMinZeros_; // minimum # of zeros
165  double tMinLowEHitTime_; // minimum low energy hit time
166  double tMaxLowEHitTime_; // maximum low energy hit time
167  double tMinHighEHitTime_; // minimum high energy hit time
168  double tMaxHighEHitTime_; // maximum high energy hit time
169  std::vector<double> tMinRBXRechitR45Cuts_;
170 
171  // "high level" cuts
172  // used to determine where an RBX fails the high level noise cuts
173  double hlMaxHPDEMF_; // maximum HPD EMF
174  double hlMaxRBXEMF_; // maximum RBX EMF
175 };
176 
178 public:
181 
183 
184 private:
185  // helper function to compare calotower references
186  struct twrrefcomp {
188  return t1->id() < t2->id();
189  }
190  };
191  typedef std::set<edm::Ref<CaloTowerCollection>, twrrefcomp> twrrefset_t;
192 };
193 
194 #endif
double HPDEMF(void) const
Definition: HcalNoiseAlgo.h:42
double r45EnergyFraction(void) const
Definition: HcalNoiseAlgo.h:47
virtual ~HcalNoiseAlgo()
Definition: HcalNoiseAlgo.h:83
double highEHitTimeSqrd(void) const
Definition: HcalNoiseAlgo.h:39
bool CheckPassFilter(double Charge, double Discriminant, std::vector< std::pair< double, double > > const &Cuts, int Side)
double lowEHitTimeSqrd(void) const
Definition: HcalNoiseAlgo.h:35
std::set< edm::Ref< CaloTowerCollection >, twrrefcomp > twrrefset_t
bool passTightRatio(const CommonHcalNoiseRBXData &) const
double pMaxHPDEMF_
int numLowEHits(void) const
Definition: HcalNoiseAlgo.h:36
bool passLooseTiming(const CommonHcalNoiseRBXData &) const
double hlMaxRBXEMF_
double pMinERatio_
bool passLooseZeros(const CommonHcalNoiseRBXData &) const
bool passLooseRatio(const CommonHcalNoiseRBXData &) const
int pMinRBXRechitR45Count_
double pMinHighEHitTime_
std::vector< double > lMinRBXRechitR45Cuts_
bool passRatioThreshold(const CommonHcalNoiseRBXData &) const
int numRBXHits(void) const
Definition: HcalNoiseAlgo.h:30
bool passTightNoiseFilter(const CommonHcalNoiseRBXData &) const
bool passTightZeros(const CommonHcalNoiseRBXData &) const
bool PassTS4TS5(void) const
Definition: HcalNoiseAlgo.h:43
int r45Count(void) const
Definition: HcalNoiseAlgo.h:45
edm::RefVector< CaloTowerCollection > rbxtowers_
Definition: HcalNoiseAlgo.h:74
double tMaxHighEHitTime_
double minHighEHitTime(void) const
Definition: HcalNoiseAlgo.h:37
double maxLowEHitTime(void) const
Definition: HcalNoiseAlgo.h:34
double lMaxHighEHitTime_
int numHPDHits(void) const
Definition: HcalNoiseAlgo.h:29
bool passLooseHits(const CommonHcalNoiseRBXData &) const
bool passLooseRBXRechitR45(const CommonHcalNoiseRBXData &) const
double pMinEZeros_
double ratio(void) const
Definition: HcalNoiseAlgo.h:25
double energy(void) const
Definition: HcalNoiseAlgo.h:24
double pMinRBXRechitR45EnergyFraction_
int numHighEHits(void) const
Definition: HcalNoiseAlgo.h:40
edm::RefVector< CaloTowerCollection > rbxTowers(void) const
Definition: HcalNoiseAlgo.h:44
double tMinHighEHitTime_
double pMaxHighEHitTime_
double RBXEMF(void) const
Definition: HcalNoiseAlgo.h:41
std::vector< double > tMinRBXRechitR45Cuts_
double lMinLowEHitTime_
int numHPDNoOtherHits(void) const
Definition: HcalNoiseAlgo.h:31
bool passZerosThreshold(const CommonHcalNoiseRBXData &) const
double pMinRBXRechitR45Fraction_
double minLowEHitTime(void) const
Definition: HcalNoiseAlgo.h:33
double tMinLowEHitTime_
bool validRatio(void) const
Definition: HcalNoiseAlgo.h:28
double pMaxLowEHitTime_
double pMinLowEHitTime_
bool passTightRBXRechitR45(const CommonHcalNoiseRBXData &) const
bool passEMFThreshold(const CommonHcalNoiseRBXData &) const
bool operator()(const edm::Ref< CaloTowerCollection > &t1, const edm::Ref< CaloTowerCollection > &t2) const
HcalNoiseAlgo(const edm::ParameterSet &iConfig)
double e2ts(void) const
Definition: HcalNoiseAlgo.h:26
bool passLooseNoiseFilter(const CommonHcalNoiseRBXData &) const
bool passHighLevelNoiseFilter(const CommonHcalNoiseRBXData &) const
double pMaxRBXEMF_
int numZeros(void) const
Definition: HcalNoiseAlgo.h:32
double lMaxLowEHitTime_
bool passTightTiming(const CommonHcalNoiseRBXData &) const
double lMinHighEHitTime_
CommonHcalNoiseRBXData(const reco::HcalNoiseRBX &rbx, double minRecHitE, double minLowHitE, double minHighHitE, double TS4TS5EnergyThreshold, std::vector< std::pair< double, double > > const &TS4TS5UpperCut, std::vector< std::pair< double, double > > const &TS4TS5LowerCut, double MinRBXRechitR45E)
Definition: HcalNoiseAlgo.cc:3
bool passTightHits(const CommonHcalNoiseRBXData &) const
double maxHighEHitTime(void) const
Definition: HcalNoiseAlgo.h:38
void operator()(edm::RefVector< CaloTowerCollection > &v1, const edm::RefVector< CaloTowerCollection > &v2) const
double r45Fraction(void) const
Definition: HcalNoiseAlgo.h:46
double e10ts(void) const
Definition: HcalNoiseAlgo.h:27
double tMaxLowEHitTime_
bool isProblematic(const CommonHcalNoiseRBXData &) const
double hlMaxHPDEMF_