22#include "FairGeoBuilder.h"
23#include "FairGeoInterface.h"
24#include "FairGeoLoader.h"
25#include "FairGeoMedia.h"
26#include "FairGeoNode.h"
27#include "FairGeoVolume.h"
28#include "FairLogger.h"
29#include "FairRootManager.h"
31#include "FairRuntimeDb.h"
32#include "FairVolume.h"
36#include "TClonesArray.h"
39#include "TGeoBoolNode.h"
40#include "TGeoCompositeShape.h"
43#include "TGeoManager.h"
44#include "TGeoMaterial.h"
45#include "TGeoShapeAssembly.h"
46#include "TGeoSphere.h"
50#include "TVirtualMC.h"
72 Double_t x_thick_start, Double_t x_thick_end,
73 Double_t y_thick_start, Double_t y_thick_end,
74 Int_t color, TGeoMedium* material,
75 Bool_t sens = kFALSE) {
76 Double_t dz = z_thick / 2;
77 Double_t dx1 = x_thick_start / 2 - 1.E-6;
78 Double_t dx2 = x_thick_end / 2 - 1.E-6;
79 Double_t dy1 = y_thick_start / 2 - 1.E-6;
80 Double_t dy2 = y_thick_end / 2 - 1.E-6;
81 TGeoArb8* T1 =
new TGeoArb8(
"T1" + xname, dz + 1.E-6);
82 T1->SetVertex(0, -dx1, -dy1);
83 T1->SetVertex(1, -dx1, dy1);
84 T1->SetVertex(2, dx1, dy1);
85 T1->SetVertex(3, dx1, -dy1);
86 T1->SetVertex(4, -dx2, -dy2);
87 T1->SetVertex(5, -dx2, dy2);
88 T1->SetVertex(6, dx2, dy2);
89 T1->SetVertex(7, dx2, -dy2);
91 TGeoVolume* T =
new TGeoVolume(xname, T1, material);
92 T->SetLineColor(color);
94 AddSensitiveVolume(T);
100 TString xname, Double_t wallthick, Double_t z_thick, Double_t x_thick_start,
101 Double_t x_thick_end, Double_t y_thick_start, Double_t y_thick_end,
102 Int_t color, TGeoMedium* material, Bool_t sens = kFALSE) {
103 Double_t dx_start = x_thick_start / 2;
104 Double_t dy_start = y_thick_start / 2;
105 Double_t dx_end = x_thick_end / 2;
106 Double_t dy_end = y_thick_end / 2;
107 Double_t dz = z_thick / 2;
109 TString nm = xname.ReplaceAll(
111 Double_t dx1 = dx_start + wallthick;
112 Double_t dx2 = dx_end + wallthick;
113 Double_t dy1 = dy_start + wallthick;
114 Double_t dy2 = dy_end + wallthick;
116 TGeoArb8* T2 =
new TGeoArb8(
"T2" + nm, dz);
117 T2->SetVertex(0, -dx1, -dy1);
118 T2->SetVertex(1, -dx1, dy1);
119 T2->SetVertex(2, dx1, dy1);
120 T2->SetVertex(3, dx1, -dy1);
121 T2->SetVertex(4, -dx2, -dy2);
122 T2->SetVertex(5, -dx2, dy2);
123 T2->SetVertex(6, dx2, dy2);
124 T2->SetVertex(7, dx2, -dy2);
126 Double_t tdx1 = dx_start;
127 Double_t tdx2 = dx_end;
128 Double_t tdy1 = dy_start;
129 Double_t tdy2 = dy_end;
130 TGeoArb8* T1 =
new TGeoArb8(
"T1" + nm, dz + 1.E-6);
131 T1->SetVertex(0, -tdx1, -tdy1);
132 T1->SetVertex(1, -tdx1, tdy1);
133 T1->SetVertex(2, tdx1, tdy1);
134 T1->SetVertex(3, tdx1, -tdy1);
135 T1->SetVertex(4, -tdx2, -tdy2);
136 T1->SetVertex(5, -tdx2, tdy2);
137 T1->SetVertex(6, tdx2, tdy2);
138 T1->SetVertex(7, tdx2, -tdy2);
140 TGeoCompositeShape* T321 =
141 new TGeoCompositeShape(
"T3" + nm,
"T2" + nm +
"-T1" + nm);
142 TGeoVolume* T =
new TGeoVolume(xname, T321, material);
143 T->SetLineColor(color);
146 AddSensitiveVolume(T);
158 return (wx1 + (z - z1) * (wx2 - wx1) / (z2 - z1));
168 return (wy1 + (z - z1) * (wy2 - wy1) / (z2 - z1));
172 double a2,
double b2,
double dA,
double dB,
173 Int_t color, TGeoMedium* material,
174 Bool_t sens = kFALSE) {
180 TGeoArb8* T1 =
new TGeoArb8(dz);
181 T1->SetVertex(0, 0, 0);
182 T1->SetVertex(1, 0, b1);
183 T1->SetVertex(2, a1, b1);
184 T1->SetVertex(3, a1, 0);
186 T1->SetVertex(4, dA, dB);
187 T1->SetVertex(5, dA, dB + b2);
188 T1->SetVertex(6, dA + a2, dB + b2);
189 T1->SetVertex(7, dA + a2, dB);
191 TGeoVolume* T =
new TGeoVolume(xname, T1, material);
192 T->SetLineColor(color);
195 AddSensitiveVolume(T);
201 double a1,
double a2,
double b1,
double b2,
202 double dA,
double dB, Int_t color,
203 TGeoMedium* material, Bool_t sens = kFALSE) {
204 TGeoArb8* T1 =
new TGeoArb8(dz);
207 T1->SetVertex(0, 0, 0);
208 T1->SetVertex(1, 0, b1);
209 T1->SetVertex(2, a1 + b1, b1);
210 T1->SetVertex(3, a1, 0);
212 T1->SetVertex(4, dA, dB);
213 T1->SetVertex(5, dA, dB + b2);
214 T1->SetVertex(6, dA + a2 + b2, dB + b2);
215 T1->SetVertex(7, dA + a2, dB);
217 T1->SetVertex(0, 0, 0);
218 T1->SetVertex(1, -a1, 0);
219 T1->SetVertex(2, -(a1 + b1), b1);
220 T1->SetVertex(3, 0, b1);
222 T1->SetVertex(4, -dA, dB);
223 T1->SetVertex(5, -(dA + a2), dB);
224 T1->SetVertex(6, -(dA + a2 + b2), dB + b2);
225 T1->SetVertex(7, -dA, dB + b2);
228 TGeoVolume* T =
new TGeoVolume(xname, T1, material);
229 T->SetLineColor(color);
232 AddSensitiveVolume(T);
238 double a1,
double a2,
double b1,
double b2,
239 double dA,
double dB, Int_t color,
240 TGeoMedium* material, Bool_t sens = kFALSE) {
241 TGeoArb8* T1 =
new TGeoArb8(dz);
244 T1->SetVertex(0, 0, 0);
245 T1->SetVertex(1, 0, a1);
246 T1->SetVertex(2, b1, a1 + b1);
247 T1->SetVertex(3, b1, 0);
249 T1->SetVertex(4, dB, dA);
250 T1->SetVertex(5, dB, dA + a2);
251 T1->SetVertex(6, dB + b2, dA + a2 + b2);
252 T1->SetVertex(7, dB + b2, dA);
254 T1->SetVertex(0, 0, 0);
255 T1->SetVertex(1, b1, 0);
256 T1->SetVertex(2, b1, -(a1 + b1));
257 T1->SetVertex(3, 0, -a1);
259 T1->SetVertex(4, dB, -dA);
260 T1->SetVertex(5, dB + b2, -dA);
261 T1->SetVertex(6, dB + b2, -(dA + a2 + b2));
262 T1->SetVertex(7, dB, -(dA + a2));
265 TGeoVolume* T =
new TGeoVolume(xname, T1, material);
266 T->SetLineColor(color);
269 AddSensitiveVolume(T);
275 double lt1,
double lt2,
double dz,
276 double slopeX,
double slopeY,
277 Int_t color, TGeoMedium* material,
278 Bool_t sens = kFALSE) {
279 Double_t wz = dz * 2;
280 double d = ribThick * sqrt(2) / 2;
281 double dx = slopeX * wz;
282 double dy = slopeY * wz;
284 TGeoArb8* T1 =
new TGeoArb8(dz);
285 T1->SetVertex(0, lt1, lt1 - d);
286 T1->SetVertex(1, 0, -d);
287 T1->SetVertex(2, 0, 0);
288 T1->SetVertex(3, lt1, lt1);
290 T1->SetVertex(4, dx + lt2, dy + lt2 - d);
291 T1->SetVertex(5, dx, dy - d);
292 T1->SetVertex(6, dx, dy);
293 T1->SetVertex(7, dx + lt2, dy + lt2);
295 TGeoArb8* T2 =
new TGeoArb8(dz);
296 T2->SetVertex(0, lt1 - d, lt1);
297 T2->SetVertex(1, lt1, lt1);
298 T2->SetVertex(2, 0, 0);
299 T2->SetVertex(3, -d, 0);
301 T2->SetVertex(4, dx + lt2 - d, dy + lt2);
302 T2->SetVertex(5, dx + lt2, dy + lt2);
303 T2->SetVertex(6, dx, dy);
304 T2->SetVertex(7, dx - d, dy);
306 TGeoVolume* T1v =
new TGeoVolume(
"part", T1, material);
307 TGeoVolume* T2v =
new TGeoVolume(
"part", T2, material);
308 T1v->SetLineColor(color);
309 T2v->SetLineColor(color);
311 AddSensitiveVolume(T1v);
314 AddSensitiveVolume(T2v);
317 TGeoVolumeAssembly* T =
new TGeoVolumeAssembly(xname);
318 T->AddNode(T1v, 1,
new TGeoTranslation(0, 0, 0));
319 T->AddNode(T2v, 2,
new TGeoTranslation(0, 0, 0));
325 double r = sqrt(x * x + y * y);
330 phi = -acos(x / r) + 2 * TMath::Pi();
332 phi = phi * 180 / TMath::Pi();
333 return static_cast<int>(Z) * 1000000 +
static_cast<int>(r) * 1000 +
334 static_cast<int>(phi);
337int veto::liscId(TString ShapeTypeName,
int blockNr,
int Zlayer,
int number,
342 if (ShapeTypeName ==
"LiScX")
344 else if (ShapeTypeName ==
"LiScY")
346 else if (ShapeTypeName ==
"LiSc_S3")
348 else if (ShapeTypeName ==
"LiSc_S4")
350 else if (ShapeTypeName ==
"LiSc_S5")
352 else if (ShapeTypeName ==
"LiSc_S6")
358 id = ShapeType * 100000 + blockNr * 10000 + Zlayer * 100 + number * 10 +
365 TGeoVolumeAssembly* tDecayVacuum,
366 TGeoVolumeAssembly* tOuterWall,
367 TGeoVolumeAssembly* tLongitRib,
368 TGeoVolumeAssembly* tVerticalRib,
369 TGeoVolumeAssembly* ttLiSc,
int& liScCounter,
int blockNr,
370 int nx,
int ny,
double z1,
double z2,
double Zshift,
371 double cell_thickness_z,
double wallThick,
372 double liscThick1,
double liscThick2,
double ribThick) {
373 TString blockName =
"block";
374 blockName += blockNr;
378 double wz = (z2 - z1);
379 double slX = (
wx(z2) -
wx(z1)) / 2 / wz;
380 double slY = (
wy(z2) -
wy(z1)) / 2 / wz;
382 double dZ = (cell_thickness_z - ribThick) / 2;
390 TString nameInnerWall = (TString)tInnerWall->GetName() +
"_" + blockName;
394 tInnerWall->AddNode(TIW, 0,
new TGeoTranslation(0, 0, Zshift));
397 TString nameDecayVacuum = (TString)tDecayVacuum->GetName() +
"_" + blockName;
400 TDV->SetVisibility(kFALSE);
401 tDecayVacuum->AddNode(TDV, 0,
new TGeoTranslation(0, 0, Zshift));
404 TString nameOuterWall = (TString)tOuterWall->GetName() +
"_" + blockName;
406 nameOuterWall, wallThick, wz,
wx(z1) + 2 * (wallThick + liscThick1),
407 wx(z2) + 2 * (wallThick + liscThick2),
408 wy(z1) + 2 * (wallThick + liscThick1),
410 tOuterWall->AddNode(TOW, 0,
new TGeoTranslation(0, 0, Zshift));
414 std::vector<TGeoVolume*> vLongitRibX(nx);
415 std::vector<TGeoVolume*> vLongitRibY(ny);
417 double z1_x_thickness_1 =
wx(z1 + ribThick) + 2 * (wallThick + liscThick1);
418 double z1_x_thickness_2 =
419 wx(z1 + cell_thickness_z) + 2 * (wallThick + liscThick1);
421 double z1_x1_Step = (z1_x_thickness_1 - nx * ribThick) / (nx + 1);
422 double z1_x2_Step = (z1_x_thickness_2 - nx * ribThick) / (nx + 1);
424 double z1_y_thickness_1 =
wy(z1 + ribThick) + 2 * (wallThick + liscThick1);
425 double z1_y_thickness_2 =
426 wy(z1 + cell_thickness_z) + 2 * (wallThick + liscThick1);
428 double z1_y1_Step = (z1_y_thickness_1 - ny * ribThick) / (ny + 1);
429 double z1_y2_Step = (z1_y_thickness_2 - ny * ribThick) / (ny + 1);
431 double z1_x1, z1_x2, z1_y1, z1_y2;
433 z1_x1 = z1_x_thickness_1 / 2;
434 z1_x2 = z1_x_thickness_2 / 2;
436 z1_y1 = z1_y_thickness_1 / 2 - liscThick1;
437 z1_y2 = z1_y_thickness_2 / 2 - liscThick2;
439 for (
int i = 0; i < nx; i++) {
440 z1_x1 = z1_x1 - z1_x1_Step;
441 z1_x2 = z1_x2 - z1_x2_Step;
444 name.Form(
"vLongitRibX_%s_phi%d", blockName.Data(),
447 GeoSideObj(name, dZ, ribThick, liscThick1, ribThick, liscThick2,
450 z1_x1 = z1_x1 - ribThick;
451 z1_x2 = z1_x2 - ribThick;
454 z1_y1 = z1_y_thickness_1 / 2;
455 z1_y2 = z1_y_thickness_2 / 2;
457 z1_x1 = z1_x_thickness_1 / 2 - liscThick1;
458 z1_x2 = z1_x_thickness_2 / 2 - liscThick2;
460 for (
int i = 0; i < ny; i++) {
461 z1_y1 = z1_y1 - z1_y1_Step;
462 z1_y2 = z1_y2 - z1_y2_Step;
465 name.Form(
"vLongitRibY_%s_phi%d", blockName.Data(),
468 GeoSideObj(name, dZ, liscThick1, ribThick, liscThick2, ribThick,
470 z1_y1 = z1_y1 - ribThick;
471 z1_y2 = z1_y2 - ribThick;
476 name =
"CornerRib_L_" + blockName +
"_id";
477 TGeoVolumeAssembly* CornerRib_L =
478 GeoCornerRib(name, ribThick, liscThick1, liscThick2, dZ, slX, slY,
480 name =
"CornerRib_R_" + blockName +
"_id";
481 TGeoVolumeAssembly* CornerRib_R =
482 GeoCornerRib(name, ribThick, liscThick1, liscThick2, dZ, slY, slX,
485 for (
double zi = z1; zi < z2; zi += cell_thickness_z) {
486 int Zlayer =
static_cast<int>(zi) / cell_thickness_z + 1;
490 nameVR.Form(
"VetoVerticalRib_z%d",
static_cast<int>(zi));
492 nameVR, liscThick1, ribThick,
wx(zi) + 2 * wallThick,
493 wx(zi + ribThick) + 2 * wallThick,
wy(zi) + 2 * wallThick,
495 tZ = Zshift - wz / 2 + zi - z1 + ribThick / 2;
497 tVerticalRib->AddNode(TVR, 0,
new TGeoTranslation(0, 0, tZ));
499 if (z2 - zi < cell_thickness_z)
continue;
501 tX =
wx(zi + ribThick) / 2 + wallThick;
502 tY =
wy(zi + ribThick) / 2 + wallThick;
503 tZ = tZ + cell_thickness_z / 2;
507 CornerRib_L,
makeId(zi, tX, tY),
508 new TGeoCombiTrans(tX, tY, tZ,
new TGeoRotation(
"r", 0, 0, 0)));
510 CornerRib_L,
makeId(zi, -tX, -tY),
511 new TGeoCombiTrans(-tX, -tY, tZ,
new TGeoRotation(
"r", 0, 0, 180)));
513 CornerRib_R,
makeId(zi, -tX, tY),
514 new TGeoCombiTrans(-tX, tY, tZ,
new TGeoRotation(
"r", 0, 0, 90)));
516 CornerRib_R,
makeId(zi, tX, -tY),
517 new TGeoCombiTrans(tX, -tY, tZ,
new TGeoRotation(
"r", 0, 0, 270)));
519 double zi_x_thickness_1 =
wx(zi + ribThick) + 2 * (wallThick + liscThick1);
520 double zi_x_thickness_2 =
521 wx(zi + cell_thickness_z) + 2 * (wallThick + liscThick1);
523 double zi_x1_Step = (zi_x_thickness_1 - nx * ribThick) / (nx + 1);
524 double zi_x2_Step = (zi_x_thickness_2 - nx * ribThick) / (nx + 1);
526 double zi_y_thickness_1 =
wy(zi + ribThick) + 2 * (wallThick + liscThick1);
527 double zi_y_thickness_2 =
528 wy(zi + cell_thickness_z) + 2 * (wallThick + liscThick1);
530 double zi_y1_Step = (zi_y_thickness_1 - ny * ribThick) / (ny + 1);
531 double zi_y2_Step = (zi_y_thickness_2 - ny * ribThick) / (ny + 1);
533 double zi_x1, zi_x2, zi_y1, zi_y2;
535 zi_x1 = zi_x_thickness_1 / 2 - liscThick1;
536 zi_x2 = zi_x_thickness_2 / 2 - liscThick1;
538 zi_y1 = zi_y_thickness_1 / 2;
539 zi_y2 = zi_y_thickness_2 / 2;
542 name.Form(
"LiSc_S4_%d",
liscId(
"LiSc_S4", blockNr, Zlayer, 0, 0));
544 name, dZ, 0, zi_y1_Step - liscThick1, zi_y2_Step - liscThick2,
545 liscThick1, liscThick2, zi_y2_Step - zi_y1_Step, zi_x2 - zi_x1,
547 ttLiSc->AddNode(LiSc_S4,
liscId(
"LiSc_S4", blockNr, Zlayer, 0, 1),
548 new TGeoCombiTrans(zi_x1, -(zi_y1 - zi_y1_Step), tZ,
549 new TGeoRotation(
"r", 0, 0, 0)));
550 ttLiSc->AddNode(LiSc_S4,
liscId(
"LiSc_S4", blockNr, Zlayer, 0, 2),
551 new TGeoCombiTrans(-zi_x1, (zi_y1 - zi_y1_Step), tZ,
552 new TGeoRotation(
"r", 0, 0, 180)));
555 name.Form(
"LiSc_S6_%d",
liscId(
"LiSc_S6", blockNr, Zlayer, ny, 0));
557 name, dZ, 1, zi_y1_Step - liscThick1, zi_y2_Step - liscThick2,
558 liscThick1, liscThick2, zi_y2_Step - zi_y1_Step, zi_x2 - zi_x1,
560 ttLiSc->AddNode(LiSc_S6,
liscId(
"LiSc_S6", blockNr, Zlayer, ny, 1),
561 new TGeoCombiTrans(zi_x1, (zi_y1 - zi_y1_Step), tZ,
562 new TGeoRotation(
"r", 0, 0, 0)));
563 ttLiSc->AddNode(LiSc_S6,
liscId(
"LiSc_S6", blockNr, Zlayer, ny, 2),
564 new TGeoCombiTrans(-zi_x1, -(zi_y1 - zi_y1_Step), tZ,
565 new TGeoRotation(
"r", 0, 0, 180)));
567 for (
int i = 0; i < ny; i++) {
568 zi_y1 = zi_y1 - zi_y1_Step;
569 zi_y2 = zi_y2 - zi_y2_Step;
571 tLongitRib->AddNode(vLongitRibY.at(i),
makeId(zi, zi_x1, zi_y1),
572 new TGeoCombiTrans(zi_x1, (zi_y1 - ribThick), tZ,
573 new TGeoRotation(
"r", 0, 0, 0)));
574 tLongitRib->AddNode(vLongitRibY.at(i),
makeId(zi, -zi_x1, -zi_y1),
575 new TGeoCombiTrans(-zi_x1, -(zi_y1 - ribThick), tZ,
576 new TGeoRotation(
"r", 0, 0, 180)));
580 name.Form(
"LiScY_%d",
liscId(
"LiScY", blockNr, Zlayer, i, 0));
582 name, dZ, liscThick1, zi_y1_Step, liscThick2, zi_y2_Step,
583 zi_x2 - zi_x1, zi_y2 - zi_y1, kMagenta - 10,
vetoMed,
true);
584 ttLiSc->AddNode(LiScY,
liscId(
"LiScY", blockNr, Zlayer, i, 1),
585 new TGeoCombiTrans(zi_x1, zi_y1, tZ,
586 new TGeoRotation(
"r", 0, 0, 0)));
587 ttLiSc->AddNode(LiScY,
liscId(
"LiScY", blockNr, Zlayer, i, 2),
588 new TGeoCombiTrans(-zi_x1, -zi_y1, tZ,
589 new TGeoRotation(
"r", 0, 0, 180)));
592 zi_y1 = zi_y1 - ribThick;
593 zi_y2 = zi_y2 - ribThick;
596 zi_x1 = zi_x_thickness_1 / 2;
597 zi_x2 = zi_x_thickness_2 / 2;
599 zi_y1 = zi_y_thickness_1 / 2 - liscThick1;
600 zi_y2 = zi_y_thickness_2 / 2 - liscThick1;
603 name.Form(
"LiSc_S3_%d",
liscId(
"LiSc_S3", blockNr, Zlayer, 0, 0));
606 name, dZ, 0, zi_x1_Step - liscThick1 - ribThick / sqrt(2),
607 zi_x2_Step - liscThick2 - ribThick / sqrt(2), liscThick1, liscThick2,
608 zi_x2_Step - zi_x1_Step - ribThick / 2, zi_y2 - zi_y1, kMagenta - 10,
610 ttLiSc->AddNode(LiSc_S3,
liscId(
"LiSc_S3", blockNr, Zlayer, 0, 1),
611 new TGeoCombiTrans(-(zi_x1 - zi_x1_Step), zi_y1, tZ,
612 new TGeoRotation(
"r", 0, 0, 0)));
613 ttLiSc->AddNode(LiSc_S3,
liscId(
"LiSc_S3", blockNr, Zlayer, 0, 2),
614 new TGeoCombiTrans((zi_x1 - zi_x1_Step), -zi_y1, tZ,
615 new TGeoRotation(
"r", 0, 0, 180)));
618 name.Form(
"LiSc_S5_%d",
liscId(
"LiSc_S5", blockNr, Zlayer, nx, 0));
621 name, dZ, 1, zi_x1_Step - liscThick1 - ribThick / sqrt(2),
622 zi_x2_Step - liscThick2 - ribThick / sqrt(2), liscThick1, liscThick2,
623 zi_x2_Step - zi_x1_Step - ribThick / 2, zi_y2 - zi_y1, kMagenta - 10,
625 ttLiSc->AddNode(LiSc_S5,
liscId(
"LiSc_S5", blockNr, Zlayer, nx, 1),
626 new TGeoCombiTrans((zi_x1 - zi_x1_Step), zi_y1, tZ,
627 new TGeoRotation(
"r", 0, 0, 0)));
628 ttLiSc->AddNode(LiSc_S5,
liscId(
"LiSc_S5", blockNr, Zlayer, nx, 2),
629 new TGeoCombiTrans(-(zi_x1 - zi_x1_Step), -zi_y1, tZ,
630 new TGeoRotation(
"r", 0, 0, 180)));
632 for (
int i = 0; i < nx; i++) {
633 zi_x1 = zi_x1 - zi_x1_Step;
634 zi_x2 = zi_x2 - zi_x2_Step;
636 tLongitRib->AddNode(vLongitRibX.at(i),
makeId(zi, zi_x1, zi_y1),
637 new TGeoCombiTrans((zi_x1 - ribThick), zi_y1, tZ,
638 new TGeoRotation(
"r", 0, 0, 0)));
639 tLongitRib->AddNode(vLongitRibX.at(i),
makeId(zi, -zi_x1, -zi_y1),
640 new TGeoCombiTrans(-(zi_x1 - ribThick), -zi_y1, tZ,
641 new TGeoRotation(
"r", 0, 0, 180)));
645 name.Form(
"LiScX_%d",
liscId(
"LiScX", blockNr, Zlayer, i, 0));
647 name, dZ, zi_x1_Step, liscThick1, zi_x2_Step, liscThick2,
648 zi_x2 - zi_x1, zi_y2 - zi_y1, kMagenta - 10,
vetoMed,
true);
649 ttLiSc->AddNode(LiScX,
liscId(
"LiScX", blockNr, Zlayer, i, 1),
650 new TGeoCombiTrans(zi_x1, zi_y1, tZ,
651 new TGeoRotation(
"r", 0, 0, 0)));
652 ttLiSc->AddNode(LiScX,
liscId(
"LiScX", blockNr, Zlayer, i, 2),
653 new TGeoCombiTrans(-zi_x1, -zi_y1, tZ,
654 new TGeoRotation(
"r", 0, 0, 180)));
657 zi_x1 = zi_x1 - ribThick;
658 zi_x2 = zi_x2 - ribThick;
664 TGeoVolumeAssembly* tTankVol =
new TGeoVolumeAssembly(
"T2");
666 Double_t cell_thickness_z0 =
668 Double_t cell_thickness_z =
671 TString nameInnerWall =
"VetoInnerWall";
672 TGeoVolumeAssembly* tInnerWall =
new TGeoVolumeAssembly(nameInnerWall);
674 TString nameDecayVacuum =
"DecayVacuum";
675 TGeoVolumeAssembly* tDecayVacuum =
new TGeoVolumeAssembly(nameDecayVacuum);
677 TString nameOuterWall =
"VetoOuterWall";
678 TGeoVolumeAssembly* tOuterWall =
new TGeoVolumeAssembly(nameOuterWall);
680 TString nameLongitRib =
"VetoLongitRib";
681 TGeoVolumeAssembly* tLongitRib =
new TGeoVolumeAssembly(nameLongitRib);
683 TString nameVerticalRib =
"VetoVerticalRib";
684 TGeoVolumeAssembly* tVerticalRib =
new TGeoVolumeAssembly(nameVerticalRib);
686 TString nameLiSc =
"VetoLiSc";
687 TGeoVolumeAssembly* ttLiSc =
new TGeoVolumeAssembly(nameLiSc);
700 double z2 = 800 *
mm;
701 double wz = (z2 - z1);
703 double Zshift = wz / 2;
705 AddBlock(tInnerWall, tDecayVacuum, tOuterWall, tLongitRib, tVerticalRib,
706 ttLiSc, liScCounter, 1, nx, ny, z1, z2, Zshift, cell_thickness_z0,
707 wallThick, liscThick, liscThick, ribThick);
720 AddBlock(tInnerWall, tDecayVacuum, tOuterWall, tLongitRib, tVerticalRib,
721 ttLiSc, liScCounter, 2, nx, ny, z1, z2, Zshift, cell_thickness_z,
722 wallThick, liscThick, liscThick, ribThick);
727 nameVR.Form(
"VetoVerticalRib_z%d",
static_cast<int>(zi));
729 nameVR, liscThick, ribThick,
wx(zi) + 2 * wallThick,
730 wx(zi + ribThick) + 2 * wallThick,
wy(zi) + 2 * wallThick,
732 double tZ = Zshift - wz / 2 + zi - z1 + ribThick / 2;
734 tVerticalRib->AddNode(TVR, 0,
new TGeoTranslation(0, 0, tZ));
736 tTankVol->AddNode(tInnerWall, 0,
new TGeoTranslation(0, 0, 0));
737 tTankVol->AddNode(tDecayVacuum, 0,
new TGeoTranslation(0, 0, 0));
738 tTankVol->AddNode(tOuterWall, 0,
new TGeoTranslation(0, 0, 0));
739 tTankVol->AddNode(tVerticalRib, 0,
new TGeoTranslation(0, 0, 0));
740 tTankVol->AddNode(tLongitRib, 0,
new TGeoTranslation(0, 0, 0));
741 tTankVol->AddNode(ttLiSc, 0,
new TGeoTranslation(0, 0, 0));
763 if (gMC->IsTrackEntering()) {
765 fTime = gMC->TrackTime() * 1.0e09;
767 gMC->TrackPosition(
fPos);
768 gMC->TrackMomentum(
fMom);
774 if (gMC->IsTrackExiting() || gMC->IsTrackStop() ||
775 gMC->IsTrackDisappeared()) {
780 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
783 gMC->CurrentVolID(veto_uniqueId);
784 TParticle* p = gMC->GetStack()->GetCurrentTrack();
785 Int_t pdgCode = p->GetPdgCode();
787 gMC->TrackPosition(pos);
789 gMC->TrackMomentum(Mom);
790 Double_t xmean = (
fPos.X() + pos.X()) / 2.;
791 Double_t ymean = (
fPos.Y() + pos.Y()) / 2.;
792 Double_t zmean = (
fPos.Z() + pos.Z()) / 2.;
795 pdgCode, TVector3(pos.X(), pos.Y(), pos.Z()),
796 TVector3(Mom.Px(), Mom.Py(), Mom.Pz()));
800 stack->AddPoint(
kVETO);
810 if (TMath::Abs(gMC->TrackPid()) != 13) {
824 TGeoVolume* top = gGeoManager->GetTopVolume();
832 gGeoManager->SetNsegments(100);
834 vetoMed = gGeoManager->GetMedium(
843 TGeoVolume* tDecayVol =
new TGeoVolumeAssembly(
"DecayVolume");
846 tDecayVol->AddNode(seg, 1,
new TGeoTranslation(0, 0, 0));
847 top->AddNode(tDecayVol, 1,
new TGeoTranslation(0, 0,
zStartDecayVol));
851 const char* Vol =
"TGeoVolume";
852 const char* Cavern =
"Cavern";
853 const char* Ain =
"AbsorberAdd";
854 const char* Aout =
"AbsorberAddCore";
855 TObjArray* volumelist = gGeoManager->GetListOfVolumes();
856 int lastvolume = volumelist->GetLast();
857 int volumeiterator = 0;
858 while (volumeiterator <= lastvolume) {
859 const char* volumename = volumelist->At(volumeiterator)->GetName();
860 const char* classname = volumelist->At(volumeiterator)->ClassName();
861 if (strstr(classname, Vol)) {
862 if (strstr(volumename, Cavern) || strstr(volumename, Ain) ||
863 strstr(volumename, Aout)) {
864 AddSensitiveVolume(gGeoManager->GetVolume(volumename));
865 LOG(info) <<
"veto: made sensitive for following muons: "
Int_t fTrackID
event index
TLorentzVector fPos
volume id
Double_t fTime
momentum at entrance
vetoPoint * AddHit(Args &&... args)
TLorentzVector fMom
position at entrance
TGeoVolume * GeoTrapezoidHollow(TString xname, Double_t thick, Double_t wz, Double_t wX_start, Double_t wX_end, Double_t wY_start, Double_t wY_end, Int_t color, TGeoMedium *material, Bool_t sens)
TString supportMedIn_name
medium of internal support structure(Default = Aluminum).
int liscId(TString ShapeTypeName, int blockNr, int Zlayer, int number, int position)
TString decayVolumeMed_name
medium of decay volume(Default= helium).
Bool_t ProcessHits(FairVolume *v=0) override
Processes a hit in the veto detector.
int makeId(double z, double x, double y)
TGeoMedium * supportMedOut
TGeoMedium * decayVolumeMed
TGeoVolume * GeoCornerLiSc2(TString xname, double dz, bool isClockwise, double a1, double a2, double b1, double b2, double dA, double dB, Int_t color, TGeoMedium *material, Bool_t sens)
TGeoVolume * MakeSegments()
Float_t VetoStartInnerX
Width of the Vessel along X at the start.
double wy(double z)
slope along the length (y)
Float_t VetoEndInnerX
Width of the Vessel along X at the end.
TGeoVolume * GeoSideObj(TString xname, double dz, double a1, double b1, double a2, double b2, double dA, double dB, Int_t color, TGeoMedium *material, Bool_t sens)
TGeoVolumeAssembly * GeoCornerRib(TString xname, double ribThick, double lt1, double lt2, double dz, double slopeX, double slopeY, Int_t color, TGeoMedium *material, Bool_t sens)
Float_t f_VetoThickness
Thickness of the liquid scintillator along z(Default = 20cm).
void AddBlock(TGeoVolumeAssembly *tInnerWall, TGeoVolumeAssembly *tDecayVacuum, TGeoVolumeAssembly *tOuterWall, TGeoVolumeAssembly *tLongitRib, TGeoVolumeAssembly *tVerticalRib, TGeoVolumeAssembly *ttLiSc, int &liScCounter, int blockNr, int nx, int ny, double z1, double z2, double Zshift, double dist, double wallThick, double liscThick1, double liscThick2, double ribThick)
Float_t VetoEndInnerY
Length of the Vessel along Y at the end.
TGeoVolume * GeoCornerLiSc1(TString xname, double dz, bool isClockwise, double a1, double a2, double b1, double b2, double dA, double dB, Int_t color, TGeoMedium *material, Bool_t sens)
Float_t zStartDecayVol
z Position of the Decay Volume start in the global coordinate system
TGeoMedium * supportMedIn
TString supportMedOut_name
medium of external support structure(Default = Aluminum).
Float_t f_InnerSupportThickness
TGeoVolume * GeoTrapezoid(TString xname, Double_t wz, Double_t wX_start, Double_t wX_end, Double_t wY_start, Double_t wY_end, Int_t color, TGeoMedium *material, Bool_t sens)
void ConstructGeometry() override
Constructs the detector geometry.
TString vetoMed_name
medium of veto counter, liquid or plastic scintillator
double wx(double z)
slope along the width (x)
veto()
Constructor for the Veto class.
Float_t VetoStartInnerY
Length of the Vessel along Y at the start.
Int_t fLiquidVeto
Flag option for Liquid Scintillator (Default=True).
Int_t InitMedium(const char *name)
Double_t cm
for FairLogger, MESSAGE_ORIGIN