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

Member Typedef Documentation

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

Definition at line 227 of file HBHEIsolatedNoiseAlgos.h.

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

Definition at line 228 of file HBHEIsolatedNoiseAlgos.h.

Constructor & Destructor Documentation

HBHEHitMap::HBHEHitMap ( )

Definition at line 426 of file HBHEIsolatedNoiseAlgos.cc.

427 {
429  nHits_=-999;
434 
435 }
double hcalEnergyNeighborTowers_
double trackEnergyNeighborTowers_
double ecalEnergyNeighborTowers_
virtual HBHEHitMap::~HBHEHitMap ( )
inlinevirtual

Definition at line 238 of file HBHEIsolatedNoiseAlgos.h.

References findQualityFiles::v.

238 {}

Member Function Documentation

hitmap_const_iterator HBHEHitMap::beginHits ( void  ) const
inline

Definition at line 286 of file HBHEIsolatedNoiseAlgos.h.

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

Definition at line 289 of file HBHEIsolatedNoiseAlgos.h.

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

Definition at line 590 of file HBHEIsolatedNoiseAlgos.cc.

591 {
592  assert(false);
593 }
void HBHEHitMap::calcEcalNeighborTowers_ ( void  ) const
private

Definition at line 682 of file HBHEIsolatedNoiseAlgos.cc.

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

683 {
686  std::set<const EcalRecHit*> v;
688  for(std::set<const EcalRecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
689  const EcalRecHit* hit=(*it);
692  }
693  return;
694 }
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 640 of file HBHEIsolatedNoiseAlgos.cc.

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

641 {
644  std::set<const EcalRecHit*> v;
646  for(std::set<const EcalRecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
647  const EcalRecHit* hit=(*it);
650  }
651  return;
652 }
void ecalHitsSameTowers(std::set< const EcalRecHit * > &v) const
float energy() const
Definition: EcalRecHit.h:68
void HBHEHitMap::calcHcalNeighborTowers_ ( void  ) const
private

Definition at line 668 of file HBHEIsolatedNoiseAlgos.cc.

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

669 {
672  std::set<const HBHERecHit*> v;
674  for(std::set<const HBHERecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
675  const HBHERecHit* hit=(*it);
678  }
679  return;
680 }
constexpr float energy() const
Definition: CaloRecHit.h:31
double hcalEnergyNeighborTowers_
void hcalHitsNeighborTowers(std::set< const HBHERecHit * > &v) const
void HBHEHitMap::calcHcalSameTowers_ ( void  ) const
private

Definition at line 626 of file HBHEIsolatedNoiseAlgos.cc.

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

627 {
630  std::set<const HBHERecHit*> v;
632  for(std::set<const HBHERecHit*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
633  const HBHERecHit* hit=(*it);
636  }
637  return;
638 }
constexpr float energy() const
Definition: CaloRecHit.h:31
void hcalHitsSameTowers(std::set< const HBHERecHit * > &v) const
void HBHEHitMap::calcHits_ ( void  ) const
private

Definition at line 612 of file HBHEIsolatedNoiseAlgos.cc.

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

613 {
614  hitEnergy_=0;
615  nHits_=0;
617  for(hitmap_const_iterator it=hits_.begin(); it!=hits_.end(); ++it) {
618  const HBHERecHit* hit=it->first;
619  if(hit->id().ietaAbs()<=26) hitEnergyTrkFid_+=hit->energy();
620  hitEnergy_+=hit->energy();
621  ++nHits_;
622  }
623  return;
624 }
constexpr float energy() const
Definition: CaloRecHit.h:31
std::map< const HBHERecHit *, const PhysicsTower * >::const_iterator hitmap_const_iterator
HcalDetId id() const
get the id
Definition: HBHERecHit.h:42
std::map< const HBHERecHit *, const PhysicsTower * > hits_
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:154
void HBHEHitMap::calcTracksNeighborTowers_ ( void  ) const
private

Definition at line 696 of file HBHEIsolatedNoiseAlgos.cc.

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

697 {
700  std::set<const reco::Track*> v;
702  for(std::set<const reco::Track*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
703  const reco::Track* trk=(*it);
706  }
707  return;
708 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:648
void tracksNeighborTowers(std::set< const reco::Track * > &v) const
double trackEnergyNeighborTowers_
void HBHEHitMap::calcTracksSameTowers_ ( void  ) const
private

Definition at line 654 of file HBHEIsolatedNoiseAlgos.cc.

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

655 {
658  std::set<const reco::Track*> v;
659  tracksSameTowers(v);
660  for(std::set<const reco::Track*>::const_iterator it=v.begin(); it!=v.end(); ++it) {
661  const reco::Track* trk=(*it);
662  trackEnergySameTowers_+=trk->p();
664  }
665  return;
666 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:648
void tracksSameTowers(std::set< const reco::Track * > &v) const
double HBHEHitMap::ecalEnergyNeighborTowers ( void  ) const

Definition at line 535 of file HBHEIsolatedNoiseAlgos.cc.

536 {
539 }
double ecalEnergyNeighborTowers_
void calcEcalNeighborTowers_(void) const
double HBHEHitMap::ecalEnergySameTowers ( void  ) const

Definition at line 468 of file HBHEIsolatedNoiseAlgos.cc.

469 {
471  return ecalEnergySameTowers_;
472 }
void calcEcalSameTowers_(void) const
void HBHEHitMap::ecalHitsNeighborTowers ( std::set< const EcalRecHit * > &  v) const

Definition at line 569 of file HBHEIsolatedNoiseAlgos.cc.

References PhysicsTower::ecalhits.

570 {
571  v.clear();
572  for(neighbor_const_iterator it1=beginNeighbors(); it1!=endNeighbors(); ++it1) {
573  const PhysicsTower* twr=(*it1);
574  v.insert(twr->ecalhits.begin(), twr->ecalhits.end());
575  }
576 
577  return;
578 }
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 505 of file HBHEIsolatedNoiseAlgos.cc.

506 {
507  v.clear();
508  for(hitmap_const_iterator it1=beginHits(); it1!=endHits(); ++it1) {
509  v.insert(it1->second->ecalhits.begin(), it1->second->ecalhits.end());
510  }
511  return;
512 }
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 287 of file HBHEIsolatedNoiseAlgos.h.

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

Definition at line 290 of file HBHEIsolatedNoiseAlgos.h.

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

Definition at line 277 of file HBHEIsolatedNoiseAlgos.h.

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

Definition at line 280 of file HBHEIsolatedNoiseAlgos.h.

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

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

Definition at line 523 of file HBHEIsolatedNoiseAlgos.cc.

524 {
527 }
double hcalEnergyNeighborTowers_
void calcHcalNeighborTowers_(void) const
double HBHEHitMap::hcalEnergySameTowers ( void  ) const

Definition at line 456 of file HBHEIsolatedNoiseAlgos.cc.

457 {
459  return hcalEnergySameTowers_;
460 }
void calcHcalSameTowers_(void) const
void HBHEHitMap::hcalHitsNeighborTowers ( std::set< const HBHERecHit * > &  v) const

Definition at line 559 of file HBHEIsolatedNoiseAlgos.cc.

References PhysicsTower::hcalhits.

560 {
561  v.clear();
562  for(neighbor_const_iterator it1=beginNeighbors(); it1!=endNeighbors(); ++it1) {
563  const PhysicsTower* twr=(*it1);
564  v.insert(twr->hcalhits.begin(), twr->hcalhits.end());
565  }
566  return;
567 }
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 492 of file HBHEIsolatedNoiseAlgos.cc.

References spr::findHit().

493 {
494  v.clear();
495  for(hitmap_const_iterator it1=beginHits(); it1!=endHits(); ++it1) {
496  for(std::set<const HBHERecHit*>::const_iterator it2=it1->second->hcalhits.begin(); it2!=it1->second->hcalhits.end(); ++it2) {
497  const HBHERecHit* hit=(*it2);
498  // if the hit in the tower is already in the hitmap, don't include it
499  if(findHit(hit)==endHits()) v.insert(hit);
500  }
501  }
502  return;
503 }
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 437 of file HBHEIsolatedNoiseAlgos.cc.

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

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

Definition at line 449 of file HBHEIsolatedNoiseAlgos.cc.

450 {
451  if(hitEnergyTrkFid_<-900) calcHits_();
452  return hitEnergyTrkFid_;
453 }
void calcHits_(void) const
void HBHEHitMap::insert ( const HBHERecHit hit,
const PhysicsTower twr,
std::set< const PhysicsTower * > &  neighbors 
)

Definition at line 595 of file HBHEIsolatedNoiseAlgos.cc.

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

Referenced by HBHEHitMapOrganizer::HBHEHitMapOrganizer().

596 {
597  hits_[hit]=twr;
598  neighbors_.insert(neighbors.begin(), neighbors.end());
599 
600  // make sure none of the neighbors are also are part of the hitmap
601  for(hitmap_const_iterator it=beginHits(); it!=endHits(); ++it) {
602  const PhysicsTower* t=it->second;
604 
605  // if a hit is also a neighbor, remove the neighbor
606  if(find!=endNeighbors()) neighbors_.erase(find);
607  }
608  return;
609 }
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:20
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 541 of file HBHEIsolatedNoiseAlgos.cc.

542 {
545 }
void calcEcalNeighborTowers_(void) const
int HBHEHitMap::nEcalHitsSameTowers ( void  ) const

Definition at line 474 of file HBHEIsolatedNoiseAlgos.cc.

475 {
477  return nEcalHitsSameTowers_;
478 }
void calcEcalSameTowers_(void) const
int HBHEHitMap::nHcalHitsNeighborTowers ( void  ) const

Definition at line 529 of file HBHEIsolatedNoiseAlgos.cc.

530 {
533 }
void calcHcalNeighborTowers_(void) const
int HBHEHitMap::nHcalHitsSameTowers ( void  ) const

Definition at line 462 of file HBHEIsolatedNoiseAlgos.cc.

463 {
465  return nHcalHitsSameTowers_;
466 }
void calcHcalSameTowers_(void) const
int HBHEHitMap::nHits ( void  ) const

Definition at line 443 of file HBHEIsolatedNoiseAlgos.cc.

444 {
445  if(nHits_<-900) calcHits_();
446  return nHits_;
447 }
void calcHits_(void) const
int HBHEHitMap::nTracksNeighborTowers ( void  ) const

Definition at line 553 of file HBHEIsolatedNoiseAlgos.cc.

554 {
556  return nTracksNeighborTowers_;
557 }
void calcTracksNeighborTowers_(void) const
int HBHEHitMap::nTracksSameTowers ( void  ) const

Definition at line 486 of file HBHEIsolatedNoiseAlgos.cc.

487 {
489  return nTracksSameTowers_;
490 }
void calcTracksSameTowers_(void) const
double HBHEHitMap::trackEnergyNeighborTowers ( void  ) const

Definition at line 547 of file HBHEIsolatedNoiseAlgos.cc.

548 {
551 }
double trackEnergyNeighborTowers_
void calcTracksNeighborTowers_(void) const
double HBHEHitMap::trackEnergySameTowers ( void  ) const

Definition at line 480 of file HBHEIsolatedNoiseAlgos.cc.

481 {
483  return trackEnergySameTowers_;
484 }
void calcTracksSameTowers_(void) const
void HBHEHitMap::tracksNeighborTowers ( std::set< const reco::Track * > &  v) const

Definition at line 580 of file HBHEIsolatedNoiseAlgos.cc.

References PhysicsTower::tracks.

581 {
582  v.clear();
583  for(neighbor_const_iterator it1=beginNeighbors(); it1!=endNeighbors(); ++it1) {
584  const PhysicsTower* twr=(*it1);
585  v.insert(twr->tracks.begin(), twr->tracks.end());
586  }
587  return;
588 }
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 514 of file HBHEIsolatedNoiseAlgos.cc.

515 {
516  v.clear();
517  for(hitmap_const_iterator it1=beginHits(); it1!=endHits(); ++it1) {
518  v.insert(it1->second->tracks.begin(), it1->second->tracks.end());
519  }
520  return;
521 }
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 318 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::ecalEnergySameTowers_
mutableprivate

Definition at line 306 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::hcalEnergyNeighborTowers_
mutableprivate

Definition at line 314 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::hcalEnergySameTowers_
mutableprivate

Definition at line 302 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::hitEnergy_
mutableprivate

Definition at line 297 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::hitEnergyTrkFid_
mutableprivate

Definition at line 298 of file HBHEIsolatedNoiseAlgos.h.

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

Definition at line 293 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nEcalHitsNeighborTowers_
mutableprivate

Definition at line 319 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nEcalHitsSameTowers_
mutableprivate

Definition at line 307 of file HBHEIsolatedNoiseAlgos.h.

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

Definition at line 294 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nHcalHitsNeighborTowers_
mutableprivate

Definition at line 315 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nHcalHitsSameTowers_
mutableprivate

Definition at line 303 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nHits_
mutableprivate

Definition at line 299 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nTracksNeighborTowers_
mutableprivate

Definition at line 323 of file HBHEIsolatedNoiseAlgos.h.

int HBHEHitMap::nTracksSameTowers_
mutableprivate

Definition at line 311 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::trackEnergyNeighborTowers_
mutableprivate

Definition at line 322 of file HBHEIsolatedNoiseAlgos.h.

double HBHEHitMap::trackEnergySameTowers_
mutableprivate

Definition at line 310 of file HBHEIsolatedNoiseAlgos.h.