CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
HCaloDetIdAssociator Class Reference

#include <CaloDetIdAssociator.h>

Inheritance diagram for HCaloDetIdAssociator:
HDetIdAssociator HEcalDetIdAssociator HHcalDetIdAssociator

Public Member Functions

 HCaloDetIdAssociator ()
 
 HCaloDetIdAssociator (const int nPhi, const int nEta, const double etaBinSize)
 
virtual void setGeometry (const CaloGeometry *ptr)
 
- Public Member Functions inherited from HDetIdAssociator
virtual std::set< DetIdgetCrossedDetIds (const std::set< DetId > &, const std::vector< GlobalPoint > &trajectory)
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &, const int idR=0)
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &point, const double dR=0)
 
virtual std::set< DetIdgetDetIdsInACone (const std::set< DetId > &, const std::vector< GlobalPoint > &trajectory, const double)
 
virtual std::set< DetIdgetMaxEDetId (const std::set< DetId > &, edm::Handle< CaloTowerCollection > caloTowers)
 
virtual std::set< DetIdgetMaxEDetId (const std::set< DetId > &, edm::Handle< HBHERecHitCollection > recHits)
 
virtual std::vector< GlobalPointgetTrajectory (const FreeTrajectoryState &, const std::vector< GlobalPoint > &)
 
 HDetIdAssociator ()
 
 HDetIdAssociator (const int nPhi, const int nEta, const double etaBinSize)
 
virtual int iEta (const GlobalPoint &)
 
virtual int iPhi (const GlobalPoint &)
 
virtual void setPropagator (Propagator *ptr)
 
virtual ~HDetIdAssociator ()
 

Protected Member Functions

void check_setup () override
 
std::set< DetIdgetASetOfValidDetIds () override
 
std::vector< GlobalPointgetDetIdPoints (const DetId &id) override
 
GlobalPoint getPosition (const DetId &id) override
 
bool insideElement (const GlobalPoint &point, const DetId &id) override
 
- Protected Member Functions inherited from HDetIdAssociator
virtual void buildMap ()
 
virtual bool nearElement (const GlobalPoint &point, const DetId &id, const double distance)
 

Protected Attributes

const CaloGeometrygeometry_
 
- Protected Attributes inherited from HDetIdAssociator
const double etaBinSize_
 
PropagatorivProp_
 
const int nEta_
 
const int nPhi_
 
std::vector< std::vector< std::set< DetId > > > * theMap_
 

Detailed Description

Definition at line 26 of file CaloDetIdAssociator.h.

Constructor & Destructor Documentation

◆ HCaloDetIdAssociator() [1/2]

HCaloDetIdAssociator::HCaloDetIdAssociator ( )
inline

Definition at line 28 of file CaloDetIdAssociator.h.

28 : HDetIdAssociator(72, 70, 0.087), geometry_(nullptr){};

◆ HCaloDetIdAssociator() [2/2]

HCaloDetIdAssociator::HCaloDetIdAssociator ( const int  nPhi,
const int  nEta,
const double  etaBinSize 
)
inline

Definition at line 29 of file CaloDetIdAssociator.h.

Member Function Documentation

◆ check_setup()

void HCaloDetIdAssociator::check_setup ( )
inlineoverrideprotectedvirtual

Reimplemented from HDetIdAssociator.

Definition at line 35 of file CaloDetIdAssociator.h.

35  {
37  if (geometry_ == nullptr)
38  throw cms::Exception("CaloGeometry is not set");
39  };

References HDetIdAssociator::check_setup(), Exception, and geometry_.

◆ getASetOfValidDetIds()

std::set<DetId> HCaloDetIdAssociator::getASetOfValidDetIds ( )
inlineoverrideprotectedvirtual

Implements HDetIdAssociator.

Reimplemented in HHcalDetIdAssociator, and HEcalDetIdAssociator.

Definition at line 48 of file CaloDetIdAssociator.h.

48  {
49  std::set<DetId> setOfValidIds;
50  const std::vector<DetId>& vectOfValidIds = geometry_->getValidDetIds(DetId::Calo, 1);
51  for (std::vector<DetId>::const_iterator it = vectOfValidIds.begin(); it != vectOfValidIds.end(); ++it)
52  setOfValidIds.insert(*it);
53 
54  return setOfValidIds;
55  };

References DetId::Calo, geometry_, and CaloGeometry::getValidDetIds().

◆ getDetIdPoints()

std::vector<GlobalPoint> HCaloDetIdAssociator::getDetIdPoints ( const DetId id)
inlineoverrideprotectedvirtual

Implements HDetIdAssociator.

Definition at line 57 of file CaloDetIdAssociator.h.

57  {
58  std::vector<GlobalPoint> points;
60  LogDebug("CaloDetIdAssociator") << "Cannot find sub-detector geometry for " << id.rawId() << "\n";
61  } else {
62  if (!(geometry_->getSubdetectorGeometry(id))->getGeometry(id)) {
63  LogDebug("CaloDetIdAssociator") << "Cannot find CaloCell geometry for " << id.rawId() << "\n";
64  } else {
66  points.assign(cor.begin(), cor.end());
67  points.push_back(getPosition(id));
68  }
69  }
70 
71  return points;
72  };

References geometry_, CaloSubdetectorGeometry::getGeometry(), getPosition(), CaloGeometry::getSubdetectorGeometry(), LogDebug, and HLT_FULL_cff::points.

◆ getPosition()

GlobalPoint HCaloDetIdAssociator::getPosition ( const DetId id)
inlineoverrideprotectedvirtual

Implements HDetIdAssociator.

Definition at line 41 of file CaloDetIdAssociator.h.

41  {
42  GlobalPoint point = (id.det() == DetId::Hcal)
43  ? (static_cast<const HcalGeometry*>(geometry_->getSubdetectorGeometry(id)))->getPosition(id)
44  : geometry_->getPosition(id);
45  return point;
46  };

References geometry_, CaloGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, and point.

Referenced by getDetIdPoints().

◆ insideElement()

bool HCaloDetIdAssociator::insideElement ( const GlobalPoint point,
const DetId id 
)
inlineoverrideprotectedvirtual

Implements HDetIdAssociator.

Definition at line 74 of file CaloDetIdAssociator.h.

74  {
75  return geometry_->getSubdetectorGeometry(id)->getGeometry(id)->inside(point);
76  };

References geometry_, CaloSubdetectorGeometry::getGeometry(), CaloGeometry::getSubdetectorGeometry(), and point.

◆ setGeometry()

virtual void HCaloDetIdAssociator::setGeometry ( const CaloGeometry ptr)
inlinevirtual

Definition at line 32 of file CaloDetIdAssociator.h.

32 { geometry_ = ptr; };

References geometry_.

Member Data Documentation

◆ geometry_

const CaloGeometry* HCaloDetIdAssociator::geometry_
protected
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21449
HLT_FULL_cff.nEta
nEta
Definition: HLT_FULL_cff.py:6586
HDetIdAssociator::HDetIdAssociator
HDetIdAssociator()
Definition: DetIdAssociator.h:34
CaloGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
DetId::Hcal
Definition: DetId.h:28
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
EZArrayFL< GlobalPoint >
HLT_FULL_cff.etaBinSize
etaBinSize
Definition: HLT_FULL_cff.py:6585
DetId::Calo
Definition: DetId.h:29
HCaloDetIdAssociator::geometry_
const CaloGeometry * geometry_
Definition: CaloDetIdAssociator.h:76
Point3DBase< float, GlobalTag >
HCaloDetIdAssociator::getPosition
GlobalPoint getPosition(const DetId &id) override
Definition: CaloDetIdAssociator.h:41
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
HDetIdAssociator::check_setup
virtual void check_setup()
Definition: DetIdAssociator.h:65
HLT_FULL_cff.nPhi
nPhi
Definition: HLT_FULL_cff.py:6587
CaloSubdetectorGeometry::getGeometry
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Definition: CaloSubdetectorGeometry.cc:36
CaloGeometry::getValidDetIds
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:75
Exception
Definition: hltDiff.cc:245
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5