@@ -49,12 +49,12 @@ TGeoVolume* TRKLayer::createSensor(std::string type, double width)
4949 TGeoShape* sensor;
5050
5151 if (type == " cylinder" ) {
52- sensor = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mZ / 2 );
52+ sensor = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mZ / 2 ); // TO BE CHECKED !!!
5353 } else if (type == " flat" ) {
5454 if (width < 0 ) {
5555 LOGP (fatal, " Attempting to create sensor with invalid width" );
5656 }
57- sensor = new TGeoBBox (width / 2 , mChipThickness / 2 , mZ / 2 );
57+ sensor = new TGeoBBox (width / 2 , mChipThickness / 2 , mZ / 2 ); // TO BE CHECKED !!!
5858 } else {
5959 LOGP (fatal, " Sensor of type '{}' is not implemented" , type);
6060 }
@@ -65,30 +65,63 @@ TGeoVolume* TRKLayer::createSensor(std::string type, double width)
6565 return sensVol;
6666};
6767
68+ TGeoVolume* TRKLayer::createDeadzone (std::string type, double width)
69+ {
70+ TGeoMedium* medSi = gGeoManager ->GetMedium (" TRK_SILICON$" );
71+ std::string deadName = GeometryTGeo::getTRKDeadzonePattern () + std::to_string (mLayerNumber );
72+
73+ TGeoShape* deadzone;
74+
75+ if (type == " cylinder" ) {
76+ deadzone = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mZ / 2 ); // TO BE CHECKED !!!
77+ } else if (type == " flat" ) {
78+ if (width < 0 ) {
79+ LOGP (fatal, " Attempting to create deadzone with invalid width" );
80+ }
81+ deadzone = new TGeoBBox (width / 2 , mChipThickness / 2 , mZ / 2 ); // TO BE CHECKED !!!
82+ } else {
83+ LOGP (fatal, " Deadzone of type '{}' is not implemented" , type);
84+ }
85+
86+ TGeoVolume* deadVol = new TGeoVolume (deadName.c_str (), deadzone, medSi);
87+ deadVol->SetLineColor (kGray );
88+
89+ return deadVol;
90+ };
91+
6892TGeoVolume* TRKLayer::createChip (std::string type, double width)
6993{
7094 TGeoMedium* medSi = gGeoManager ->GetMedium (" TRK_SILICON$" );
7195 std::string chipName = GeometryTGeo::getTRKChipPattern () + std::to_string (mLayerNumber );
7296
7397 TGeoShape* chip;
98+
7499 TGeoVolume* sensVol;
100+ TGeoVolume* deadVol;
75101
76102 if (type == " cylinder" ) {
77103 chip = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mZ / 2 );
78104 sensVol = createSensor (" cylinder" );
105+ deadVol = createDeadzone (" cylinder" );
79106 } else if (type == " flat" ) {
80107 if (width < 0 ) {
81108 LOGP (fatal, " Attempting to create chip with invalid width" );
82109 }
83- chip = new TGeoBBox (width / 2 , mChipThickness / 2 , mZ / 2 );
110+ chip = new TGeoBBox (width / 2 , mChipThickness / 2 , mZ / 2 ); // TO BE CHECKED !!!
84111 sensVol = createSensor (" flat" , width);
112+ deadVol = createDeadzone (" flat" , width);
85113 } else {
86114 LOGP (fatal, " Sensor of type '{}' is not implemented" , type);
87115 }
88116
89117 TGeoVolume* chipVol = new TGeoVolume (chipName.c_str (), chip, medSi);
118+
90119 LOGP (info, " Inserting {} in {} " , sensVol->GetName (), chipVol->GetName ());
91120 chipVol->AddNode (sensVol, 1 , nullptr );
121+
122+ LOGP (info, " Inserting {} in {} " , deadVol->GetName (), chipVol->GetName ());
123+ chipVol->AddNode (deadVol, 1 , nullptr );
124+
92125 chipVol->SetLineColor (kYellow );
93126
94127 return chipVol;
@@ -100,24 +133,39 @@ TGeoVolume* TRKLayer::createModule(std::string type, double width)
100133 std::string moduleName = GeometryTGeo::getTRKModulePattern () + std::to_string (mLayerNumber );
101134
102135 TGeoShape* module ;
103- TGeoVolume* chipVol ;
136+ TGeoVolume* moduleVol ;
104137
105138 if (type == " cylinder" ) {
106139 module = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mZ / 2 );
107- chipVol = createChip (" cylinder" );
140+ moduleVol = new TGeoVolume (moduleName.c_str (), module , medAir);
141+
142+ TGeoVolume* chipVol = createChip (" cylinder" );
143+ LOGP (info, " Inserting {} in {} " , chipVol->GetName (), moduleVol->GetName ());
144+ moduleVol->AddNode (chipVol, 1 , nullptr );
108145 } else if (type == " flat" ) {
109146 if (width < 0 ) {
110147 LOGP (fatal, " Attempting to create module with invalid width" );
111148 }
112- module = new TGeoBBox (width / 2 , mChipThickness / 2 , mZ / 2 );
113- chipVol = createChip (" flat" , width);
149+
150+ module = new TGeoBBox (width / 2 , mChipThickness / 2 , mZ / 2 ); // TO BE CHECKED !!!
151+ moduleVol = new TGeoVolume (moduleName.c_str (), module , medAir);
152+
153+ int nChips = 4 ;
154+
155+ for (int iChip = 0 ; iChip < nChips; iChip++) {
156+ TGeoVolume* chipVol = createChip (" flat" , mModuleWidth );
157+
158+ // Put the chips in the correct position
159+ TGeoCombiTrans* trans = new TGeoCombiTrans ();
160+ trans->SetTranslation (0 , 0 , iChip * (mModuleWidth + 0.1 )); // TO BE CHECKED !!!
161+
162+ LOGP (info, " Inserting {} in {} " , chipVol->GetName (), moduleVol->GetName ());
163+ moduleVol->AddNode (chipVol, iChip, trans);
164+ }
114165 } else {
115166 LOGP (fatal, " Chip of type '{}' is not implemented" , type);
116167 }
117168
118- TGeoVolume* moduleVol = new TGeoVolume (moduleName.c_str (), module , medAir);
119- LOGP (info, " Inserting {} in {} " , chipVol->GetName (), moduleVol->GetName ());
120- moduleVol->AddNode (chipVol, 1 , nullptr );
121169 moduleVol->SetLineColor (kYellow );
122170
123171 return moduleVol;
@@ -130,39 +178,56 @@ TGeoVolume* TRKLayer::createStave(std::string type, double width)
130178
131179 TGeoShape* stave;
132180 TGeoVolume* staveVol;
133- TGeoVolume* moduleVol;
134181
135182 if (type == " cylinder" ) {
136183 stave = new TGeoTube (mInnerRadius , mInnerRadius + mChipThickness , mZ / 2 );
137- moduleVol = createModule (" cylinder" );
138184 staveVol = new TGeoVolume (staveName.c_str (), stave, medAir);
185+
186+ TGeoVolume* moduleVol = createModule (" cylinder" );
139187 LOGP (info, " Inserting {} in {} " , moduleVol->GetName (), staveVol->GetName ());
140188 staveVol->AddNode (moduleVol, 1 , nullptr );
141189 } else if (type == " flat" ) {
142190 if (width < 0 ) {
143191 LOGP (fatal, " Attempting to create stave with invalid width" );
144192 }
193+
145194 stave = new TGeoBBox (width / 2 , mChipThickness / 2 , mZ / 2 );
146- moduleVol = createModule (" flat" , width);
147195 staveVol = new TGeoVolume (staveName.c_str (), stave, medAir);
148- LOGP (info, " Inserting {} in {} " , moduleVol->GetName (), staveVol->GetName ());
149- staveVol->AddNode (moduleVol, 1 , nullptr );
196+
197+ int nModules = 10 ;
198+
199+ for (int iModule = 0 ; iModule < nModules; iModule++) {
200+ TGeoVolume* moduleVol = createModule (" flat" , mModuleWidth );
201+
202+ // Put the modules in the correct position
203+ TGeoCombiTrans* trans = new TGeoCombiTrans ();
204+ trans->SetTranslation (0 , 0 , iModule * (mModuleWidth + 0.1 )); // TO BE CHECKED !!!
205+
206+ LOGP (info, " Inserting {} in {} " , moduleVol->GetName (), staveVol->GetName ());
207+ staveVol->AddNode (moduleVol, iModule, trans);
208+ }
150209 } else if (type == " staggered" ) {
151210 double width = mModuleWidth * 2 ; // Each stave has two modules (based on the LOI design)
152211 stave = new TGeoBBox (width / 2 , mLogicalVolumeThickness / 2 , mZ / 2 );
153- TGeoVolume* moduleVolLeft = createModule (" flat" , mModuleWidth );
154- TGeoVolume* moduleVolRight = createModule (" flat" , mModuleWidth );
155212 staveVol = new TGeoVolume (staveName.c_str (), stave, medAir);
156213
157- TGeoCombiTrans* transLeft = new TGeoCombiTrans ();
158- transLeft->SetTranslation (-mModuleWidth / 2 + 0.05 , 0 , 0 ); // 1mm overlap between the modules
159- LOGP (info, " Inserting {} in {} " , moduleVolLeft->GetName (), staveVol->GetName ());
160- staveVol->AddNode (moduleVolLeft, 0 , transLeft);
214+ int nModules = 10 ;
215+
216+ for (int iModule = 0 ; iModule < nModules; iModule++) {
217+ TGeoVolume* moduleVolLeft = createModule (" flat" , mModuleWidth );
218+ TGeoVolume* moduleVolRight = createModule (" flat" , mModuleWidth );
219+
220+ // Put the modules in the correct position
221+ TGeoCombiTrans* transLeft = new TGeoCombiTrans ();
222+ transLeft->SetTranslation (-mModuleWidth / 2 + 0.05 , 0 , iModule * (mModuleWidth + 0.1 )); // TO BE CHECKED !!! 1mm overlap between the modules
223+ LOGP (info, " Inserting {} in {} " , moduleVolLeft->GetName (), staveVol->GetName ());
224+ staveVol->AddNode (moduleVolLeft, iModule * 2 , transLeft);
161225
162- TGeoCombiTrans* transRight = new TGeoCombiTrans ();
163- transRight->SetTranslation (mModuleWidth / 2 - 0.05 , 0.2 , 0 );
164- LOGP (info, " Inserting {} in {} " , moduleVolRight->GetName (), staveVol->GetName ());
165- staveVol->AddNode (moduleVolRight, 1 , transRight);
226+ TGeoCombiTrans* transRight = new TGeoCombiTrans ();
227+ transRight->SetTranslation (mModuleWidth / 2 - 0.05 , 0 , iModule * (mModuleWidth + 0.1 )); // TO BE CHECKED !!! 1mm overlap between the modules
228+ LOGP (info, " Inserting {} in {} " , moduleVolRight->GetName (), staveVol->GetName ());
229+ staveVol->AddNode (moduleVolRight, iModule * 2 + 1 , transRight);
230+ }
166231 } else {
167232 LOGP (fatal, " Chip of type '{}' is not implemented" , type);
168233 }
@@ -191,7 +256,7 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume)
191256 layerVol->SetLineColor (kYellow );
192257
193258 if (mLayout == eLayout::kCylinder ) {
194- auto staveVol = createStave (" cylinder" );
259+ TGeoVolume* staveVol = createStave (" cylinder" );
195260 LOGP (info, " Inserting {} in {} " , staveVol->GetName (), layerVol->GetName ());
196261 layerVol->AddNode (staveVol, 1 , nullptr );
197262 } else if (mLayout == eLayout::kTurboStaves ) {
@@ -200,7 +265,6 @@ void TRKLayer::createLayer(TGeoVolume* motherVolume)
200265 if (mInnerRadius > 25 ) {
201266 width *= 2 ; // Outer layers have two modules per stave
202267 }
203-
204268 int nStaves = (int )std::ceil (mInnerRadius * 2 * TMath::Pi () / width);
205269 nStaves += nStaves % 2 ; // Require an even number of staves
206270
0 commit comments