CMS 3D CMS Logo

EcalEndcapGeometry.h
Go to the documentation of this file.
1 #ifndef EcalEndcapGeometry_h
2 #define EcalEndcapGeometry_h
3 
14 #include <vector>
15 #include <map>
16 #include <atomic>
17 
18 class TruncatedPyramid;
19 
21 {
22  public:
23 
24  typedef std::vector<TruncatedPyramid> CellVec ;
25 
29 
34 
35  typedef EZArrayFL<EBDetId> OrderedListOfEBDetId ; // like an stl vector: begin(), end(), [i]
36 
37  typedef std::vector<OrderedListOfEBDetId*> VecOrdListEBDetIdPtr ;
38 
40 
41  typedef EEDetId DetIdType ;
42 
44 
45  enum { k_NumberOfShapes = 1 } ;
46 
48 
49 
50  static std::string dbString() { return "PEcalEndcapRcd" ; }
51 
52  unsigned int numberOfShapes() const override { return k_NumberOfShapes ; }
53  unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape ; }
54 
56 
57  ~EcalEndcapGeometry() override;
58 
59  int getNumberOfModules() const { return _nnmods ; }
60 
61  int getNumberOfCrystalPerModule() const { return _nncrys ; }
62 
63  void setNumberOfModules( const int nnmods ) { _nnmods=nnmods ; }
64 
65  void setNumberOfCrystalPerModule( const int nncrys ) { _nncrys=nncrys ; }
66 
67  const OrderedListOfEBDetId* getClosestBarrelCells( EEDetId id ) const;
68 
69  // Get closest cell, etc...
70  DetId getClosestCell( const GlobalPoint& r ) const override ;
71 
73  double dR ) const override ;
74 
75  void initializeParms() override ;
76 
77  CCGFloat avgAbsZFrontFaceCenter() const ; // average over both endcaps. Positive!
78 
79  static std::string hitString() { return "EcalHitsEE" ; }
80 
81  static std::string producerTag() { return "EcalEndcap" ; }
82 
83  static unsigned int numberOfAlignments() { return 4 ; }
84 
85  static unsigned int alignmentTransformIndexLocal( const DetId& id ) ;
86 
87  static unsigned int alignmentTransformIndexGlobal( const DetId& id ) ;
88 
89  static DetId detIdFromLocalAlignmentIndex( unsigned int iLoc ) ;
90 
91  static void localCorners( Pt3DVec& lc ,
92  const CCGFloat* pv ,
93  unsigned int i ,
94  Pt3D& ref ) ;
95 
96  void newCell( const GlobalPoint& f1 ,
97  const GlobalPoint& f2 ,
98  const GlobalPoint& f3 ,
99  const CCGFloat* parm ,
100  const DetId& detId ) override ;
101 
102  bool present( const DetId& id ) const override;
103 
104  protected:
105 
106  // Modify the RawPtr class
107  const CaloCellGeometry* getGeometryRawPtr (uint32_t index) const override;
108  private:
109 
110  static int myPhi( int i ) { i+=720; return ( 1 + (i-1)%360 ) ; }
111 
113  int _nnmods;
114 
116  int _nncrys;
117 
118  CCGFloat zeP, zeN;
119 
120  CCGFloat m_wref, m_xlo[2], m_xhi[2], m_ylo[2], m_yhi[2], m_xoff[2], m_yoff[2], m_del ;
121 
122  unsigned int m_nref ;
123 
124  unsigned int xindex( CCGFloat x, CCGFloat z ) const ;
125  unsigned int yindex( CCGFloat y, CCGFloat z ) const ;
126 
127  EEDetId gId( float x, float y, float z ) const ;
128 
129  mutable std::atomic<EZMgrFL<EBDetId>*> m_borderMgr ;
130 
131  mutable std::atomic<VecOrdListEBDetIdPtr*> m_borderPtrVec ;
132 
133  CMS_THREAD_GUARD(m_check) mutable CCGFloat m_avgZ ;
134  mutable std::atomic<bool> m_check;
135 
136  CellVec m_cellVec ;
137 } ;
138 
139 
140 #endif
141 
int _nncrys
number of crystals per module
void setNumberOfCrystalPerModule(const int nncrys)
bool present(const DetId &id) const override
is this detid present in the geometry?
~EcalEndcapGeometry() override
static unsigned int numberOfAlignments()
int getNumberOfModules() const
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
CaloCellGeometry::Pt3D Pt3D
CaloSubdetectorGeometry::DetIdSet getCells(const GlobalPoint &r, double dR) const override
Get a list of all cells within a dR of the given cell.
static std::string producerTag()
std::vector< Pt3D > Pt3DVec
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
void setNumberOfModules(const int nnmods)
CCGFloat avgAbsZFrontFaceCenter() const
std::atomic< EZMgrFL< EBDetId > * > m_borderMgr
static unsigned int alignmentTransformIndexLocal(const DetId &id)
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
unsigned int yindex(CCGFloat y, CCGFloat z) const
CaloCellGeometry::CCGFloat CCGFloat
std::atomic< VecOrdListEBDetIdPtr * > m_borderPtrVec
CaloCellGeometry::Pt3DVec Pt3DVec
#define CMS_THREAD_GUARD(_var_)
def pv(vc)
Definition: MetAnalyzer.py:7
std::vector< OrderedListOfEBDetId * > VecOrdListEBDetIdPtr
std::vector< TruncatedPyramid > CellVec
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
unsigned int numberOfParametersPerShape() const override
EcalEndcapNumberingScheme NumberingScheme
EEAlignmentRcd AlignmentRecord
int _nnmods
number of modules
unsigned int xindex(CCGFloat x, CCGFloat z) const
Definition: DetId.h:18
EcalEndcapGeometryRecord AlignedRecord
int getNumberOfCrystalPerModule() const
static int myPhi(int i)
HepGeom::Point3D< CCGFloat > Pt3D
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
std::atomic< bool > m_check
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
IdealGeometryRecord IdealRecord
unsigned int numberOfShapes() const override
static std::string hitString()
EZArrayFL< EBDetId > OrderedListOfEBDetId
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
DetId getClosestCell(const GlobalPoint &r) const override
EEDetId gId(float x, float y, float z) const
static std::string dbString()
PEcalEndcapRcd PGeometryRecord
void initializeParms() override