CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes

HBHEHitMap Class Reference

#include <HBHEIsolatedNoiseAlgos.h>

List of all members.

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 221 of file HBHEIsolatedNoiseAlgos.h.


Member Typedef Documentation

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

Definition at line 225 of file HBHEIsolatedNoiseAlgos.h.

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

Definition at line 226 of file HBHEIsolatedNoiseAlgos.h.


Constructor & Destructor Documentation

HBHEHitMap::HBHEHitMap ( )
virtual HBHEHitMap::~HBHEHitMap ( ) [inline, virtual]

Definition at line 236 of file HBHEIsolatedNoiseAlgos.h.

{}

Member Function Documentation

hitmap_const_iterator HBHEHitMap::beginHits ( void  ) const [inline]

Definition at line 284 of file HBHEIsolatedNoiseAlgos.h.

References hits_.

Referenced by ecalHitsSameTowers(), hcalHitsSameTowers(), insert(), and tracksSameTowers().

{ return hits_.begin(); }
neighbor_const_iterator HBHEHitMap::beginNeighbors ( void  ) const [inline]

Definition at line 287 of file HBHEIsolatedNoiseAlgos.h.

References neighbors_.

Referenced by ecalHitsNeighborTowers(), hcalHitsNeighborTowers(), and tracksNeighborTowers().

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

Definition at line 584 of file HBHEIsolatedNoiseAlgos.cc.

{
  assert(0);
}
void HBHEHitMap::calcEcalNeighborTowers_ ( void  ) const [private]

Definition at line 676 of file HBHEIsolatedNoiseAlgos.cc.

References ecalEnergyNeighborTowers_, ecalHitsNeighborTowers(), CaloRecHit::energy(), nEcalHitsNeighborTowers_, and v.

Referenced by ecalEnergyNeighborTowers(), and nEcalHitsNeighborTowers().

{
  ecalEnergyNeighborTowers_=0;
  nEcalHitsNeighborTowers_=0;
  std::set<const EcalRecHit*> v;
  ecalHitsNeighborTowers(v);
  for(std::set<const EcalRecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
    const EcalRecHit* hit=(*it);
    ecalEnergyNeighborTowers_+=hit->energy();
    ++nEcalHitsNeighborTowers_;
  }
  return;
}
void HBHEHitMap::calcEcalSameTowers_ ( void  ) const [private]

Definition at line 634 of file HBHEIsolatedNoiseAlgos.cc.

References ecalEnergySameTowers_, ecalHitsSameTowers(), CaloRecHit::energy(), nEcalHitsSameTowers_, and v.

Referenced by ecalEnergySameTowers(), and nEcalHitsSameTowers().

{
  ecalEnergySameTowers_=0;
  nEcalHitsSameTowers_=0;
  std::set<const EcalRecHit*> v;
  ecalHitsSameTowers(v);
  for(std::set<const EcalRecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
    const EcalRecHit* hit=(*it);
    ecalEnergySameTowers_+=hit->energy();
    ++nEcalHitsSameTowers_;
  }
  return;
}
void HBHEHitMap::calcHcalNeighborTowers_ ( void  ) const [private]

Definition at line 662 of file HBHEIsolatedNoiseAlgos.cc.

References CaloRecHit::energy(), hcalEnergyNeighborTowers_, hcalHitsNeighborTowers(), nHcalHitsNeighborTowers_, and v.

Referenced by hcalEnergyNeighborTowers(), and nHcalHitsNeighborTowers().

{
  hcalEnergyNeighborTowers_=0;
  nHcalHitsNeighborTowers_=0;
  std::set<const HBHERecHit*> v;
  hcalHitsNeighborTowers(v);
  for(std::set<const HBHERecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
    const HBHERecHit* hit=(*it);
    hcalEnergyNeighborTowers_+=hit->energy();
    ++nHcalHitsNeighborTowers_;
  }
  return;
}
void HBHEHitMap::calcHcalSameTowers_ ( void  ) const [private]

Definition at line 620 of file HBHEIsolatedNoiseAlgos.cc.

References CaloRecHit::energy(), hcalEnergySameTowers_, hcalHitsSameTowers(), nHcalHitsSameTowers_, and v.

Referenced by hcalEnergySameTowers(), and nHcalHitsSameTowers().

{
  hcalEnergySameTowers_=0;
  nHcalHitsSameTowers_=0;
  std::set<const HBHERecHit*> v;
  hcalHitsSameTowers(v);
  for(std::set<const HBHERecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
    const HBHERecHit* hit=(*it);
    hcalEnergySameTowers_+=hit->energy();
    ++nHcalHitsSameTowers_;
  }
  return;
}
void HBHEHitMap::calcHits_ ( void  ) const [private]

Definition at line 606 of file HBHEIsolatedNoiseAlgos.cc.

References CaloRecHit::energy(), hitEnergy_, hitEnergyTrkFid_, hits_, HBHERecHit::id(), HcalDetId::ietaAbs(), and nHits_.

Referenced by hitEnergy(), hitEnergyTrackFiducial(), and nHits().

{
  hitEnergy_=0;
  nHits_=0;
  hitEnergyTrkFid_=0;
  for(hitmap_const_iterator it=hits_.begin(); it!=hits_.end(); ++it) {
    const HBHERecHit* hit=it->first;
    if(hit->id().ietaAbs()<=26) hitEnergyTrkFid_+=hit->energy();
    hitEnergy_+=hit->energy();
    ++nHits_;
  }
  return;
}
void HBHEHitMap::calcTracksNeighborTowers_ ( void  ) const [private]

Definition at line 690 of file HBHEIsolatedNoiseAlgos.cc.

References nTracksNeighborTowers_, reco::TrackBase::p(), trackEnergyNeighborTowers_, tracksNeighborTowers(), and v.

Referenced by nTracksNeighborTowers(), and trackEnergyNeighborTowers().

{
  trackEnergyNeighborTowers_=0;
  nTracksNeighborTowers_=0;
  std::set<const reco::Track*> v;
  tracksNeighborTowers(v);
  for(std::set<const reco::Track*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
    const reco::Track* trk=(*it);
    trackEnergyNeighborTowers_+=trk->p();
    ++nTracksNeighborTowers_;
  }
  return;
}
void HBHEHitMap::calcTracksSameTowers_ ( void  ) const [private]

Definition at line 648 of file HBHEIsolatedNoiseAlgos.cc.

References nTracksSameTowers_, reco::TrackBase::p(), trackEnergySameTowers_, tracksSameTowers(), and v.

Referenced by nTracksSameTowers(), and trackEnergySameTowers().

{
  trackEnergySameTowers_=0;
  nTracksSameTowers_=0;
  std::set<const reco::Track*> v;
  tracksSameTowers(v);
  for(std::set<const reco::Track*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
    const reco::Track* trk=(*it);
    trackEnergySameTowers_+=trk->p();
    ++nTracksSameTowers_;
  }
  return;
}
double HBHEHitMap::ecalEnergyNeighborTowers ( void  ) const
double HBHEHitMap::ecalEnergySameTowers ( void  ) const
void HBHEHitMap::ecalHitsNeighborTowers ( std::set< const EcalRecHit * > &  v) const

Definition at line 563 of file HBHEIsolatedNoiseAlgos.cc.

References beginNeighbors(), PhysicsTower::ecalhits, and endNeighbors().

Referenced by calcEcalNeighborTowers_().

{
  v.clear();
  for(neighbor_const_iterator it1=beginNeighbors(); it1!=endNeighbors(); ++it1) {
    const PhysicsTower* twr=(*it1);
    v.insert(twr->ecalhits.begin(), twr->ecalhits.end());
  }

  return;
}
void HBHEHitMap::ecalHitsSameTowers ( std::set< const EcalRecHit * > &  v) const

Definition at line 499 of file HBHEIsolatedNoiseAlgos.cc.

References beginHits(), and endHits().

Referenced by calcEcalSameTowers_().

{
  v.clear();
  for(hitmap_const_iterator it1=beginHits(); it1!=endHits(); ++it1) {
    v.insert(it1->second->ecalhits.begin(), it1->second->ecalhits.end());
  }
  return;
}
hitmap_const_iterator HBHEHitMap::endHits ( void  ) const [inline]

Definition at line 285 of file HBHEIsolatedNoiseAlgos.h.

References hits_.

Referenced by ecalHitsSameTowers(), hcalHitsSameTowers(), insert(), and tracksSameTowers().

{ return hits_.end(); }
neighbor_const_iterator HBHEHitMap::endNeighbors ( void  ) const [inline]

Definition at line 288 of file HBHEIsolatedNoiseAlgos.h.

References neighbors_.

Referenced by ecalHitsNeighborTowers(), hcalHitsNeighborTowers(), insert(), and tracksNeighborTowers().

{ return neighbors_.end(); }
hitmap_const_iterator HBHEHitMap::findHit ( const HBHERecHit hit) const [inline]

Definition at line 275 of file HBHEIsolatedNoiseAlgos.h.

References hits_.

Referenced by hcalHitsSameTowers().

{ return hits_.find(hit); }
neighbor_const_iterator HBHEHitMap::findNeighbor ( const PhysicsTower twr) const [inline]

Definition at line 278 of file HBHEIsolatedNoiseAlgos.h.

References neighbors_.

Referenced by insert().

{ return neighbors_.find(twr); }
double HBHEHitMap::hcalEnergyNeighborTowers ( void  ) const
double HBHEHitMap::hcalEnergySameTowers ( void  ) const
void HBHEHitMap::hcalHitsNeighborTowers ( std::set< const HBHERecHit * > &  v) const

Definition at line 553 of file HBHEIsolatedNoiseAlgos.cc.

References beginNeighbors(), endNeighbors(), and PhysicsTower::hcalhits.

Referenced by calcHcalNeighborTowers_().

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

Definition at line 486 of file HBHEIsolatedNoiseAlgos.cc.

References beginHits(), endHits(), and findHit().

Referenced by calcHcalSameTowers_().

{
  v.clear();
  for(hitmap_const_iterator it1=beginHits(); it1!=endHits(); ++it1) {
    for(std::set<const HBHERecHit*>::const_iterator it2=it1->second->hcalhits.begin(); it2!=it1->second->hcalhits.end(); ++it2) {
      const HBHERecHit* hit=(*it2);
      // if the hit in the tower is already in the hitmap, don't include it
      if(findHit(hit)==endHits()) v.insert(hit);
    }
  }
  return;
}
double HBHEHitMap::hitEnergy ( void  ) const

Definition at line 431 of file HBHEIsolatedNoiseAlgos.cc.

References calcHits_(), and hitEnergy_.

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

{
  if(hitEnergy_<-900) calcHits_();
  return hitEnergy_;
}
double HBHEHitMap::hitEnergyTrackFiducial ( void  ) const

Definition at line 443 of file HBHEIsolatedNoiseAlgos.cc.

References calcHits_(), and hitEnergyTrkFid_.

void HBHEHitMap::insert ( const HBHERecHit hit,
const PhysicsTower twr,
std::set< const PhysicsTower * > &  neighbors 
)

Definition at line 589 of file HBHEIsolatedNoiseAlgos.cc.

References beginHits(), endHits(), endNeighbors(), spr::find(), findNeighbor(), hits_, neighbors_, and lumiQTWidget::t.

Referenced by HBHEHitMapOrganizer::HBHEHitMapOrganizer().

{
  hits_[hit]=twr;
  neighbors_.insert(neighbors.begin(), neighbors.end());

  // make sure none of the neighbors are also are part of the hitmap
  for(hitmap_const_iterator it=beginHits(); it!=endHits(); ++it) {
    const PhysicsTower* t=it->second;
    neighbor_const_iterator find=findNeighbor(t);

    // if a hit is also a neighbor, remove the neighbor
    if(find!=endNeighbors()) neighbors_.erase(find);
  }
  return;
}
int HBHEHitMap::nEcalHitsNeighborTowers ( void  ) const
int HBHEHitMap::nEcalHitsSameTowers ( void  ) const
int HBHEHitMap::nHcalHitsNeighborTowers ( void  ) const
int HBHEHitMap::nHcalHitsSameTowers ( void  ) const
int HBHEHitMap::nHits ( void  ) const

Definition at line 437 of file HBHEIsolatedNoiseAlgos.cc.

References calcHits_(), and nHits_.

{
  if(nHits_<-900) calcHits_();
  return nHits_;
}
int HBHEHitMap::nTracksNeighborTowers ( void  ) const
int HBHEHitMap::nTracksSameTowers ( void  ) const
double HBHEHitMap::trackEnergyNeighborTowers ( void  ) const
double HBHEHitMap::trackEnergySameTowers ( void  ) const
void HBHEHitMap::tracksNeighborTowers ( std::set< const reco::Track * > &  v) const

Definition at line 574 of file HBHEIsolatedNoiseAlgos.cc.

References beginNeighbors(), endNeighbors(), and PhysicsTower::tracks.

Referenced by calcTracksNeighborTowers_().

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

Definition at line 508 of file HBHEIsolatedNoiseAlgos.cc.

References beginHits(), and endHits().

Referenced by calcTracksSameTowers_().

{
  v.clear();
  for(hitmap_const_iterator it1=beginHits(); it1!=endHits(); ++it1) {
    v.insert(it1->second->tracks.begin(), it1->second->tracks.end());
  }
  return;
}

Member Data Documentation

double HBHEHitMap::ecalEnergyNeighborTowers_ [mutable, private]
double HBHEHitMap::ecalEnergySameTowers_ [mutable, private]

Definition at line 304 of file HBHEIsolatedNoiseAlgos.h.

Referenced by calcEcalSameTowers_(), ecalEnergySameTowers(), and HBHEHitMap().

double HBHEHitMap::hcalEnergyNeighborTowers_ [mutable, private]
double HBHEHitMap::hcalEnergySameTowers_ [mutable, private]

Definition at line 300 of file HBHEIsolatedNoiseAlgos.h.

Referenced by calcHcalSameTowers_(), HBHEHitMap(), and hcalEnergySameTowers().

double HBHEHitMap::hitEnergy_ [mutable, private]

Definition at line 295 of file HBHEIsolatedNoiseAlgos.h.

Referenced by calcHits_(), HBHEHitMap(), and hitEnergy().

double HBHEHitMap::hitEnergyTrkFid_ [mutable, private]

Definition at line 296 of file HBHEIsolatedNoiseAlgos.h.

Referenced by calcHits_(), HBHEHitMap(), and hitEnergyTrackFiducial().

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

Definition at line 291 of file HBHEIsolatedNoiseAlgos.h.

Referenced by beginHits(), calcHits_(), endHits(), findHit(), and insert().

int HBHEHitMap::nEcalHitsNeighborTowers_ [mutable, private]
int HBHEHitMap::nEcalHitsSameTowers_ [mutable, private]

Definition at line 305 of file HBHEIsolatedNoiseAlgos.h.

Referenced by calcEcalSameTowers_(), HBHEHitMap(), and nEcalHitsSameTowers().

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

Definition at line 292 of file HBHEIsolatedNoiseAlgos.h.

Referenced by beginNeighbors(), endNeighbors(), findNeighbor(), and insert().

int HBHEHitMap::nHcalHitsNeighborTowers_ [mutable, private]
int HBHEHitMap::nHcalHitsSameTowers_ [mutable, private]

Definition at line 301 of file HBHEIsolatedNoiseAlgos.h.

Referenced by calcHcalSameTowers_(), HBHEHitMap(), and nHcalHitsSameTowers().

int HBHEHitMap::nHits_ [mutable, private]

Definition at line 297 of file HBHEIsolatedNoiseAlgos.h.

Referenced by calcHits_(), HBHEHitMap(), and nHits().

int HBHEHitMap::nTracksNeighborTowers_ [mutable, private]
int HBHEHitMap::nTracksSameTowers_ [mutable, private]

Definition at line 309 of file HBHEIsolatedNoiseAlgos.h.

Referenced by calcTracksSameTowers_(), HBHEHitMap(), and nTracksSameTowers().

double HBHEHitMap::trackEnergyNeighborTowers_ [mutable, private]
double HBHEHitMap::trackEnergySameTowers_ [mutable, private]