7 double minRBXRechitR45E)
10 ,r45EnergyFraction_(0)
21 if(
energy_ > TS4TS5EnergyThreshold)
23 std::vector<float> AllCharge = rbx.
allCharge();
24 double BaseCharge = AllCharge[4] + AllCharge[5];
27 double TS4TS5 = (AllCharge[4] - AllCharge[5]) / BaseCharge;
38 int rbxHitCount = rbx.
numRecHits(minRBXRechitR45E);
51 for(std::vector<reco::HcalNoiseHPD>::const_iterator it1=rbx.
HPDsBegin(); it1!=rbx.
HPDsEnd(); ++it1) {
52 int nhpdhits=it1->numRecHits(minRecHitE);
66 for(std::vector<reco::HcalNoiseHPD>::const_iterator it1=rbx.
HPDsBegin(); it1!=rbx.
HPDsEnd(); ++it1) {
69 float energy=(*it2)->energy();
70 float time=(*it2)->time();
71 if(energy>=minLowHitE) {
77 if(energy>=minHighHitE) {
88 for(std::vector<reco::HcalNoiseHPD>::const_iterator it1=rbx.
HPDsBegin(); it1!=rbx.
HPDsEnd(); ++it1) {
89 double eme=it1->caloTowerEmE();
90 double hade=it1->recHitEnergy(minRecHitE);
91 double emf=(eme+hade)==0 ? 999 : eme/(eme+hade);
100 for(std::vector<reco::HcalNoiseHPD>::const_iterator it1=rbx.
HPDsBegin(); it1!=rbx.
HPDsEnd(); ++it1) {
109 pMinERatio_ = iConfig.
getParameter<
double>(
"pMinERatio");
110 pMinEZeros_ = iConfig.
getParameter<
double>(
"pMinEZeros");
120 pMinHPDHits_ = iConfig.
getParameter<
int>(
"pMinHPDHits");
121 pMinRBXHits_ = iConfig.
getParameter<
int>(
"pMinRBXHits");
122 pMinHPDNoOtherHits_ = iConfig.
getParameter<
int>(
"pMinHPDNoOtherHits");
124 pMinLowEHitTime_ = iConfig.
getParameter<
double>(
"pMinLowEHitTime");
125 pMaxLowEHitTime_ = iConfig.
getParameter<
double>(
"pMaxLowEHitTime");
126 pMinHighEHitTime_ = iConfig.
getParameter<
double>(
"pMinHighEHitTime");
127 pMaxHighEHitTime_ = iConfig.
getParameter<
double>(
"pMaxHighEHitTime");
128 pMaxHPDEMF_ = iConfig.
getParameter<
double>(
"pMaxHPDEMF");
129 pMaxRBXEMF_ = iConfig.
getParameter<
double>(
"pMaxRBXEMF");
131 if(iConfig.
existsAs<
int>(
"pMinRBXRechitR45Count"))
132 pMinRBXRechitR45Count_ = iConfig.
getParameter<
int>(
"pMinRBXRechitR45Count");
134 pMinRBXRechitR45Count_ = 0;
135 if(iConfig.
existsAs<
double>(
"pMinRBXRechitR45Fraction"))
136 pMinRBXRechitR45Fraction_ = iConfig.
getParameter<
double>(
"pMinRBXRechitR45Fraction");
138 pMinRBXRechitR45Fraction_ = 0;
139 if(iConfig.
existsAs<
double>(
"pMinRBXRechitR45EnergyFraction"))
140 pMinRBXRechitR45EnergyFraction_ = iConfig.
getParameter<
double>(
"pMinRBXRechitR45EnergyFraction");
142 pMinRBXRechitR45EnergyFraction_ = 0;
146 lMinHPDHits_ = iConfig.
getParameter<
int>(
"lMinHPDHits");
147 lMinRBXHits_ = iConfig.
getParameter<
int>(
"lMinRBXHits");
148 lMinHPDNoOtherHits_ = iConfig.
getParameter<
int>(
"lMinHPDNoOtherHits");
150 lMinLowEHitTime_ = iConfig.
getParameter<
double>(
"lMinLowEHitTime");
151 lMaxLowEHitTime_ = iConfig.
getParameter<
double>(
"lMaxLowEHitTime");
152 lMinHighEHitTime_ = iConfig.
getParameter<
double>(
"lMinHighEHitTime");
153 lMaxHighEHitTime_ = iConfig.
getParameter<
double>(
"lMaxHighEHitTime");
155 if(iConfig.
existsAs<std::vector<double> >(
"lRBXRecHitR45Cuts"))
156 lMinRBXRechitR45Cuts_ = iConfig.
getParameter<std::vector<double> >(
"lRBXRecHitR45Cuts");
159 double defaultCut[4] = {-999, -999, -999, -999};
160 lMinRBXRechitR45Cuts_ = std::vector<double>(defaultCut, defaultCut + 4);
165 tMinHPDHits_ = iConfig.
getParameter<
int>(
"tMinHPDHits");
166 tMinRBXHits_ = iConfig.
getParameter<
int>(
"tMinRBXHits");
167 tMinHPDNoOtherHits_ = iConfig.
getParameter<
int>(
"tMinHPDNoOtherHits");
169 tMinLowEHitTime_ = iConfig.
getParameter<
double>(
"tMinLowEHitTime");
170 tMaxLowEHitTime_ = iConfig.
getParameter<
double>(
"tMaxLowEHitTime");
171 tMinHighEHitTime_ = iConfig.
getParameter<
double>(
"tMinHighEHitTime");
172 tMaxHighEHitTime_ = iConfig.
getParameter<
double>(
"tMaxHighEHitTime");
174 if(iConfig.
existsAs<std::vector<double> >(
"tRBXRecHitR45Cuts"))
175 tMinRBXRechitR45Cuts_ = iConfig.
getParameter<std::vector<double> >(
"tRBXRecHitR45Cuts");
178 double defaultCut[4] = {-999, -999, -999, -999};
179 tMinRBXRechitR45Cuts_ = std::vector<double>(defaultCut, defaultCut + 4);
182 hlMaxHPDEMF_ = iConfig.
getParameter<
double>(
"hlMaxHPDEMF");
183 hlMaxRBXEMF_ = iConfig.
getParameter<
double>(
"hlMaxRBXEMF");
188 if(data.
energy()>pMinE_)
return true;
191 if(data.
numHPDHits()>=pMinHPDHits_)
return true;
192 if(data.
numRBXHits()>=pMinRBXHits_)
return true;
194 if(data.
numZeros()>=pMinZeros_ && data.
energy()>pMinEZeros_)
return true;
199 if(data.
HPDEMF()<pMaxHPDEMF_ && data.
energy()>pMinEEMF_)
return true;
200 if(data.
RBXEMF()<pMaxRBXEMF_ && data.
energy()>pMinEEMF_)
return true;
201 if(data.
r45Count() >= pMinRBXRechitR45Count_)
return true;
202 if(data.
r45Fraction() >= pMinRBXRechitR45Fraction_)
return true;
211 return (passLooseRatio(data) && passLooseHits(data) && passLooseZeros(data) && passLooseTiming(data) && passLooseRBXRechitR45(data));
216 return (passTightRatio(data) && passTightHits(data) && passTightZeros(data) && passTightTiming(data) && passTightRBXRechitR45(data));
221 if(passEMFThreshold(data)) {
222 if(data.
HPDEMF()<hlMaxHPDEMF_)
return false;
223 if(data.
RBXEMF()<hlMaxRBXEMF_)
return false;
230 if(passRatioThreshold(data)) {
239 if(data.
numHPDHits()>=lMinHPDHits_)
return false;
240 if(data.
numRBXHits()>=lMinRBXHits_)
return false;
247 if(passZerosThreshold(data)) {
248 if(data.
numZeros()>=lMinZeros_)
return false;
268 for(
int i = 0;
i + 3 < (
int)lMinRBXRechitR45Cuts_.size();
i =
i + 4)
270 double Value = Count * lMinRBXRechitR45Cuts_[
i] + Fraction * lMinRBXRechitR45Cuts_[
i+1] + EnergyFraction * lMinRBXRechitR45Cuts_[
i+2] + lMinRBXRechitR45Cuts_[
i+3];
280 if(passRatioThreshold(data)) {
289 if(data.
numHPDHits()>=tMinHPDHits_)
return false;
290 if(data.
numRBXHits()>=tMinRBXHits_)
return false;
297 if(passZerosThreshold(data)) {
298 if(data.
numZeros()>=tMinZeros_)
return false;
318 for(
int i = 0;
i + 3 < (
int)tMinRBXRechitR45Cuts_.size();
i =
i + 4)
320 double Value = Count * tMinRBXRechitR45Cuts_[
i] + Fraction * tMinRBXRechitR45Cuts_[
i+1] + EnergyFraction * tMinRBXRechitR45Cuts_[
i+2] + tMinRBXRechitR45Cuts_[
i+3];
330 return (data.
energy()>minERatio_);
335 return (data.
energy()>minEZeros_);
340 return (data.
energy()>minEEMF_);
350 twrrefset.insert(*it);
352 twrrefset.insert(*it);
356 for(twrrefset_t::const_iterator it=twrrefset.begin(); it!=twrrefset.end(); ++it) {
363 std::vector<std::pair<double, double> > &Cuts,
int Side)
377 if(Charge <= Cuts[0].
first)
380 int IndexLargerThanCharge = -1;
381 for(
int i = 1;
i < (
int)Cuts.size();
i++)
383 if(Cuts[
i].first > Charge)
385 IndexLargerThanCharge =
i;
390 double limit = 1000000;
392 if(IndexLargerThanCharge == -1)
393 limit = Cuts[Cuts.size()-1].second;
396 double C1 = Cuts[IndexLargerThanCharge].first;
397 double C2 = Cuts[IndexLargerThanCharge-1].first;
398 double L1 = Cuts[IndexLargerThanCharge].second;
399 double L2 = Cuts[IndexLargerThanCharge-1].second;
401 limit = (Charge - C1) / (C2 - C1) * (L2 - L1) + L1;
404 if(Side > 0 && Discriminant > limit)
406 if(Side < 0 && Discriminant < limit)
bool CheckPassFilter(double Charge, double Discriminant, std::vector< std::pair< double, double > > &Cuts, int Side)
double HPDEMF(void) const
T getParameter(std::string const &) const
int numRecHitsFailR45(double threshold=1.5) const
bool isProblematic(const CommonHcalNoiseRBXData &) const
bool passTightRatio(const CommonHcalNoiseRBXData &) const
double minLowEHitTime(void) const
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
float allChargeHighest2TS(unsigned int firstts=4) const
bool passLooseRatio(const CommonHcalNoiseRBXData &) const
bool passTightRBXRechitR45(const CommonHcalNoiseRBXData &) const
double maxHighEHitTime(void) const
bool passTightTiming(const CommonHcalNoiseRBXData &) const
double maxLowEHitTime(void) const
std::vector< HcalNoiseHPD >::const_iterator HPDsBegin(void) const
double r45EnergyFraction(void) const
int numRecHits(double threshold=1.5) const
std::vector< HcalNoiseHPD >::const_iterator HPDsEnd(void) const
bool passLooseRBXRechitR45(const CommonHcalNoiseRBXData &) const
const_iterator end() const
Termination of iteration.
edm::RefVector< CaloTowerCollection > rbxtowers_
bool passHighLevelNoiseFilter(const CommonHcalNoiseRBXData &) const
const_iterator begin() const
Initialize an iterator over the RefVector.
double RBXEMF(void) const
double caloTowerEmE(void) const
double r45EnergyFraction_
int numRBXHits(void) const
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)
bool passLooseZeros(const CommonHcalNoiseRBXData &) const
double recHitEnergy(double theshold=1.5) const
float allChargeTotal(void) const
bool passTightZeros(const CommonHcalNoiseRBXData &) const
emf
the use of emf in the JEC is not yet implemented
bool passRatioThreshold(const CommonHcalNoiseRBXData &) const
void operator()(edm::RefVector< CaloTowerCollection > &v1, const edm::RefVector< CaloTowerCollection > &v2) const
reco::JetExtendedAssociation::JetExtendedData Value
int numHPDNoOtherHits(void) const
bool passZerosThreshold(const CommonHcalNoiseRBXData &) const
bool passLooseNoiseFilter(const CommonHcalNoiseRBXData &) const
HcalNoiseAlgo(const edm::ParameterSet &iConfig)
bool passLooseHits(const CommonHcalNoiseRBXData &) const
int totalZeros(void) const
static std::string join(char **cmd)
void clear()
Clear the vector.
double recHitEnergyFailR45(double threshold=1.5) const
double energy(void) const
bool passLooseTiming(const CommonHcalNoiseRBXData &) const
bool passTightNoiseFilter(const CommonHcalNoiseRBXData &) const
char data[epos_bytes_allocation]
double minHighEHitTime(void) const
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
bool passEMFThreshold(const CommonHcalNoiseRBXData &) const
const std::vector< float > allCharge(void) const
int numHPDHits(void) const
bool validRatio(void) const
bool passTightHits(const CommonHcalNoiseRBXData &) const
double r45Fraction(void) const