CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
HBHEHitMap Class Reference

#include <HBHEIsolatedNoiseAlgos.h>

Classes

struct  twrinfo
 

Public Types

typedef std::map< const HBHERecHit *, const PhysicsTower * >::const_iterator hitmap_const_iterator
 
typedef std::set< const PhysicsTower * >::const_iterator neighbor_const_iterator
 

Public Member Functions

hitmap_const_iterator beginHits (void) const
 
neighbor_const_iterator beginNeighbors (void) const
 
void byTowers (std::vector< twrinfo > &v) const
 
double ecalEnergyNeighborTowers (void) const
 
double ecalEnergySameTowers (void) const
 
void ecalHitsNeighborTowers (std::set< const EcalRecHit * > &v) const
 
void ecalHitsSameTowers (std::set< const EcalRecHit * > &v) const
 
hitmap_const_iterator endHits (void) const
 
neighbor_const_iterator endNeighbors (void) const
 
hitmap_const_iterator findHit (const HBHERecHit *hit) const
 
neighbor_const_iterator findNeighbor (const PhysicsTower *twr) const
 
 HBHEHitMap ()
 
double hcalEnergyNeighborTowers (void) const
 
double hcalEnergySameTowers (void) const
 
void hcalHitsNeighborTowers (std::set< const HBHERecHit * > &v) const
 
void hcalHitsSameTowers (std::set< const HBHERecHit * > &v) const
 
double hitEnergy (void) const
 
double hitEnergyTrackFiducial (void) const
 
void insert (const HBHERecHit *hit, const PhysicsTower *twr, std::set< const PhysicsTower * > &neighbors)
 
int nEcalHitsNeighborTowers (void) const
 
int nEcalHitsSameTowers (void) const
 
int nHcalHitsNeighborTowers (void) const
 
int nHcalHitsSameTowers (void) const
 
int nHits (void) const
 
int nTracksNeighborTowers (void) const
 
int nTracksSameTowers (void) const
 
double trackEnergyNeighborTowers (void) const
 
double trackEnergySameTowers (void) const
 
void tracksNeighborTowers (std::set< const reco::Track * > &v) const
 
void tracksSameTowers (std::set< const reco::Track * > &v) const
 
virtual ~HBHEHitMap ()
 

Private Member Functions

void calcEcalNeighborTowers_ (void) const
 
void calcEcalSameTowers_ (void) const
 
void calcHcalNeighborTowers_ (void) const
 
void calcHcalSameTowers_ (void) const
 
void calcHits_ (void) const
 
void calcTracksNeighborTowers_ (void) const
 
void calcTracksSameTowers_ (void) const
 

Private Attributes

double ecalEnergyNeighborTowers_
 
double ecalEnergySameTowers_
 
double hcalEnergyNeighborTowers_
 
double hcalEnergySameTowers_
 
double hitEnergy_
 
double hitEnergyTrkFid_
 
std::map< const HBHERecHit *, const PhysicsTower * > hits_
 
int nEcalHitsNeighborTowers_
 
int nEcalHitsSameTowers_
 
std::set< const PhysicsTower * > neighbors_
 
int nHcalHitsNeighborTowers_
 
int nHcalHitsSameTowers_
 
int nHits_
 
int nTracksNeighborTowers_
 
int nTracksSameTowers_
 
double trackEnergyNeighborTowers_
 
double trackEnergySameTowers_
 

Detailed Description

Definition at line 222 of file HBHEIsolatedNoiseAlgos.h.

Member Typedef Documentation

typedef std::map<const HBHERecHit*, const PhysicsTower*>::const_iterator HBHEHitMap::hitmap_const_iterator

Definition at line 224 of file HBHEIsolatedNoiseAlgos.h.

typedef std::set<const PhysicsTower*>::const_iterator HBHEHitMap::neighbor_const_iterator

Definition at line 225 of file HBHEIsolatedNoiseAlgos.h.

Constructor & Destructor Documentation

HBHEHitMap::HBHEHitMap ( )

Definition at line 474 of file HBHEIsolatedNoiseAlgos.cc.

474  {
475  hitEnergy_ = hitEnergyTrkFid_ = -999.;
476  nHits_ = -999;
481 }
double hcalEnergyNeighborTowers_
double trackEnergyNeighborTowers_
double ecalEnergyNeighborTowers_
virtual HBHEHitMap::~HBHEHitMap ( )
inlinevirtual

Definition at line 235 of file HBHEIsolatedNoiseAlgos.h.

References findQualityFiles::v.

235 {}

Member Function Documentation

hitmap_const_iterator HBHEHitMap::beginHits ( void  ) const
inline

Definition at line 283 of file HBHEIsolatedNoiseAlgos.h.

283 { return hits_.begin(); }
std::map< const HBHERecHit *, const PhysicsTower * > hits_
neighbor_const_iterator HBHEHitMap::beginNeighbors ( void  ) const
inline

Definition at line 286 of file HBHEIsolatedNoiseAlgos.h.

286 { return neighbors_.begin(); }
std::set< const PhysicsTower * > neighbors_
void HBHEHitMap::byTowers ( std::vector< twrinfo > &  v) const

Definition at line 632 of file HBHEIsolatedNoiseAlgos.cc.

632 { assert(false); }
void HBHEHitMap::calcEcalNeighborTowers_ ( void  ) const
private

Definition at line 716 of file HBHEIsolatedNoiseAlgos.cc.

References EcalRecHit::energy(), and findQualityFiles::v.

716  {
719  std::set<const EcalRecHit*> v;
721  for (std::set<const EcalRecHit*>::const_iterator it = v.begin(); it != v.end(); ++it) {
722  const EcalRecHit* hit = (*it);
725  }
726  return;
727 }
void ecalHitsNeighborTowers(std::set< const EcalRecHit * > &v) const
float energy() const
Definition: EcalRecHit.h:68
double ecalEnergyNeighborTowers_
void HBHEHitMap::calcEcalSameTowers_ ( void  ) const
private

Definition at line 677 of file HBHEIsolatedNoiseAlgos.cc.

References EcalRecHit::energy(), and findQualityFiles::v.

677  {
680  std::set<const EcalRecHit*> v;
682  for (std::set<const EcalRecHit*>::const_iterator it = v.begin(); it != v.end(); ++it) {
683  const EcalRecHit* hit = (*it);
684  ecalEnergySameTowers_ += hit->energy();
686  }
687  return;
688 }
void ecalHitsSameTowers(std::set< const EcalRecHit * > &v) const
float energy() const
Definition: EcalRecHit.h:68
void HBHEHitMap::calcHcalNeighborTowers_ ( void  ) const
private

Definition at line 703 of file HBHEIsolatedNoiseAlgos.cc.

References CaloRecHit::energy(), and findQualityFiles::v.

703  {
706  std::set<const HBHERecHit*> v;
708  for (std::set<const HBHERecHit*>::const_iterator it = v.begin(); it != v.end(); ++it) {
709  const HBHERecHit* hit = (*it);
712  }
713  return;
714 }
constexpr float energy() const
Definition: CaloRecHit.h:29
double hcalEnergyNeighborTowers_
void hcalHitsNeighborTowers(std::set< const HBHERecHit * > &v) const
void HBHEHitMap::calcHcalSameTowers_ ( void  ) const
private

Definition at line 664 of file HBHEIsolatedNoiseAlgos.cc.

References CaloRecHit::energy(), and findQualityFiles::v.

664  {
667  std::set<const HBHERecHit*> v;
669  for (std::set<const HBHERecHit*>::const_iterator it = v.begin(); it != v.end(); ++it) {
670  const HBHERecHit* hit = (*it);
671  hcalEnergySameTowers_ += hit->energy();
673  }
674  return;
675 }
constexpr float energy() const
Definition: CaloRecHit.h:29
void hcalHitsSameTowers(std::set< const HBHERecHit * > &v) const
void HBHEHitMap::calcHits_ ( void  ) const
private

Definition at line 650 of file HBHEIsolatedNoiseAlgos.cc.

References CaloRecHit::energy(), HBHERecHit::id(), and HcalDetId::ietaAbs().

650  {
651  hitEnergy_ = 0;
652  nHits_ = 0;
653  hitEnergyTrkFid_ = 0;
654  for (hitmap_const_iterator it = hits_.begin(); it != hits_.end(); ++it) {
655  const HBHERecHit* hit = it->first;
656  if (hit->id().ietaAbs() <= 26)
657  hitEnergyTrkFid_ += hit->energy();
658  hitEnergy_ += hit->energy();
659  ++nHits_;
660  }
661  return;
662 }
constexpr float energy() const
Definition: CaloRecHit.h:29
std::map< const HBHERecHit *, const PhysicsTower * >::const_iterator hitmap_const_iterator
HcalDetId id() const
get the id
Definition: HBHERecHit.h:39
std::map< const HBHERecHit *, const PhysicsTower * > hits_
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148
void HBHEHitMap::calcTracksNeighborTowers_ ( void  ) const
private

Definition at line 729 of file HBHEIsolatedNoiseAlgos.cc.

References reco::TrackBase::p(), and findQualityFiles::v.

729  {
732  std::set<const reco::Track*> v;
734  for (std::set<const reco::Track*>::const_iterator it = v.begin(); it != v.end(); ++it) {
735  const reco::Track* trk = (*it);
736  trackEnergyNeighborTowers_ += trk->p();
738  }
739  return;
740 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:599
void tracksNeighborTowers(std::set< const reco::Track * > &v) const
double trackEnergyNeighborTowers_
void HBHEHitMap::calcTracksSameTowers_ ( void  ) const
private

Definition at line 690 of file HBHEIsolatedNoiseAlgos.cc.

References reco::TrackBase::p(), and findQualityFiles::v.

690  {
692  nTracksSameTowers_ = 0;
693  std::set<const reco::Track*> v;
694  tracksSameTowers(v);
695  for (std::set<const reco::Track*>::const_iterator it = v.begin(); it != v.end(); ++it) {
696  const reco::Track* trk = (*it);
697  trackEnergySameTowers_ += trk->p();
699  }
700  return;
701 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:599
void tracksSameTowers(std::set< const reco::Track * > &v) const
double HBHEHitMap::ecalEnergyNeighborTowers ( void  ) const

Definition at line 580 of file HBHEIsolatedNoiseAlgos.cc.

580  {
581  if (ecalEnergyNeighborTowers_ < -900)
584 }
double ecalEnergyNeighborTowers_
void calcEcalNeighborTowers_(void) const
double HBHEHitMap::ecalEnergySameTowers ( void  ) const

Definition at line 513 of file HBHEIsolatedNoiseAlgos.cc.

513  {
514  if (ecalEnergySameTowers_ < -900)
516  return ecalEnergySameTowers_;
517 }
void calcEcalSameTowers_(void) const
void HBHEHitMap::ecalHitsNeighborTowers ( std::set< const EcalRecHit * > &  v) const

Definition at line 613 of file HBHEIsolatedNoiseAlgos.cc.

References PhysicsTower::ecalhits.

613  {
614  v.clear();
615  for (neighbor_const_iterator it1 = beginNeighbors(); it1 != endNeighbors(); ++it1) {
616  const PhysicsTower* twr = (*it1);
617  v.insert(twr->ecalhits.begin(), twr->ecalhits.end());
618  }
619 
620  return;
621 }
neighbor_const_iterator beginNeighbors(void) const
std::set< const PhysicsTower * >::const_iterator neighbor_const_iterator
std::set< const EcalRecHit * > ecalhits
neighbor_const_iterator endNeighbors(void) const
void HBHEHitMap::ecalHitsSameTowers ( std::set< const EcalRecHit * > &  v) const

Definition at line 552 of file HBHEIsolatedNoiseAlgos.cc.

552  {
553  v.clear();
554  for (hitmap_const_iterator it1 = beginHits(); it1 != endHits(); ++it1) {
555  v.insert(it1->second->ecalhits.begin(), it1->second->ecalhits.end());
556  }
557  return;
558 }
std::map< const HBHERecHit *, const PhysicsTower * >::const_iterator hitmap_const_iterator
hitmap_const_iterator endHits(void) const
hitmap_const_iterator beginHits(void) const
hitmap_const_iterator HBHEHitMap::endHits ( void  ) const
inline

Definition at line 284 of file HBHEIsolatedNoiseAlgos.h.

284 { return hits_.end(); }
std::map< const HBHERecHit *, const PhysicsTower * > hits_
neighbor_const_iterator HBHEHitMap::endNeighbors ( void  ) const
inline

Definition at line 287 of file HBHEIsolatedNoiseAlgos.h.

287 { return neighbors_.end(); }
std::set< const PhysicsTower * > neighbors_
hitmap_const_iterator HBHEHitMap::findHit ( const HBHERecHit hit) const
inline

Definition at line 274 of file HBHEIsolatedNoiseAlgos.h.

274 { return hits_.find(hit); }
std::map< const HBHERecHit *, const PhysicsTower * > hits_
neighbor_const_iterator HBHEHitMap::findNeighbor ( const PhysicsTower twr) const
inline

Definition at line 277 of file HBHEIsolatedNoiseAlgos.h.

References edm::eventsetup::heterocontainer::insert().

277 { return neighbors_.find(twr); }
std::set< const PhysicsTower * > neighbors_
double HBHEHitMap::hcalEnergyNeighborTowers ( void  ) const

Definition at line 568 of file HBHEIsolatedNoiseAlgos.cc.

568  {
569  if (hcalEnergyNeighborTowers_ < -900)
572 }
double hcalEnergyNeighborTowers_
void calcHcalNeighborTowers_(void) const
double HBHEHitMap::hcalEnergySameTowers ( void  ) const

Definition at line 501 of file HBHEIsolatedNoiseAlgos.cc.

501  {
502  if (hcalEnergySameTowers_ < -900)
504  return hcalEnergySameTowers_;
505 }
void calcHcalSameTowers_(void) const
void HBHEHitMap::hcalHitsNeighborTowers ( std::set< const HBHERecHit * > &  v) const

Definition at line 604 of file HBHEIsolatedNoiseAlgos.cc.

References PhysicsTower::hcalhits.

604  {
605  v.clear();
606  for (neighbor_const_iterator it1 = beginNeighbors(); it1 != endNeighbors(); ++it1) {
607  const PhysicsTower* twr = (*it1);
608  v.insert(twr->hcalhits.begin(), twr->hcalhits.end());
609  }
610  return;
611 }
std::set< const HBHERecHit * > hcalhits
neighbor_const_iterator beginNeighbors(void) const
std::set< const PhysicsTower * >::const_iterator neighbor_const_iterator
neighbor_const_iterator endNeighbors(void) const
void HBHEHitMap::hcalHitsSameTowers ( std::set< const HBHERecHit * > &  v) const

Definition at line 537 of file HBHEIsolatedNoiseAlgos.cc.

References spr::findHit().

537  {
538  v.clear();
539  for (hitmap_const_iterator it1 = beginHits(); it1 != endHits(); ++it1) {
540  for (std::set<const HBHERecHit*>::const_iterator it2 = it1->second->hcalhits.begin();
541  it2 != it1->second->hcalhits.end();
542  ++it2) {
543  const HBHERecHit* hit = (*it2);
544  // if the hit in the tower is already in the hitmap, don't include it
545  if (findHit(hit) == endHits())
546  v.insert(hit);
547  }
548  }
549  return;
550 }
std::map< const HBHERecHit *, const PhysicsTower * >::const_iterator hitmap_const_iterator
hitmap_const_iterator findHit(const HBHERecHit *hit) const
hitmap_const_iterator endHits(void) const
hitmap_const_iterator beginHits(void) const
double HBHEHitMap::hitEnergy ( void  ) const

Definition at line 483 of file HBHEIsolatedNoiseAlgos.cc.

Referenced by HBHEHitMapOrganizer::getHPDs(), and HBHEHitMapOrganizer::getRBXs().

483  {
484  if (hitEnergy_ < -900)
485  calcHits_();
486  return hitEnergy_;
487 }
void calcHits_(void) const
double HBHEHitMap::hitEnergyTrackFiducial ( void  ) const

Definition at line 495 of file HBHEIsolatedNoiseAlgos.cc.

495  {
496  if (hitEnergyTrkFid_ < -900)
497  calcHits_();
498  return hitEnergyTrkFid_;
499 }
void calcHits_(void) const
void HBHEHitMap::insert ( const HBHERecHit hit,
const PhysicsTower twr,
std::set< const PhysicsTower * > &  neighbors 
)

Definition at line 634 of file HBHEIsolatedNoiseAlgos.cc.

References spr::find(), and OrderedSet::t.

Referenced by HBHEHitMapOrganizer::HBHEHitMapOrganizer().

634  {
635  hits_[hit] = twr;
636  neighbors_.insert(neighbors.begin(), neighbors.end());
637 
638  // make sure none of the neighbors are also are part of the hitmap
639  for (hitmap_const_iterator it = beginHits(); it != endHits(); ++it) {
640  const PhysicsTower* t = it->second;
642 
643  // if a hit is also a neighbor, remove the neighbor
644  if (find != endNeighbors())
645  neighbors_.erase(find);
646  }
647  return;
648 }
std::map< const HBHERecHit *, const PhysicsTower * >::const_iterator hitmap_const_iterator
neighbor_const_iterator findNeighbor(const PhysicsTower *twr) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
hitmap_const_iterator endHits(void) const
std::map< const HBHERecHit *, const PhysicsTower * > hits_
std::set< const PhysicsTower * > neighbors_
std::set< const PhysicsTower * >::const_iterator neighbor_const_iterator
neighbor_const_iterator endNeighbors(void) const
hitmap_const_iterator beginHits(void) const
int HBHEHitMap::nEcalHitsNeighborTowers ( void  ) const

Definition at line 586 of file HBHEIsolatedNoiseAlgos.cc.

586  {
587  if (nEcalHitsNeighborTowers_ < -900)
590 }
void calcEcalNeighborTowers_(void) const
int HBHEHitMap::nEcalHitsSameTowers ( void  ) const

Definition at line 519 of file HBHEIsolatedNoiseAlgos.cc.

519  {
520  if (nEcalHitsSameTowers_ < -900)
522  return nEcalHitsSameTowers_;
523 }
void calcEcalSameTowers_(void) const
int HBHEHitMap::nHcalHitsNeighborTowers ( void  ) const

Definition at line 574 of file HBHEIsolatedNoiseAlgos.cc.

574  {
575  if (nHcalHitsNeighborTowers_ < -900)
578 }
void calcHcalNeighborTowers_(void) const
int HBHEHitMap::nHcalHitsSameTowers ( void  ) const

Definition at line 507 of file HBHEIsolatedNoiseAlgos.cc.

507  {
508  if (nHcalHitsSameTowers_ < -900)
510  return nHcalHitsSameTowers_;
511 }
void calcHcalSameTowers_(void) const
int HBHEHitMap::nHits ( void  ) const

Definition at line 489 of file HBHEIsolatedNoiseAlgos.cc.

489  {
490  if (nHits_ < -900)
491  calcHits_();
492  return nHits_;
493 }
void calcHits_(void) const
int HBHEHitMap::nTracksNeighborTowers ( void  ) const

Definition at line 598 of file HBHEIsolatedNoiseAlgos.cc.

598  {
599  if (nTracksNeighborTowers_ < -900)
601  return nTracksNeighborTowers_;
602 }
void calcTracksNeighborTowers_(void) const
int HBHEHitMap::nTracksSameTowers ( void  ) const

Definition at line 531 of file HBHEIsolatedNoiseAlgos.cc.

531  {
532  if (nTracksSameTowers_ < -900)
534  return nTracksSameTowers_;
535 }
void calcTracksSameTowers_(void) const
double HBHEHitMap::trackEnergyNeighborTowers ( void  ) const

Definition at line 592 of file HBHEIsolatedNoiseAlgos.cc.

592  {
593  if (trackEnergyNeighborTowers_ < -900)
596 }
double trackEnergyNeighborTowers_
void calcTracksNeighborTowers_(void) const
double HBHEHitMap::trackEnergySameTowers ( void  ) const

Definition at line 525 of file HBHEIsolatedNoiseAlgos.cc.

525  {
526  if (trackEnergySameTowers_ < -900)
528  return trackEnergySameTowers_;
529 }
void calcTracksSameTowers_(void) const
void HBHEHitMap::tracksNeighborTowers ( std::set< const reco::Track * > &  v) const

Definition at line 623 of file HBHEIsolatedNoiseAlgos.cc.

References PhysicsTower::tracks.

623  {
624  v.clear();
625  for (neighbor_const_iterator it1 = beginNeighbors(); it1 != endNeighbors(); ++it1) {
626  const PhysicsTower* twr = (*it1);
627  v.insert(twr->tracks.begin(), twr->tracks.end());
628  }
629  return;
630 }
neighbor_const_iterator beginNeighbors(void) const
std::set< const PhysicsTower * >::const_iterator neighbor_const_iterator
std::set< const reco::Track * > tracks
neighbor_const_iterator endNeighbors(void) const
void HBHEHitMap::tracksSameTowers ( std::set< const reco::Track * > &  v) const

Definition at line 560 of file HBHEIsolatedNoiseAlgos.cc.

560  {
561  v.clear();
562  for (hitmap_const_iterator it1 = beginHits(); it1 != endHits(); ++it1) {
563  v.insert(it1->second->tracks.begin(), it1->second->tracks.end());
564  }
565  return;
566 }
std::map< const HBHERecHit *, const PhysicsTower * >::const_iterator hitmap_const_iterator
hitmap_const_iterator endHits(void) const
hitmap_const_iterator beginHits(void) const

Member Data Documentation

double HBHEHitMap::ecalEnergyNeighborTowers_
mutableprivate

Definition at line 315 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::ecalEnergySameTowers_
mutableprivate

Definition at line 303 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::hcalEnergyNeighborTowers_
mutableprivate

Definition at line 311 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::hcalEnergySameTowers_
mutableprivate

Definition at line 299 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::hitEnergy_
mutableprivate

Definition at line 294 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::hitEnergyTrkFid_
mutableprivate

Definition at line 295 of file HBHEIsolatedNoiseAlgos.h.

std::map<const HBHERecHit*, const PhysicsTower*> HBHEHitMap::hits_
private

Definition at line 290 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nEcalHitsNeighborTowers_
mutableprivate

Definition at line 316 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nEcalHitsSameTowers_
mutableprivate

Definition at line 304 of file HBHEIsolatedNoiseAlgos.h.

std::set<const PhysicsTower*> HBHEHitMap::neighbors_
private

Definition at line 291 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nHcalHitsNeighborTowers_
mutableprivate

Definition at line 312 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nHcalHitsSameTowers_
mutableprivate

Definition at line 300 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nHits_
mutableprivate

Definition at line 296 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nTracksNeighborTowers_
mutableprivate

Definition at line 320 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nTracksSameTowers_
mutableprivate

Definition at line 308 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::trackEnergyNeighborTowers_
mutableprivate

Definition at line 319 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::trackEnergySameTowers_
mutableprivate

Definition at line 307 of file HBHEIsolatedNoiseAlgos.h.