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 ( const edm::Handle< HBHERecHitCollection > &  hbhehitcoll_h,
const ObjectValidatorAbs objvalidator,
const PhysicsTowerOrganizer pto,
const HcalFrontEndMap hfemap 
)

Definition at line 748 of file HBHEIsolatedNoiseAlgos.cc.

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

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 }
constexpr float energy() const
Definition: CaloRecHit.h:29
void getHPDNeighbors(const HBHERecHit *hit, std::vector< const HBHERecHit * > &neighbors, const PhysicsTowerOrganizer &pto)
std::vector< HBHEHitMap > dihits_
HcalDetId id() const
get the id
Definition: HBHERecHit.h:39
const int lookupRMIndex(DetId fId) const
std::vector< T >::const_iterator const_iterator
void insert(const HBHERecHit *hit, const PhysicsTower *twr, std::set< const PhysicsTower * > &neighbors)
const PhysicsTower * findTower(const CaloTowerDetId &id) const
const int lookupRBXIndex(DetId fId) const
std::map< int, HBHEHitMap > rbxs_
virtual bool validHit(const HBHERecHit &) const =0
int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
std::map< int, HBHEHitMap > hpds_
const_iterator end() const
int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
std::vector< HBHEHitMap > monohits_
const HcalFrontEndMap * hfemap_
void findNeighbors(const CaloTowerDetId &id, std::set< const PhysicsTower * > &neighbors) const
const_iterator begin() const
virtual HBHEHitMapOrganizer::~HBHEHitMapOrganizer ( )
inlinevirtual

Definition at line 337 of file HBHEIsolatedNoiseAlgos.h.

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

337 {}

Member Function Documentation

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

Definition at line 825 of file HBHEIsolatedNoiseAlgos.cc.

References dihits_, and HCALHighEnergyHPDFilter_cfi::energy.

Referenced by HBHEIsolatedNoiseReflagger::produce().

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 }
std::vector< HBHEHitMap > dihits_
void HBHEHitMapOrganizer::getHPDNeighbors ( const HBHERecHit hit,
std::vector< const HBHERecHit * > &  neighbors,
const PhysicsTowerOrganizer pto 
)
private

Definition at line 841 of file HBHEIsolatedNoiseAlgos.cc.

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

Referenced by HBHEHitMapOrganizer().

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 }
HcalDetId id() const
get the id
Definition: HBHERecHit.h:39
const int lookupRMIndex(DetId fId) const
const PhysicsTower * findTower(const CaloTowerDetId &id) const
int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
const HcalFrontEndMap * hfemap_
void findNeighbors(const CaloTowerDetId &id, std::set< const PhysicsTower * > &neighbors) const
void HBHEHitMapOrganizer::getHPDs ( std::vector< HBHEHitMap > &  v,
double  energy 
) const

Definition at line 816 of file HBHEIsolatedNoiseAlgos.cc.

References HCALHighEnergyHPDFilter_cfi::energy, HBHEHitMap::hitEnergy(), hpds_, and genParticles_cff::map.

Referenced by HBHEIsolatedNoiseReflagger::produce().

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 }
std::map< int, HBHEHitMap > hpds_
double hitEnergy(void) const
void HBHEHitMapOrganizer::getMonoHits ( std::vector< HBHEHitMap > &  v,
double  energy 
) const

Definition at line 833 of file HBHEIsolatedNoiseAlgos.cc.

References HCALHighEnergyHPDFilter_cfi::energy, and monohits_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

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 }
std::vector< HBHEHitMap > monohits_
void HBHEHitMapOrganizer::getRBXs ( std::vector< HBHEHitMap > &  v,
double  energy 
) const

Definition at line 807 of file HBHEIsolatedNoiseAlgos.cc.

References HCALHighEnergyHPDFilter_cfi::energy, HBHEHitMap::hitEnergy(), genParticles_cff::map, and rbxs_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

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 }
std::map< int, HBHEHitMap > rbxs_
double hitEnergy(void) const

Member Data Documentation

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

Definition at line 347 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getDiHits(), and HBHEHitMapOrganizer().

const HcalFrontEndMap* HBHEHitMapOrganizer::hfemap_
private

Definition at line 345 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getHPDNeighbors(), and HBHEHitMapOrganizer().

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

Definition at line 346 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getHPDs(), and HBHEHitMapOrganizer().

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

Definition at line 347 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getMonoHits(), and HBHEHitMapOrganizer().

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

Definition at line 346 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getRBXs(), and HBHEHitMapOrganizer().