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:
14  CommonHcalNoiseRBXData(const reco::HcalNoiseRBX& rbx, double minRecHitE, double minLowHitE, double minHighHitE,
15  double TS4TS5EnergyThreshold, std::vector<std::pair<double, double> > &TS4TS5UpperCut,
16  std::vector<std::pair<double, double> > &TS4TS5LowerCut);
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 
42  bool CheckPassFilter(double Charge, double Discriminant, std::vector<std::pair<double, double> > &Cuts, int Side);
43 
44 private:
45 
46  // values
47  double energy_; // RBX hadronic energy as determined by the sum of calotowers
48  double e2ts_; // pedestal subtracted charge in two peak TS for RBX
49  double e10ts_; // pedestal subtracted charge in all 10 TS for RBX
50  int numHPDHits_; // largest number of hits in an HPD in the RBX
51  int numRBXHits_; // number of hits in the RBX
52  int numHPDNoOtherHits_; // largest number of hits in an HPD when no other HPD has a hit in the RBX
53  int numZeros_; // number of ADC 0 counts in all hits in all TS in the RBX
54  double minLowEHitTime_; // minimum time found for any low energy hit in the RBX
55  double maxLowEHitTime_; // maximum time found for any low energy hit in the RBX
56  double lowEHitTimeSqrd_; // low energy hit time^2
57  int numLowEHits_; // number of low energy hits
58  double minHighEHitTime_; // minimum time found for any high energy hit in the RBX
59  double maxHighEHitTime_; // maximum time found for any high energy hit in the RBX
60  double highEHitTimeSqrd_; // high energy hit time^2
61  int numHighEHits_; // number of high energy hits
62  double HPDEMF_; // minimum electromagnetic fraction found in an HPD in the RBX
63  double RBXEMF_; // electromagnetic fraction of the RBX
64  bool TS4TS5Decision_; // if this RBX fails TS4TS5 variable or not
65  edm::RefVector<CaloTowerCollection> rbxtowers_; // calotowers associated with the RBX
66 
67 };
68 
70 
71 public:
72 
73  HcalNoiseAlgo(const edm::ParameterSet& iConfig);
74  virtual ~HcalNoiseAlgo() {}
75 
76  // an rbx is "interesting/problematic" (i.e. is recorded to the event record)
77  bool isProblematic(const CommonHcalNoiseRBXData&) const;
78 
79  // an rbx passes a noise filter
83 
84  // loose filter broken down into separate components
85  bool passLooseRatio(const CommonHcalNoiseRBXData&) const;
86  bool passLooseHits(const CommonHcalNoiseRBXData&) const;
87  bool passLooseZeros(const CommonHcalNoiseRBXData&) const;
88  bool passLooseTiming(const CommonHcalNoiseRBXData&) const;
89 
90  // tight filter broken down into separate components
91  bool passTightRatio(const CommonHcalNoiseRBXData&) const;
92  bool passTightHits(const CommonHcalNoiseRBXData&) const;
93  bool passTightZeros(const CommonHcalNoiseRBXData&) const;
94  bool passTightTiming(const CommonHcalNoiseRBXData&) const;
95 
96  // an rbx passes an energy (or other) threshold to test a certain variable
97  // for instance, the EMF cut might require that the RBX have 20 GeV of energy
98  bool passRatioThreshold(const CommonHcalNoiseRBXData&) const;
99  bool passZerosThreshold(const CommonHcalNoiseRBXData&) const;
100  bool passEMFThreshold(const CommonHcalNoiseRBXData&) const;
101 
102 
103 private:
104 
105  // energy thresholds used for problematic cuts
106  double pMinERatio_; // minimum energy to apply ratio cuts
107  double pMinEZeros_; // minimum energy to apply zeros cuts
108  double pMinEEMF_; // minimum energy to apply EMF cuts
109 
110  // energy thresholds used for loose, tight and high level cuts
111  double minERatio_; // minimum energy to apply ratio cuts
112  double minEZeros_; // minimum energy to apply zeros cuts
113  double minEEMF_; // minimum energy to apply EMF cuts
114 
115  // "problematic" cuts
116  // used to determine whether an RBX is stored in the EDM
117  double pMinE_; // minimum energy
118  double pMinRatio_; // minimum ratio
119  double pMaxRatio_; // maximum ratio
120  int pMinHPDHits_; // minimum # of HPD hits
121  int pMinRBXHits_; // minimum # of RBX hits
122  int pMinHPDNoOtherHits_; // minimum # of HPD hits with no other hits in the RBX
123  int pMinZeros_; // minimum # of zeros
124  double pMinLowEHitTime_; // minimum low energy hit time
125  double pMaxLowEHitTime_; // maximum low energy hit time
126  double pMinHighEHitTime_; // minimum high energy hit time
127  double pMaxHighEHitTime_; // maximum high energy hit time
128  double pMaxHPDEMF_; // maximum HPD EMF
129  double pMaxRBXEMF_; // maximum RBX EMF
130 
131  // "loose" cuts
132  // used to determine whether an RBX fails the loose noise cuts
133  double lMinRatio_; // minimum ratio
134  double lMaxRatio_; // maximum ratio
135  int lMinHPDHits_; // minimum # of HPD hits
136  int lMinRBXHits_; // minimum # of RBX hits
137  int lMinHPDNoOtherHits_; // minimum # of HPD hits with no other hits in the RBX
138  int lMinZeros_; // minimum # of zeros
139  double lMinLowEHitTime_; // minimum low energy hit time
140  double lMaxLowEHitTime_; // maximum low energy hit time
141  double lMinHighEHitTime_; // minimum high energy hit time
142  double lMaxHighEHitTime_; // maximum high energy hit time
143 
144  // "tight" cuts
145  // used to determine whether an RBX fails the tight noise cuts
146  double tMinRatio_; // minimum ratio
147  double tMaxRatio_; // maximum ratio
148  int tMinHPDHits_; // minimum # of HPD hits
149  int tMinRBXHits_; // minimum # of RBX hits
150  int tMinHPDNoOtherHits_; // minimum # of HPD hits with no other hits in the RBX
151  int tMinZeros_; // minimum # of zeros
152  double tMinLowEHitTime_; // minimum low energy hit time
153  double tMaxLowEHitTime_; // maximum low energy hit time
154  double tMinHighEHitTime_; // minimum high energy hit time
155  double tMaxHighEHitTime_; // maximum high energy hit time
156 
157  // "high level" cuts
158  // used to determine where an RBX fails the high level noise cuts
159  double hlMaxHPDEMF_; // maximum HPD EMF
160  double hlMaxRBXEMF_; // maximum RBX EMF
161 
162 };
163 
165 {
166  public:
169 
171 
172  private:
173 
174  // helper function to compare calotower references
175  struct twrrefcomp {
177  return t1->id() < t2->id();
178  }
179  };
180  typedef std::set< edm::Ref<CaloTowerCollection>, twrrefcomp> twrrefset_t;
181 };
182 
183 
184 #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:74
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
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
double pMinHighEHitTime_
double ratio(void) const
Definition: HcalNoiseAlgo.h:21
edm::RefVector< CaloTowerCollection > rbxtowers_
Definition: HcalNoiseAlgo.h:65
bool passHighLevelNoiseFilter(const CommonHcalNoiseRBXData &) const
double tMaxHighEHitTime_
double RBXEMF(void) const
Definition: HcalNoiseAlgo.h:37
double lMaxHighEHitTime_
int numRBXHits(void) const
Definition: HcalNoiseAlgo.h:26
double pMinEZeros_
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)
Definition: HcalNoiseAlgo.cc:3
double highEHitTimeSqrd(void) const
Definition: HcalNoiseAlgo.h:35
std::set< edm::Ref< CaloTowerCollection >, twrrefcomp > twrrefset_t
bool passLooseZeros(const CommonHcalNoiseRBXData &) const
double tMinHighEHitTime_
double pMaxHighEHitTime_
double lMinLowEHitTime_
bool passTightZeros(const CommonHcalNoiseRBXData &) const
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
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_
ProductID id() const
Accessor for product ID.
Definition: Ref.h:256
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