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 <memory>
5 #include <vector>
6 #include <set>
7 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
8 #include <atomic>
9 #endif
14 
16 
17 
26 
27 public:
28  typedef std::vector<std::shared_ptr<const CaloCellGeometry> > CellSet;
30 
31  typedef std::set<DetId> DetIdSet;
32 
33 
37 
38  typedef std::vector<CCGFloat> TrVec ;
39  typedef std::vector<unsigned int> IVec ;
40  typedef std::vector<CCGFloat> DimVec ;
41 
43 
45  virtual ~CaloSubdetectorGeometry();
46 
50 
51  virtual void newCell( const GlobalPoint& f1 ,
52  const GlobalPoint& f2 ,
53  const GlobalPoint& f3 ,
54  const CCGFloat* parm ,
55  const DetId& detId ) = 0 ;
56 
58  virtual bool present( const DetId& id ) const;
59 
61  virtual std::shared_ptr<const CaloCellGeometry> getGeometry(const DetId& id) const;
62 
67  virtual const std::vector<DetId>& getValidDetIds( DetId::Detector det = DetId::Detector(0) , int subdet = 0 ) const ;
68 
69  // Get closest cell, etc...
70  virtual DetId getClosestCell( const GlobalPoint& r ) const;
71 
78  virtual DetIdSet getCells( const GlobalPoint& r, double dR ) const;
79  virtual CellSet getCellSet( const GlobalPoint& r, double dR ) const;
80 
81  CCGFloat deltaPhi( const DetId& detId ) const;
82 
83  CCGFloat deltaEta( const DetId& detId ) const;
84 
86 
88 
89  void allocatePar( ParVec::size_type n, unsigned int m ) ;
90 
91  ParMgr* parMgr() { return m_parMgr ; }
92  const ParMgr* parMgrConst() const { return m_parMgr ; }
93 
94  ParVecVec& parVecVec() { return m_parVecVec ; }
95  const ParVecVec& parVecVec() const { return m_parVecVec ; }
96 
97  virtual unsigned int numberOfShapes() const { return 1 ; }
98  virtual unsigned int numberOfParametersPerShape() const { return 1 ; }
99  virtual unsigned int numberOfTransformParms() const { return 6 ; }
100 
101  virtual void fillDefaultNamedParameters() const { return ; }
102 
103  virtual void getSummary( TrVec& trVector,
104  IVec& iVector,
105  DimVec& dimVector,
106  IVec& dinsVector ) const;
107 
108  virtual void initializeParms() { return ; }
109 
110 protected:
111 
112  virtual unsigned int indexFor(const DetId& id) const;
113  virtual unsigned int sizeForDenseIndex(const DetId& id) const;
114 
115  virtual const CaloCellGeometry* getGeometryRawPtr(uint32_t index) const = 0;
116  virtual std::shared_ptr<const CaloCellGeometry> cellGeomPtr( uint32_t index ) const;
117 
118  ParVecVec m_parVecVec ;
119 
120  static CCGFloat deltaR( const GlobalPoint& p1,
121  const GlobalPoint& p2 )
122  { return reco::deltaR( p1, p2 ) ; }
123 
124  void addValidID(const DetId& id);
125 
126  std::vector<DetId> m_validIds ;
127 
128 private:
129 
130  ParMgr* m_parMgr ;
131 
133 
134  bool m_sortedIds ;
135 
136 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
137  mutable std::atomic<std::vector<CCGFloat>*> m_deltaPhi ;
138  mutable std::atomic<std::vector<CCGFloat>*> m_deltaEta ;
139 #else
140  mutable std::vector<CCGFloat>* m_deltaPhi ;
141  mutable std::vector<CCGFloat>* m_deltaEta ;
142 #endif
143 };
144 
145 
146 #endif
virtual const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const =0
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< 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)
return((rh^lh)&mask)
std::vector< std::shared_ptr< const CaloCellGeometry > > CellSet
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 std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
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
CaloCellGeometry::ParVec ParVec
double p2[4]
Definition: TauolaWrapper.h:90
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
void addValidID(const DetId &id)
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.
CaloCellGeometry::CornersMgr * cornersMgr()
Detector
Definition: DetId.h:26
CaloCellGeometry::ParVecVec ParVecVec
Definition: EZMgrFL.h:8
const ParVecVec & parVecVec() const
CaloCellGeometry::ParMgr ParMgr
static CCGFloat deltaR(const GlobalPoint &p1, const GlobalPoint &p2)
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