@@ -26,15 +26,15 @@ namespace o2
2626namespace trk
2727{
2828TRKLayer::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 )
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 ), mSensorThickness ( 100 . e-4 ), mHalfNumberOfChips (4 )
3030{
3131 float Si_X0 = 9 .5f ;
3232 mChipThickness = mX2X0 * Si_X0;
3333 LOGP (info, " Creating layer: id: {} rInner: {} rOuter: {} zLength: {} x2X0: {}" , mLayerNumber , mInnerRadius , mOuterRadius , getZ (), mX2X0 );
3434}
3535
3636TRKLayer::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 )
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 ), mSensorThickness ( 100 . e-4 ), mHalfNumberOfChips (4 )
3838{
3939 float Si_X0 = 9 .5f ;
4040 mOuterRadius = rInn + thick;
@@ -50,9 +50,9 @@ TGeoVolume* TRKLayer::createSensor(std::string type)
5050 TGeoShape* sensor;
5151
5252 if (type == " cylinder" ) {
53- sensor = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mChipLength / 2 ); // TO BE CHECKED !!!
53+ sensor = new TGeoTube (mInnerRadius , mInnerRadius + mSensorThickness , mChipLength / 2 ); // TO BE CHECKED !!!
5454 } else if (type == " flat" ) {
55- sensor = new TGeoBBox ((mChipWidth - mDeadzoneWidth ) / 2 , mChipThickness / 2 , mChipLength / 2 ); // TO BE CHECKED !!!
55+ sensor = new TGeoBBox ((mChipWidth - mDeadzoneWidth ) / 2 , mSensorThickness / 2 , mChipLength / 2 ); // TO BE CHECKED !!!
5656 } else {
5757 LOGP (fatal, " Sensor of type '{}' is not implemented" , type);
5858 }
@@ -71,9 +71,9 @@ TGeoVolume* TRKLayer::createDeadzone(std::string type)
7171 TGeoShape* deadzone;
7272
7373 if (type == " cylinder" ) {
74- deadzone = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mChipLength / 2 ); // TO BE CHECKED !!!
74+ deadzone = new TGeoTube (mInnerRadius , mInnerRadius + mSensorThickness , mChipLength / 2 ); // TO BE CHECKED !!!
7575 } else if (type == " flat" ) {
76- deadzone = new TGeoBBox (mDeadzoneWidth / 2 , mChipThickness / 2 , mChipLength / 2 ); // TO BE CHECKED !!!
76+ deadzone = new TGeoBBox (mDeadzoneWidth / 2 , mSensorThickness / 2 , mChipLength / 2 ); // TO BE CHECKED !!!
7777 } else {
7878 LOGP (fatal, " Deadzone of type '{}' is not implemented" , type);
7979 }
@@ -84,6 +84,27 @@ TGeoVolume* TRKLayer::createDeadzone(std::string type)
8484 return deadVol;
8585};
8686
87+ TGeoVolume* TRKLayer::createMetalStack (std::string type)
88+ {
89+ TGeoMedium* medSi = gGeoManager ->GetMedium (" TRK_SILICON$" );
90+ std::string metalName = GeometryTGeo::getTRKMetalStackPattern () + std::to_string (mLayerNumber );
91+
92+ TGeoShape* metalStack;
93+
94+ if (type == " cylinder" ) {
95+ metalStack = new TGeoTube (mInnerRadius + mSensorThickness , mInnerRadius + mChipThickness , mChipLength / 2 ); // TO BE CHECKED !!!
96+ } else if (type == " flat" ) {
97+ metalStack = new TGeoBBox (mChipWidth / 2 , mChipThickness - mSensorThickness / 2 , mChipLength / 2 ); // TO BE CHECKED !!!
98+ } else {
99+ LOGP (fatal, " Metal stack of type '{}' is not implemented" , type);
100+ }
101+
102+ TGeoVolume* metalVol = new TGeoVolume (metalName.c_str (), metalStack, medSi);
103+ metalVol->SetLineColor (kGray );
104+
105+ return metalVol;
106+ };
107+
87108TGeoVolume* TRKLayer::createChip (std::string type)
88109{
89110 TGeoMedium* medSi = gGeoManager ->GetMedium (" TRK_SILICON$" );
@@ -94,14 +115,24 @@ TGeoVolume* TRKLayer::createChip(std::string type)
94115
95116 TGeoVolume* sensVol;
96117 TGeoVolume* deadVol;
118+ TGeoVolume* metalVol;
97119
98120 if (type == " cylinder" ) {
99121 chip = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mChipLength / 2 );
100122 chipVol = new TGeoVolume (chipName.c_str (), chip, medSi);
101123
102124 sensVol = createSensor (" cylinder" );
125+ metalVol = createMetalStack (" cylinder" );
126+
127+ TGeoCombiTrans* transSens = new TGeoCombiTrans ();
128+ transSens->SetTranslation (0 , -(mChipThickness - mSensorThickness ) / 2 , 0 ); // TO BE CHECKED !!!
103129 LOGP (info, " Inserting {} in {} " , sensVol->GetName (), chipVol->GetName ());
104- chipVol->AddNode (sensVol, 1 , nullptr );
130+ chipVol->AddNode (sensVol, 1 , transSens);
131+
132+ TGeoCombiTrans* transMetal = new TGeoCombiTrans ();
133+ transMetal->SetTranslation (0 , mSensorThickness / 2 , 0 ); // TO BE CHECKED !!!
134+ LOGP (info, " Inserting {} in {} " , metalVol->GetName (), chipVol->GetName ());
135+ chipVol->AddNode (metalVol, 1 , transMetal);
105136
106137 // deadVol = createDeadzone("cylinder");
107138 } else if (type == " flat" ) {
@@ -110,16 +141,22 @@ TGeoVolume* TRKLayer::createChip(std::string type)
110141
111142 sensVol = createSensor (" flat" );
112143 deadVol = createDeadzone (" flat" );
144+ metalVol = createMetalStack (" flat" );
113145
114146 TGeoCombiTrans* transSens = new TGeoCombiTrans ();
115- transSens->SetTranslation (-mDeadzoneWidth / 2 , 0 , 0 ); // TO BE CHECKED !!!
147+ transSens->SetTranslation (-mDeadzoneWidth / 2 , -( mChipThickness - mSensorThickness ) / 2 , 0 ); // TO BE CHECKED !!!
116148 LOGP (info, " Inserting {} in {} " , sensVol->GetName (), chipVol->GetName ());
117149 chipVol->AddNode (sensVol, 1 , transSens);
118150
119151 TGeoCombiTrans* transDead = new TGeoCombiTrans ();
120- transDead->SetTranslation ((mChipWidth - mDeadzoneWidth ) / 2 , 0 , 0 ); // TO BE CHECKED !!!
152+ transDead->SetTranslation ((mChipWidth - mDeadzoneWidth ) / 2 , -( mChipThickness - mSensorThickness ) / 2 , 0 ); // TO BE CHECKED !!!
121153 LOGP (info, " Inserting {} in {} " , deadVol->GetName (), chipVol->GetName ());
122154 chipVol->AddNode (deadVol, 1 , transDead);
155+
156+ TGeoCombiTrans* transMetal = new TGeoCombiTrans ();
157+ transMetal->SetTranslation (0 , mSensorThickness / 2 , 0 ); // TO BE CHECKED !!!
158+ LOGP (info, " Inserting {} in {} " , metalVol->GetName (), chipVol->GetName ());
159+ chipVol->AddNode (metalVol, 1 , transMetal);
123160 } else {
124161 LOGP (fatal, " Sensor of type '{}' is not implemented" , type);
125162 }
@@ -169,6 +206,9 @@ TGeoVolume* TRKLayer::createModule(std::string type)
169206
170207 TGeoCombiTrans* transRight = new TGeoCombiTrans ();
171208 transRight->SetTranslation (xRight, 0 , zRight); // TO BE CHECKED !!!
209+ TGeoRotation* rot = new TGeoRotation ();
210+ rot->RotateY (180 );
211+ transRight->SetRotation (rot);
172212 LOGP (info, " Inserting {} in {} " , chipVolRight->GetName (), moduleVol->GetName ());
173213 moduleVol->AddNode (chipVolRight, iChip * 2 + 1 , transRight);
174214 }
@@ -266,26 +306,6 @@ TGeoVolume* TRKLayer::createStave(std::string type)
266306 stave = new TGeoBBox (staveWidth / 2 , mLogicalVolumeThickness / 2 , staveLength / 2 );
267307 staveVol = new TGeoVolume (staveName.c_str (), stave, medAir);
268308
269- /* for (int iModule = 0; iModule < mNumberOfModules; iModule++) {
270- TGeoVolume* moduleVolLeft = createModule("flat");
271- TGeoVolume* moduleVolRight = createModule("flat");
272-
273- // Put the modules in the correct position
274- double xLeft = -moduleWidth / 2 + 0.05;
275- double xRight = moduleWidth / 2 - 0.05;
276- double zPos = -0.5 * mNumberOfModules * moduleLength + (iModule + 0.5) * moduleLength;
277-
278- TGeoCombiTrans* transLeft = new TGeoCombiTrans();
279- transLeft->SetTranslation(xLeft, 0, zPos); // TO BE CHECKED !!! 1mm overlap between the modules
280- LOGP(info, "Inserting {} in {} ", moduleVolLeft->GetName(), staveVol->GetName());
281- staveVol->AddNode(moduleVolLeft, iModule * 2, transLeft);
282-
283- TGeoCombiTrans* transRight = new TGeoCombiTrans();
284- transRight->SetTranslation(xRight, 0.2, zPos); // TO BE CHECKED !!! 1mm overlap between the modules
285- LOGP(info, "Inserting {} in {} ", moduleVolRight->GetName(), staveVol->GetName());
286- staveVol->AddNode(moduleVolRight, iModule * 2 + 1, transRight);
287- }*/
288-
289309 // Put the half staves in the correct position
290310 TGeoVolume* halfStaveVolLeft = createHalfStave (" flat" );
291311 TGeoVolume* halfStaveVolRight = createHalfStave (" flat" );
0 commit comments