Go to the documentation of this file.00001 #ifndef _RECOMET_METALGORITHMS_HCALNOISEALGO_H_
00002 #define _RECOMET_METALGORITHMS_HCALNOISEALGO_H_
00003
00004 #include "DataFormats/METReco/interface/HcalNoiseRBX.h"
00005 #include "DataFormats/Common/interface/RefVector.h"
00006 #include "DataFormats/Common/interface/Ref.h"
00007 #include "DataFormats/Common/interface/RefProd.h"
00008 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
00009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00010
00011 class CommonHcalNoiseRBXData {
00012
00013 public:
00014 CommonHcalNoiseRBXData(const reco::HcalNoiseRBX& rbx, double minRecHitE, double minLowHitE, double minHighHitE,
00015 double TS4TS5EnergyThreshold, std::vector<std::pair<double, double> > &TS4TS5UpperCut,
00016 std::vector<std::pair<double, double> > &TS4TS5LowerCut);
00017 ~CommonHcalNoiseRBXData() {}
00018
00019
00020 inline double energy(void) const { return energy_; }
00021 inline double ratio(void) const { return e2ts_/e10ts_; }
00022 inline double e2ts(void) const { return e2ts_; }
00023 inline double e10ts(void) const { return e10ts_; }
00024 inline bool validRatio(void) const { return e10ts_!=0.0; }
00025 inline int numHPDHits(void) const { return numHPDHits_; }
00026 inline int numRBXHits(void) const { return numRBXHits_; }
00027 inline int numHPDNoOtherHits(void) const { return numHPDNoOtherHits_; }
00028 inline int numZeros(void) const { return numZeros_; }
00029 inline double minLowEHitTime(void) const { return minLowEHitTime_; }
00030 inline double maxLowEHitTime(void) const { return maxLowEHitTime_; }
00031 inline double lowEHitTimeSqrd(void) const { return lowEHitTimeSqrd_; }
00032 inline int numLowEHits(void) const { return numLowEHits_; }
00033 inline double minHighEHitTime(void) const { return minHighEHitTime_; }
00034 inline double maxHighEHitTime(void) const { return maxHighEHitTime_; }
00035 inline double highEHitTimeSqrd(void) const { return highEHitTimeSqrd_; }
00036 inline int numHighEHits(void) const { return numHighEHits_; }
00037 inline double RBXEMF(void) const { return RBXEMF_; }
00038 inline double HPDEMF(void) const { return HPDEMF_; }
00039 inline bool PassTS4TS5(void) const { return TS4TS5Decision_; }
00040 inline edm::RefVector<CaloTowerCollection> rbxTowers(void) const { return rbxtowers_; }
00041
00042 bool CheckPassFilter(double Charge, double Discriminant, std::vector<std::pair<double, double> > &Cuts, int Side);
00043
00044 private:
00045
00046
00047 double energy_;
00048 double e2ts_;
00049 double e10ts_;
00050 int numHPDHits_;
00051 int numRBXHits_;
00052 int numHPDNoOtherHits_;
00053 int numZeros_;
00054 double minLowEHitTime_;
00055 double maxLowEHitTime_;
00056 double lowEHitTimeSqrd_;
00057 int numLowEHits_;
00058 double minHighEHitTime_;
00059 double maxHighEHitTime_;
00060 double highEHitTimeSqrd_;
00061 int numHighEHits_;
00062 double HPDEMF_;
00063 double RBXEMF_;
00064 bool TS4TS5Decision_;
00065 edm::RefVector<CaloTowerCollection> rbxtowers_;
00066
00067 };
00068
00069 class HcalNoiseAlgo {
00070
00071 public:
00072
00073 HcalNoiseAlgo(const edm::ParameterSet& iConfig);
00074 virtual ~HcalNoiseAlgo() {}
00075
00076
00077 bool isProblematic(const CommonHcalNoiseRBXData&) const;
00078
00079
00080 bool passLooseNoiseFilter(const CommonHcalNoiseRBXData&) const;
00081 bool passTightNoiseFilter(const CommonHcalNoiseRBXData&) const;
00082 bool passHighLevelNoiseFilter(const CommonHcalNoiseRBXData&) const;
00083
00084
00085 bool passLooseRatio(const CommonHcalNoiseRBXData&) const;
00086 bool passLooseHits(const CommonHcalNoiseRBXData&) const;
00087 bool passLooseZeros(const CommonHcalNoiseRBXData&) const;
00088 bool passLooseTiming(const CommonHcalNoiseRBXData&) const;
00089
00090
00091 bool passTightRatio(const CommonHcalNoiseRBXData&) const;
00092 bool passTightHits(const CommonHcalNoiseRBXData&) const;
00093 bool passTightZeros(const CommonHcalNoiseRBXData&) const;
00094 bool passTightTiming(const CommonHcalNoiseRBXData&) const;
00095
00096
00097
00098 bool passRatioThreshold(const CommonHcalNoiseRBXData&) const;
00099 bool passZerosThreshold(const CommonHcalNoiseRBXData&) const;
00100 bool passEMFThreshold(const CommonHcalNoiseRBXData&) const;
00101
00102
00103 private:
00104
00105
00106 double pMinERatio_;
00107 double pMinEZeros_;
00108 double pMinEEMF_;
00109
00110
00111 double minERatio_;
00112 double minEZeros_;
00113 double minEEMF_;
00114
00115
00116
00117 double pMinE_;
00118 double pMinRatio_;
00119 double pMaxRatio_;
00120 int pMinHPDHits_;
00121 int pMinRBXHits_;
00122 int pMinHPDNoOtherHits_;
00123 int pMinZeros_;
00124 double pMinLowEHitTime_;
00125 double pMaxLowEHitTime_;
00126 double pMinHighEHitTime_;
00127 double pMaxHighEHitTime_;
00128 double pMaxHPDEMF_;
00129 double pMaxRBXEMF_;
00130
00131
00132
00133 double lMinRatio_;
00134 double lMaxRatio_;
00135 int lMinHPDHits_;
00136 int lMinRBXHits_;
00137 int lMinHPDNoOtherHits_;
00138 int lMinZeros_;
00139 double lMinLowEHitTime_;
00140 double lMaxLowEHitTime_;
00141 double lMinHighEHitTime_;
00142 double lMaxHighEHitTime_;
00143
00144
00145
00146 double tMinRatio_;
00147 double tMaxRatio_;
00148 int tMinHPDHits_;
00149 int tMinRBXHits_;
00150 int tMinHPDNoOtherHits_;
00151 int tMinZeros_;
00152 double tMinLowEHitTime_;
00153 double tMaxLowEHitTime_;
00154 double tMinHighEHitTime_;
00155 double tMaxHighEHitTime_;
00156
00157
00158
00159 double hlMaxHPDEMF_;
00160 double hlMaxRBXEMF_;
00161
00162 };
00163
00164 class JoinCaloTowerRefVectorsWithoutDuplicates
00165 {
00166 public:
00167 JoinCaloTowerRefVectorsWithoutDuplicates() {}
00168 ~JoinCaloTowerRefVectorsWithoutDuplicates() {}
00169
00170 void operator()(edm::RefVector<CaloTowerCollection>& v1, const edm::RefVector<CaloTowerCollection>& v2) const;
00171
00172 private:
00173
00174
00175 struct twrrefcomp {
00176 inline bool operator() ( const edm::Ref<CaloTowerCollection> & t1, const edm::Ref<CaloTowerCollection> & t2 ) {
00177 return t1->id() < t2->id();
00178 }
00179 };
00180 typedef std::set< edm::Ref<CaloTowerCollection>, twrrefcomp> twrrefset_t;
00181 };
00182
00183
00184 #endif