CMS 3D CMS Logo

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

#include <DetIdAssociator.h>

Inheritance diagram for HDetIdAssociator:
HCaloDetIdAssociator HEcalDetIdAssociator HHcalDetIdAssociator

Public Member Functions

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

virtual void buildMap ()
 
virtual void check_setup ()
 
virtual std::set< DetIdgetASetOfValidDetIds ()=0
 
virtual std::vector< GlobalPointgetDetIdPoints (const DetId &)=0
 
virtual GlobalPoint getPosition (const DetId &)=0
 
virtual bool insideElement (const GlobalPoint &, const DetId &)=0
 
virtual bool nearElement (const GlobalPoint &point, const DetId &id, const double distance)
 

Protected Attributes

const double etaBinSize_
 
PropagatorivProp_
 
const int nEta_
 
const int nPhi_
 
std::vector< std::vector
< std::set< DetId > > > * 
theMap_
 

Detailed Description

Definition at line 30 of file DetIdAssociator.h.

Constructor & Destructor Documentation

HDetIdAssociator::HDetIdAssociator ( )
inline

Definition at line 32 of file DetIdAssociator.h.

32 :theMap_(0),nPhi_(0),nEta_(0),etaBinSize_(0),ivProp_(0){};
const double etaBinSize_
std::vector< std::vector< std::set< DetId > > > * theMap_
Propagator * ivProp_
HDetIdAssociator::HDetIdAssociator ( const int  nPhi,
const int  nEta,
const double  etaBinSize 
)
inline

Definition at line 33 of file DetIdAssociator.h.

const double etaBinSize_
std::vector< std::vector< std::set< DetId > > > * theMap_
Propagator * ivProp_
virtual HDetIdAssociator::~HDetIdAssociator ( )
inlinevirtual

Definition at line 36 of file DetIdAssociator.h.

36 {};

Member Function Documentation

void HDetIdAssociator::buildMap ( )
protectedvirtual

Definition at line 249 of file DetIdAssociator.cc.

virtual void HDetIdAssociator::check_setup ( )
inlineprotectedvirtual

Reimplemented in HCaloDetIdAssociator.

Definition at line 70 of file DetIdAssociator.h.

References etaBinSize_, Exception, ivProp_, nEta_, and nPhi_.

Referenced by HCaloDetIdAssociator::check_setup().

71  {
72  if (nEta_==0) throw cms::Exception("FatalError") << "Number of eta bins is not set.\n";
73  if (nPhi_==0) throw cms::Exception("FatalError") << "Number of phi bins is not set.\n";
74  if (ivProp_==0) throw cms::Exception("FatalError") << "Track propagator is not defined\n";
75  if (etaBinSize_==0) throw cms::Exception("FatalError") << "Eta bin size is not set.\n";
76  }
const double etaBinSize_
Propagator * ivProp_
virtual std::set<DetId> HDetIdAssociator::getASetOfValidDetIds ( )
protectedpure virtual
std::set< DetId > HDetIdAssociator::getCrossedDetIds ( const std::set< DetId > &  inset,
const std::vector< GlobalPoint > &  trajectory 
)
virtual

Definition at line 351 of file DetIdAssociator.cc.

virtual std::vector<GlobalPoint> HDetIdAssociator::getDetIdPoints ( const DetId )
protectedpure virtual

Implemented in HCaloDetIdAssociator.

std::set< DetId > HDetIdAssociator::getDetIdsCloseToAPoint ( const GlobalPoint direction,
const int  idR = 0 
)
virtual

Definition at line 143 of file DetIdAssociator.cc.

Referenced by getDetIdsCloseToAPoint().

virtual std::set<DetId> HDetIdAssociator::getDetIdsCloseToAPoint ( const GlobalPoint point,
const double  dR = 0 
)
inlinevirtual

Definition at line 44 of file DetIdAssociator.h.

References PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, etaBinSize_, getDetIdsCloseToAPoint(), and nPhi_.

46  {
47  int etaIdR = int(dR/etaBinSize_);
48  int phiIdR = int(dR/(2*3.1416)*nPhi_);
49  if (etaIdR>phiIdR)
50  return getDetIdsCloseToAPoint(point, 1+etaIdR);
51  else
52  return getDetIdsCloseToAPoint(point, 1+phiIdR);
53  }
virtual std::set< DetId > getDetIdsCloseToAPoint(const GlobalPoint &, const int idR=0)
const double etaBinSize_
std::set< DetId > HDetIdAssociator::getDetIdsInACone ( const std::set< DetId > &  inset,
const std::vector< GlobalPoint > &  trajectory,
const double  dR 
)
virtual

Definition at line 306 of file DetIdAssociator.cc.

std::set< DetId > HDetIdAssociator::getMaxEDetId ( const std::set< DetId > &  inset,
edm::Handle< CaloTowerCollection caloTowers 
)
virtual

Definition at line 363 of file DetIdAssociator.cc.

std::set< DetId > HDetIdAssociator::getMaxEDetId ( const std::set< DetId > &  inset,
edm::Handle< HBHERecHitCollection recHits 
)
virtual

Definition at line 398 of file DetIdAssociator.cc.

virtual GlobalPoint HDetIdAssociator::getPosition ( const DetId )
protectedpure virtual

Implemented in HCaloDetIdAssociator.

Referenced by nearElement().

std::vector< GlobalPoint > HDetIdAssociator::getTrajectory ( const FreeTrajectoryState ftsStart,
const std::vector< GlobalPoint > &  surfaces 
)
virtual

Definition at line 25 of file DetIdAssociator.cc.

int HDetIdAssociator::iEta ( const GlobalPoint point)
virtual

Definition at line 197 of file DetIdAssociator.cc.

virtual bool HDetIdAssociator::insideElement ( const GlobalPoint ,
const DetId  
)
protectedpure virtual

Implemented in HCaloDetIdAssociator.

int HDetIdAssociator::iPhi ( const GlobalPoint point)
virtual

Definition at line 241 of file DetIdAssociator.cc.

virtual bool HDetIdAssociator::nearElement ( const GlobalPoint point,
const DetId id,
const double  distance 
)
inlineprotectedvirtual

Definition at line 84 of file DetIdAssociator.h.

References HLT_25ns10e33_v2_cff::distance, PV3DBase< T, PVType, FrameType >::eta(), getPosition(), PV3DBase< T, PVType, FrameType >::phi(), funct::pow(), and mathSSE::sqrt().

85  {
86  GlobalPoint center = getPosition(id);
87  return sqrt(pow(point.eta()-center.eta(),2)+pow(point.phi()-center.phi(),2)) < distance;
88  };
virtual GlobalPoint getPosition(const DetId &)=0
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T sqrt(T t)
Definition: SSEVec.h:18
T eta() const
Definition: PV3DBase.h:76
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
virtual void HDetIdAssociator::setPropagator ( Propagator ptr)
inlinevirtual

Definition at line 67 of file DetIdAssociator.h.

References ivProp_.

67 { ivProp_ = ptr; };
Propagator * ivProp_

Member Data Documentation

const double HDetIdAssociator::etaBinSize_
protected

Definition at line 93 of file DetIdAssociator.h.

Referenced by check_setup(), and getDetIdsCloseToAPoint().

Propagator* HDetIdAssociator::ivProp_
protected

Definition at line 94 of file DetIdAssociator.h.

Referenced by check_setup(), and setPropagator().

const int HDetIdAssociator::nEta_
protected

Definition at line 92 of file DetIdAssociator.h.

Referenced by check_setup().

const int HDetIdAssociator::nPhi_
protected

Definition at line 91 of file DetIdAssociator.h.

Referenced by check_setup(), and getDetIdsCloseToAPoint().

std::vector<std::vector<std::set<DetId> > >* HDetIdAssociator::theMap_
protected

Definition at line 88 of file DetIdAssociator.h.