90 const uint32_t recHitFlag = hit.
flags();
95 if(severityLevel==0)
return true;
141 const edm::Handle<std::vector<reco::TrackExtrapolation> >& trackextrapcoll_h,
157 if(!objectvalidator.
validHit(*hit))
continue;
168 if(!objectvalidator.
validHit(*hit))
continue;
177 if(!objectvalidator.
validHit(*hit))
continue;
183 for(std::vector<reco::TrackExtrapolation>::const_iterator it=trackextrapcoll_h->begin(); it!=trackextrapcoll_h->end(); ++it) {
188 if(!objectvalidator.
validTrack(*track))
continue;
191 if ( extrap->
positions().empty() )
continue;
197 if(std::fabs(
point.eta())<1.479) {
221 std::set<PhysicsTower, towercmp>::iterator it=towers_.find(dummy);
223 if(it==towers_.end())
return nullptr;
240 std::set<PhysicsTower, towercmp>::iterator it=towers_.find(dummy);
242 if(it==towers_.end())
return nullptr;
249 return findTower(tid);
255 return findTower(tid);
264 std::vector<CaloTowerDetId>
ids;
266 if(
id.ietaAbs()<=20) {
275 if(
id.ietaAbs()<=20) {
284 if(
id.ietaAbs()==20 && (
id.iphi()%2)==0)
290 if(
id.ietaAbs()==21) {
293 }
else if(
id.ietaAbs()==1) {
300 if(
id.ietaAbs()<=19 || (
id.ietaAbs()==20 && (
id.iphi()%2)==0)) {
303 }
else if(
id.ietaAbs()>=21) {
309 if(
id.ietaAbs()<=19) {
312 }
else if(
id.ietaAbs()>=21 || (
id.ietaAbs()==20 && (
id.iphi()%2)==1)) {
318 if(
id.ietaAbs()==1) {
321 }
else if(
id.ietaAbs()<=20) {
324 }
else if(
id.ietaAbs()>=21) {
330 if(
id.ietaAbs()==1) {
333 }
else if(
id.ietaAbs()<=20) {
336 }
else if(
id.ietaAbs()>=22) {
339 }
else if(
id.ietaAbs()==21) {
348 for(std::vector<CaloTowerDetId>::const_iterator it=ids.begin(); it!=ids.end(); ++it) {
350 if(twr) neighbors.insert(twr);
358 findNeighbors(twr->
id, neighbors);
378 towers_.insert(dummy);
395 towers_.insert(dummy);
411 dummy.
tracks.insert(track);
412 towers_.insert(dummy);
414 twr->
tracks.insert(track);
428 hitEnergy_=hitEnergyTrkFid_=-999.;
430 hcalEnergySameTowers_=ecalEnergySameTowers_=trackEnergySameTowers_=-999.;
431 nHcalHitsSameTowers_=nEcalHitsSameTowers_=nTracksSameTowers_=-999;
432 hcalEnergyNeighborTowers_=ecalEnergyNeighborTowers_=trackEnergyNeighborTowers_=-999.;
433 nHcalHitsNeighborTowers_=nEcalHitsNeighborTowers_=nTracksNeighborTowers_=-999;
439 if(hitEnergy_<-900) calcHits_();
445 if(nHits_<-900) calcHits_();
451 if(hitEnergyTrkFid_<-900) calcHits_();
452 return hitEnergyTrkFid_;
458 if(hcalEnergySameTowers_<-900) calcHcalSameTowers_();
459 return hcalEnergySameTowers_;
464 if(nHcalHitsSameTowers_<-900) calcHcalSameTowers_();
465 return nHcalHitsSameTowers_;
470 if(ecalEnergySameTowers_<-900) calcEcalSameTowers_();
471 return ecalEnergySameTowers_;
476 if(nEcalHitsSameTowers_<-900) calcEcalSameTowers_();
477 return nEcalHitsSameTowers_;
482 if(trackEnergySameTowers_<-900) calcTracksSameTowers_();
483 return trackEnergySameTowers_;
488 if(nTracksSameTowers_<-900) calcTracksSameTowers_();
489 return nTracksSameTowers_;
496 for(std::set<const HBHERecHit*>::const_iterator it2=it1->second->hcalhits.begin(); it2!=it1->second->hcalhits.end(); ++it2) {
499 if(
findHit(hit)==endHits()) v.insert(hit);
509 v.insert(it1->second->ecalhits.begin(), it1->second->ecalhits.end());
518 v.insert(it1->second->tracks.begin(), it1->second->tracks.end());
525 if(hcalEnergyNeighborTowers_<-900) calcHcalNeighborTowers_();
526 return hcalEnergyNeighborTowers_;
531 if(nHcalHitsNeighborTowers_<-900) calcHcalNeighborTowers_();
532 return nHcalHitsNeighborTowers_;
537 if(ecalEnergyNeighborTowers_<-900) calcEcalNeighborTowers_();
538 return ecalEnergyNeighborTowers_;
543 if(nEcalHitsNeighborTowers_<-900) calcEcalNeighborTowers_();
544 return nEcalHitsNeighborTowers_;
549 if(trackEnergyNeighborTowers_<-900) calcTracksNeighborTowers_();
550 return trackEnergyNeighborTowers_;
555 if(nTracksNeighborTowers_<-900) calcTracksNeighborTowers_();
556 return nTracksNeighborTowers_;
598 neighbors_.insert(neighbors.begin(), neighbors.end());
606 if(find!=endNeighbors()) neighbors_.erase(find);
620 hitEnergy_+=hit->
energy();
628 hcalEnergySameTowers_=0;
629 nHcalHitsSameTowers_=0;
630 std::set<const HBHERecHit*>
v;
631 hcalHitsSameTowers(v);
632 for(std::set<const HBHERecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
634 hcalEnergySameTowers_+=hit->
energy();
635 ++nHcalHitsSameTowers_;
642 ecalEnergySameTowers_=0;
643 nEcalHitsSameTowers_=0;
644 std::set<const EcalRecHit*>
v;
645 ecalHitsSameTowers(v);
646 for(std::set<const EcalRecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
648 ecalEnergySameTowers_+=hit->
energy();
649 ++nEcalHitsSameTowers_;
656 trackEnergySameTowers_=0;
657 nTracksSameTowers_=0;
658 std::set<const reco::Track*>
v;
660 for(std::set<const reco::Track*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
662 trackEnergySameTowers_+=trk->
p();
663 ++nTracksSameTowers_;
670 hcalEnergyNeighborTowers_=0;
671 nHcalHitsNeighborTowers_=0;
672 std::set<const HBHERecHit*>
v;
673 hcalHitsNeighborTowers(v);
674 for(std::set<const HBHERecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
676 hcalEnergyNeighborTowers_+=hit->
energy();
677 ++nHcalHitsNeighborTowers_;
684 ecalEnergyNeighborTowers_=0;
685 nEcalHitsNeighborTowers_=0;
686 std::set<const EcalRecHit*>
v;
687 ecalHitsNeighborTowers(v);
688 for(std::set<const EcalRecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
690 ecalEnergyNeighborTowers_+=hit->
energy();
691 ++nEcalHitsNeighborTowers_;
698 trackEnergyNeighborTowers_=0;
699 nTracksNeighborTowers_=0;
700 std::set<const reco::Track*>
v;
701 tracksNeighborTowers(v);
702 for(std::set<const reco::Track*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
704 trackEnergyNeighborTowers_+=trk->
p();
705 ++nTracksNeighborTowers_;
726 if(!objvalidator.
validHit(*hit))
continue;
731 std::set<const PhysicsTower*> neighbors;
736 rbxs_[rbxidnum].insert(hit, tower, neighbors);
740 hpds_[hpdidnum].insert(hit, tower, neighbors);
744 std::vector<const HBHERecHit*> hpdneighbors;
747 if(hpdneighbors.size()==1) {
748 std::vector<const HBHERecHit*> hpdneighborsneighbors;
751 if(hpdneighborsneighbors.size()==1 && hpdneighborsneighbors[0]==hit && hit->
energy()>hpdneighbors[0]->energy()) {
756 const PhysicsTower* tower2=pto.
findTower(hpdneighbors[0]->
id().ieta(), hpdneighbors[0]->
id().iphi());
757 std::set<const PhysicsTower*> neighbors2;
758 pto.
findNeighbors(hpdneighbors[0]->
id().ieta(), hpdneighbors[0]->
id().iphi(), neighbors2);
761 dihit.
insert(hit, tower, neighbors);
762 dihit.
insert(hpdneighbors[0], tower2, neighbors2);
765 }
else if(hpdneighbors.empty()) {
769 monohit.
insert(hit, tower, neighbors);
779 for(std::map<int, HBHEHitMap>::const_iterator it=
rbxs_.begin(); it!=
rbxs_.end(); ++it) {
781 if(map.
hitEnergy()>energy) v.push_back(map);
788 for(std::map<int, HBHEHitMap>::const_iterator it=
hpds_.begin(); it!=
hpds_.end(); ++it) {
790 if(map.
hitEnergy()>energy) v.push_back(map);
797 for(std::vector<HBHEHitMap>::const_iterator it=
dihits_.begin(); it!=
dihits_.end(); ++it) {
798 if(it->hitEnergy()>energy) v.push_back(*it);
805 for(std::vector<HBHEHitMap>::const_iterator it=
monohits_.begin(); it!=
monohits_.end(); ++it) {
806 if(it->hitEnergy()>energy) v.push_back(*it);
815 std::set<const PhysicsTower*>
temp;
822 for(std::set<const PhysicsTower*>::const_iterator it1=temp.begin(); it1!=temp.end(); ++it1) {
823 for(std::set<const HBHERecHit*>::const_iterator it2=(*it1)->hcalhits.begin(); it2!=(*it1)->hcalhits.end(); ++it2) {
826 neighbors.push_back(hit2);
constexpr float energy() const
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
int nHcalHitsSameTowers(void) const
HcalSubdetector subdet() const
get the subdetector
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
double MinValidTrackPtBarrel_
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
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_
constexpr const DetId & detid() const
void getHPDs(std::vector< HBHEHitMap > &v, double energy) const
HBHEHitMapOrganizer(const edm::Handle< HBHERecHitCollection > &hbhehitcoll_h, const ObjectValidatorAbs &objvalidator, const PhysicsTowerOrganizer &pto, const HcalFrontEndMap *hfemap)
HcalDetId id() const
get the id
uint32_t auxPhase1() const
const int lookupRMIndex(DetId fId) const
const DetId & detid() const
std::vector< HBHERecHit >::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
void getRBXs(std::vector< HBHEHitMap > &v, double energy) const
const Vector & momentum() const
track momentum vector
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)
bool UseAllCombinedRechits_
void getMonoHits(std::vector< HBHEHitMap > &v, double energy) const
void ecalHitsSameTowers(std::set< const EcalRecHit * > &v) const
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
uint32_t HcalAcceptSeverityLevel_
double ecalEnergyNeighborTowers(void) const
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
const int lookupRBXIndex(DetId fId) 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_
double pt() const
track transverse momentum
const EcalChannelStatus * theEcalChStatus_
virtual bool validHit(const HBHERecHit &) const =0
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)
bool validTrack(const reco::Track &) const override
unsigned short numberOfValidHits() const
number of valid hits found
const EcalRecHitCollection * theEBRecHitCollection_
std::set< const PhysicsTower * >::const_iterator neighbor_const_iterator
constexpr bool getBit(const uint32_t u, const unsigned bitnum)
std::map< int, HBHEHitMap > hpds_
~ObjectValidator() override
int ietaAbs() const
get the absolute value of the cell ieta
const_iterator end() const
virtual DetId getClosestCell(const GlobalPoint &r) const
int iphi() const
get the cell iphi
double hitEnergy(void) const
void calcEcalSameTowers_(void) const
DetId id() const
get the id
void calcTracksNeighborTowers_(void) const
void calcHcalNeighborTowers_(void) 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
static const unsigned OFF_COMBINED
std::vector< HBHEHitMap > monohits_
bool validHit(const HBHERecHit &) const override
int nTracksSameTowers(void) const
void getDiHits(std::vector< HBHEHitMap > &v, double energy) const
double ecalEnergySameTowers(void) const
const HcalChannelQuality * theHcalChStatus_
int nEcalHitsSameTowers(void) const
int nTracksNeighborTowers(void) const
uint32_t getValue() const
const HcalFrontEndMap * hfemap_
void hcalHitsSameTowers(std::set< const HBHERecHit * > &v) const
const HcalSeverityLevelComputer * theHcalSevLvlComputer_
T const * product() const
constexpr uint32_t flags() const
void byTowers(std::vector< twrinfo > &v) const
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
const_iterator begin() const
bool UseEcalRecoveredHits_
void hcalHitsNeighborTowers(std::set< const HBHERecHit * > &v) const