CMS 3D CMS Logo

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