28 LooseHcalIsol_(iConfig.getParameter<double>(
"LooseHcalIsol")),
29 LooseEcalIsol_(iConfig.getParameter<double>(
"LooseEcalIsol")),
30 LooseTrackIsol_(iConfig.getParameter<double>(
"LooseTrackIsol")),
31 TightHcalIsol_(iConfig.getParameter<double>(
"TightHcalIsol")),
32 TightEcalIsol_(iConfig.getParameter<double>(
"TightEcalIsol")),
33 TightTrackIsol_(iConfig.getParameter<double>(
"TightTrackIsol")),
35 LooseRBXEne1_(iConfig.getParameter<double>(
"LooseRBXEne1")),
36 LooseRBXEne2_(iConfig.getParameter<double>(
"LooseRBXEne2")),
37 LooseRBXHits1_(iConfig.getParameter<
int>(
"LooseRBXHits1")),
38 LooseRBXHits2_(iConfig.getParameter<
int>(
"LooseRBXHits2")),
39 TightRBXEne1_(iConfig.getParameter<double>(
"TightRBXEne1")),
40 TightRBXEne2_(iConfig.getParameter<double>(
"TightRBXEne2")),
41 TightRBXHits1_(iConfig.getParameter<
int>(
"TightRBXHits1")),
42 TightRBXHits2_(iConfig.getParameter<
int>(
"TightRBXHits2")),
44 LooseHPDEne1_(iConfig.getParameter<double>(
"LooseHPDEne1")),
45 LooseHPDEne2_(iConfig.getParameter<double>(
"LooseHPDEne2")),
46 LooseHPDHits1_(iConfig.getParameter<
int>(
"LooseHPDHits1")),
47 LooseHPDHits2_(iConfig.getParameter<
int>(
"LooseHPDHits2")),
48 TightHPDEne1_(iConfig.getParameter<double>(
"TightHPDEne1")),
49 TightHPDEne2_(iConfig.getParameter<double>(
"TightHPDEne2")),
50 TightHPDHits1_(iConfig.getParameter<
int>(
"TightHPDHits1")),
51 TightHPDHits2_(iConfig.getParameter<
int>(
"TightHPDHits2")),
53 LooseDiHitEne_(iConfig.getParameter<double>(
"LooseDiHitEne")),
54 TightDiHitEne_(iConfig.getParameter<double>(
"TightDiHitEne")),
55 LooseMonoHitEne_(iConfig.getParameter<double>(
"LooseMonoHitEne")),
56 TightMonoHitEne_(iConfig.getParameter<double>(
"TightMonoHitEne")),
58 RBXEneThreshold_(iConfig.getParameter<double>(
"RBXEneThreshold")),
60 debug_(iConfig.getUntrackedParameter<
bool>(
"debug",
true)),
61 objvalidator_(iConfig)
69 produces<HBHERecHitCollection>();
136 std::vector<HBHEHitMap> rbxs;
137 std::vector<HBHEHitMap> hpds;
138 std::vector<HBHEHitMap> dihits;
139 std::vector<HBHEHitMap> monohits;
145 if(
debug_ && (!rbxs.empty() || !hpds.empty() || !dihits.empty() || !monohits.empty())) {
146 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"RBXs:" << std::endl;
148 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nHPDs:" << std::endl;
150 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nDiHits:" << std::endl;
152 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nMonoHits:" << std::endl;
159 std::set<const HBHERecHit*> noisehits;
160 for(
int i=0; i<static_cast<int>(rbxs.size());
i++) {
161 int nhits=rbxs[
i].nHits();
162 double ene=rbxs[
i].hitEnergy();
163 double trkfide=rbxs[
i].hitEnergyTrackFiducial();
164 double isolhcale=rbxs[
i].hcalEnergySameTowers()+rbxs[
i].hcalEnergyNeighborTowers();
165 double isolecale=rbxs[
i].ecalEnergySameTowers();
166 double isoltrke=rbxs[
i].trackEnergySameTowers()+rbxs[
i].trackEnergyNeighborTowers();
169 bool isLooseIso=
false;
170 bool isTightIso=
false;
177 if( ene<=RBXEneThreshold_ && ene>0 ){
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();
202 noisehits.insert(it->first);
207 for(
int i=0; i<static_cast<int>(dihits.size());
i++) {
208 double ene=dihits[
i].hitEnergy();
209 double trkfide=dihits[
i].hitEnergyTrackFiducial();
210 double isolhcale=dihits[
i].hcalEnergySameTowers()+dihits[
i].hcalEnergyNeighborTowers();
211 double isolecale=dihits[
i].ecalEnergySameTowers();
212 double isoltrke=dihits[
i].trackEnergySameTowers()+dihits[
i].trackEnergyNeighborTowers();
216 noisehits.insert(it->first);
221 for(
int i=0; i<static_cast<int>(monohits.size());
i++) {
222 double ene=monohits[
i].hitEnergy();
223 double trkfide=monohits[
i].hitEnergyTrackFiducial();
224 double isolhcale=monohits[
i].hcalEnergySameTowers()+monohits[
i].hcalEnergyNeighborTowers();
225 double isolecale=monohits[
i].ecalEnergySameTowers();
226 double isoltrke=monohits[
i].trackEnergySameTowers()+monohits[
i].trackEnergyNeighborTowers();
230 noisehits.insert(it->first);
236 auto pOut = std::make_unique<HBHERecHitCollection>();
241 if(noisehits.end()!=noisehits.find(hit)) {
244 pOut->push_back(newhit);
255 for(std::vector<HBHEHitMap>::const_iterator it=i.begin(); it!=i.end(); ++it) {
256 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"hit energy=" << it->hitEnergy()
257 <<
"; # hits=" << it->nHits()
258 <<
"; hcal energy same=" << it->hcalEnergySameTowers()
259 <<
"; 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;
268 <<
"; " << (*hit) << std::endl;
T getParameter(std::string const &) const
~HBHEIsolatedNoiseReflagger() override
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
#define DEFINE_FWK_MODULE(type)
void setHcalChannelQuality(const HcalChannelQuality *q)
void getHPDs(std::vector< HBHEHitMap > &v, double energy) const
HcalDetId id() const
get the id
void setFlagField(uint32_t value, int base, int width=1)
const int lookupRMIndex(DetId fId) const
std::vector< HBHERecHit >::const_iterator const_iterator
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
HBHEIsolatedNoiseReflagger(const edm::ParameterSet &)
void getRBXs(std::vector< HBHEHitMap > &v, double energy) const
void getMonoHits(std::vector< HBHEHitMap > &v, double energy) const
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)
void produce(edm::Event &, const edm::EventSetup &) override
ObjectValidator objvalidator_
void getDiHits(std::vector< HBHEHitMap > &v, double energy) const
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
const HcalFrontEndMap * hfemap
void setEBRecHitCollection(const EcalRecHitCollection *q)
T const * product() const
const std::string lookupRBX(DetId fId) const
brief lookup the RBX associated with the given logical id
const_iterator begin() const