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 744 of file HBHEIsolatedNoiseAlgos.cc.

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

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

◆ ~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 821 of file HBHEIsolatedNoiseAlgos.cc.

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

References dihits_, HCALHighEnergyHPDFilter_cfi::energy, and findQualityFiles::v.

◆ getHPDNeighbors()

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

Definition at line 837 of file HBHEIsolatedNoiseAlgos.cc.

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

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

Referenced by HBHEHitMapOrganizer().

◆ getHPDs()

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

Definition at line 812 of file HBHEIsolatedNoiseAlgos.cc.

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

References HCALHighEnergyHPDFilter_cfi::energy, hpds_, genParticles_cff::map, and findQualityFiles::v.

◆ getMonoHits()

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

Definition at line 829 of file HBHEIsolatedNoiseAlgos.cc.

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

References HCALHighEnergyHPDFilter_cfi::energy, monohits_, and findQualityFiles::v.

◆ getRBXs()

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

Definition at line 803 of file HBHEIsolatedNoiseAlgos.cc.

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

References HCALHighEnergyHPDFilter_cfi::energy, genParticles_cff::map, rbxs_, and findQualityFiles::v.

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().

edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
HcalFrontEndMap::lookupRMIndex
const int lookupRMIndex(DetId fId) const
Definition: HcalFrontEndMap.cc:63
HBHEHitMapOrganizer::hfemap_
const HcalFrontEndMap * hfemap_
Definition: HBHEIsolatedNoiseAlgos.h:345
HBHERecHit
Definition: HBHERecHit.h:13
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:4
ObjectValidatorAbs::validHit
virtual bool validHit(const HBHERecHit &) const =0
findQualityFiles.v
v
Definition: findQualityFiles.py:179
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
HBHEHitMapOrganizer::rbxs_
std::map< int, HBHEHitMap > rbxs_
Definition: HBHEIsolatedNoiseAlgos.h:346
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
HBHEHitMap
Definition: HBHEIsolatedNoiseAlgos.h:222
PhysicsTowerOrganizer::findTower
const PhysicsTower * findTower(const CaloTowerDetId &id) const
Definition: HBHEIsolatedNoiseAlgos.cc:248
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
HcalFrontEndMap::lookupRBXIndex
const int lookupRBXIndex(DetId fId) const
Definition: HcalFrontEndMap.cc:76
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HBHEHitMapOrganizer::getHPDNeighbors
void getHPDNeighbors(const HBHERecHit *hit, std::vector< const HBHERecHit * > &neighbors, const PhysicsTowerOrganizer &pto)
Definition: HBHEIsolatedNoiseAlgos.cc:837
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
HBHEHitMap::insert
void insert(const HBHERecHit *hit, const PhysicsTower *twr, std::set< const PhysicsTower * > &neighbors)
Definition: HBHEIsolatedNoiseAlgos.cc:630
PhysicsTower
Definition: HBHEIsolatedNoiseAlgos.h:154
HBHEHitMapOrganizer::hpds_
std::map< int, HBHEHitMap > hpds_
Definition: HBHEIsolatedNoiseAlgos.h:346
HBHEHitMapOrganizer::monohits_
std::vector< HBHEHitMap > monohits_
Definition: HBHEIsolatedNoiseAlgos.h:347
HBHEHitMapOrganizer::dihits_
std::vector< HBHEHitMap > dihits_
Definition: HBHEIsolatedNoiseAlgos.h:347
genParticles_cff.map
map
Definition: genParticles_cff.py:11
hit
Definition: SiStripHitEffFromCalibTree.cc:88
PhysicsTowerOrganizer::findNeighbors
void findNeighbors(const CaloTowerDetId &id, std::set< const PhysicsTower * > &neighbors) const
Definition: HBHEIsolatedNoiseAlgos.cc:276