CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 743 of file HBHEIsolatedNoiseAlgos.cc.

References dihits_, CaloRecHit::energy(), PhysicsTowerOrganizer::findNeighbors(), PhysicsTowerOrganizer::findTower(), getHPDNeighbors(), hfemap_, hpds_, HBHERecHit::id(), HcalDetId::ieta(), HBHEHitMap::insert(), HcalDetId::iphi(), HcalFrontEndMap::lookupRBXIndex(), HcalFrontEndMap::lookupRMIndex(), monohits_, rbxs_, hgcalTowerProducer_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 }
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_
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_
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
constexpr HcalDetId id() const
get the id
Definition: HBHERecHit.h:41
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
std::map< int, HBHEHitMap > hpds_
virtual bool validHit(const HBHERecHit &) const =0
std::vector< HBHEHitMap > monohits_
const HcalFrontEndMap * hfemap_
void findNeighbors(const CaloTowerDetId &id, std::set< const PhysicsTower * > &neighbors) const
virtual HBHEHitMapOrganizer::~HBHEHitMapOrganizer ( )
inlinevirtual

Definition at line 337 of file HBHEIsolatedNoiseAlgos.h.

337 {}

Member Function Documentation

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

Definition at line 820 of file HBHEIsolatedNoiseAlgos.cc.

References dihits_, and relval_parameters_module::energy.

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_
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(), HcalDetId::ieta(), HcalDetId::iphi(), 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
const PhysicsTower * findTower(const CaloTowerDetId &id) const
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
constexpr HcalDetId id() const
get the id
Definition: HBHERecHit.h:41
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
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 811 of file HBHEIsolatedNoiseAlgos.cc.

References relval_parameters_module::energy, HBHEHitMap::hitEnergy(), and hpds_.

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

Definition at line 828 of file HBHEIsolatedNoiseAlgos.cc.

References relval_parameters_module::energy, and monohits_.

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

Definition at line 802 of file HBHEIsolatedNoiseAlgos.cc.

References relval_parameters_module::energy, HBHEHitMap::hitEnergy(), and rbxs_.

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