1111
1212#include " IOTOFSimulation/Layer.h"
1313#include " IOTOFBase/GeometryTGeo.h"
14+ #include " IOTOFSimulation/TF3Chip.h"
1415
1516#include " Framework/Logger.h"
1617
@@ -185,42 +186,45 @@ void ITOFLayer::createLayer(TGeoVolume* motherVolume)
185186 setLayerStyle (layerVol);
186187
187188 // Now we create the volume for a single stave
188- TGeoBBox* stave = new TGeoBBox (staveSizeX * 0.5 , staveSizeY * 0.5 , staveSizeZ * 0.5 );
189- TGeoVolume* staveVol = new TGeoVolume (staveName, stave, medAir );
189+ TGeoBBox* stave = new TGeoBBox (staveSizeX * 0.5 , staveSizeY * 0.5 - 0.5 * 300 . e - 4 , staveSizeZ * 0.5 );
190+ TGeoVolume* staveVol = new TGeoVolume (staveName, stave, medSi );
190191 setStaveStyle (staveVol);
191192
193+ // Now we create the volume for a single chip (chip + sensor)
194+ // TGeoVolume* chipVol1 = o2::iotof::TF3Chip::createChip(0.5 * 300.e-4, mSensorThickness, chipName, sensName);
195+
196+
192197 // Now we create the volume for a single module (sensor + chip)
193198 const int modulesPerStaveX = 1 ; // we assume that each stave is divided in 1 modules along the x direction
194- const double moduleSizeX = staveSizeX / modulesPerStaveX; // cm
199+ const double moduleSizeX = 5.22 ; // staveSizeX / modulesPerStaveX; // cm
195200 const double moduleSizeY = staveSizeY; // cm
196- const double moduleSizeZ = staveSizeZ / mModulesPerStave ; // cm
197- TGeoBBox* module = new TGeoBBox (moduleSizeX * 0.5 , moduleSizeY * 0.5 , moduleSizeZ * 0.5 );
201+ const double moduleSizeZ = 18.1 ; // staveSizeZ / mModulesPerStave; // cm
202+ TGeoBBox* module = new TGeoBBox (0.5 * moduleSizeX, 300 . e - 4 * 0.5 , moduleSizeZ * 0.5 );
198203 TGeoVolume* moduleVol = new TGeoVolume (moduleName, module , medAir);
199204 setModuleStyle (moduleVol);
200205
201206 // Now we create the volume of the chip, which is the same for all modules
202207 const int chipsPerModuleX = 2 ; // we assume that each module is divided in 2 chips along the x direction
203- const int chipsPerModuleZ = 4 ; // we assume that each module is divided in 2 chips along the z direction
208+ const int chipsPerModuleZ = 6 ; // we assume that each module is divided in 2 chips along the z direction
204209 const double chipSizeX = moduleSizeX / chipsPerModuleX; // cm
205210 const double chipSizeY = moduleSizeY; // cm
206211 const double chipSizeZ = moduleSizeZ / chipsPerModuleZ; // cm
207- TGeoBBox* chip = new TGeoBBox (chipSizeX * 0.5 , chipSizeY * 0.5 , chipSizeZ * 0.5 );
208- TGeoVolume* chipVol = new TGeoVolume (chipName, chip, medSi);
209- setChipStyle (chipVol);
212+ // TGeoBBox* chip = new TGeoBBox(chipSizeX * 0.5, chipSizeY * 0.5, chipSizeZ * 0.5);
213+ TGeoVolume* chipVol = o2::iotof::TF3Chip::createChip (300 .e -4 , mSensorThickness , chipName, sensName); // new TGeoVolume(chipName, chip, medSi);
210214
211215 // Finally we create the volume of the sensor, which is the same for all chips
212- const int sensorsPerChipX = 1 ; // we assume that each chip is divided in 2 sensors along the x direction
216+ /* const int sensorsPerChipX = 1; // we assume that each chip is divided in 2 sensors along the x direction
213217 const int sensorsPerChipZ = 1; // we assume that each chip is divided in 2 sensors along the z direction
214218 const double sensorSizeX = chipSizeX / sensorsPerChipX; // cm
215219 const double sensorSizeY = mSensorThickness; // cm
216220 const double sensorSizeZ = chipSizeZ / sensorsPerChipZ; // cm
217221 TGeoBBox* sensor = new TGeoBBox(sensorSizeX * 0.5, sensorSizeY * 0.5, sensorSizeZ * 0.5);
218222 TGeoVolume* sensVol = new TGeoVolume(sensName, sensor, medSi);
219223 setSensorStyle(sensVol);
220- ITOFLayer::mRegister .push_back (sensVol-> GetName () );
224+ */ ITOFLayer::mRegister .push_back (sensName );
221225
222226 // Now we build a chip from sensors
223- for (int i = 0 ; i < sensorsPerChipX; ++i) {
227+ /* for (int i = 0; i < sensorsPerChipX; ++i) {
224228 for (int j = 0; j < sensorsPerChipZ; ++j) {
225229 LOGP(info, "iTOF: Creating sensor {}/{} for chip {}/{}", i + 1, sensorsPerChipX, j + 1, sensorsPerChipZ);
226230 auto* translation = new TGeoTranslation((i + 0.5) * sensorSizeX - 0.5 * chipSizeX,
@@ -229,12 +233,14 @@ void ITOFLayer::createLayer(TGeoVolume* motherVolume)
229233 chipVol->AddNode(sensVol, 1 + i * sensorsPerChipZ + j, translation);
230234 }
231235 }
232-
236+ */
233237 // Now we build a module from chips
234238 for (int i = 0 ; i < chipsPerModuleX; ++i) {
235239 for (int j = 0 ; j < chipsPerModuleZ; ++j) {
236240 LOGP (info, " iTOF: Creating chip {}/{} for module {}/{}" , i + 1 , chipsPerModuleX, j + 1 , chipsPerModuleZ);
237- auto * translation = new TGeoTranslation ((i + 0.5 ) * chipSizeX - 0.5 * moduleSizeX, 0 , (j + 0.5 ) * chipSizeZ - 0.5 * moduleSizeZ);
241+ auto * translation = new TGeoTranslation ((i - 0.5 ) * (2.6 + 0.02 ), 0 , (j + 0.5 ) * 3 + j * 0.02 - 0.5 * moduleSizeZ);
242+ auto * rotation = new TGeoRotation (Form (" segmentRotChip%d" , i + 1 ), 0 ., 0 . /* i == 0 ? 0. : 180.*/ , 0 .);
243+ // auto* transformation = new TGeoCombiTrans(*translation, *rotation);
238244 moduleVol->AddNode (chipVol, 1 + i * chipsPerModuleZ + j, translation);
239245 }
240246 }
@@ -243,7 +249,7 @@ void ITOFLayer::createLayer(TGeoVolume* motherVolume)
243249 for (int i = 0 ; i < modulesPerStaveX; ++i) {
244250 for (int j = 0 ; j < mModulesPerStave ; ++j) {
245251 LOGP (info, " iTOF: Creating module {}/{} for stave {}/{}" , i + 1 , modulesPerStaveX, j + 1 , mModulesPerStave );
246- auto * translation = new TGeoTranslation ((i + 0.5 ) * moduleSizeX - 0.5 * staveSizeX, 0 , (j + 0.5 ) * moduleSizeZ - 0.5 * staveSizeZ);
252+ auto * translation = new TGeoTranslation (0 ., staveSizeY * 0.5 , (j + 0.5 ) * ( moduleSizeZ) + j * 0.02 - 0.5 * staveSizeZ);
247253 staveVol->AddNode (moduleVol, 1 + i * mModulesPerStave + j, translation);
248254 }
249255 }
0 commit comments