test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
13  public:
15  double TS4TS5EnergyThreshold, std::vector<std::pair<double, double> > &TS4TS5UpperCut,
16  std::vector<std::pair<double, double> > &TS4TS5LowerCut, double MinRBXRechitR45E);
18 
19  // accessors to internal variables
20  inline double energy(void) const { return energy_; }
21  inline double ratio(void) const { return e2ts_/e10ts_; }
22  inline double e2ts(void) const { return e2ts_; }
23  inline double e10ts(void) const { return e10ts_; }
24  inline bool validRatio(void) const { return e10ts_!=0.0; }
25  inline int numHPDHits(void) const { return numHPDHits_; }
26  inline int numRBXHits(void) const { return numRBXHits_; }
27  inline int numHPDNoOtherHits(void) const { return numHPDNoOtherHits_; }
28  inline int numZeros(void) const { return numZeros_; }
29  inline double minLowEHitTime(void) const { return minLowEHitTime_; }
30  inline double maxLowEHitTime(void) const { return maxLowEHitTime_; }
31  inline double lowEHitTimeSqrd(void) const { return lowEHitTimeSqrd_; }
32  inline int numLowEHits(void) const { return numLowEHits_; }
33  inline double minHighEHitTime(void) const { return minHighEHitTime_; }
34  inline double maxHighEHitTime(void) const { return maxHighEHitTime_; }
35  inline double highEHitTimeSqrd(void) const { return highEHitTimeSqrd_; }
36  inline int numHighEHits(void) const { return numHighEHits_; }
37  inline double RBXEMF(void) const { return RBXEMF_; }
38  inline double HPDEMF(void) const { return HPDEMF_; }
39  inline bool PassTS4TS5(void) const { return TS4TS5Decision_; }
41  inline int r45Count(void) const { return r45Count_; }
42  inline double r45Fraction(void) const { return r45Fraction_; }
43  inline double r45EnergyFraction(void) const { return r45EnergyFraction_; }
44 
45  bool CheckPassFilter(double Charge, double Discriminant, std::vector<std::pair<double, double> > &Cuts, int Side);
46 
47 private:
48 
49  // values
50  double energy_; // RBX hadronic energy as determined by the sum of calotowers
51  double e2ts_; // pedestal subtracted charge in two peak TS for RBX
52  double e10ts_; // pedestal subtracted charge in all 10 TS for RBX
53  int numHPDHits_; // largest number of hits in an HPD in the RBX
54  int numRBXHits_; // number of hits in the RBX
55  int numHPDNoOtherHits_; // largest number of hits in an HPD when no other HPD has a hit in the RBX
56  int numZeros_; // number of ADC 0 counts in all hits in all TS in the RBX
57  double minLowEHitTime_; // minimum time found for any low energy hit in the RBX
58  double maxLowEHitTime_; // maximum time found for any low energy hit in the RBX
59  double lowEHitTimeSqrd_; // low energy hit time^2
60  int numLowEHits_; // number of low energy hits
61  double minHighEHitTime_; // minimum time found for any high energy hit in the RBX
62  double maxHighEHitTime_; // maximum time found for any high energy hit in the RBX
63  double highEHitTimeSqrd_; // high energy hit time^2
64  int numHighEHits_; // number of high energy hits
65  double HPDEMF_; // minimum electromagnetic fraction found in an HPD in the RBX
66  double RBXEMF_; // electromagnetic fraction of the RBX
67  bool TS4TS5Decision_; // if this RBX fails TS4TS5 variable or not
68  edm::RefVector<CaloTowerCollection> rbxtowers_; // calotowers associated with the RBX
69  int r45Count_; // Number of rechits above some threshold flagged by R45
70  double r45Fraction_; // Fraction of rechits above some threshold flagged by R45
71  double r45EnergyFraction_; // Energy fraction of rechits above some threshold
72 
73 };
74 
76 
77 public:
78 
79  HcalNoiseAlgo(const edm::ParameterSet& iConfig);
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
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 
111 private:
112 
113  // energy thresholds used for problematic cuts
114  double pMinERatio_; // minimum energy to apply ratio cuts
115  double pMinEZeros_; // minimum energy to apply zeros cuts
116  double pMinEEMF_; // minimum energy to apply EMF cuts
117 
118  // energy thresholds used for loose, tight and high level cuts
119  double minERatio_; // minimum energy to apply ratio cuts
120  double minEZeros_; // minimum energy to apply zeros cuts
121  double minEEMF_; // minimum energy to apply EMF cuts
122 
123  // "problematic" cuts
124  // used to determine whether an RBX is stored in the EDM
125  double pMinE_; // minimum energy
126  double pMinRatio_; // minimum ratio
127  double pMaxRatio_; // maximum ratio
128  int pMinHPDHits_; // minimum # of HPD hits
129  int pMinRBXHits_; // minimum # of RBX hits
130  int pMinHPDNoOtherHits_; // minimum # of HPD hits with no other hits in the RBX
131  int pMinZeros_; // minimum # of zeros
132  double pMinLowEHitTime_; // minimum low energy hit time
133  double pMaxLowEHitTime_; // maximum low energy hit time
134  double pMinHighEHitTime_; // minimum high energy hit time
135  double pMaxHighEHitTime_; // maximum high energy hit time
136  double pMaxHPDEMF_; // maximum HPD EMF
137  double pMaxRBXEMF_; // maximum RBX EMF
138  int pMinRBXRechitR45Count_; // number of R45-flagged hits
139  double pMinRBXRechitR45Fraction_; // fraction of R45-flagged hits
140  double pMinRBXRechitR45EnergyFraction_; // energy fraction of R45-flagged hits
141 
142  // "loose" cuts
143  // used to determine whether an RBX fails the loose noise cuts
144  double lMinRatio_; // minimum ratio
145  double lMaxRatio_; // maximum ratio
146  int lMinHPDHits_; // minimum # of HPD hits
147  int lMinRBXHits_; // minimum # of RBX hits
148  int lMinHPDNoOtherHits_; // minimum # of HPD hits with no other hits in the RBX
149  int lMinZeros_; // minimum # of zeros
150  double lMinLowEHitTime_; // minimum low energy hit time
151  double lMaxLowEHitTime_; // maximum low energy hit time
152  double lMinHighEHitTime_; // minimum high energy hit time
153  double lMaxHighEHitTime_; // maximum high energy hit time
154  std::vector<double> lMinRBXRechitR45Cuts_;
155 
156  // "tight" cuts
157  // used to determine whether an RBX fails the tight noise cuts
158  double tMinRatio_; // minimum ratio
159  double tMaxRatio_; // maximum ratio
160  int tMinHPDHits_; // minimum # of HPD hits
161  int tMinRBXHits_; // minimum # of RBX hits
162  int tMinHPDNoOtherHits_; // minimum # of HPD hits with no other hits in the RBX
163  int tMinZeros_; // minimum # of zeros
164  double tMinLowEHitTime_; // minimum low energy hit time
165  double tMaxLowEHitTime_; // maximum low energy hit time
166  double tMinHighEHitTime_; // minimum high energy hit time
167  double tMaxHighEHitTime_; // maximum high energy hit time
168  std::vector<double> tMinRBXRechitR45Cuts_;
169 
170  // "high level" cuts
171  // used to determine where an RBX fails the high level noise cuts
172  double hlMaxHPDEMF_; // maximum HPD EMF
173  double hlMaxRBXEMF_; // maximum RBX EMF
174 
175 };
176 
178 {
179  public:
182 
184 
185  private:
186 
187  // helper function to compare calotower references
188  struct twrrefcomp {
190  return t1->id() < t2->id();
191  }
192  };
193  typedef std::set< edm::Ref<CaloTowerCollection>, twrrefcomp> twrrefset_t;
194 };
195 
196 
197 #endif
bool CheckPassFilter(double Charge, double Discriminant, std::vector< std::pair< double, double > > &Cuts, int Side)
double e10ts(void) const
Definition: HcalNoiseAlgo.h:23
virtual ~HcalNoiseAlgo()
Definition: HcalNoiseAlgo.h:80
double HPDEMF(void) const
Definition: HcalNoiseAlgo.h:38
double e2ts(void) const
Definition: HcalNoiseAlgo.h:22
double lowEHitTimeSqrd(void) const
Definition: HcalNoiseAlgo.h:31
bool isProblematic(const CommonHcalNoiseRBXData &) const
bool passTightRatio(const CommonHcalNoiseRBXData &) const
double pMaxHPDEMF_
double minLowEHitTime(void) const
Definition: HcalNoiseAlgo.h:29
bool operator()(const edm::Ref< CaloTowerCollection > &t1, const edm::Ref< CaloTowerCollection > &t2)
double hlMaxRBXEMF_
double pMinERatio_
bool passLooseRatio(const CommonHcalNoiseRBXData &) const
bool passTightRBXRechitR45(const CommonHcalNoiseRBXData &) const
double maxHighEHitTime(void) const
Definition: HcalNoiseAlgo.h:34
bool passTightTiming(const CommonHcalNoiseRBXData &) const
double maxLowEHitTime(void) const
Definition: HcalNoiseAlgo.h:30
int numLowEHits(void) const
Definition: HcalNoiseAlgo.h:32
int pMinRBXRechitR45Count_
double pMinHighEHitTime_
std::vector< double > lMinRBXRechitR45Cuts_
double r45EnergyFraction(void) const
Definition: HcalNoiseAlgo.h:43
double ratio(void) const
Definition: HcalNoiseAlgo.h:21
bool passLooseRBXRechitR45(const CommonHcalNoiseRBXData &) const
edm::RefVector< CaloTowerCollection > rbxtowers_
Definition: HcalNoiseAlgo.h:68
bool passHighLevelNoiseFilter(const CommonHcalNoiseRBXData &) const
double tMaxHighEHitTime_
ProductID id() const
Accessor for product ID.
Definition: Ref.h:258
double RBXEMF(void) const
Definition: HcalNoiseAlgo.h:37
double lMaxHighEHitTime_
int numRBXHits(void) const
Definition: HcalNoiseAlgo.h:26
double pMinEZeros_
double highEHitTimeSqrd(void) const
Definition: HcalNoiseAlgo.h:35
std::set< edm::Ref< CaloTowerCollection >, twrrefcomp > twrrefset_t
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_
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
double lMinLowEHitTime_
bool passTightZeros(const CommonHcalNoiseRBXData &) const
double pMinRBXRechitR45Fraction_
int numHighEHits(void) const
Definition: HcalNoiseAlgo.h:36
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:27
int numZeros(void) const
Definition: HcalNoiseAlgo.h:28
double pMaxLowEHitTime_
double pMinLowEHitTime_
bool passZerosThreshold(const CommonHcalNoiseRBXData &) const
int r45Count(void) const
Definition: HcalNoiseAlgo.h:41
bool passLooseNoiseFilter(const CommonHcalNoiseRBXData &) const
edm::RefVector< CaloTowerCollection > rbxTowers(void) const
Definition: HcalNoiseAlgo.h:40
HcalNoiseAlgo(const edm::ParameterSet &iConfig)
bool passLooseHits(const CommonHcalNoiseRBXData &) const
double pMaxRBXEMF_
double energy(void) const
Definition: HcalNoiseAlgo.h:20
bool passLooseTiming(const CommonHcalNoiseRBXData &) const
bool passTightNoiseFilter(const CommonHcalNoiseRBXData &) const
double minHighEHitTime(void) const
Definition: HcalNoiseAlgo.h:33
double lMaxLowEHitTime_
double lMinHighEHitTime_
bool PassTS4TS5(void) const
Definition: HcalNoiseAlgo.h:39
bool passEMFThreshold(const CommonHcalNoiseRBXData &) const
int numHPDHits(void) const
Definition: HcalNoiseAlgo.h:25
double tMaxLowEHitTime_
bool validRatio(void) const
Definition: HcalNoiseAlgo.h:24
double hlMaxHPDEMF_
bool passTightHits(const CommonHcalNoiseRBXData &) const
double r45Fraction(void) const
Definition: HcalNoiseAlgo.h:42