@@ -25,21 +25,21 @@ namespace o2
2525{
2626namespace trk
2727{
28- TRKLayer::TRKLayer (int layerNumber, std::string layerName, float rInn, float rOut, float zLength , float layerX2X0)
29- : mLayerNumber (layerNumber), mLayout (kCylinder ), mLayerName (layerName), mInnerRadius (rInn), mOuterRadius (rOut), mZ (zLength ), mX2X0 (layerX2X0), mChipWidth (constants::moduleMLOT::chip::width), mChipLength (constants::moduleMLOT::chip::length), mDeadzoneWidth (1.5 * 1e-1 )
28+ TRKLayer::TRKLayer (int layerNumber, std::string layerName, float rInn, float rOut, int numberOfModules , float layerX2X0)
29+ : mLayerNumber (layerNumber), mLayout (kCylinder ), mLayerName (layerName), mInnerRadius (rInn), mOuterRadius (rOut), mNumberOfModules (numberOfModules ), mX2X0 (layerX2X0), mChipWidth (constants::moduleMLOT::chip::width), mChipLength (constants::moduleMLOT::chip::length), mDeadzoneWidth (1.5 * 1e-1 ), mHalfNumberOfChips ( 4 )
3030{
3131 float Si_X0 = 9 .5f ;
3232 mChipThickness = mX2X0 * Si_X0;
33- LOGP (info, " Creating layer: id: {} rInner: {} rOuter: {} zLength: {} x2X0: {}" , mLayerNumber , mInnerRadius , mOuterRadius , mZ , mX2X0 );
33+ LOGP (info, " Creating layer: id: {} rInner: {} rOuter: {} zLength: {} x2X0: {}" , mLayerNumber , mInnerRadius , mOuterRadius , getZ () , mX2X0 );
3434}
3535
36- TRKLayer::TRKLayer (int layerNumber, std::string layerName, float rInn, float zLength , float thick)
37- : mLayerNumber (layerNumber), mLayout (kCylinder ), mLayerName (layerName), mInnerRadius (rInn), mZ (zLength ), mChipThickness (thick), mChipWidth (constants::moduleMLOT::chip::width), mChipLength (constants::moduleMLOT::chip::length), mDeadzoneWidth (1.5 * 1e-1 )
36+ TRKLayer::TRKLayer (int layerNumber, std::string layerName, float rInn, int numberOfModules , float thick)
37+ : mLayerNumber (layerNumber), mLayout (kCylinder ), mLayerName (layerName), mInnerRadius (rInn), mNumberOfModules (numberOfModules ), mChipThickness (thick), mChipWidth (constants::moduleMLOT::chip::width), mChipLength (constants::moduleMLOT::chip::length), mDeadzoneWidth (1.5 * 1e-1 ), mHalfNumberOfChips ( 4 )
3838{
3939 float Si_X0 = 9 .5f ;
4040 mOuterRadius = rInn + thick;
4141 mX2X0 = mChipThickness / Si_X0;
42- LOGP (info, " Creating layer: id: {} rInner: {} rOuter: {} zLength: {} x2X0: {}" , mLayerNumber , mInnerRadius , mOuterRadius , mZ , mX2X0 );
42+ LOGP (info, " Creating layer: id: {} rInner: {} rOuter: {} zLength: {} x2X0: {}" , mLayerNumber , mInnerRadius , mOuterRadius , getZ () , mX2X0 );
4343}
4444
4545TGeoVolume* TRKLayer::createSensor (std::string type)
@@ -50,7 +50,7 @@ TGeoVolume* TRKLayer::createSensor(std::string type)
5050 TGeoShape* sensor;
5151
5252 if (type == " cylinder" ) {
53- sensor = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mZ / 2 ); // TO BE CHECKED !!!
53+ sensor = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mChipLength / 2 ); // TO BE CHECKED !!!
5454 } else if (type == " flat" ) {
5555 sensor = new TGeoBBox ((mChipWidth - mDeadzoneWidth ) / 2 , mChipThickness / 2 , mChipLength / 2 ); // TO BE CHECKED !!!
5656 } else {
@@ -71,7 +71,7 @@ TGeoVolume* TRKLayer::createDeadzone(std::string type)
7171 TGeoShape* deadzone;
7272
7373 if (type == " cylinder" ) {
74- deadzone = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mZ / 2 ); // TO BE CHECKED !!!
74+ deadzone = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mChipLength / 2 ); // TO BE CHECKED !!!
7575 } else if (type == " flat" ) {
7676 deadzone = new TGeoBBox (mDeadzoneWidth / 2 , mChipThickness / 2 , mChipLength / 2 ); // TO BE CHECKED !!!
7777 } else {
@@ -96,7 +96,7 @@ TGeoVolume* TRKLayer::createChip(std::string type)
9696 TGeoVolume* deadVol;
9797
9898 if (type == " cylinder" ) {
99- chip = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mZ / 2 );
99+ chip = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mChipLength / 2 );
100100 chipVol = new TGeoVolume (chipName.c_str (), chip, medSi);
101101
102102 sensVol = createSensor (" cylinder" );
@@ -138,7 +138,7 @@ TGeoVolume* TRKLayer::createModule(std::string type)
138138 TGeoVolume* moduleVol;
139139
140140 if (type == " cylinder" ) {
141- module = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mZ / 2 );
141+ module = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mChipLength / 2 );
142142 moduleVol = new TGeoVolume (moduleName.c_str (), module , medAir);
143143
144144 TGeoVolume* chipVol = createChip (" cylinder" );
@@ -151,9 +151,7 @@ TGeoVolume* TRKLayer::createModule(std::string type)
151151 module = new TGeoBBox (moduleWidth / 2 , mChipThickness / 2 , moduleLength / 2 ); // TO BE CHECKED !!!
152152 moduleVol = new TGeoVolume (moduleName.c_str (), module , medAir);
153153
154- int nChips = 4 ;
155-
156- for (int iChip = 0 ; iChip < nChips; iChip++) {
154+ for (int iChip = 0 ; iChip < mHalfNumberOfChips ; iChip++) {
157155 TGeoVolume* chipVolLeft = createChip (" flat" );
158156 TGeoVolume* chipVolRight = createChip (" flat" );
159157
@@ -192,7 +190,7 @@ TGeoVolume* TRKLayer::createStave(std::string type)
192190 TGeoVolume* staveVol;
193191
194192 if (type == " cylinder" ) {
195- stave = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mZ / 2 );
193+ stave = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mChipLength / 2 );
196194 staveVol = new TGeoVolume (staveName.c_str (), stave, medAir);
197195
198196 TGeoVolume* moduleVol = createModule (" cylinder" );
@@ -206,13 +204,11 @@ TGeoVolume* TRKLayer::createStave(std::string type)
206204 stave = new TGeoBBox (staveWidth / 2 , mChipThickness / 2 , staveLength / 2 );
207205 staveVol = new TGeoVolume (staveName.c_str (), stave, medAir);
208206
209- int nModules = 10 ;
210-
211- for (int iModule = 0 ; iModule < nModules; iModule++) {
207+ for (int iModule = 0 ; iModule < mNumberOfModules ; iModule++) {
212208 TGeoVolume* moduleVol = createModule (" flat" );
213209
214210 // Put the modules in the correct position
215- double zPos = -0.5 * (nModules - 1 ) * moduleLength + iModule * moduleLength;
211+ double zPos = -0.5 * (mNumberOfModules - 1 ) * moduleLength + iModule * moduleLength;
216212
217213 TGeoCombiTrans* trans = new TGeoCombiTrans ();
218214 trans->SetTranslation (0 , 0 , zPos); // TO BE CHECKED !!!
@@ -229,16 +225,14 @@ TGeoVolume* TRKLayer::createStave(std::string type)
229225 stave = new TGeoBBox (staveWidth / 2 , mLogicalVolumeThickness / 2 , staveLength / 2 );
230226 staveVol = new TGeoVolume (staveName.c_str (), stave, medAir);
231227
232- int nModules = 20 ;
233-
234- for (int iModule = 0 ; iModule < nModules; iModule++) {
228+ for (int iModule = 0 ; iModule < mNumberOfModules ; iModule++) {
235229 TGeoVolume* moduleVolLeft = createModule (" flat" );
236230 TGeoVolume* moduleVolRight = createModule (" flat" );
237231
238232 // Put the modules in the correct position
239233 double xLeft = -moduleWidth / 2 + 0.05 ;
240234 double xRight = moduleWidth / 2 - 0.05 ;
241- double zPos = -0.5 * (nModules - 1 ) * moduleLength + iModule * moduleLength;
235+ double zPos = -0.5 * (mNumberOfModules - 1 ) * moduleLength + iModule * moduleLength;
242236
243237 TGeoCombiTrans* transLeft = new TGeoCombiTrans ();
244238 transLeft->SetTranslation (xLeft, 0 , zPos); // TO BE CHECKED !!! 1mm overlap between the modules
@@ -272,14 +266,14 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume)
272266 TGeoVolume* layerVol;
273267
274268 if (mLayout == eLayout::kCylinder ) {
275- layer = new TGeoTube (mInnerRadius - 0.333 * layerThickness, mInnerRadius + 0.667 * layerThickness, mZ / 2 );
269+ layer = new TGeoTube (mInnerRadius - 0.333 * layerThickness, mInnerRadius + 0.667 * layerThickness, mChipLength / 2 );
276270 layerVol = new TGeoVolume (mLayerName .c_str (), layer, medAir);
277271
278272 TGeoVolume* staveVol = createStave (" cylinder" );
279273 LOGP (info, " Inserting {} in {} " , staveVol->GetName (), layerVol->GetName ());
280274 layerVol->AddNode (staveVol, 1 , nullptr );
281275 } else if (mLayout == eLayout::kTurboStaves ) {
282- double layerLength = constants::ML ::length;
276+ double layerLength = constants::moduleMLOT ::length * mNumberOfModules ;
283277 double staveWidth = constants::ML::width; // Each stave has two modules (based on the LOI design)
284278
285279 if (mInnerRadius > 25 ) {
@@ -317,7 +311,7 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume)
317311 layerVol->AddNode (staveVol, iStave, trans);
318312 }
319313 } else if (mLayout == kStaggered ) {
320- double layerLength = constants::OT ::length;
314+ double layerLength = constants::moduleMLOT ::length * mNumberOfModules ;
321315
322316 layer = new TGeoTube (mInnerRadius - 0.333 * layerThickness, mInnerRadius + 0.667 * layerThickness, layerLength / 2 );
323317 layerVol = new TGeoVolume (mLayerName .c_str (), layer, medAir);
0 commit comments