CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HBHEHitMapOrganizer Class Reference

#include <HBHEIsolatedNoiseAlgos.h>

Public Member Functions

void getDiHits (std::vector< HBHEHitMap > &v, double energy) const
 
void getHPDs (std::vector< HBHEHitMap > &v, double energy) const
 
void getMonoHits (std::vector< HBHEHitMap > &v, double energy) const
 
void getRBXs (std::vector< HBHEHitMap > &v, double energy) const
 
 HBHEHitMapOrganizer (const edm::Handle< HBHERecHitCollection > &hbhehitcoll_h, const ObjectValidatorAbs &objvalidator, const PhysicsTowerOrganizer &pto, const HcalFrontEndMap *hfemap)
 
virtual ~HBHEHitMapOrganizer ()
 

Private Member Functions

void getHPDNeighbors (const HBHERecHit *hit, std::vector< const HBHERecHit *> &neighbors, const PhysicsTowerOrganizer &pto)
 

Private Attributes

std::vector< HBHEHitMapdihits_
 
const HcalFrontEndMaphfemap_
 
std::map< int, HBHEHitMaphpds_
 
std::vector< HBHEHitMapmonohits_
 
std::map< int, HBHEHitMaprbxs_
 

Detailed Description

Definition at line 330 of file HBHEIsolatedNoiseAlgos.h.

Constructor & Destructor Documentation

◆ HBHEHitMapOrganizer()

HBHEHitMapOrganizer::HBHEHitMapOrganizer ( const edm::Handle< HBHERecHitCollection > &  hbhehitcoll_h,
const ObjectValidatorAbs objvalidator,
const PhysicsTowerOrganizer pto,
const HcalFrontEndMap hfemap 
)

Definition at line 743 of file HBHEIsolatedNoiseAlgos.cc.

References edm::SortedCollection< T, SORT >::begin(), dihits_, edm::SortedCollection< T, SORT >::end(), PhysicsTowerOrganizer::findNeighbors(), PhysicsTowerOrganizer::findTower(), getHPDNeighbors(), hfemap_, hpds_, hit::id, hcalRecHitTable_cff::ieta, HBHEHitMap::insert(), hcalRecHitTable_cff::iphi, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, HcalFrontEndMap::lookupRBXIndex(), HcalFrontEndMap::lookupRMIndex(), monohits_, rbxs_, l1tHGCalTowerProducer_cfi::tower, and ObjectValidatorAbs::validHit().

747  : hfemap_(hfemap) {
748  // loop over the hits
749  for (HBHERecHitCollection::const_iterator it = hbhehitcoll_h->begin(); it != hbhehitcoll_h->end(); ++it) {
750  const HBHERecHit* hit = &(*it);
751  if (!objvalidator.validHit(*hit))
752  continue;
753 
754  // get the Physics Tower and the neighbors
755  const PhysicsTower* tower = pto.findTower(hit->id().ieta(), hit->id().iphi());
756 
757  std::set<const PhysicsTower*> neighbors;
758  pto.findNeighbors(hit->id().ieta(), hit->id().iphi(), neighbors);
759 
760  // organize the RBXs
761  int rbxidnum = hfemap_->lookupRBXIndex(hit->id());
762  rbxs_[rbxidnum].insert(hit, tower, neighbors);
763 
764  // organize the HPDs
765  int hpdidnum = hfemap_->lookupRMIndex(hit->id());
766  hpds_[hpdidnum].insert(hit, tower, neighbors);
767 
768  // organize the dihits
769  std::vector<const HBHERecHit*> hpdneighbors;
770  getHPDNeighbors(hit, hpdneighbors, pto);
771 
772  if (hpdneighbors.size() == 1) {
773  std::vector<const HBHERecHit*> hpdneighborsneighbors;
774  getHPDNeighbors(hpdneighbors[0], hpdneighborsneighbors, pto);
775 
776  if (hpdneighborsneighbors.size() == 1 && hpdneighborsneighbors[0] == hit &&
777  hit->energy() > hpdneighbors[0]->energy()) {
778  // we've found two hits who are neighbors in the same HPD, but who have no other
779  // neighbors (in the same HPD) in common. In order not to double-count, we
780  // require that the first hit has more energy
781 
782  const PhysicsTower* tower2 = pto.findTower(hpdneighbors[0]->id().ieta(), hpdneighbors[0]->id().iphi());
783  std::set<const PhysicsTower*> neighbors2;
784  pto.findNeighbors(hpdneighbors[0]->id().ieta(), hpdneighbors[0]->id().iphi(), neighbors2);
785 
786  HBHEHitMap dihit;
787  dihit.insert(hit, tower, neighbors);
788  dihit.insert(hpdneighbors[0], tower2, neighbors2);
789  dihits_.push_back(dihit);
790  }
791  } else if (hpdneighbors.empty()) {
792  // organize the monohits
793  HBHEHitMap monohit;
794  monohit.insert(hit, tower, neighbors);
795  monohits_.push_back(monohit);
796  }
797 
798  } // finished looping over HBHERecHits
799  return;
800 }
const int lookupRBXIndex(DetId fId) const
void insert(const HBHERecHit *hit, const PhysicsTower *twr, std::set< const PhysicsTower *> &neighbors)
std::vector< HBHEHitMap > dihits_
std::vector< T >::const_iterator const_iterator
const int lookupRMIndex(DetId fId) const
std::map< int, HBHEHitMap > rbxs_
const_iterator begin() const
void getHPDNeighbors(const HBHERecHit *hit, std::vector< const HBHERecHit *> &neighbors, const PhysicsTowerOrganizer &pto)
std::map< int, HBHEHitMap > hpds_
unsigned int id
const_iterator end() const
const PhysicsTower * findTower(const CaloTowerDetId &id) const
virtual bool validHit(const HBHERecHit &) const =0
void findNeighbors(const CaloTowerDetId &id, std::set< const PhysicsTower *> &neighbors) const
std::vector< HBHEHitMap > monohits_
const HcalFrontEndMap * hfemap_

◆ ~HBHEHitMapOrganizer()

virtual HBHEHitMapOrganizer::~HBHEHitMapOrganizer ( )
inlinevirtual

Definition at line 337 of file HBHEIsolatedNoiseAlgos.h.

337 {}

Member Function Documentation

◆ getDiHits()

void HBHEHitMapOrganizer::getDiHits ( std::vector< HBHEHitMap > &  v,
double  energy 
) const

Definition at line 820 of file HBHEIsolatedNoiseAlgos.cc.

References dihits_, HBHEDarkening_cff::energy, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and findQualityFiles::v.

820  {
821  for (std::vector<HBHEHitMap>::const_iterator it = dihits_.begin(); it != dihits_.end(); ++it) {
822  if (it->hitEnergy() > energy)
823  v.push_back(*it);
824  }
825  return;
826 }
std::vector< HBHEHitMap > dihits_

◆ getHPDNeighbors()

void HBHEHitMapOrganizer::getHPDNeighbors ( const HBHERecHit hit,
std::vector< const HBHERecHit *> &  neighbors,
const PhysicsTowerOrganizer pto 
)
private

Definition at line 836 of file HBHEIsolatedNoiseAlgos.cc.

References PhysicsTowerOrganizer::findNeighbors(), PhysicsTowerOrganizer::findTower(), hfemap_, HBHERecHit::id(), hit::id, HcalFrontEndMap::lookupRMIndex(), and groupFilesInBlocks::temp.

Referenced by HBHEHitMapOrganizer().

838  {
839  std::set<const PhysicsTower*> temp;
840  pto.findNeighbors(hit->id().ieta(), hit->id().iphi(), temp);
841 
842  // make sure to include the same tower that the hit is in
843  temp.insert(pto.findTower(hit->id().ieta(), hit->id().iphi()));
844 
845  // loop over the rechits in the temp neighbors
846  for (std::set<const PhysicsTower*>::const_iterator it1 = temp.begin(); it1 != temp.end(); ++it1) {
847  for (std::set<const HBHERecHit*>::const_iterator it2 = (*it1)->hcalhits.begin(); it2 != (*it1)->hcalhits.end();
848  ++it2) {
849  const HBHERecHit* hit2(*it2);
850  if (hit != hit2 && hfemap_->lookupRMIndex(hit->id()) == hfemap_->lookupRMIndex(hit2->id())) {
851  neighbors.push_back(hit2);
852  }
853  }
854  }
855  return;
856 }
const int lookupRMIndex(DetId fId) const
unsigned int id
const PhysicsTower * findTower(const CaloTowerDetId &id) const
void findNeighbors(const CaloTowerDetId &id, std::set< const PhysicsTower *> &neighbors) const
const HcalFrontEndMap * hfemap_

◆ getHPDs()

void HBHEHitMapOrganizer::getHPDs ( std::vector< HBHEHitMap > &  v,
double  energy 
) const

Definition at line 811 of file HBHEIsolatedNoiseAlgos.cc.

References HBHEDarkening_cff::energy, hpds_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, genParticles_cff::map, and findQualityFiles::v.

811  {
812  for (std::map<int, HBHEHitMap>::const_iterator it = hpds_.begin(); it != hpds_.end(); ++it) {
813  const HBHEHitMap& map = it->second;
814  if (map.hitEnergy() > energy)
815  v.push_back(map);
816  }
817  return;
818 }
std::map< int, HBHEHitMap > hpds_

◆ getMonoHits()

void HBHEHitMapOrganizer::getMonoHits ( std::vector< HBHEHitMap > &  v,
double  energy 
) const

Definition at line 828 of file HBHEIsolatedNoiseAlgos.cc.

References HBHEDarkening_cff::energy, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, monohits_, and findQualityFiles::v.

828  {
829  for (std::vector<HBHEHitMap>::const_iterator it = monohits_.begin(); it != monohits_.end(); ++it) {
830  if (it->hitEnergy() > energy)
831  v.push_back(*it);
832  }
833  return;
834 }
std::vector< HBHEHitMap > monohits_

◆ getRBXs()

void HBHEHitMapOrganizer::getRBXs ( std::vector< HBHEHitMap > &  v,
double  energy 
) const

Definition at line 802 of file HBHEIsolatedNoiseAlgos.cc.

References HBHEDarkening_cff::energy, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, genParticles_cff::map, rbxs_, and findQualityFiles::v.

802  {
803  for (std::map<int, HBHEHitMap>::const_iterator it = rbxs_.begin(); it != rbxs_.end(); ++it) {
804  const HBHEHitMap& map = it->second;
805  if (map.hitEnergy() > energy)
806  v.push_back(map);
807  }
808  return;
809 }
std::map< int, HBHEHitMap > rbxs_

Member Data Documentation

◆ dihits_

std::vector<HBHEHitMap> HBHEHitMapOrganizer::dihits_
private

Definition at line 347 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getDiHits(), and HBHEHitMapOrganizer().

◆ hfemap_

const HcalFrontEndMap* HBHEHitMapOrganizer::hfemap_
private

Definition at line 345 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getHPDNeighbors(), and HBHEHitMapOrganizer().

◆ hpds_

std::map<int, HBHEHitMap> HBHEHitMapOrganizer::hpds_
private

Definition at line 346 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getHPDs(), and HBHEHitMapOrganizer().

◆ monohits_

std::vector<HBHEHitMap> HBHEHitMapOrganizer::monohits_
private

Definition at line 347 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getMonoHits(), and HBHEHitMapOrganizer().

◆ rbxs_

std::map<int, HBHEHitMap> HBHEHitMapOrganizer::rbxs_
private

Definition at line 346 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getRBXs(), and HBHEHitMapOrganizer().