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 
23 public:
24  typedef std::vector<std::shared_ptr<const CaloCellGeometry> > CellSet;
26 
27  typedef std::set<DetId> DetIdSet;
28 
32 
33  typedef std::vector<CCGFloat> TrVec;
34  typedef std::vector<unsigned int> IVec;
35  typedef std::vector<CCGFloat> DimVec;
36 
38 
40  virtual ~CaloSubdetectorGeometry();
41 
45 
46  virtual void newCell(const GlobalPoint& f1,
47  const GlobalPoint& f2,
48  const GlobalPoint& f3,
49  const CCGFloat* parm,
50  const DetId& detId) = 0;
51 
53  virtual bool present(const DetId& id) const;
54 
56  virtual std::shared_ptr<const CaloCellGeometry> getGeometry(const DetId& id) const;
57 
62  virtual const std::vector<DetId>& getValidDetIds(DetId::Detector det = DetId::Detector(0), int subdet = 0) const;
63 
64  // Get closest cell, etc...
65  virtual DetId getClosestCell(const GlobalPoint& r) const;
66 
73  virtual DetIdSet getCells(const GlobalPoint& r, double dR) const;
74  virtual CellSet getCellSet(const GlobalPoint& r, double dR) const;
75 
76  CCGFloat deltaPhi(const DetId& detId) const;
77 
78  CCGFloat deltaEta(const DetId& detId) const;
79 
81 
83 
84  void allocatePar(ParVec::size_type n, unsigned int m);
85 
86  ParMgr* parMgr() { return m_parMgr; }
87  const ParMgr* parMgrConst() const { return m_parMgr; }
88 
90  const ParVecVec& parVecVec() const { return m_parVecVec; }
91 
92  virtual unsigned int numberOfShapes() const { return 1; }
93  virtual unsigned int numberOfParametersPerShape() const { return 1; }
94  virtual unsigned int numberOfTransformParms() const { return 6; }
95 
96  virtual void fillDefaultNamedParameters() const { return; }
97 
98  virtual void getSummary(TrVec& trVector, IVec& iVector, DimVec& dimVector, IVec& dinsVector) const;
99 
100  virtual void initializeParms() { return; }
101 
102 protected:
103  virtual unsigned int indexFor(const DetId& id) const;
104  virtual unsigned int sizeForDenseIndex(const DetId& id) const;
105 
106  virtual const CaloCellGeometry* getGeometryRawPtr(uint32_t index) const = 0;
107  virtual std::shared_ptr<const CaloCellGeometry> cellGeomPtr(uint32_t index) const;
108 
110 
111  static CCGFloat deltaR(const GlobalPoint& p1, const GlobalPoint& p2) { return reco::deltaR(p1, p2); }
112 
113  void addValidID(const DetId& id);
114 
115  std::vector<DetId> m_validIds;
116 
117 private:
119 
121 
123 
124 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
125  mutable std::atomic<std::vector<CCGFloat>*> m_deltaPhi;
126  mutable std::atomic<std::vector<CCGFloat>*> m_deltaEta;
127 #else
128  mutable std::vector<CCGFloat>* m_deltaPhi;
129  mutable std::vector<CCGFloat>* m_deltaEta;
130 #endif
131 };
132 
133 #endif
CaloSubdetectorGeometry::initializeParms
virtual void initializeParms()
Definition: CaloSubdetectorGeometry.h:100
CaloSubdetectorGeometry::numberOfParametersPerShape
virtual unsigned int numberOfParametersPerShape() const
Definition: CaloSubdetectorGeometry.h:93
CaloCellGeometry::CCGFloat
float CCGFloat
Definition: CaloCellGeometry.h:52
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
CaloSubdetectorGeometry::m_cmgr
CaloCellGeometry::CornersMgr * m_cmgr
Definition: CaloSubdetectorGeometry.h:120
CaloSubdetectorGeometry::DetIdSet
std::set< DetId > DetIdSet
Definition: CaloSubdetectorGeometry.h:27
CaloSubdetectorGeometry::operator=
CaloSubdetectorGeometry & operator=(const CaloSubdetectorGeometry &)=delete
CaloSubdetectorGeometry::DimVec
std::vector< CCGFloat > DimVec
Definition: CaloSubdetectorGeometry.h:35
CaloSubdetectorGeometry::TrVec
std::vector< CCGFloat > TrVec
Definition: CaloSubdetectorGeometry.h:33
CaloSubdetectorGeometry::numberOfTransformParms
virtual unsigned int numberOfTransformParms() const
Definition: CaloSubdetectorGeometry.h:94
CaloSubdetectorGeometry::newCell
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)=0
CaloSubdetectorGeometry::IVec
std::vector< unsigned int > IVec
Definition: CaloSubdetectorGeometry.h:34
EZArrayFL
Definition: EZArrayFL.h:20
CaloSubdetectorGeometry::allocatePar
void allocatePar(ParVec::size_type n, unsigned int m)
Definition: CaloSubdetectorGeometry.cc:113
CaloSubdetectorGeometry::numberOfShapes
virtual unsigned int numberOfShapes() const
Definition: CaloSubdetectorGeometry.h:92
CaloSubdetectorGeometry::parVecVec
const ParVecVec & parVecVec() const
Definition: CaloSubdetectorGeometry.h:90
deltaR.h
EZArrayFL< GlobalPoint >::size_type
MgrType::size_type size_type
Definition: EZArrayFL.h:27
DetId
Definition: DetId.h:17
CaloSubdetectorGeometry::CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloSubdetectorGeometry.h:25
CaloSubdetectorGeometry::getCells
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
Definition: CaloSubdetectorGeometry.cc:66
CaloSubdetectorGeometry::deltaPhi
CCGFloat deltaPhi(const DetId &detId) const
Definition: CaloSubdetectorGeometry.cc:180
CaloSubdetectorGeometry::CellSet
std::vector< std::shared_ptr< const CaloCellGeometry > > CellSet
Definition: CaloSubdetectorGeometry.h:24
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
CaloSubdetectorGeometry::m_validIds
std::vector< DetId > m_validIds
Definition: CaloSubdetectorGeometry.h:115
CaloSubdetectorGeometry::m_deltaPhi
std::atomic< std::vector< CCGFloat > * > m_deltaPhi
Definition: CaloSubdetectorGeometry.h:125
p2
double p2[4]
Definition: TauolaWrapper.h:90
Point3DBase< float, GlobalTag >
CaloSubdetectorGeometry::getValidDetIds
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)
Definition: CaloSubdetectorGeometry.cc:32
CaloSubdetectorGeometry::ParVec
CaloCellGeometry::ParVec ParVec
Definition: CaloSubdetectorGeometry.h:30
CaloSubdetectorGeometry::present
virtual bool present(const DetId &id) const
is this detid present in the geometry?
Definition: CaloSubdetectorGeometry.cc:40
CaloCellGeometry
Definition: CaloCellGeometry.h:50
DeadROC_duringRun.f2
f2
Definition: DeadROC_duringRun.py:220
CaloSubdetectorGeometry::addValidID
void addValidID(const DetId &id)
Definition: CaloSubdetectorGeometry.cc:27
p1
double p1[4]
Definition: TauolaWrapper.h:89
CaloSubdetectorGeometry::m_parMgr
ParMgr * m_parMgr
Definition: CaloSubdetectorGeometry.h:118
DetId::Detector
Detector
Definition: DetId.h:24
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
CaloSubdetectorGeometry::getClosestCell
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: CaloSubdetectorGeometry.cc:44
CaloSubdetectorGeometry::CaloSubdetectorGeometry
CaloSubdetectorGeometry()
Definition: CaloSubdetectorGeometry.cc:15
CaloSubdetectorGeometry::indexFor
virtual unsigned int indexFor(const DetId &id) const
Definition: CaloSubdetectorGeometry.cc:254
alignCSCRings.r
r
Definition: alignCSCRings.py:93
CaloSubdetectorGeometry::~CaloSubdetectorGeometry
virtual ~CaloSubdetectorGeometry()
The base class DOES assume that it owns the CaloCellGeometry objects.
Definition: CaloSubdetectorGeometry.cc:18
CaloCellGeometry.h
CaloCellGeometry::ParVecVec
std::vector< ParVec > ParVecVec
Definition: CaloCellGeometry.h:61
CaloSubdetectorGeometry::cornersMgr
CaloCellGeometry::CornersMgr * cornersMgr()
Definition: CaloSubdetectorGeometry.h:82
CaloSubdetectorGeometry::getSummary
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
Definition: CaloSubdetectorGeometry.cc:118
CaloSubdetectorGeometry::m_sortedIds
bool m_sortedIds
Definition: CaloSubdetectorGeometry.h:122
CaloSubdetectorGeometry::ParVecVec
CaloCellGeometry::ParVecVec ParVecVec
Definition: CaloSubdetectorGeometry.h:31
DetId.h
CaloSubdetectorGeometry::ParMgr
CaloCellGeometry::ParMgr ParMgr
Definition: CaloSubdetectorGeometry.h:29
CaloSubdetectorGeometry::deltaR
static CCGFloat deltaR(const GlobalPoint &p1, const GlobalPoint &p2)
Definition: CaloSubdetectorGeometry.h:111
CaloSubdetectorGeometry::getCellSet
virtual CellSet getCellSet(const GlobalPoint &r, double dR) const
Definition: CaloSubdetectorGeometry.cc:96
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
CaloSubdetectorGeometry::parMgr
ParMgr * parMgr()
Definition: CaloSubdetectorGeometry.h:86
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
EZMgrFL
Definition: EZMgrFL.h:8
CaloSubdetectorGeometry::fillDefaultNamedParameters
virtual void fillDefaultNamedParameters() const
Definition: CaloSubdetectorGeometry.h:96
CaloSubdetectorGeometry::getGeometryRawPtr
virtual const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const =0
CaloSubdetectorGeometry::deltaEta
CCGFloat deltaEta(const DetId &detId) const
Definition: CaloSubdetectorGeometry.cc:220
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
CaloSubdetectorGeometry::allocateCorners
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
Definition: CaloSubdetectorGeometry.cc:106
CaloSubdetectorGeometry::parVecVec
ParVecVec & parVecVec()
Definition: CaloSubdetectorGeometry.h:89
CaloSubdetectorGeometry::cellGeomPtr
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
Definition: CaloSubdetectorGeometry.cc:260
CaloSubdetectorGeometry::m_deltaEta
std::atomic< std::vector< CCGFloat > * > m_deltaEta
Definition: CaloSubdetectorGeometry.h:126
DeadROC_duringRun.f1
f1
Definition: DeadROC_duringRun.py:219
CaloSubdetectorGeometry::parMgrConst
const ParMgr * parMgrConst() const
Definition: CaloSubdetectorGeometry.h:87
GlobalPoint.h
CaloSubdetectorGeometry::sizeForDenseIndex
virtual unsigned int sizeForDenseIndex(const DetId &id) const
Definition: CaloSubdetectorGeometry.cc:256
CaloSubdetectorGeometry::m_parVecVec
ParVecVec m_parVecVec
Definition: CaloSubdetectorGeometry.h:109