26 LooseHcalIsol_(iConfig.getParameter<double>(
"LooseHcalIsol")),
27 LooseEcalIsol_(iConfig.getParameter<double>(
"LooseEcalIsol")),
28 LooseTrackIsol_(iConfig.getParameter<double>(
"LooseTrackIsol")),
29 TightHcalIsol_(iConfig.getParameter<double>(
"TightHcalIsol")),
30 TightEcalIsol_(iConfig.getParameter<double>(
"TightEcalIsol")),
31 TightTrackIsol_(iConfig.getParameter<double>(
"TightTrackIsol")),
33 LooseRBXEne1_(iConfig.getParameter<double>(
"LooseRBXEne1")),
34 LooseRBXEne2_(iConfig.getParameter<double>(
"LooseRBXEne2")),
35 LooseRBXHits1_(iConfig.getParameter<
int>(
"LooseRBXHits1")),
36 LooseRBXHits2_(iConfig.getParameter<
int>(
"LooseRBXHits2")),
37 TightRBXEne1_(iConfig.getParameter<double>(
"TightRBXEne1")),
38 TightRBXEne2_(iConfig.getParameter<double>(
"TightRBXEne2")),
39 TightRBXHits1_(iConfig.getParameter<
int>(
"TightRBXHits1")),
40 TightRBXHits2_(iConfig.getParameter<
int>(
"TightRBXHits2")),
42 LooseHPDEne1_(iConfig.getParameter<double>(
"LooseHPDEne1")),
43 LooseHPDEne2_(iConfig.getParameter<double>(
"LooseHPDEne2")),
44 LooseHPDHits1_(iConfig.getParameter<
int>(
"LooseHPDHits1")),
45 LooseHPDHits2_(iConfig.getParameter<
int>(
"LooseHPDHits2")),
46 TightHPDEne1_(iConfig.getParameter<double>(
"TightHPDEne1")),
47 TightHPDEne2_(iConfig.getParameter<double>(
"TightHPDEne2")),
48 TightHPDHits1_(iConfig.getParameter<
int>(
"TightHPDHits1")),
49 TightHPDHits2_(iConfig.getParameter<
int>(
"TightHPDHits2")),
51 LooseDiHitEne_(iConfig.getParameter<double>(
"LooseDiHitEne")),
52 TightDiHitEne_(iConfig.getParameter<double>(
"TightDiHitEne")),
53 LooseMonoHitEne_(iConfig.getParameter<double>(
"LooseMonoHitEne")),
54 TightMonoHitEne_(iConfig.getParameter<double>(
"TightMonoHitEne")),
56 RBXEneThreshold_(iConfig.getParameter<double>(
"RBXEneThreshold")),
58 debug_(iConfig.getUntrackedParameter<
bool>(
"debug",
true)),
59 objvalidator_(iConfig) {
69 hcalSevToken_ = esConsumes<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd>();
70 ecalSevToken_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>();
71 ctcmToken_ = esConsumes<CaloTowerConstituentsMap, CaloGeometryRecord>();
72 hfemapToken_ = esConsumes<HcalFrontEndMap, HcalFrontEndMapRcd>();
75 produces<HBHERecHitCollection>();
125 std::vector<HBHEHitMap> rbxs;
126 std::vector<HBHEHitMap> hpds;
127 std::vector<HBHEHitMap> dihits;
128 std::vector<HBHEHitMap> monohits;
134 if (
debug_ && (!rbxs.empty() || !hpds.empty() || !dihits.empty() || !monohits.empty())) {
135 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"RBXs:" << std::endl;
137 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nHPDs:" << std::endl;
139 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nDiHits:" << std::endl;
141 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nMonoHits:" << std::endl;
148 std::set<const HBHERecHit*> noisehits;
149 for (
int i = 0; i < static_cast<int>(rbxs.size());
i++) {
150 int nhits = rbxs[
i].nHits();
151 double ene = rbxs[
i].hitEnergy();
152 double trkfide = rbxs[
i].hitEnergyTrackFiducial();
153 double isolhcale = rbxs[
i].hcalEnergySameTowers() + rbxs[
i].hcalEnergyNeighborTowers();
154 double isolecale = rbxs[
i].ecalEnergySameTowers();
155 double isoltrke = rbxs[
i].trackEnergySameTowers() + rbxs[
i].trackEnergyNeighborTowers();
158 bool isLooseIso =
false;
159 bool isTightIso =
false;
168 if (ene <= RBXEneThreshold_ && ene > 0) {
180 noisehits.insert(it->first);
185 for (
int i = 0; i < static_cast<int>(hpds.size());
i++) {
186 int nhits = hpds[
i].nHits();
187 double ene = hpds[
i].hitEnergy();
188 double trkfide = hpds[
i].hitEnergyTrackFiducial();
189 double isolhcale = hpds[
i].hcalEnergySameTowers() + hpds[
i].hcalEnergyNeighborTowers();
190 double isolecale = hpds[
i].ecalEnergySameTowers();
191 double isoltrke = hpds[
i].trackEnergySameTowers() + hpds[
i].trackEnergyNeighborTowers();
201 noisehits.insert(it->first);
206 for (
int i = 0; i < static_cast<int>(dihits.size());
i++) {
207 double ene = dihits[
i].hitEnergy();
208 double trkfide = dihits[
i].hitEnergyTrackFiducial();
209 double isolhcale = dihits[
i].hcalEnergySameTowers() + dihits[
i].hcalEnergyNeighborTowers();
210 double isolecale = dihits[
i].ecalEnergySameTowers();
211 double isoltrke = dihits[
i].trackEnergySameTowers() + dihits[
i].trackEnergyNeighborTowers();
213 isoltrke / ene < LooseTrackIsol_ && trkfide > 0.99 * ene && trkfide >
LooseDiHitEne_) ||
217 noisehits.insert(it->first);
222 for (
int i = 0; i < static_cast<int>(monohits.size());
i++) {
223 double ene = monohits[
i].hitEnergy();
224 double trkfide = monohits[
i].hitEnergyTrackFiducial();
225 double isolhcale = monohits[
i].hcalEnergySameTowers() + monohits[
i].hcalEnergyNeighborTowers();
226 double isolecale = monohits[
i].ecalEnergySameTowers();
227 double isoltrke = monohits[
i].trackEnergySameTowers() + monohits[
i].trackEnergyNeighborTowers();
229 isoltrke / ene < LooseTrackIsol_ && trkfide > 0.99 * ene && trkfide >
LooseMonoHitEne_) ||
233 noisehits.insert(it->first);
239 auto pOut = std::make_unique<HBHERecHitCollection>();
244 if (noisehits.end() != noisehits.find(
hit)) {
247 pOut->push_back(newhit);
256 for (std::vector<HBHEHitMap>::const_iterator it =
i.begin(); it !=
i.end(); ++it) {
258 <<
"hit energy=" << it->hitEnergy() <<
"; # hits=" << it->nHits()
259 <<
"; hcal energy same=" << it->hcalEnergySameTowers() <<
"; ecal energy same=" << it->ecalEnergySameTowers()
260 <<
"; track energy same=" << it->trackEnergySameTowers()
261 <<
"; neighbor hcal energy=" << it->hcalEnergyNeighborTowers() << std::endl;
262 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"hits:" << std::endl;
267 << (*
hit) << std::endl;