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

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

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

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

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

Referenced by HBHEIsolatedNoiseReflagger::produce().

◆ getHPDNeighbors()

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

Definition at line 841 of file HBHEIsolatedNoiseAlgos.cc.

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

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

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

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

Referenced by HBHEIsolatedNoiseReflagger::produce().

◆ getMonoHits()

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

Definition at line 833 of file HBHEIsolatedNoiseAlgos.cc.

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

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

Referenced by HBHEIsolatedNoiseReflagger::produce().

◆ getRBXs()

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

Definition at line 807 of file HBHEIsolatedNoiseAlgos.cc.

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

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

Referenced by HBHEIsolatedNoiseReflagger::produce().

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:3
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:252
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:841
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:634
PhysicsTower
Definition: HBHEIsolatedNoiseAlgos.h:153
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:280