128 iEvent, evSetup, hbhehits_h, ebhits_h, eehits_h, trackextraps_h,
objvalidator_, *(ctcm.
product()));
132 std::vector<HBHEHitMap> rbxs;
133 std::vector<HBHEHitMap> hpds;
134 std::vector<HBHEHitMap> dihits;
135 std::vector<HBHEHitMap> monohits;
141 if (
debug_ && (!rbxs.empty() || !hpds.empty() || !dihits.empty() || !monohits.empty())) {
142 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"RBXs:" << std::endl;
144 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nHPDs:" << std::endl;
146 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nDiHits:" << std::endl;
148 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nMonoHits:" << std::endl;
155 std::set<const HBHERecHit*> noisehits;
156 for (
int i = 0; i < static_cast<int>(rbxs.size());
i++) {
157 int nhits = rbxs[
i].nHits();
158 double ene = rbxs[
i].hitEnergy();
159 double trkfide = rbxs[
i].hitEnergyTrackFiducial();
160 double isolhcale = rbxs[
i].hcalEnergySameTowers() + rbxs[
i].hcalEnergyNeighborTowers();
161 double isolecale = rbxs[
i].ecalEnergySameTowers();
162 double isoltrke = rbxs[
i].trackEnergySameTowers() + rbxs[
i].trackEnergyNeighborTowers();
165 bool isLooseIso =
false;
166 bool isTightIso =
false;
175 if (ene <= RBXEneThreshold_ && ene > 0) {
184 (isTightIso && ((trkfide > TightRBXEne1_ && nhits >=
TightRBXHits1_) ||
187 noisehits.insert(it->first);
192 for (
int i = 0; i < static_cast<int>(hpds.size());
i++) {
193 int nhits = hpds[
i].nHits();
194 double ene = hpds[
i].hitEnergy();
195 double trkfide = hpds[
i].hitEnergyTrackFiducial();
196 double isolhcale = hpds[
i].hcalEnergySameTowers() + hpds[
i].hcalEnergyNeighborTowers();
197 double isolecale = hpds[
i].ecalEnergySameTowers();
198 double isoltrke = hpds[
i].trackEnergySameTowers() + hpds[
i].trackEnergyNeighborTowers();
208 noisehits.insert(it->first);
213 for (
int i = 0; i < static_cast<int>(dihits.size());
i++) {
214 double ene = dihits[
i].hitEnergy();
215 double trkfide = dihits[
i].hitEnergyTrackFiducial();
216 double isolhcale = dihits[
i].hcalEnergySameTowers() + dihits[
i].hcalEnergyNeighborTowers();
217 double isolecale = dihits[
i].ecalEnergySameTowers();
218 double isoltrke = dihits[
i].trackEnergySameTowers() + dihits[
i].trackEnergyNeighborTowers();
220 isoltrke / ene < LooseTrackIsol_ && trkfide > 0.99 * ene && trkfide >
LooseDiHitEne_) ||
222 isoltrke / ene < TightTrackIsol_ && ene > TightDiHitEne_)) {
224 noisehits.insert(it->first);
229 for (
int i = 0; i < static_cast<int>(monohits.size());
i++) {
230 double ene = monohits[
i].hitEnergy();
231 double trkfide = monohits[
i].hitEnergyTrackFiducial();
232 double isolhcale = monohits[
i].hcalEnergySameTowers() + monohits[
i].hcalEnergyNeighborTowers();
233 double isolecale = monohits[
i].ecalEnergySameTowers();
234 double isoltrke = monohits[
i].trackEnergySameTowers() + monohits[
i].trackEnergyNeighborTowers();
236 isoltrke / ene < LooseTrackIsol_ && trkfide > 0.99 * ene && trkfide >
LooseMonoHitEne_) ||
238 isoltrke / ene < TightTrackIsol_ && ene > TightMonoHitEne_)) {
240 noisehits.insert(it->first);
246 auto pOut = std::make_unique<HBHERecHitCollection>();
251 if (noisehits.end() != noisehits.find(hit)) {
254 pOut->push_back(newhit);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void DumpHBHEHitMap(std::vector< HBHEHitMap > &i) const
std::map< const HBHERecHit *, const PhysicsTower * >::const_iterator hitmap_const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setHcalChannelQuality(const HcalChannelQuality *q)
std::vector< T >::const_iterator const_iterator
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
void setHcalSeverityLevelComputer(const HcalSeverityLevelComputer *q)
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > tok_trackExt_
const_iterator end() const
void setEcalSeverityLevelAlgo(const EcalSeverityLevelAlgo *q)
void setEcalChannelStatus(const EcalChannelStatus *q)
void setEERecHitCollection(const EcalRecHitCollection *q)
ObjectValidator objvalidator_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
const HcalFrontEndMap * hfemap
void setEBRecHitCollection(const EcalRecHitCollection *q)
T const * product() const
const_iterator begin() const