CMS 3D CMS Logo

CaloSubdetectorGeometry.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOGEOMETRY_CALOSUBDETECTORGEOMETRY_H
2 #define GEOMETRY_CALOGEOMETRY_CALOSUBDETECTORGEOMETRY_H 1
3 
4 #include <vector>
5 #include <set>
6 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
7 #include <atomic>
8 #endif
13 
15 
16 
25 
26 public:
27  typedef std::vector<CaloCellGeometry const *> CellSet;
29 
30  typedef std::set<DetId> DetIdSet;
31 
32 
36 
37  typedef std::vector<CCGFloat> TrVec ;
38  typedef std::vector<unsigned int> IVec ;
39  typedef std::vector<CCGFloat> DimVec ;
40 
42 
44  virtual ~CaloSubdetectorGeometry();
45 
49 
50  virtual void newCell( const GlobalPoint& f1 ,
51  const GlobalPoint& f2 ,
52  const GlobalPoint& f3 ,
53  const CCGFloat* parm ,
54  const DetId& detId ) = 0 ;
55 
57  virtual bool present( const DetId& id ) const;
58 
60  virtual const CaloCellGeometry* getGeometry( const DetId& id ) const ;
61 
66  virtual const std::vector<DetId>& getValidDetIds( DetId::Detector det = DetId::Detector(0) , int subdet = 0 ) const ;
67 
68  // Get closest cell, etc...
69  virtual DetId getClosestCell( const GlobalPoint& r ) const ;
70 
77  virtual DetIdSet getCells( const GlobalPoint& r, double dR ) const ;
78  virtual CellSet getCellSet( const GlobalPoint& r, double dR ) const ;
79 
80  CCGFloat deltaPhi( const DetId& detId ) const ;
81 
82  CCGFloat deltaEta( const DetId& detId ) const ;
83 
85 
87 
88  void allocatePar( ParVec::size_type n, unsigned int m ) ;
89 
90  ParMgr* parMgr() { return m_parMgr ; }
91  const ParMgr* parMgrConst() const { return m_parMgr ; }
92 
93  ParVecVec& parVecVec() { return m_parVecVec ; }
94  const ParVecVec& parVecVec() const { return m_parVecVec ; }
95 
96  virtual unsigned int numberOfShapes() const { return 1 ; }
97  virtual unsigned int numberOfParametersPerShape() const { return 1 ; }
98  virtual unsigned int numberOfTransformParms() const { return 6 ; }
99 
100  virtual void fillDefaultNamedParameters() const { return ; }
101 
102  virtual void getSummary( TrVec& trVector,
103  IVec& iVector,
104  DimVec& dimVector,
105  IVec& dinsVector ) const ;
106 
107  virtual void initializeParms() { return ; }
108 
109 protected:
110 
111  virtual unsigned int indexFor(const DetId& id) const;
112  virtual unsigned int sizeForDenseIndex(const DetId& id) const;
113 
114  virtual const CaloCellGeometry* cellGeomPtr( uint32_t index ) const = 0 ;
115 
116  ParVecVec m_parVecVec ;
117 
118  static CCGFloat deltaR( const GlobalPoint& p1,
119  const GlobalPoint& p2 )
120  { return reco::deltaR( p1, p2 ) ; }
121 
122  void addValidID(const DetId& id);
123 
124  std::vector<DetId> m_validIds ;
125 
126 private:
127 
128  ParMgr* m_parMgr ;
129 
131 
132  bool m_sortedIds ;
133 
134 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
135  mutable std::atomic<std::vector<CCGFloat>*> m_deltaPhi ;
136  mutable std::atomic<std::vector<CCGFloat>*> m_deltaEta ;
137 #else
138  mutable std::vector<CCGFloat>* m_deltaPhi ;
139  mutable std::vector<CCGFloat>* m_deltaEta ;
140 #endif
141 };
142 
143 
144 #endif
CaloCellGeometry::CornersMgr * m_cmgr
std::vector< CCGFloat > DimVec
std::vector< ParVec > ParVecVec
virtual unsigned int numberOfParametersPerShape() const
CaloSubdetectorGeometry & operator=(const CaloSubdetectorGeometry &)=delete
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)=0
const ParMgr * parMgrConst() const
CCGFloat deltaPhi(const DetId &detId) const
MgrType::size_type size_type
Definition: EZArrayFL.h:30
std::vector< unsigned int > IVec
std::vector< CaloCellGeometry const * > CellSet
std::vector< CCGFloat > TrVec
virtual void fillDefaultNamedParameters() const
CCGFloat deltaEta(const DetId &detId) const
CaloCellGeometry::CCGFloat CCGFloat
void allocatePar(ParVec::size_type n, unsigned int m)
virtual CellSet getCellSet(const GlobalPoint &r, double dR) const
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
virtual bool present(const DetId &id) const
is this detid present in the geometry?
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
virtual unsigned int numberOfShapes() const
std::vector< DetId > m_validIds
std::atomic< std::vector< CCGFloat > * > m_deltaPhi
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const =0
CaloCellGeometry::ParVec ParVec
double p2[4]
Definition: TauolaWrapper.h:90
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
void addValidID(const DetId &id)
CaloCellGeometry::CornersMgr * cornersMgr()
Detector
Definition: DetId.h:24
CaloCellGeometry::ParVecVec ParVecVec
Definition: EZMgrFL.h:8
const ParVecVec & parVecVec() const
CaloCellGeometry::ParMgr ParMgr
static CCGFloat deltaR(const GlobalPoint &p1, const GlobalPoint &p2)
return(e1-e2)*(e1-e2)+dp *dp
virtual unsigned int indexFor(const DetId &id) const
virtual ~CaloSubdetectorGeometry()
The base class DOES assume that it owns the CaloCellGeometry objects.
double p1[4]
Definition: TauolaWrapper.h:89
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
std::atomic< std::vector< CCGFloat > * > m_deltaEta
virtual unsigned int numberOfTransformParms() const
virtual unsigned int sizeForDenseIndex(const DetId &id) const