45 #include <TLorentzVector.h>
53 : HcalNoiseRBXCollectionTag_(iConfig.getParameter<
edm::
InputTag>(
"HcalNoiseRBXCollection")),
54 TowerCollectionTag_(iConfig.getParameter<
edm::
InputTag>(
"CaloTowerCollection")),
55 severity_(iConfig.getParameter<
int>(
"severity")),
56 maxNumRBXs_(iConfig.getParameter<
int>(
"maxNumRBXs")),
57 numRBXsToConsider_(iConfig.getParameter<
int>(
"numRBXsToConsider")),
58 needEMFCoincidence_(iConfig.getParameter<
bool>(
"needEMFCoincidence")),
59 minRBXEnergy_(iConfig.getParameter<double>(
"minRBXEnergy")),
60 minRatio_(iConfig.getParameter<double>(
"minRatio")),
61 maxRatio_(iConfig.getParameter<double>(
"maxRatio")),
62 minHPDHits_(iConfig.getParameter<
int>(
"minHPDHits")),
63 minRBXHits_(iConfig.getParameter<
int>(
"minRBXHits")),
64 minHPDNoOtherHits_(iConfig.getParameter<
int>(
"minHPDNoOtherHits")),
65 minZeros_(iConfig.getParameter<
int>(
"minZeros")),
66 minHighEHitTime_(iConfig.getParameter<double>(
"minHighEHitTime")),
67 maxHighEHitTime_(iConfig.getParameter<double>(
"maxHighEHitTime")),
68 maxRBXEMF_(iConfig.getParameter<double>(
"maxRBXEMF")),
69 minRecHitE_(iConfig.getParameter<double>(
"minRecHitE")),
70 minLowHitE_(iConfig.getParameter<double>(
"minLowHitE")),
71 minHighHitE_(iConfig.getParameter<double>(
"minHighHitE")),
73 TS4TS5EnergyThreshold_(iConfig.getParameter<double>(
"TS4TS5EnergyThreshold")) {
75 std::vector<double> TS4TS5UpperThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperThreshold");
76 std::vector<double> TS4TS5UpperCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperCut");
77 std::vector<double> TS4TS5LowerThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerThreshold");
78 std::vector<double> TS4TS5LowerCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerCut");
80 for (
int i = 0;
i < (
int)TS4TS5UpperThresholdTemp.size() &&
i < (
int)TS4TS5UpperCutTemp.size();
i++)
81 TS4TS5UpperCut_.push_back(std::pair<double, double>(TS4TS5UpperThresholdTemp[
i], TS4TS5UpperCutTemp[
i]));
84 for (
int i = 0;
i < (
int)TS4TS5LowerThresholdTemp.size() &&
i < (
int)TS4TS5LowerCutTemp.size();
i++)
85 TS4TS5LowerCut_.push_back(std::pair<double, double>(TS4TS5LowerThresholdTemp[
i], TS4TS5LowerCutTemp[
i]));
91 if (iConfig.
existsAs<
double>(
"minR45HitE"))
94 produces<CaloTowerCollection>();
103 desc.add<
double>(
"maxTowerNoiseEnergyFraction", 0.5);
104 desc.add<
int>(
"severity", 1);
105 desc.add<
int>(
"maxNumRBXs", 2);
106 desc.add<
int>(
"numRBXsToConsider", 2);
107 desc.add<
bool>(
"needEMFCoincidence",
true);
108 desc.add<
double>(
"minRBXEnergy", 50.0);
109 desc.add<
double>(
"minRatio", -999.);
110 desc.add<
double>(
"maxRatio", 999.);
111 desc.add<
int>(
"minHPDHits", 17);
112 desc.add<
int>(
"minRBXHits", 999);
113 desc.add<
int>(
"minHPDNoOtherHits", 10);
114 desc.add<
int>(
"minZeros", 10);
115 desc.add<
double>(
"minHighEHitTime", -9999.0);
116 desc.add<
double>(
"maxHighEHitTime", 9999.0);
117 desc.add<
double>(
"maxRBXEMF", 0.02);
118 desc.add<
double>(
"minRecHitE", 1.5);
119 desc.add<
double>(
"minLowHitE", 10.0);
120 desc.add<
double>(
"minHighHitE", 25.0);
121 desc.add<
double>(
"minR45HitE", 5.0);
122 desc.add<
double>(
"TS4TS5EnergyThreshold", 50.0);
124 double TS4TS5UpperThresholdArray[5] = {70, 90, 100, 400, 4000};
125 double TS4TS5UpperCutArray[5] = {1, 0.8, 0.75, 0.72, 0.72};
126 double TS4TS5LowerThresholdArray[7] = {100, 120, 150, 200, 300, 400, 500};
127 double TS4TS5LowerCutArray[7] = {-1, -0.7, -0.4, -0.2, -0.08, 0, 0.1};
128 double hltRBXRecHitR45CutsArray[8] = {0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 1.0, -1.0};
129 std::vector<double>
TS4TS5UpperThreshold(TS4TS5UpperThresholdArray, TS4TS5UpperThresholdArray + 5);
130 std::vector<double>
TS4TS5UpperCut(TS4TS5UpperCutArray, TS4TS5UpperCutArray + 5);
131 std::vector<double>
TS4TS5LowerThreshold(TS4TS5LowerThresholdArray, TS4TS5LowerThresholdArray + 7);
132 std::vector<double>
TS4TS5LowerCut(TS4TS5LowerCutArray, TS4TS5LowerCutArray + 7);
133 std::vector<double> hltRBXRecHitR45Cuts(hltRBXRecHitR45CutsArray, hltRBXRecHitR45CutsArray + 8);
139 desc.add<std::vector<double> >(
"hltRBXRecHitR45Cuts", hltRBXRecHitR45Cuts);
140 descriptions.
add(
"hltHcalTowerNoiseCleanerWithrechit",
desc);
148 using namespace reco;
157 std::set<unsigned int> noisyTowers;
160 edm::LogError(
"HLTHcalTowerNoiseCleanerWithrechit") <<
"Input Tower Collection is not Valid";
175 for (
auto const& rbx : *rbxs_h) {
190 for (
auto const& it :
data) {
193 bool passRechitr45 =
true;
194 int r45Count = it.r45Count();
195 double r45Fraction = it.r45Fraction();
196 double r45EnergyFraction = it.r45EnergyFraction();
201 passRechitr45 =
false;
204 bool passFilter =
true;
207 if (it.validRatio() && it.ratio() <
minRatio_)
209 else if (it.validRatio() && it.ratio() >
maxRatio_)
223 else if (passRechitr45 ==
false)
232 LogDebug(
"") <<
"HLTHcalTowerNoiseCleanerWithrechit debug: Found a noisy RBX: "
233 <<
"energy=" << it.energy() <<
"; "
234 <<
"ratio=" << it.ratio() <<
"; "
235 <<
"# RBX hits=" << it.numRBXHits() <<
"; "
236 <<
"# HPD hits=" << it.numHPDHits() <<
"; "
237 <<
"# Zeros=" << it.numZeros() <<
"; "
238 <<
"min time=" << it.minHighEHitTime() <<
"; "
239 <<
"max time=" << it.maxHighEHitTime() <<
"; "
240 <<
"RBX EMF=" << it.RBXEMF() << std::endl;
245 for (noiseTowersIt = noiseTowers.
begin(); noiseTowersIt != noiseTowers.
end(); noiseTowersIt++) {
248 noisyTowers.insert(caloTowerTopology->
denseIndex(
id));
259 for (inTowersIt = tower_h->
begin(); inTowersIt != tower_h->
end(); inTowersIt++) {
263 if (noisyTowers.find(caloTowerTopology->
denseIndex(
id)) == noisyTowers.end()) {
264 OutputTowers->push_back(*inTowersIt);