@@ -22,57 +22,113 @@ namespace o2
2222{
2323namespace trk
2424{
25- class TRKLayer
25+ enum class MatBudgetParamMode {
26+ Thickness,
27+ X2X0
28+ };
29+
30+ class TRKCylindricalLayer
2631{
2732 public:
28- TRKLayer () = default ;
29- TRKLayer (int layerNumber, std::string layerName, float rInn, float rOut, int numberOfModules, float layerX2X0);
30- TRKLayer (int layerNumber, std::string layerName, float rInn, int numberOfModules, float thick);
31- ~TRKLayer () = default ;
32-
33- void setLayout (eLayout layout) { mLayout = layout; };
33+ TRKCylindricalLayer () = default ;
34+ TRKCylindricalLayer (int layerNumber, std::string layerName, float rInn, float length, float thickOrX2X0, MatBudgetParamMode mode);
35+ virtual ~TRKCylindricalLayer () = default ;
3436
3537 auto getInnerRadius () const { return mInnerRadius ; }
3638 auto getOuterRadius () const { return mOuterRadius ; }
37- auto getZ () const { return constants::moduleMLOT::length * mNumberOfModules ; }
39+ auto getZ () const { return mLength ; }
3840 auto getx2X0 () const { return mX2X0 ; }
3941 auto getChipThickness () const { return mChipThickness ; }
4042 auto getNumber () const { return mLayerNumber ; }
4143 auto getName () const { return mLayerName ; }
4244
43- TGeoVolume* createSensor (std::string type);
44- TGeoVolume* createDeadzone (std::string type);
45- TGeoVolume* createMetalStack (std::string type);
46- TGeoVolume* createChip (std::string type);
47- TGeoVolume* createModule (std::string type);
48- TGeoVolume* createStave (std::string type);
49- TGeoVolume* createHalfStave (std::string type);
50- void createLayer (TGeoVolume* motherVolume);
51-
52- private:
53- // TGeo objects outside logical volumes can cause errors. Only used in case of kStaggered and kTurboStaves layouts
54- static constexpr float mLogicalVolumeThickness = 1.3 ;
45+ virtual TGeoVolume* createSensor ();
46+ virtual TGeoVolume* createMetalStack ();
47+ virtual void createLayer (TGeoVolume* motherVolume);
5548
49+ protected:
5650 // User defined parameters for the layer, to be set in the constructor
5751 int mLayerNumber ;
5852 std::string mLayerName ;
5953 float mInnerRadius ;
6054 float mOuterRadius ;
61- int mNumberOfModules ;
55+ float mLength ;
6256 float mX2X0 ;
6357 float mChipThickness ;
6458
6559 // Fixed parameters for the layer, to be set based on the specifications of the chip and module
66- eLayout mLayout = kCylinder ;
67- float mChipWidth = constants::moduleMLOT::chip::width;
68- float mChipLength = constants::moduleMLOT::chip::length;
69- float mDeadzoneWidth = constants::moduleMLOT::chip::passiveEdgeReadOut;
70- float mSensorThickness = constants::moduleMLOT::silicon::thickness;
71- int mHalfNumberOfChips = 4 ;
60+ static constexpr double sSensorThickness = constants::moduleMLOT::silicon::thickness;
7261
7362 static constexpr float Si_X0 = 9 .5f ;
7463
75- ClassDef (TRKLayer, 2 );
64+ ClassDef (TRKCylindricalLayer, 0 );
65+ };
66+
67+ class TRKSegmentedLayer : public TRKCylindricalLayer
68+ {
69+ public:
70+ TRKSegmentedLayer () = default ;
71+ TRKSegmentedLayer (int layerNumber, std::string layerName, float rInn, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode);
72+ ~TRKSegmentedLayer () override = default ;
73+
74+ TGeoVolume* createSensor () override ;
75+ TGeoVolume* createDeadzone ();
76+ TGeoVolume* createMetalStack () override ;
77+ TGeoVolume* createChip ();
78+ TGeoVolume* createModule ();
79+ virtual TGeoVolume* createStave () = 0;
80+ void createLayer (TGeoVolume* motherVolume) override = 0;
81+
82+ protected:
83+ int mNumberOfModules ;
84+
85+ // Fixed parameters for the layer, to be set based on the specifications of the chip and module
86+ static constexpr double sChipWidth = constants::moduleMLOT::chip::width;
87+ static constexpr double sChipLength = constants::moduleMLOT::chip::length;
88+ static constexpr double sDeadzoneWidth = constants::moduleMLOT::chip::passiveEdgeReadOut;
89+ static constexpr double sModuleLength = constants::moduleMLOT::length;
90+ static constexpr double sModuleWidth = constants::moduleMLOT::width;
91+ static constexpr int sHalfNumberOfChips = 4 ;
92+
93+ // TGeo objects outside logical volumes can cause errors
94+ static constexpr float sLogicalVolumeThickness = 1.3 ;
95+
96+ ClassDefOverride (TRKSegmentedLayer, 0 );
97+ };
98+
99+ class TRKMLLayer : public TRKSegmentedLayer
100+ {
101+ public:
102+ TRKMLLayer () = default ;
103+ TRKMLLayer (int layerNumber, std::string layerName, float rInn, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode);
104+ ~TRKMLLayer () override = default ;
105+
106+ TGeoVolume* createStave () override ;
107+ void createLayer (TGeoVolume* motherVolume) override ;
108+
109+ private:
110+ static constexpr double sStaveWidth = constants::ML::width;
111+
112+ ClassDefOverride (TRKMLLayer, 0 );
113+ };
114+
115+ class TRKOTLayer : public TRKSegmentedLayer
116+ {
117+ public:
118+ TRKOTLayer () = default ;
119+ TRKOTLayer (int layerNumber, std::string layerName, float rInn, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode);
120+ ~TRKOTLayer () override = default ;
121+
122+ TGeoVolume* createStave () override ;
123+ TGeoVolume* createHalfStave ();
124+ void createLayer (TGeoVolume* motherVolume) override ;
125+
126+ private:
127+ static constexpr double sHalfStaveWidth = constants::OT::halfstave::width;
128+ static constexpr double sInStaveOverlap = constants::moduleMLOT::gaps::outerEdgeLongSide + constants::moduleMLOT::chip::passiveEdgeReadOut + 0.1 ; // 1.5mm outer-edge + 1mm deadzone + 1mm (true) overlap
129+ static constexpr double sStaveWidth = constants::OT::width - sInStaveOverlap ;
130+
131+ ClassDefOverride (TRKOTLayer, 0 )
76132};
77133
78134} // namespace trk
0 commit comments