35 HcalNoiseRBXCollectionTag_(iConfig.getParameter<
edm::InputTag>(
"HcalNoiseRBXCollection")),
36 severity_(iConfig.getParameter<
int> (
"severity")),
37 maxNumRBXs_(iConfig.getParameter<
int>(
"maxNumRBXs")),
38 numRBXsToConsider_(iConfig.getParameter<
int>(
"numRBXsToConsider")),
39 needEMFCoincidence_(iConfig.getParameter<
bool>(
"needEMFCoincidence")),
40 minRBXEnergy_(iConfig.getParameter<double>(
"minRBXEnergy")),
41 minRatio_(iConfig.getParameter<double>(
"minRatio")),
42 maxRatio_(iConfig.getParameter<double>(
"maxRatio")),
43 minHPDHits_(iConfig.getParameter<
int>(
"minHPDHits")),
44 minRBXHits_(iConfig.getParameter<
int>(
"minRBXHits")),
45 minHPDNoOtherHits_(iConfig.getParameter<
int>(
"minHPDNoOtherHits")),
46 minZeros_(iConfig.getParameter<
int>(
"minZeros")),
47 minHighEHitTime_(iConfig.getParameter<double>(
"minHighEHitTime")),
48 maxHighEHitTime_(iConfig.getParameter<double>(
"maxHighEHitTime")),
49 maxRBXEMF_(iConfig.getParameter<double>(
"maxRBXEMF")),
50 minRecHitE_(iConfig.getParameter<double>(
"minRecHitE")),
51 minLowHitE_(iConfig.getParameter<double>(
"minLowHitE")),
52 minHighHitE_(iConfig.getParameter<double>(
"minHighHitE")),
54 TS4TS5EnergyThreshold_(iConfig.getParameter<double>(
"TS4TS5EnergyThreshold"))
57 std::vector<double> TS4TS5UpperThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperThreshold");
58 std::vector<double> TS4TS5UpperCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperCut");
59 std::vector<double> TS4TS5LowerThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerThreshold");
60 std::vector<double> TS4TS5LowerCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerCut");
62 for(
int i = 0;
i < (
int)TS4TS5UpperThresholdTemp.size() &&
i < (
int)TS4TS5UpperCutTemp.size();
i++)
63 TS4TS5UpperCut_.push_back(std::pair<double, double>(TS4TS5UpperThresholdTemp[
i], TS4TS5UpperCutTemp[i]));
66 for(
int i = 0; i < (
int)TS4TS5LowerThresholdTemp.size() && i < (
int)TS4TS5LowerCutTemp.size(); i++)
67 TS4TS5LowerCut_.push_back(std::pair<double, double>(TS4TS5LowerThresholdTemp[i], TS4TS5LowerCutTemp[i]));
70 if(iConfig.
existsAs<
double>(
"minR45HitE"))
83 desc.
add<
int>(
"severity",1);
84 desc.
add<
int>(
"maxNumRBXs",2);
85 desc.
add<
int>(
"numRBXsToConsider",2);
86 desc.
add<
bool>(
"needEMFCoincidence",
true);
87 desc.
add<
double>(
"minRBXEnergy",50.0);
88 desc.
add<
double>(
"minRatio",-999.);
89 desc.
add<
double>(
"maxRatio",999.);
90 desc.
add<
int>(
"minHPDHits",17);
91 desc.
add<
int>(
"minRBXHits",999);
92 desc.
add<
int>(
"minHPDNoOtherHits",10);
93 desc.
add<
int>(
"minZeros",10);
94 desc.
add<
double>(
"minHighEHitTime",-9999.0);
95 desc.
add<
double>(
"maxHighEHitTime",9999.0);
96 desc.
add<
double>(
"maxRBXEMF",0.02);
97 desc.
add<
double>(
"minRecHitE",1.5);
98 desc.
add<
double>(
"minLowHitE",10.0);
99 desc.
add<
double>(
"minHighHitE",25.0);
100 desc.
add<
double>(
"minR45HitE",5.0);
101 desc.
add<
double>(
"TS4TS5EnergyThreshold",50.0);
103 double TS4TS5UpperThresholdArray[5] = {70, 90, 100, 400, 4000 };
104 double TS4TS5UpperCutArray[5] = {1, 0.8, 0.75, 0.72, 0.72};
105 double TS4TS5LowerThresholdArray[7] = {100, 120, 150, 200, 300, 400, 500};
106 double TS4TS5LowerCutArray[7] = {-1, -0.7, -0.4, -0.2, -0.08, 0, 0.1};
107 std::vector<double>
TS4TS5UpperThreshold(TS4TS5UpperThresholdArray, TS4TS5UpperThresholdArray+5);
108 std::vector<double>
TS4TS5UpperCut(TS4TS5UpperCutArray, TS4TS5UpperCutArray+5);
109 std::vector<double>
TS4TS5LowerThreshold(TS4TS5LowerThresholdArray, TS4TS5LowerThresholdArray+7);
110 std::vector<double>
TS4TS5LowerCut(TS4TS5LowerCutArray, TS4TS5LowerCutArray+7);
116 descriptions.
add(
"hltHcalMETNoiseFilter",desc);
125 using namespace reco;
134 edm::LogError(
"DataNotFound") <<
"HLTHcalMETNoiseFilter: Could not find HcalNoiseRBXCollection product named " 140 if(static_cast<int>(rbxs_h->size())>
maxNumRBXs_)
return true;
144 for(
auto const & rbx : *rbxs_h) {
153 for(
auto it=data.begin();
157 bool passFilter=
true;
160 if(it->validRatio() && it->ratio()<
minRatio_) passFilter=
false;
161 else if(it->validRatio() && it->ratio()>
maxRatio_) passFilter=
false;
162 else if(it->numHPDHits()>=
minHPDHits_) passFilter=
false;
163 else if(it->numRBXHits()>=
minRBXHits_) passFilter=
false;
165 else if(it->numZeros()>=
minZeros_) passFilter=
false;
168 else if(!it->PassTS4TS5()) passFilter=
false;
175 LogDebug(
"") <<
"HLTHcalMETNoiseFilter debug: Found a noisy RBX: " 176 <<
"energy=" << it->energy() <<
"; " 177 <<
"ratio=" << it->ratio() <<
"; " 178 <<
"# RBX hits=" << it->numRBXHits() <<
"; " 179 <<
"# HPD hits=" << it->numHPDHits() <<
"; " 180 <<
"# Zeros=" << it->numZeros() <<
"; " 181 <<
"min time=" << it->minHighEHitTime() <<
"; " 182 <<
"max time=" << it->maxHighEHitTime() <<
"; " 183 <<
"passTS4TS5=" << it->PassTS4TS5() <<
"; " 184 <<
"RBX EMF=" << it->RBXEMF()
std::vector< std::pair< double, double > > TS4TS5LowerCut_
T getParameter(std::string const &) const
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< std::pair< double, double > > TS4TS5UpperCut_
double TS4TS5EnergyThreshold_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~HLTHcalMETNoiseFilter() override
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > m_theHcalNoiseToken
edm::InputTag HcalNoiseRBXCollectionTag_
bool filter(edm::Event &, const edm::EventSetup &) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::set< CommonHcalNoiseRBXData, noisedatacomp > noisedataset_t
HLTHcalMETNoiseFilter(const edm::ParameterSet &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
char data[epos_bytes_allocation]