1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
#ifndef EcalEndcapGeometry_h
#define EcalEndcapGeometry_h
#include "Geometry/CaloGeometry/interface/EZArrayFL.h"
#include "DataFormats/EcalDetId/interface/EEDetId.h"
#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"
#include "Geometry/Records/interface/EcalEndcapGeometryRecord.h"
#include "CondFormats/AlignmentRecord/interface/EEAlignmentRcd.h"
#include "Geometry/EcalCommonData/interface/EcalEndcapNumberingScheme.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/Records/interface/PEcalEndcapRcd.h"
#include "FWCore/Utilities/interface/thread_safety_macros.h"
#include <vector>
#include <map>
#include <atomic>
class TruncatedPyramid;
class EcalEndcapGeometry final : public CaloSubdetectorGeometry {
public:
typedef std::vector<TruncatedPyramid> CellVec;
typedef CaloCellGeometry::CCGFloat CCGFloat;
typedef CaloCellGeometry::Pt3D Pt3D;
typedef CaloCellGeometry::Pt3DVec Pt3DVec;
typedef IdealGeometryRecord IdealRecord;
typedef EcalEndcapGeometryRecord AlignedRecord;
typedef EEAlignmentRcd AlignmentRecord;
typedef PEcalEndcapRcd PGeometryRecord;
typedef EZArrayFL<EBDetId> OrderedListOfEBDetId; // like an stl vector: begin(), end(), [i]
typedef std::vector<OrderedListOfEBDetId*> VecOrdListEBDetIdPtr;
typedef EcalEndcapNumberingScheme NumberingScheme;
typedef EEDetId DetIdType;
static constexpr int k_NumberOfCellsForCorners = EEDetId::kSizeForDenseIndexing;
static constexpr int k_NumberOfShapes = 1;
static constexpr int k_NumberOfParametersPerShape = 11;
static std::string dbString() { return "PEcalEndcapRcd"; }
unsigned int numberOfShapes() const override { return k_NumberOfShapes; }
unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape; }
EcalEndcapGeometry();
~EcalEndcapGeometry() override;
int getNumberOfModules() const { return _nnmods; }
int getNumberOfCrystalPerModule() const { return _nncrys; }
void setNumberOfModules(const int nnmods) { _nnmods = nnmods; }
void setNumberOfCrystalPerModule(const int nncrys) { _nncrys = nncrys; }
const OrderedListOfEBDetId* getClosestBarrelCells(EEDetId id) const;
// Get closest cell, etc...
DetId getClosestCell(const GlobalPoint& r) const override;
CaloSubdetectorGeometry::DetIdSet getCells(const GlobalPoint& r, double dR) const override;
void initializeParms() override;
CCGFloat avgAbsZFrontFaceCenter() const; // average over both endcaps. Positive!
static std::string hitString() { return "EcalHitsEE"; }
static std::string producerTag() { return "EcalEndcap"; }
static unsigned int numberOfAlignments() { return 4; }
static unsigned int alignmentTransformIndexLocal(const DetId& id);
static unsigned int alignmentTransformIndexGlobal(const DetId& id);
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc);
static void localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref);
void newCell(const GlobalPoint& f1,
const GlobalPoint& f2,
const GlobalPoint& f3,
const CCGFloat* parm,
const DetId& detId) override;
bool present(const DetId& id) const override;
protected:
// Modify the RawPtr class
CaloCellGeometryPtr getGeometryRawPtr(uint32_t index) const override;
private:
static int myPhi(int i) {
i += 720;
return (1 + (i - 1) % 360);
}
/// number of modules
int _nnmods;
/// number of crystals per module
int _nncrys;
CCGFloat zeP, zeN;
CCGFloat m_wref, m_xlo[2], m_xhi[2], m_ylo[2], m_yhi[2], m_xoff[2], m_yoff[2], m_del;
unsigned int m_nref;
unsigned int xindex(CCGFloat x, CCGFloat z) const;
unsigned int yindex(CCGFloat y, CCGFloat z) const;
EEDetId gId(float x, float y, float z) const;
mutable std::atomic<EZMgrFL<EBDetId>*> m_borderMgr;
mutable std::atomic<VecOrdListEBDetIdPtr*> m_borderPtrVec;
CMS_THREAD_GUARD(m_check) mutable CCGFloat m_avgZ;
mutable std::atomic<bool> m_check;
CellVec m_cellVec;
};
#endif
|