CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
DetIdAssociator Class Referenceabstract

#include <DetIdAssociator.h>

Inheritance diagram for DetIdAssociator:
CaloDetIdAssociator MuonDetIdAssociator EcalDetIdAssociator HcalDetIdAssociator HODetIdAssociator PreshowerDetIdAssociator

Classes

struct  MapRange
 

Public Types

typedef std::vector
< GlobalPoint >
::const_iterator 
const_iterator
 
enum  PropagationTarget { Barrel, ForwardEndcap, BackwardEndcap }
 

Public Member Functions

virtual void buildMap ()
 make the look-up map More...
 
 DetIdAssociator (const int nPhi, const int nEta, const double etaBinSize)
 
double etaBinSize () const
 look-up map bin size in eta dimension More...
 
virtual std::vector< DetIdgetCrossedDetIds (const std::set< DetId > &, const std::vector< GlobalPoint > &trajectory) const
 
virtual std::vector< DetIdgetCrossedDetIds (const std::set< DetId > &, const std::vector< SteppingHelixStateInfo > &trajectory, const double toleranceInSigmas=-1) const
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &, const int iN=0) const
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &direction, const unsigned int iNEtaPlus, const unsigned int iNEtaMinus, const unsigned int iNPhiPlus, const unsigned int iNPhiMinus) const
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &direction, const MapRange &mapRange) const
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &point, const double d=0) const
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &point, const double dThetaPlus, const double dThetaMinus, const double dPhiPlus, const double dPhiMinus) const
 
virtual std::set< DetIdgetDetIdsInACone (const std::set< DetId > &, const std::vector< GlobalPoint > &trajectory, const double dR) const
 
virtual const GeomDetgetGeomDet (const DetId &) const =0
 
virtual int iEta (const GlobalPoint &) const
 look-up map eta index More...
 
virtual int iPhi (const GlobalPoint &) const
 look-up map phi index More...
 
virtual const char * name () const =0
 
int nEtaBins () const
 number of bins of the look-up map in eta dimension More...
 
int nPhiBins () const
 number of bins of the look-up map in phi dimension More...
 
virtual bool selectAllInACone (const double dR) const
 helper to see if getDetIdsInACone is useful More...
 
virtual void setConditions (const DetIdAssociatorRecord &)
 
virtual void setGeometry (const DetIdAssociatorRecord &)=0
 
const FiducialVolumevolume () const
 get active detector volume More...
 
virtual ~DetIdAssociator ()
 

Protected Member Functions

virtual void check_setup () const
 
virtual bool crossedElement (const GlobalPoint &, const GlobalPoint &, const DetId &, const double toleranceInSigmas=-1, const SteppingHelixStateInfo *=0) const
 
virtual void dumpMapContent (int, int) const
 
virtual void dumpMapContent (int, int, int, int) const
 
void fillSet (std::set< DetId > &set, unsigned int iEta, unsigned int iPhi) const
 
virtual std::pair
< const_iterator,
const_iterator
getDetIdPoints (const DetId &, std::vector< GlobalPoint > &) const =0
 
virtual const unsigned int getNumberOfSubdetectors () const
 
virtual GlobalPoint getPosition (const DetId &) const =0
 
virtual void getValidDetIds (unsigned int subDetectorIndex, std::vector< DetId > &) const =0
 
unsigned int index (unsigned int iEta, unsigned int iPhi) const
 
virtual bool insideElement (const GlobalPoint &, const DetId &) const =0
 
virtual bool nearElement (const GlobalPoint &point, const DetId &id, const double distance) const
 

Protected Attributes

std::vector< DetIdcontainer_
 
const double etaBinSize_
 
std::vector< std::pair
< unsigned int, unsigned int > > 
lookupMap_
 
double maxEta_
 
double minTheta_
 
const int nEta_
 
const int nPhi_
 
bool theMapIsValid_
 
FiducialVolume volume_
 

Detailed Description

\

Description: Abstract base class for 3D point -> std::set<DetId>

Implementation: A look up map of active detector elements in eta-phi space is built to speed up access to the detector element geometry as well as associated hits. The map is uniformly binned in eta and phi dimensions, which can be viewed as a histogram with every bin containing DetId of elements crossed in a given eta-phi window. It is very likely that a single DetId can be found in a few bins if it's geometrical size is bigger than eta-phi bin size.

The map is implemented as a double array. The first one has fixed size and points to the range of array elements in the second one.

Definition at line 46 of file DetIdAssociator.h.

Member Typedef Documentation

Definition at line 55 of file DetIdAssociator.h.

Member Enumeration Documentation

Enumerator
Barrel 
ForwardEndcap 
BackwardEndcap 

Definition at line 48 of file DetIdAssociator.h.

Constructor & Destructor Documentation

DetIdAssociator::DetIdAssociator ( const int  nPhi,
const int  nEta,
const double  etaBinSize 
)

Definition at line 25 of file DetIdAssociator.cc.

virtual DetIdAssociator::~DetIdAssociator ( )
inlinevirtual

Definition at line 58 of file DetIdAssociator.h.

Member Function Documentation

void DetIdAssociator::buildMap ( )
virtual

make the look-up map

Definition at line 142 of file DetIdAssociator.cc.

void DetIdAssociator::check_setup ( ) const
protectedvirtual

Reimplemented in MuonDetIdAssociator, and CaloDetIdAssociator.

Definition at line 377 of file DetIdAssociator.cc.

Referenced by MuonDetIdAssociator::check_setup().

virtual bool DetIdAssociator::crossedElement ( const GlobalPoint ,
const GlobalPoint ,
const DetId ,
const double  toleranceInSigmas = -1,
const SteppingHelixStateInfo = 0 
) const
inlineprotectedvirtual

Reimplemented in CaloDetIdAssociator.

Definition at line 138 of file DetIdAssociator.h.

void DetIdAssociator::dumpMapContent ( int  ieta,
int  iphi 
) const
protectedvirtual

Definition at line 324 of file DetIdAssociator.cc.

void DetIdAssociator::dumpMapContent ( int  ieta_min,
int  ieta_max,
int  iphi_min,
int  iphi_max 
) const
protectedvirtual

Definition at line 346 of file DetIdAssociator.cc.

double DetIdAssociator::etaBinSize ( ) const
inline

look-up map bin size in eta dimension

Definition at line 113 of file DetIdAssociator.h.

void DetIdAssociator::fillSet ( std::set< DetId > &  set,
unsigned int  iEta,
unsigned int  iPhi 
) const
protected

Definition at line 385 of file DetIdAssociator.cc.

std::vector< DetId > DetIdAssociator::getCrossedDetIds ( const std::set< DetId > &  inset,
const std::vector< GlobalPoint > &  trajectory 
) const
virtual
  • DetIds crossed by the track tolerance is the radius of the trajectory used for matching -1 is default and represent the case with no uncertainty on the trajectory direction. It's the fastest option
  • DetIds crossed by the track, ordered according to the order that they were crossed by the track flying outside the detector

Definition at line 284 of file DetIdAssociator.cc.

std::vector< DetId > DetIdAssociator::getCrossedDetIds ( const std::set< DetId > &  inset,
const std::vector< SteppingHelixStateInfo > &  trajectory,
const double  toleranceInSigmas = -1 
) const
virtual

Definition at line 303 of file DetIdAssociator.cc.

virtual std::pair<const_iterator, const_iterator> DetIdAssociator::getDetIdPoints ( const DetId ,
std::vector< GlobalPoint > &   
) const
protectedpure virtual
std::set< DetId > DetIdAssociator::getDetIdsCloseToAPoint ( const GlobalPoint direction,
const int  iN = 0 
) const
virtual

Preselect DetIds close to a point on the inner surface of the detector. "iN" is a number of the adjacent bins of the map to retrieve

Definition at line 35 of file DetIdAssociator.cc.

std::set< DetId > DetIdAssociator::getDetIdsCloseToAPoint ( const GlobalPoint direction,
const unsigned int  iNEtaPlus,
const unsigned int  iNEtaMinus,
const unsigned int  iNPhiPlus,
const unsigned int  iNPhiMinus 
) const
virtual

Definition at line 43 of file DetIdAssociator.cc.

std::set< DetId > DetIdAssociator::getDetIdsCloseToAPoint ( const GlobalPoint direction,
const MapRange mapRange 
) const
virtual

Definition at line 359 of file DetIdAssociator.cc.

std::set< DetId > DetIdAssociator::getDetIdsCloseToAPoint ( const GlobalPoint point,
const double  d = 0 
) const
virtual

Preselect DetIds close to a point on the inner surface of the detector. "d" defines the allowed range in theta-phi space:

  • theta is in [point.theta()-d, point.theta()+d]
  • phi is in [point.phi()-d, point.phi()+d]

Definition at line 94 of file DetIdAssociator.cc.

std::set< DetId > DetIdAssociator::getDetIdsCloseToAPoint ( const GlobalPoint point,
const double  dThetaPlus,
const double  dThetaMinus,
const double  dPhiPlus,
const double  dPhiMinus 
) const
virtual
  • theta is in [point.theta()-dThetaMinus, point.theta()+dThetaPlus]
  • phi is in [point.phi()-dPhiMinus, point.phi()+dPhiPlus]

Definition at line 100 of file DetIdAssociator.cc.

std::set< DetId > DetIdAssociator::getDetIdsInACone ( const std::set< DetId > &  inset,
const std::vector< GlobalPoint > &  trajectory,
const double  dR 
) const
virtual

Find DetIds that satisfy given requirements

  • inside eta-phi cone of radius dR

Definition at line 268 of file DetIdAssociator.cc.

virtual const GeomDet* DetIdAssociator::getGeomDet ( const DetId ) const
pure virtual
virtual const unsigned int DetIdAssociator::getNumberOfSubdetectors ( ) const
inlineprotectedvirtual

Reimplemented in EcalDetIdAssociator, and HcalDetIdAssociator.

Definition at line 133 of file DetIdAssociator.h.

virtual GlobalPoint DetIdAssociator::getPosition ( const DetId ) const
protectedpure virtual
virtual void DetIdAssociator::getValidDetIds ( unsigned int  subDetectorIndex,
std::vector< DetId > &   
) const
protectedpure virtual
int DetIdAssociator::iEta ( const GlobalPoint point) const
virtual

look-up map eta index

Definition at line 131 of file DetIdAssociator.cc.

unsigned int DetIdAssociator::index ( unsigned int  iEta,
unsigned int  iPhi 
) const
inlineprotected

Definition at line 147 of file DetIdAssociator.h.

virtual bool DetIdAssociator::insideElement ( const GlobalPoint ,
const DetId  
) const
protectedpure virtual
int DetIdAssociator::iPhi ( const GlobalPoint point) const
virtual

look-up map phi index

Definition at line 136 of file DetIdAssociator.cc.

virtual const char* DetIdAssociator::name ( ) const
pure virtual
bool DetIdAssociator::nearElement ( const GlobalPoint point,
const DetId id,
const double  distance 
) const
protectedvirtual

Definition at line 367 of file DetIdAssociator.cc.

int DetIdAssociator::nEtaBins ( ) const
inline

number of bins of the look-up map in eta dimension

Definition at line 111 of file DetIdAssociator.h.

int DetIdAssociator::nPhiBins ( ) const
inline

number of bins of the look-up map in phi dimension

Definition at line 109 of file DetIdAssociator.h.

virtual bool DetIdAssociator::selectAllInACone ( const double  dR) const
inlinevirtual

helper to see if getDetIdsInACone is useful

Definition at line 86 of file DetIdAssociator.h.

virtual void DetIdAssociator::setConditions ( const DetIdAssociatorRecord )
inlinevirtual

Reimplemented in MuonDetIdAssociator.

Definition at line 122 of file DetIdAssociator.h.

virtual void DetIdAssociator::setGeometry ( const DetIdAssociatorRecord )
pure virtual
const FiducialVolume & DetIdAssociator::volume ( void  ) const

get active detector volume

Definition at line 353 of file DetIdAssociator.cc.

Member Data Documentation

std::vector<DetId> DetIdAssociator::container_
protected

Definition at line 159 of file DetIdAssociator.h.

const double DetIdAssociator::etaBinSize_
protected

Definition at line 161 of file DetIdAssociator.h.

std::vector<std::pair<unsigned int,unsigned int> > DetIdAssociator::lookupMap_
protected

Definition at line 158 of file DetIdAssociator.h.

double DetIdAssociator::maxEta_
protected

Definition at line 162 of file DetIdAssociator.h.

double DetIdAssociator::minTheta_
protected

Definition at line 163 of file DetIdAssociator.h.

const int DetIdAssociator::nEta_
protected

Definition at line 154 of file DetIdAssociator.h.

const int DetIdAssociator::nPhi_
protected

Definition at line 153 of file DetIdAssociator.h.

bool DetIdAssociator::theMapIsValid_
protected

Definition at line 160 of file DetIdAssociator.h.

FiducialVolume DetIdAssociator::volume_
protected

Definition at line 168 of file DetIdAssociator.h.