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)
67 produces<HBHERecHitCollection>();
129 std::vector<HBHEHitMap> rbxs;
130 std::vector<HBHEHitMap> hpds;
131 std::vector<HBHEHitMap> dihits;
132 std::vector<HBHEHitMap> monohits;
138 if(
debug_ && (rbxs.size()>0 || hpds.size()>0 || dihits.size()>0 || monohits.size()>0)) {
139 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"RBXs:" << std::endl;
141 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nHPDs:" << std::endl;
143 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nDiHits:" << std::endl;
145 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"\nMonoHits:" << std::endl;
152 std::set<const HBHERecHit*> noisehits;
153 for(
int i=0; i<static_cast<int>(rbxs.size());
i++) {
154 int nhits=rbxs[
i].nHits();
155 double ene=rbxs[
i].hitEnergy();
156 double trkfide=rbxs[
i].hitEnergyTrackFiducial();
157 double isolhcale=rbxs[
i].hcalEnergySameTowers()+rbxs[
i].hcalEnergyNeighborTowers();
158 double isolecale=rbxs[
i].ecalEnergySameTowers();
159 double isoltrke=rbxs[
i].trackEnergySameTowers()+rbxs[
i].trackEnergyNeighborTowers();
162 bool isLooseIso=
false;
163 bool isTightIso=
false;
170 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();
195 noisehits.insert(it->first);
200 for(
int i=0; i<static_cast<int>(dihits.size());
i++) {
201 double ene=dihits[
i].hitEnergy();
202 double trkfide=dihits[
i].hitEnergyTrackFiducial();
203 double isolhcale=dihits[
i].hcalEnergySameTowers()+dihits[
i].hcalEnergyNeighborTowers();
204 double isolecale=dihits[
i].ecalEnergySameTowers();
205 double isoltrke=dihits[
i].trackEnergySameTowers()+dihits[
i].trackEnergyNeighborTowers();
209 noisehits.insert(it->first);
214 for(
int i=0; i<static_cast<int>(monohits.size());
i++) {
215 double ene=monohits[
i].hitEnergy();
216 double trkfide=monohits[
i].hitEnergyTrackFiducial();
217 double isolhcale=monohits[
i].hcalEnergySameTowers()+monohits[
i].hcalEnergyNeighborTowers();
218 double isolecale=monohits[
i].ecalEnergySameTowers();
219 double isoltrke=monohits[
i].trackEnergySameTowers()+monohits[
i].trackEnergyNeighborTowers();
223 noisehits.insert(it->first);
234 if(noisehits.end()!=noisehits.find(hit)) {
237 pOut->push_back(newhit);
248 for(std::vector<HBHEHitMap>::const_iterator it=i.begin(); it!=i.end(); ++it) {
249 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"hit energy=" << it->hitEnergy()
250 <<
"; # hits=" << it->nHits()
251 <<
"; hcal energy same=" << it->hcalEnergySameTowers()
252 <<
"; ecal energy same=" << it->ecalEnergySameTowers()
253 <<
"; track energy same=" << it->trackEnergySameTowers()
254 <<
"; neighbor hcal energy=" << it->hcalEnergyNeighborTowers() << std::endl;
255 edm::LogInfo(
"HBHEIsolatedNoiseReflagger") <<
"hits:" << std::endl;
260 <<
"; " << (*hit) << std::endl;
T getParameter(std::string const &) const
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
static int indexRBX(const HcalDetId &)
#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)
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)
~HBHEIsolatedNoiseReflagger()
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > tok_trackExt_
edm::SortedCollection< HBHERecHit > HBHERecHitCollection
void setEcalSeverityLevelAlgo(const EcalSeverityLevelAlgo *q)
void setEcalChannelStatus(const EcalChannelStatus *q)
void setEERecHitCollection(const EcalRecHitCollection *q)
virtual void produce(edm::Event &, const edm::EventSetup &) override
T const * product() const
ObjectValidator objvalidator_
void getDiHits(std::vector< HBHEHitMap > &v, double energy) const
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
static int indexHPD(const HcalDetId &)
void setEBRecHitCollection(const EcalRecHitCollection *q)