27 LooseHcalIsol_(iConfig.getParameter<double>(
"LooseHcalIsol")),
28 LooseEcalIsol_(iConfig.getParameter<double>(
"LooseEcalIsol")),
29 LooseTrackIsol_(iConfig.getParameter<double>(
"LooseTrackIsol")),
30 TightHcalIsol_(iConfig.getParameter<double>(
"TightHcalIsol")),
31 TightEcalIsol_(iConfig.getParameter<double>(
"TightEcalIsol")),
32 TightTrackIsol_(iConfig.getParameter<double>(
"TightTrackIsol")),
34 LooseRBXEne1_(iConfig.getParameter<double>(
"LooseRBXEne1")),
35 LooseRBXEne2_(iConfig.getParameter<double>(
"LooseRBXEne2")),
36 LooseRBXHits1_(iConfig.getParameter<
int>(
"LooseRBXHits1")),
37 LooseRBXHits2_(iConfig.getParameter<
int>(
"LooseRBXHits2")),
38 TightRBXEne1_(iConfig.getParameter<double>(
"TightRBXEne1")),
39 TightRBXEne2_(iConfig.getParameter<double>(
"TightRBXEne2")),
40 TightRBXHits1_(iConfig.getParameter<
int>(
"TightRBXHits1")),
41 TightRBXHits2_(iConfig.getParameter<
int>(
"TightRBXHits2")),
43 LooseHPDEne1_(iConfig.getParameter<double>(
"LooseHPDEne1")),
44 LooseHPDEne2_(iConfig.getParameter<double>(
"LooseHPDEne2")),
45 LooseHPDHits1_(iConfig.getParameter<
int>(
"LooseHPDHits1")),
46 LooseHPDHits2_(iConfig.getParameter<
int>(
"LooseHPDHits2")),
47 TightHPDEne1_(iConfig.getParameter<double>(
"TightHPDEne1")),
48 TightHPDEne2_(iConfig.getParameter<double>(
"TightHPDEne2")),
49 TightHPDHits1_(iConfig.getParameter<
int>(
"TightHPDHits1")),
50 TightHPDHits2_(iConfig.getParameter<
int>(
"TightHPDHits2")),
52 LooseDiHitEne_(iConfig.getParameter<double>(
"LooseDiHitEne")),
53 TightDiHitEne_(iConfig.getParameter<double>(
"TightDiHitEne")),
54 LooseMonoHitEne_(iConfig.getParameter<double>(
"LooseMonoHitEne")),
55 TightMonoHitEne_(iConfig.getParameter<double>(
"TightMonoHitEne")),
57 RBXEneThreshold_(iConfig.getParameter<double>(
"RBXEneThreshold")),
59 debug_(iConfig.getUntrackedParameter<
bool>(
"debug",
true)),
60 objvalidator_(iConfig) {
67 produces<HBHERecHitCollection>();
130 std::vector<HBHEHitMap> rbxs;
131 std::vector<HBHEHitMap> hpds;
132 std::vector<HBHEHitMap> dihits;
133 std::vector<HBHEHitMap> monohits;
139 if (
debug_ && (!rbxs.empty() || !hpds.empty() || !dihits.empty() || !monohits.empty())) {
140 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"RBXs:" << std::endl;
142 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nHPDs:" << std::endl;
144 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nDiHits:" << std::endl;
146 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nMonoHits:" << std::endl;
153 std::set<const HBHERecHit*> noisehits;
154 for (
int i = 0; i < static_cast<int>(rbxs.size());
i++) {
155 int nhits = rbxs[
i].nHits();
156 double ene = rbxs[
i].hitEnergy();
157 double trkfide = rbxs[
i].hitEnergyTrackFiducial();
158 double isolhcale = rbxs[
i].hcalEnergySameTowers() + rbxs[
i].hcalEnergyNeighborTowers();
159 double isolecale = rbxs[
i].ecalEnergySameTowers();
160 double isoltrke = rbxs[
i].trackEnergySameTowers() + rbxs[
i].trackEnergyNeighborTowers();
163 bool isLooseIso =
false;
164 bool isTightIso =
false;
173 if (ene <= RBXEneThreshold_ && ene > 0) {
185 noisehits.insert(it->first);
190 for (
int i = 0; i < static_cast<int>(hpds.size());
i++) {
191 int nhits = hpds[
i].nHits();
192 double ene = hpds[
i].hitEnergy();
193 double trkfide = hpds[
i].hitEnergyTrackFiducial();
194 double isolhcale = hpds[
i].hcalEnergySameTowers() + hpds[
i].hcalEnergyNeighborTowers();
195 double isolecale = hpds[
i].ecalEnergySameTowers();
196 double isoltrke = hpds[
i].trackEnergySameTowers() + hpds[
i].trackEnergyNeighborTowers();
206 noisehits.insert(it->first);
211 for (
int i = 0; i < static_cast<int>(dihits.size());
i++) {
212 double ene = dihits[
i].hitEnergy();
213 double trkfide = dihits[
i].hitEnergyTrackFiducial();
214 double isolhcale = dihits[
i].hcalEnergySameTowers() + dihits[
i].hcalEnergyNeighborTowers();
215 double isolecale = dihits[
i].ecalEnergySameTowers();
216 double isoltrke = dihits[
i].trackEnergySameTowers() + dihits[
i].trackEnergyNeighborTowers();
218 isoltrke / ene < LooseTrackIsol_ && trkfide > 0.99 * ene && trkfide >
LooseDiHitEne_) ||
222 noisehits.insert(it->first);
227 for (
int i = 0; i < static_cast<int>(monohits.size());
i++) {
228 double ene = monohits[
i].hitEnergy();
229 double trkfide = monohits[
i].hitEnergyTrackFiducial();
230 double isolhcale = monohits[
i].hcalEnergySameTowers() + monohits[
i].hcalEnergyNeighborTowers();
231 double isolecale = monohits[
i].ecalEnergySameTowers();
232 double isoltrke = monohits[
i].trackEnergySameTowers() + monohits[
i].trackEnergyNeighborTowers();
234 isoltrke / ene < LooseTrackIsol_ && trkfide > 0.99 * ene && trkfide >
LooseMonoHitEne_) ||
238 noisehits.insert(it->first);
244 auto pOut = std::make_unique<HBHERecHitCollection>();
249 if (noisehits.end() != noisehits.find(
hit)) {
252 pOut->push_back(newhit);
261 for (std::vector<HBHEHitMap>::const_iterator it =
i.begin(); it !=
i.end(); ++it) {
263 <<
"hit energy=" << it->hitEnergy() <<
"; # hits=" << it->nHits()
264 <<
"; hcal energy same=" << it->hcalEnergySameTowers() <<
"; ecal energy same=" << it->ecalEnergySameTowers()
265 <<
"; track energy same=" << it->trackEnergySameTowers()
266 <<
"; neighbor hcal energy=" << it->hcalEnergyNeighborTowers() << std::endl;
267 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"hits:" << std::endl;
272 << (*
hit) << std::endl;