84 const uint32_t recHitFlag = hit.
flags();
89 if(severityLevel==0)
return true;
105 int severityLevel = 999;
135 const edm::Handle<std::vector<reco::TrackExtrapolation> >& trackextrapcoll_h,
151 if(!objectvalidator.
validHit(*hit))
continue;
162 if(!objectvalidator.
validHit(*hit))
continue;
171 if(!objectvalidator.
validHit(*hit))
continue;
177 for(std::vector<reco::TrackExtrapolation>::const_iterator it=trackextrapcoll_h->begin(); it!=trackextrapcoll_h->end(); ++it) {
182 if(!objectvalidator.
validTrack(*track))
continue;
185 if ( extrap->
positions().size()==0 )
continue;
191 if(std::fabs(
point.eta())<1.479) {
211 if(
id.ietaAbs()==29) dummy.
id =
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(),
id.iphi());
215 std::set<PhysicsTower, towercmp>::iterator it=
towers_.find(dummy);
217 if(it==
towers_.end())
return 0;
230 if(
id.ietaAbs()==29) dummy.
id =
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(),
id.iphi());
234 std::set<PhysicsTower, towercmp>::iterator it=
towers_.find(dummy);
236 if(it==
towers_.end())
return 0;
258 std::vector<CaloTowerDetId> ids;
260 if(
id.ietaAbs()<=20) {
269 if(
id.ietaAbs()<=20) {
278 if(
id.ietaAbs()==20 && (
id.iphi()%2)==0)
279 ids.push_back(
CaloTowerDetId((
id.ietaAbs()+1)*
id.zside(),
id.iphi()-1));
281 ids.push_back(
CaloTowerDetId((
id.ietaAbs()+1)*
id.zside(),
id.iphi()));
284 if(
id.ietaAbs()==21) {
285 ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(),
id.iphi()));
286 ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(),
id.iphi()+1));
287 }
else if(
id.ietaAbs()==1) {
290 ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(),
id.iphi()));
294 if(
id.ietaAbs()<=19 || (
id.ietaAbs()==20 && (
id.iphi()%2)==0)) {
295 if(
id.iphi()==72) ids.push_back(
CaloTowerDetId((
id.ietaAbs()+1)*
id.zside(), 1));
296 else ids.push_back(
CaloTowerDetId((
id.ietaAbs()+1)*
id.zside(),
id.iphi()+1));
297 }
else if(
id.ietaAbs()>=21) {
298 if(
id.iphi()==71) ids.push_back(
CaloTowerDetId((
id.ietaAbs()+1)*
id.zside(), 1));
299 else ids.push_back(
CaloTowerDetId((
id.ietaAbs()+1)*
id.zside(),
id.iphi()+2));
303 if(
id.ietaAbs()<=19) {
304 if(
id.iphi()==1) ids.push_back(
CaloTowerDetId((
id.ietaAbs()+1)*
id.zside(), 72));
305 else ids.push_back(
CaloTowerDetId((
id.ietaAbs()+1)*
id.zside(),
id.iphi()-1));
306 }
else if(
id.ietaAbs()>=21 || (
id.ietaAbs()==20 && (
id.iphi()%2)==1)) {
307 if(
id.iphi()==1) ids.push_back(
CaloTowerDetId((
id.ietaAbs()+1)*
id.zside(), 71));
308 else ids.push_back(
CaloTowerDetId((
id.ietaAbs()+1)*
id.zside(),
id.iphi()-2));
312 if(
id.ietaAbs()==1) {
315 }
else if(
id.ietaAbs()<=20) {
316 if(
id.iphi()==72) ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(), 1));
317 else ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(),
id.iphi()+1));
318 }
else if(
id.ietaAbs()>=21) {
319 if(
id.iphi()==71) ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(), 1));
320 else ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(),
id.iphi()+2));
324 if(
id.ietaAbs()==1) {
327 }
else if(
id.ietaAbs()<=20) {
328 if(
id.iphi()==1) ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(), 72));
329 else ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(),
id.iphi()-1));
330 }
else if(
id.ietaAbs()>=22) {
331 if(
id.iphi()==1) ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(), 71));
332 else ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(),
id.iphi()-2));
333 }
else if(
id.ietaAbs()==21) {
334 if(
id.iphi()==1) ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(), 72));
335 else ids.push_back(
CaloTowerDetId((
id.ietaAbs()-1)*
id.zside(),
id.iphi()-1));
342 for(std::vector<CaloTowerDetId>::const_iterator it=ids.begin(); it!=ids.end(); ++it) {
344 if(twr) neighbors.insert(twr);
405 dummy.
tracks.insert(track);
408 twr->
tracks.insert(track);
490 for(std::set<const HBHERecHit*>::const_iterator it2=it1->second->hcalhits.begin(); it2!=it1->second->hcalhits.end(); ++it2) {
503 v.insert(it1->second->ecalhits.begin(), it1->second->ecalhits.end());
512 v.insert(it1->second->tracks.begin(), it1->second->tracks.end());
592 neighbors_.insert(neighbors.begin(), neighbors.end());
624 std::set<const HBHERecHit*>
v;
626 for(std::set<const HBHERecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
638 std::set<const EcalRecHit*>
v;
640 for(std::set<const EcalRecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
652 std::set<const reco::Track*>
v;
654 for(std::set<const reco::Track*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
666 std::set<const HBHERecHit*>
v;
668 for(std::set<const HBHERecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
680 std::set<const EcalRecHit*>
v;
682 for(std::set<const EcalRecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
694 std::set<const reco::Track*>
v;
696 for(std::set<const reco::Track*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
718 if(!objvalidator.
validHit(*hit))
continue;
723 std::set<const PhysicsTower*> neighbors;
728 rbxs_[rbxidnum].insert(hit, tower, neighbors);
732 hpds_[hpdidnum].insert(hit, tower, neighbors);
736 std::vector<const HBHERecHit*> hpdneighbors;
739 if(hpdneighbors.size()==1) {
740 std::vector<const HBHERecHit*> hpdneighborsneighbors;
743 if(hpdneighborsneighbors.size()==1 && hpdneighborsneighbors[0]==hit && hit->
energy()>hpdneighbors[0]->energy()) {
748 const PhysicsTower* tower2=pto.
findTower(hpdneighbors[0]->
id().ieta(), hpdneighbors[0]->
id().iphi());
749 std::set<const PhysicsTower*> neighbors2;
750 pto.
findNeighbors(hpdneighbors[0]->
id().ieta(), hpdneighbors[0]->
id().iphi(), neighbors2);
753 dihit.
insert(hit, tower, neighbors);
754 dihit.
insert(hpdneighbors[0], tower2, neighbors2);
757 }
else if(hpdneighbors.size()==0) {
761 monohit.
insert(hit, tower, neighbors);
771 for(std::map<int, HBHEHitMap>::const_iterator it=
rbxs_.begin(); it!=
rbxs_.end(); ++it) {
780 for(std::map<int, HBHEHitMap>::const_iterator it=
hpds_.begin(); it!=
hpds_.end(); ++it) {
789 for(std::vector<HBHEHitMap>::const_iterator it=
dihits_.begin(); it!=
dihits_.end(); ++it) {
790 if(it->hitEnergy()>
energy) v.push_back(*it);
797 for(std::vector<HBHEHitMap>::const_iterator it=
monohits_.begin(); it!=
monohits_.end(); ++it) {
798 if(it->hitEnergy()>
energy) v.push_back(*it);
807 std::set<const PhysicsTower*>
temp;
814 for(std::set<const PhysicsTower*>::const_iterator it1=temp.begin(); it1!=temp.end(); ++it1) {
815 for(std::set<const HBHERecHit*>::const_iterator it2=(*it1)->hcalhits.begin(); it2!=(*it1)->hcalhits.end(); ++it2) {
818 neighbors.push_back(hit2);
void getHPDNeighbors(const HBHERecHit *hit, std::vector< const HBHERecHit * > &neighbors, const PhysicsTowerOrganizer &pto)
double p() const
momentum vector magnitude
double hcalEnergySameTowers(void) const
std::set< const HBHERecHit * > hcalhits
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
void tracksNeighborTowers(std::set< const reco::Track * > &v) const
double ecalEnergySameTowers_
int nHcalHitsSameTowers(void) const
const Vector & momentum() const
track momentum vector
HcalSubdetector subdet() const
get the subdetector
double MinValidTrackPtBarrel_
std::map< const HBHERecHit *, const PhysicsTower * >::const_iterator hitmap_const_iterator
int ietaAbs() const
get the absolute value of the tower ieta
std::vector< HBHEHitMap > dihits_
hitmap_const_iterator findHit(const HBHERecHit *hit) const
const DetId & detid() const
static int indexRBX(const HcalDetId &)
void getHPDs(std::vector< HBHEHitMap > &v, double energy) const
neighbor_const_iterator findNeighbor(const PhysicsTower *twr) const
std::vector< T >::const_iterator const_iterator
virtual bool validTrack(const reco::Track &) const =0
int nEcalHitsNeighborTowers(void) const
const Item * getValues(DetId fId, bool throwOnFail=true) const
bool validTrack(const reco::Track &) const
neighbor_const_iterator beginNeighbors(void) const
double hcalEnergyNeighborTowers_
void getRBXs(std::vector< HBHEHitMap > &v, double energy) const
ObjectValidator(const edm::ParameterSet &)
void ecalHitsNeighborTowers(std::set< const EcalRecHit * > &v) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
hitmap_const_iterator endHits(void) const
std::map< const HBHERecHit *, const PhysicsTower * > hits_
void getMonoHits(std::vector< HBHEHitMap > &v, double energy) const
void ecalHitsSameTowers(std::set< const EcalRecHit * > &v) const
double trackEnergyNeighborTowers_
PhysicsTowerOrganizer(const edm::Event &iEvent, const edm::EventSetup &evSetup, const edm::Handle< HBHERecHitCollection > &hbhehitcoll_h, const edm::Handle< EcalRecHitCollection > &ebhitcoll_h, const edm::Handle< EcalRecHitCollection > &eehitcoll_h, const edm::Handle< std::vector< reco::TrackExtrapolation > > &trackextrapcoll_h, const ObjectValidatorAbs &objectvalidator, const CaloTowerConstituentsMap &ctcm)
void calcTracksSameTowers_(void) const
double trackEnergySameTowers_
uint32_t HcalAcceptSeverityLevel_
double ecalEnergyNeighborTowers(void) const
std::set< const PhysicsTower * > neighbors_
void insert(const HBHERecHit *hit, const PhysicsTower *twr, std::set< const PhysicsTower * > &neighbors)
const PhysicsTower * findTower(const CaloTowerDetId &id) const
void tracksSameTowers(std::set< const reco::Track * > &v) const
int nHcalHitsNeighborTowers(void) const
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
void calcHcalSameTowers_(void) const
std::map< int, HBHEHitMap > rbxs_
bool UseHcalRecoveredHits_
int nEcalHitsNeighborTowers_
double pt() const
track transverse momentum
const EcalChannelStatus * theEcalChStatus_
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
const EcalRecHitCollection * theEERecHitCollection_
int ieta() const
get the cell ieta
double hcalEnergyNeighborTowers(void) const
int iphi() const
get the tower iphi
double trackEnergySameTowers(void) const
void insert_(CaloTowerDetId &id, const HBHERecHit *hit)
virtual ~ObjectValidator()
double hcalEnergySameTowers_
int nHcalHitsNeighborTowers_
unsigned short numberOfValidHits() const
number of valid hits found
const EcalRecHitCollection * theEBRecHitCollection_
std::set< const PhysicsTower * >::const_iterator neighbor_const_iterator
std::map< int, HBHEHitMap > hpds_
int ietaAbs() const
get the absolute value of the cell ieta
virtual DetId getClosestCell(const GlobalPoint &r) const
std::set< PhysicsTower, towercmp > towers_
int iphi() const
get the cell iphi
double hitEnergy(void) const
void calcEcalSameTowers_(void) const
DetId id() const
get the id
virtual bool validHit(const HBHERecHit &) const =0
double ecalEnergyNeighborTowers_
void calcTracksNeighborTowers_(void) const
void calcHcalNeighborTowers_(void) const
HBHEHitMapOrganizer(const edm::Handle< HBHERecHitCollection > &hbhehitcoll_h, const ObjectValidatorAbs &objvalidator, const PhysicsTowerOrganizer &pto)
T const * product() const
int zside() const
get the z-side of the tower (1/-1)
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
std::set< const EcalRecHit * > ecalhits
uint32_t EcalAcceptSeverityLevel_
double trackEnergyNeighborTowers(void) const
double hitEnergyTrackFiducial(void) const
void calcHits_(void) const
std::set< const reco::Track * > tracks
void calcEcalNeighborTowers_(void) const
std::vector< HBHEHitMap > monohits_
int nTracksSameTowers(void) const
void getDiHits(std::vector< HBHEHitMap > &v, double energy) const
int nTracksNeighborTowers_
double ecalEnergySameTowers(void) const
const HcalChannelQuality * theHcalChStatus_
int nEcalHitsSameTowers(void) const
static int indexHPD(const HcalDetId &)
int nTracksNeighborTowers(void) const
uint32_t getValue() const
void hcalHitsSameTowers(std::set< const HBHERecHit * > &v) const
bool validHit(const HBHERecHit &) const
const HcalSeverityLevelComputer * theHcalSevLvlComputer_
void byTowers(std::vector< twrinfo > &v) const
neighbor_const_iterator endNeighbors(void) const
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id, const EcalRecHitCollection &rhs) const
Evaluate status from id.
void findNeighbors(const CaloTowerDetId &id, std::set< const PhysicsTower * > &neighbors) const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
hitmap_const_iterator beginHits(void) const
bool UseEcalRecoveredHits_
void hcalHitsNeighborTowers(std::set< const HBHERecHit * > &v) const