BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
create_rootgeom_TOF400_RUN9.C
Go to the documentation of this file.
1/*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6
7/*
8 * File: create_rootgeom_TOF400_RUN8.C
9 * Author: mikhailr
10 *
11 * Created on January 10, 2023, 11:06 AM
12 */
13
14R__ADD_INCLUDE_PATH($VMCWORKDIR)
15// #include "macro/run/bmnloadlibs.C"
16
17using namespace std;
18
20{
21 // Load the necessary FairRoot libraries
22 // gROOT->LoadMacro("$VMCWORKDIR/macro/run/bmnloadlibs.C");
23 // bmnloadlibs(); // load libraries
24
25 // ------- Load media from media file --------------------------------
26 TGeoManager* gGeoMan;
27 cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
28 FairGeoLoader* geoLoad = new FairGeoLoader("TGeo", "FairGeoLoader");
29 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
30 TString geoPath = gSystem->Getenv("VMCWORKDIR");
31 TString medFile = geoPath + "/geometry/media.geo";
32 geoFace->setMediaFile(medFile);
33 geoFace->readMedia();
34 gGeoMan = gGeoManager;
35
36 // ------- Geometry file name (output) -------------------------------
37 const TString geoDetectorName = "TOF400";
38 const TString geoDetectorVersion = "RUN9_v2";
39 // const TString geoFileName = geoPath + "/geometry/" + geoDetectorName + "_" + geoDetectorVersion + ".root";
40 const TString geoFileName = geoDetectorName + "_" + geoDetectorVersion + ".root";
41
42 // ----------------- Get and create the required media --------------
43 FairGeoMedia* geoMedia = geoFace->getMedia();
44 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
45
46 // Air
47 FairGeoMedium* matAir = geoMedia->getMedium("air");
48 if (!matAir)
49 Fatal("Main", "FairMedium air not found");
50 geoBuild->createMedium(matAir);
51 TGeoMedium* medAir = gGeoMan->GetMedium("air");
52 if (!medAir)
53 Fatal("Main", "Medium air not found");
54
55 // Polypropylene
56 FairGeoMedium* matPprop = geoMedia->getMedium("polypropylene");
57 if (!matPprop)
58 Fatal("Main", "FairMedium polypropylene not found");
59 geoBuild->createMedium(matPprop);
60 TGeoMedium* medPprop = gGeoMan->GetMedium("polypropylene");
61 if (!medPprop)
62 Fatal("Main", "Medium polypropylene not found");
63
64 // lead
65 FairGeoMedium* matPb = geoMedia->getMedium("lead");
66 if (!matPb)
67 Fatal("Main", "FairMedium lead not found");
68 geoBuild->createMedium(matPb);
69 TGeoMedium* medPb = gGeoMan->GetMedium("lead");
70 if (!medPb)
71 Fatal("Main", "Medium lead not found");
72
73 // aluminium
74 FairGeoMedium* matAl = geoMedia->getMedium("aluminium");
75 if (!matAl)
76 Fatal("Main", "FairMedium aluminium not found");
77 geoBuild->createMedium(matAl);
78 TGeoMedium* medAl = gGeoMan->GetMedium("aluminium");
79 if (!medAl)
80 Fatal("Main", "Medium aluminium not found");
81
82 // RPCglass
83 FairGeoMedium* matGlass = geoMedia->getMedium("RPCglass");
84 if (!matGlass)
85 Fatal("Main", "FairMedium RPCglass not found");
86 geoBuild->createMedium(matGlass);
87 TGeoMedium* medGlass = gGeoMan->GetMedium("RPCglass");
88 if (!medGlass)
89 Fatal("Main", "Medium RPCglass not found");
90
91 // RPCgas
92 FairGeoMedium* matGas = geoMedia->getMedium("RPCgas");
93 if (!matGas)
94 Fatal("Main", "FairMedium RPCgas not found");
95 geoBuild->createMedium(matGas);
96 TGeoMedium* medGas = gGeoMan->GetMedium("RPCgas");
97 if (!medGas)
98 Fatal("Main", "Medium RPCgas not found");
99
100 // G10
101 FairGeoMedium* matG10 = geoMedia->getMedium("G10");
102 if (!matG10)
103 Fatal("Main", "FairMedium G10 not found");
104 geoBuild->createMedium(matG10);
105 TGeoMedium* medG10 = gGeoMan->GetMedium("G10");
106 if (!medG10)
107 Fatal("Main", "Medium G10 not found");
108
109 // ----------------------------------------- Create geometry and top volume
110 // -----------------------------------------------
111 gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
112 gGeoMan->SetName(geoDetectorName + "_geom");
113 TGeoVolume* top = new TGeoVolumeAssembly("TOP"); // TOP VOLUME
114 top->SetMedium(medAir);
115 gGeoMan->SetTopVolume(top);
116 gGeoMan->SetTopVisible(1);
117 gGeoMan->SetVisLevel(7);
118
119 // --------------------------------------- Define TOP Geometry ------------------------------------
120 TGeoVolume* topTof = new TGeoVolumeAssembly(geoDetectorName);
121 topTof->SetMedium(medAir);
122
123 TGeoVolume* vDetector = new TGeoVolumeAssembly("tof1Detector");
124 vDetector->SetMedium(medAir);
125
126 const double DetXsize = 60.; // [cm]
127 const double DetYsize = 30.; // [cm]
128 const double DetZsize = 3.0; // [cm]
129
130 TGeoVolume* vBox = new TGeoVolumeAssembly("tof1Box");
131 vDetector->SetMedium(medAir);
132
133 // --------------------- Create Box Frame --------------
134 TGeoVolumeAssembly* vChannel_lr = new TGeoVolumeAssembly("tof1ChannelV_lr");
135
136 TGeoBBox* sPartСhannel1 = new TGeoBBox(3.6 / 2., 158. / 2., 0.8 / 2.);
137 TGeoVolume* vPartСhannel1 = new TGeoVolume("vPartСhannel1", sPartСhannel1, medAl);
138 vPartСhannel1->SetLineColor(kRed);
139
140 TGeoBBox* sPartСhannel2 = new TGeoBBox(0.4 / 2., 158 / 2., 20. / 2.);
141 TGeoVolume* vPartСhannel2 = new TGeoVolume("vPartСhannel2", sPartСhannel2, medAl);
142 vPartСhannel2->SetLineColor(kGray);
143
144 vChannel_lr->AddNode(vPartСhannel1, 1, new TGeoTranslation("", 2.2, 0., 1.));
145 vChannel_lr->AddNode(vPartСhannel1, 2, new TGeoTranslation("", 2.2, 0., 19.2 + 1.));
146 vChannel_lr->AddNode(vPartСhannel2, 1, new TGeoTranslation("", 0.2, 0., 10.6));
147
148 vBox->AddNode(vChannel_lr, 1, new TGeoTranslation("", 93., 0., 0));
149 vBox->AddNode(vChannel_lr, 2, new TGeoCombiTrans("", -93., 0., 0, new TGeoRotation("", 180, 0, 0)));
150
151 //***
152
153 TGeoVolumeAssembly* vChannel_ud = new TGeoVolumeAssembly("tof1ChannelV_ud");
154
155 TGeoBBox* sPartСhannel3 = new TGeoBBox(194. / 2., 3.2 / 2., 0.8 / 2.);
156 TGeoVolume* vPartСhannel3 = new TGeoVolume("vPartСhannel3", sPartСhannel3, medAl);
157 vPartСhannel3->SetLineColor(kRed);
158
159 TGeoBBox* sPartСhannel4 = new TGeoBBox(194. / 2., 0.8 / 2., 20. / 2.);
160 TGeoVolume* vPartСhannel4 = new TGeoVolume("vPartСhannel4", sPartСhannel4, medAl);
161 vPartСhannel4->SetLineColor(kGray);
162
163 vChannel_ud->AddNode(vPartСhannel3, 1, new TGeoTranslation("", 0, 2.4, 1.));
164 vChannel_ud->AddNode(vPartСhannel3, 1, new TGeoTranslation("", 0, 2.4, 19.2 + 1.));
165 vChannel_ud->AddNode(vPartСhannel4, 2, new TGeoTranslation("", 0, 0.4, 10.6));
166
167 // vBox->AddNode(vChannel_ud, 1, new TGeoTranslation("", 0, 0, 0));
168 vBox->AddNode(vChannel_ud, 1, new TGeoTranslation("", 0, 158. / 2., 0));
169 vBox->AddNode(vChannel_ud, 2, new TGeoCombiTrans("", 0, -158. / 2., 0, new TGeoRotation("", 180, 0, 0)));
170
171 //*** covers
172
173 TGeoBBox* sCover = new TGeoBBox(194. / 2., 166. / 2., 0.1 / 2.);
174 TGeoVolume* vCover = new TGeoVolume("vCover", sCover, medAl);
175 vCover->SetLineColor(kGreen);
176
177 vBox->AddNode(vCover, 1, new TGeoTranslation("", 0, 0, 20 + 0.6 + 0.1 / 2.));
178 vBox->AddNode(vCover, 2, new TGeoTranslation("", 0, 0, 0.6 - 0.1 / 2.));
179
180 // --------------------- Create strip ------------------
181 const float stripGasX = 1.25, stripGasY = DetYsize, stripGasZ = 0.3; // [cm]
182 TGeoBBox* sStripGas = new TGeoBBox(stripGasX / 2., stripGasY / 2., stripGasZ / 2.);
183 sStripGas->SetName("StripGas");
184 TGeoVolume* vStripGas = new TGeoVolume("tof1StripActiveGasV", sStripGas, medGas);
185 vStripGas->SetLineColor(kRed);
186
187 // --------------------- Create Glass plates ------------------
188 const float detGlassX = DetXsize, detGlassY = DetYsize, detGlassZ = 0.618 / 2.; // [cm] 6.18 mm / 2 plate
189 TGeoBBox* sDetGlass = new TGeoBBox(detGlassX / 2., detGlassY / 2., detGlassZ / 2.);
190 sDetGlass->SetName("DetectorGlass");
191 TGeoVolume* vDetGlass = new TGeoVolume("tof1DetGlassV", sDetGlass, medGlass);
192 vDetGlass->SetLineColor(kYellow);
193
194 // --------------------- Create G10 plates ------------------
195 const float detPlateX = DetXsize, detPlateY = DetYsize, detPlateZ = 0.64 / 2.; // [cm] 6.4 mm / 2 plate
196 TGeoBBox* sDetPlate = new TGeoBBox(detPlateX / 2., detPlateY / 2., detPlateZ / 2.);
197 sDetPlate->SetName("DetectorPlate");
198 TGeoVolume* vDetPlate = new TGeoVolume("tof1DetPlateV", sDetPlate, medG10);
199 vDetPlate->SetLineColor(kBlue);
200
201 // --------------------------------------- Assemble a detector
202
203 // Add strips
204 const int NStrips = 48; // 24 strips group
205 const double StripStep = 1.25; // [cm]
206 for (int i = 0; i < NStrips; i++) {
207 vDetector->AddNode(vStripGas, i + 1,
208 new TGeoTranslation("", -DetXsize / 2. + StripStep / 2. + i * StripStep, 0., 0.));
209 }
210
211 // Add Glass plates
212 vDetector->AddNode(vDetGlass, 1, new TGeoTranslation("", 0., 0., -stripGasZ / 2. - detGlassZ / 2.));
213 vDetector->AddNode(vDetGlass, 2, new TGeoTranslation("", 0., 0., +stripGasZ / 2. + detGlassZ / 2.));
214
215 // Add G10 plates
216 vDetector->AddNode(vDetPlate, 1, new TGeoTranslation("", 0., 0., -DetZsize / 2. + detPlateZ / 2.));
217 vDetector->AddNode(vDetPlate, 2, new TGeoTranslation("", 0., 0., +DetZsize / 2. - detPlateZ / 2.));
218
219 // -------------------------------------- Install Detectors
220 const double tofZgap = 0.4; // 4 mm between detectors
221 const double tofYoverlap = 3.0; // 30 mm detectors overlap at Y direction
222 const double tofZshift = (tofZgap + DetZsize) * -1.;
223
224 // Box1, left side, X>0
225 const double box1_x = 164.193; // [cm]
226 const double box1_y = -2.128; // [cm]
227 const double box1_z = 422.167; // [cm]
228
229 // column 1: det #0-4
230 const double ofsetDetRelBox1_col1_x = +3.0 + 55.;
231 const double ofsetDetRelBox1_col1_y = -2.25;
232 const double ofsetDetRelBox1_col1_z = 15.0 + 2. * tofZshift;
233 TGeoRotation* geoRot1 = new TGeoRotation();
234 geoRot1->RotateX(0); // 0.005 Deg
235 geoRot1->RotateY(0); //-0.055 Deg
236 geoRot1->RotateZ(0.); // 0.09 Deg
237 // alignet to the Proton peak with 1.2 < p < 2 ; 05.10.2026
238 const Double_t corr_X_col1[5] = {0.13, 0.22, 0.04, -0.08, -0.16};
239 const Double_t corr_Y_col1[5] = {0.71, 0.59, 0.44, 0.44, 0.40};
240 const Double_t corr_Z_col1[5] = {0, 0, 0, 0, 0};
241
242 TGeoCombiTrans* cR1 =
243 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col1_x + corr_X_col1[0],
244 2. * DetYsize - 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col1_y + corr_Y_col1[0],
245 box1_z + ofsetDetRelBox1_col1_z + corr_Z_col1[0], geoRot1);
246 topTof->AddNode(vDetector, 1, cR1);
247
248 TGeoCombiTrans* cR2 =
249 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col1_x + corr_X_col1[1],
250 1. * DetYsize - tofYoverlap + box1_y + ofsetDetRelBox1_col1_y + corr_Y_col1[1],
251 box1_z + ofsetDetRelBox1_col1_z + corr_Z_col1[1] + tofZshift, geoRot1);
252 topTof->AddNode(vDetector, 2, cR2);
253
254 TGeoCombiTrans* cR3 = new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col1_x + corr_X_col1[2],
255 0. + box1_y + ofsetDetRelBox1_col1_y + corr_Y_col1[2],
256 box1_z + ofsetDetRelBox1_col1_z + corr_Z_col1[2], geoRot1);
257 topTof->AddNode(vDetector, 3, cR3);
258
259 TGeoCombiTrans* cR4 =
260 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col1_x + corr_X_col1[3],
261 -1. * DetYsize + tofYoverlap + box1_y + ofsetDetRelBox1_col1_y + corr_Y_col1[3],
262 box1_z + ofsetDetRelBox1_col1_z + corr_Z_col1[3] + tofZshift, geoRot1);
263 topTof->AddNode(vDetector, 4, cR4);
264
265 TGeoCombiTrans* cR5 =
266 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col1_x + corr_X_col1[4],
267 -2. * DetYsize + 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col1_y + corr_Y_col1[4],
268 box1_z + ofsetDetRelBox1_col1_z + corr_Z_col1[4], geoRot1);
269 topTof->AddNode(vDetector, 5, cR5);
270
271 // column 2: det #5-9
272 const double ofsetDetRelBox1_col2_x = +3.0;
273 const double ofsetDetRelBox1_col2_y = -2.25;
274 const double ofsetDetRelBox1_col2_z = 15.0;
275 TGeoRotation* geoRot2 = new TGeoRotation();
276 geoRot2->RotateX(0); // 0.005 Deg
277 geoRot2->RotateY(0); //-0.055 Deg
278 geoRot2->RotateZ(0.); // 0.09 Deg
279 // alignet to the Proton peak with 1.2 < p < 2 ; 05.10.2026
280 const Double_t corr_X_col2[5] = {-0.63, -0.43, -0.81, -0.74, -1.30};
281 const Double_t corr_Y_col2[5] = {0.4, 0.65, 0.15, 0.11, 0.16};
282 const Double_t corr_Z_col2[5] = {0, 0, 0, 0, 0};
283
284 TGeoCombiTrans* cR6 =
285 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col2_x + corr_X_col2[0],
286 2. * DetYsize - 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col2_y + corr_Y_col2[0],
287 box1_z + ofsetDetRelBox1_col2_z + corr_Z_col2[0], geoRot1);
288 topTof->AddNode(vDetector, 6, cR6);
289
290 TGeoCombiTrans* cR7 =
291 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col2_x + corr_X_col2[1],
292 1. * DetYsize - tofYoverlap + box1_y + ofsetDetRelBox1_col2_y + corr_Y_col2[1],
293 box1_z + ofsetDetRelBox1_col2_z + corr_Z_col2[1] + tofZshift, geoRot1);
294 topTof->AddNode(vDetector, 7, cR7);
295
296 TGeoCombiTrans* cR8 = new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col2_x + corr_X_col2[2],
297 0. + box1_y + ofsetDetRelBox1_col2_y + corr_Y_col2[2],
298 box1_z + ofsetDetRelBox1_col2_z + corr_Z_col2[2], geoRot1);
299 topTof->AddNode(vDetector, 8, cR8);
300
301 TGeoCombiTrans* cR9 =
302 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col2_x + corr_X_col2[3],
303 -1. * DetYsize + tofYoverlap + box1_y + ofsetDetRelBox1_col2_y + corr_Y_col2[3],
304 box1_z + ofsetDetRelBox1_col2_z + corr_Z_col2[3] + tofZshift, geoRot1);
305 topTof->AddNode(vDetector, 9, cR9);
306
307 TGeoCombiTrans* cR10 =
308 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col2_x + corr_X_col2[4],
309 -2. * DetYsize + 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col2_y + corr_Y_col2[4],
310 box1_z + ofsetDetRelBox1_col2_z + corr_Z_col2[4], geoRot1);
311 topTof->AddNode(vDetector, 10, cR10);
312
313 // column 3: det #10-14
314 const double ofsetDetRelBox1_col3_x = +3.0 - 55.;
315 const double ofsetDetRelBox1_col3_y = -2.25;
316 const double ofsetDetRelBox1_col3_z = 15.0 + 2. * tofZshift;
317 TGeoRotation* geoRot3 = new TGeoRotation();
318 geoRot3->RotateX(0); // 0.005 Deg
319 geoRot3->RotateY(0); //-0.055 Deg
320 geoRot3->RotateZ(0.); // 0.09 Deg
321 // alignet to the Proton peak with 1.2 < p < 2 ; 05.10.2026
322 const Double_t corr_X_col3[5] = {-0.67, -0.84, -1.11, 0., -1.43};
323 const Double_t corr_Y_col3[5] = {0.42, 0.25, 0.28, 0., 0.};
324 const Double_t corr_Z_col3[5] = {0, 0, 0, 0, 0};
325
326 TGeoCombiTrans* cR11 =
327 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col3_x + corr_X_col3[0],
328 2. * DetYsize - 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col3_y + corr_Y_col3[0],
329 box1_z + ofsetDetRelBox1_col3_z + corr_Z_col3[0], geoRot1);
330 topTof->AddNode(vDetector, 11, cR11);
331
332 TGeoCombiTrans* cR12 =
333 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col3_x + corr_X_col3[1],
334 1. * DetYsize - tofYoverlap + box1_y + ofsetDetRelBox1_col3_y + corr_Y_col3[1],
335 box1_z + ofsetDetRelBox1_col3_z + corr_Z_col3[1] + tofZshift, geoRot1);
336 topTof->AddNode(vDetector, 12, cR12);
337
338 TGeoCombiTrans* cR13 = new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col3_x + corr_X_col3[2],
339 0. + box1_y + ofsetDetRelBox1_col3_y + corr_Y_col3[2],
340 box1_z + ofsetDetRelBox1_col3_z + corr_Z_col3[2], geoRot1);
341 topTof->AddNode(vDetector, 13, cR13);
342
343 TGeoCombiTrans* cR14 =
344 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col3_x + corr_X_col3[3],
345 -1. * DetYsize + tofYoverlap + box1_y + ofsetDetRelBox1_col3_y + corr_Y_col3[3],
346 box1_z + ofsetDetRelBox1_col3_z + corr_Z_col3[3] + tofZshift, geoRot1);
347 topTof->AddNode(vDetector, 14, cR14);
348
349 TGeoCombiTrans* cR15 =
350 new TGeoCombiTrans("", box1_x + ofsetDetRelBox1_col3_x + corr_X_col3[4],
351 -2. * DetYsize + 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col3_y + corr_Y_col3[4],
352 box1_z + ofsetDetRelBox1_col3_z + corr_Z_col3[4], geoRot1);
353 topTof->AddNode(vDetector, 15, cR15);
354
355 // Box
356 TGeoCombiTrans* cBox1 = new TGeoCombiTrans("", box1_x, box1_y, box1_z, geoRot1);
357 topTof->AddNode(vBox, 1, cBox1);
358
359 //-----------------------------
360 // Box2, right side, X<0
361 const double box2_x = -119.799; // [cm]
362 const double box2_y = -2.055; // [cm]
363 const double box2_z = 422.238; // [cm]
364
365 // column 4: det #15-19
366 const double ofsetDetRelBox2_col4_x = -5.0 + 55.;
367 const double ofsetDetRelBox2_col4_y = -2.25;
368 const double ofsetDetRelBox2_col4_z = 15.0 + 2. * tofZshift;
369 TGeoRotation* geoRot4 = new TGeoRotation();
370 geoRot4->RotateX(0); // 0.005 Deg
371 geoRot4->RotateY(0); //-0.055 Deg
372 geoRot4->RotateZ(0.); // 0.09 Deg
373 // alignet to the Proton peak with 1.2 < p < 2 ; 05.10.2026
374 const Double_t corr_X_col4[5] = {-0.14, 0., 0., -0.23, -0.2};
375 const Double_t corr_Y_col4[5] = {0.34, 0., 0., -0.1, -0.28};
376 const Double_t corr_Z_col4[5] = {0, 0, 0, 0, 0};
377
378 TGeoCombiTrans* cR16 =
379 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col4_x + corr_X_col4[0],
380 2. * DetYsize - 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col4_y + corr_Y_col4[0],
381 box2_z + ofsetDetRelBox2_col4_z + corr_Z_col4[0], geoRot4);
382 topTof->AddNode(vDetector, 16, cR16);
383
384 TGeoCombiTrans* cR17 =
385 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col4_x + corr_X_col4[1],
386 1. * DetYsize - tofYoverlap + box2_y + ofsetDetRelBox2_col4_y + corr_Y_col4[1],
387 box2_z + ofsetDetRelBox2_col4_z + corr_Z_col4[1] + tofZshift, geoRot4);
388 topTof->AddNode(vDetector, 17, cR17);
389
390 TGeoCombiTrans* cR18 = new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col4_x + corr_X_col4[2],
391 0. + box2_y + ofsetDetRelBox2_col4_y + corr_Y_col4[2],
392 box2_z + ofsetDetRelBox2_col4_z + corr_Z_col4[2], geoRot4);
393 topTof->AddNode(vDetector, 18, cR18);
394
395 TGeoCombiTrans* cR19 =
396 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col4_x + corr_X_col4[3],
397 -1. * DetYsize + tofYoverlap + box2_y + ofsetDetRelBox2_col4_y + corr_Y_col4[3],
398 box2_z + ofsetDetRelBox2_col4_z + corr_Z_col4[3] + tofZshift, geoRot4);
399 topTof->AddNode(vDetector, 19, cR19);
400
401 TGeoCombiTrans* cR20 =
402 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col4_x + corr_X_col4[4],
403 -2. * DetYsize + 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col4_y + corr_Y_col4[4],
404 box2_z + ofsetDetRelBox2_col4_z + corr_Z_col4[4], geoRot4);
405 topTof->AddNode(vDetector, 20, cR20);
406
407 // column 5: det #20-24
408 const double ofsetDetRelBox2_col5_x = -5.0;
409 const double ofsetDetRelBox2_col5_y = -2.25;
410 const double ofsetDetRelBox2_col5_z = 15.0;
411 TGeoRotation* geoRot5 = new TGeoRotation();
412 geoRot5->RotateX(0); // 0.005 Deg
413 geoRot5->RotateY(0); //-0.055 Deg
414 geoRot5->RotateZ(0.); // 0.09 Deg
415 // alignet to the Proton peak with 1.2 < p < 2 ; 05.10.2026
416 const Double_t corr_X_col5[5] = {-0.3, -0.29, -0.43, -0.78, -0.57};
417 const Double_t corr_Y_col5[5] = {0.22, 0.12, -0.31, -0.6, -0.35};
418 const Double_t corr_Z_col5[5] = {0, 0, 0, 0, 0};
419
420 TGeoCombiTrans* cR21 =
421 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col5_x + corr_X_col5[0],
422 2. * DetYsize - 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col5_y + corr_Y_col5[0],
423 box2_z + ofsetDetRelBox2_col5_z + corr_Z_col5[0], geoRot5);
424 topTof->AddNode(vDetector, 21, cR21);
425
426 TGeoCombiTrans* cR22 =
427 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col5_x + corr_X_col5[1],
428 1. * DetYsize - tofYoverlap + box2_y + ofsetDetRelBox2_col5_y + corr_Y_col5[1],
429 box2_z + ofsetDetRelBox2_col5_z + corr_Z_col5[1] + tofZshift, geoRot5);
430 topTof->AddNode(vDetector, 22, cR22);
431
432 TGeoCombiTrans* cR23 = new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col5_x + corr_X_col5[2],
433 0. + box2_y + ofsetDetRelBox2_col5_y + corr_Y_col5[2],
434 box2_z + ofsetDetRelBox2_col5_z + corr_Z_col5[2], geoRot5);
435 topTof->AddNode(vDetector, 23, cR23);
436
437 TGeoCombiTrans* cR24 =
438 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col5_x + corr_X_col5[3],
439 -1. * DetYsize + tofYoverlap + box2_y + ofsetDetRelBox2_col5_y + corr_Y_col5[3],
440 box2_z + ofsetDetRelBox2_col5_z + corr_Z_col5[3] + tofZshift, geoRot5);
441 topTof->AddNode(vDetector, 24, cR24);
442
443 TGeoCombiTrans* cR25 =
444 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col5_x + corr_X_col5[4],
445 -2. * DetYsize + 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col5_y + corr_Y_col5[4],
446 box2_z + ofsetDetRelBox2_col5_z + corr_Z_col5[4], geoRot5);
447 topTof->AddNode(vDetector, 25, cR25);
448
449 // column 6: det #25-29
450 const double ofsetDetRelBox2_col6_x = -5.0 - 55.;
451 const double ofsetDetRelBox2_col6_y = -2.25;
452 const double ofsetDetRelBox2_col6_z = 15.0 + 2. * tofZshift;
453 TGeoRotation* geoRot6 = new TGeoRotation();
454 geoRot6->RotateX(0); // 0.005 Deg
455 geoRot6->RotateY(0); //-0.055 Deg
456 geoRot6->RotateZ(0.); // 0.09 Deg
457 // alignet to the Proton peak with 1.2 < p < 2 ; 05.10.2026
458 const Double_t corr_X_col6[5] = {-0.45, -0.4, -0.4, -0.23, -0.33};
459 const Double_t corr_Y_col6[5] = {0.24, 0.12, -0.19, -0.24, -0.35};
460 const Double_t corr_Z_col6[5] = {0, 0, 0, 0, 0};
461
462 TGeoCombiTrans* cR26 =
463 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col6_x + corr_X_col6[0],
464 2. * DetYsize - 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col6_y + corr_Y_col6[0],
465 box2_z + ofsetDetRelBox2_col6_z + corr_Z_col6[0], geoRot6);
466 topTof->AddNode(vDetector, 26, cR26);
467
468 TGeoCombiTrans* cR27 =
469 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col6_x + corr_X_col6[1],
470 1. * DetYsize - tofYoverlap + box2_y + ofsetDetRelBox2_col6_y + corr_Y_col6[1],
471 box2_z + ofsetDetRelBox2_col6_z + corr_Z_col6[1] + tofZshift, geoRot6);
472 topTof->AddNode(vDetector, 27, cR27);
473
474 TGeoCombiTrans* cR28 = new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col6_x + corr_X_col6[2],
475 0. + box2_y + ofsetDetRelBox2_col6_y + corr_Y_col6[2],
476 box2_z + ofsetDetRelBox2_col6_z + corr_Z_col6[2], geoRot6);
477 topTof->AddNode(vDetector, 28, cR28);
478
479 TGeoCombiTrans* cR29 =
480 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col6_x + corr_X_col6[3],
481 -1. * DetYsize + tofYoverlap + box2_y + ofsetDetRelBox2_col6_y + corr_Y_col6[3],
482 box2_z + ofsetDetRelBox2_col6_z + corr_Z_col6[3] + tofZshift, geoRot6);
483 topTof->AddNode(vDetector, 29, cR29);
484
485 TGeoCombiTrans* cR30 =
486 new TGeoCombiTrans("", box2_x + ofsetDetRelBox2_col6_x + corr_X_col6[4],
487 -2. * DetYsize + 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col6_y + corr_Y_col6[4],
488 box2_z + ofsetDetRelBox2_col6_z + corr_Z_col6[4], geoRot6);
489 topTof->AddNode(vDetector, 30, cR30);
490
491 // Box
492 TGeoCombiTrans* cBox2 = new TGeoCombiTrans("", box2_x, box2_y, box2_z, geoRot3);
493 topTof->AddNode(vBox, 2, cBox2);
494
495 // ------------------ Adding the TOP Volume --------------------------
496 top->AddNode(topTof, 1, new TGeoTranslation("tw", 0., 0., 0.));
497
498 // --------------- Finish --------------------------------------------
500
501 gGeoMan->CloseGeometry();
502 gGeoMan->CheckOverlaps(0.001);
503 gGeoMan->PrintOverlaps();
504 gGeoMan->Test();
505
506 TFile* geoFile = new TFile(geoFileName, "RECREATE");
507 top->Write();
508 geoFile->Close();
509
510 top->Draw("ogl");
511 gGeoMan->Browse(new TBrowser);
512}
int i
Definition P4_F32vec4.h:22
double Double_t
constexpr Bool_t kTRUE
#define R__ADD_INCLUDE_PATH(PATH)
kGray
kRed
kGreen
kBlue
kYellow
void Fatal(const char *location, const char *msgfmt,...)
R__EXTERN TGeoManager * gGeoManager
#define gROOT
R__EXTERN TSystem * gSystem
void Close(Option_t *option="") override
void RotateX(Double_t angle) override
void RotateY(Double_t angle) override
void RotateZ(Double_t angle) override
TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="") override
void SetVisContainers(Bool_t flag=kTRUE) override
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
void Draw(Option_t *option="") override
virtual void SetMedium(TGeoMedium *medium)
void SetLineColor(Color_t lcolor) override
virtual void SetName(const char *name)
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
void create_rootgeom_TOF400_RUN9()
Definition json.hpp:4446