16 #include <phparameter/PHParameters.h>
22 #include <Geant4/G4Color.hh>
23 #include <Geant4/G4Box.hh>
24 #include <Geant4/G4LogicalVolume.hh>
25 #include <Geant4/G4Material.hh>
26 #include <Geant4/G4PVPlacement.hh>
27 #include <Geant4/G4SubtractionSolid.hh>
28 #include <Geant4/G4SystemOfUnits.hh>
29 #include <Geant4/G4Tubs.hh>
30 #include <Geant4/G4Box.hh>
31 #include <Geant4/G4Para.hh>
32 #include <Geant4/G4RotationMatrix.hh>
33 #include <Geant4/G4SystemOfUnits.hh>
34 #include <Geant4/G4ThreeVector.hh>
35 #include <Geant4/G4Transform3D.hh>
36 #include <Geant4/G4Types.hh>
37 #include <Geant4/G4VPhysicalVolume.hh>
39 #include <Geant4/G4UnionSolid.hh>
40 #include <Geant4/G4VisAttributes.hh>
41 #include <Geant4/G4TwoVector.hh>
42 #include <Geant4/G4ExtrudedSolid.hh>
43 #include <Geant4/G4Trd.hh>
68 const std::string &dnam,
const int lyr)
70 , m_Params(parameters)
119 std::cout <<
"EICG4LumiDetector: Begin Construction" << std::endl;
163 double factorV1 = 1.0;
164 double factorV2 = 1.0;
165 double factorV3 = 1.0;
171 std::string TrianTrapMaterial =
"G4_AIR";
172 std::string CuboidMaterial =
"G4_AIR";
173 std::string MagCoreMaterial =
"G4_AIR";
174 std::string RecConeMaterial =
"G4_AIR";
175 std::string ExitWinV2Material =
"G4_AIR";
176 std::string ExitWinV3Material =
"G4_AIR";
185 case 2: TrianTrapMaterial =
"G4_Galactic";
186 CuboidMaterial =
"G4_Galactic";
187 MagCoreMaterial =
"G4_Galactic";
189 ExitWinV2Material = LumiWin_Material;
193 case 3: TrianTrapMaterial =
"G4_Galactic";
194 CuboidMaterial =
"G4_Galactic";
195 MagCoreMaterial =
"G4_Galactic";
196 RecConeMaterial =
"G4_Galactic";
197 ExitWinV2Material =
"G4_Galactic";
199 ExitWinV3Material = LumiWin_Material;
203 default : std::cout<<
"WRONG CHOICE (ONLY 1, 2 & 3)"<<endl;
228 LumiSpec_Z + LumiSpecTower_DZ/2.0 + LumiWin_Thickness + LumiTracker2_DZ/2.0 );
231 double LumiTracker1_XY = pos_tr2.
y() - size_ewV2.
y()/2.;
236 TotalLumiSpecTower*LumiSpecTower_XY, TotalLumiSpecTower*LumiSpecTower_XY, LumiSpecTower_DZ );
239 double dz_tr2_daughter = -1*pos_tr2.
z() - (-1*pos_ov.
z() + size_ov.
z()/2.0);
243 -1*(dz_tr2_daughter/2.0) + size_tr2.
z()/2.0 );
252 AddLumiWindow( size_lw, pos_lw, LumiWin_Tilt, LumiWin_Material, logicWorld);
254 AddCuboid( size_lw, pos_lw, size_ov, pos_ov, LumiWin_Tilt, CuboidMaterial, logicWorld);
260 size_tr2, pos_tr2, LumiWin_Tilt, RecConeMaterial, logicWorld );
262 AddExitWindowForV2( size_ewV2, pos_ewV2_daughter, LumiWin_Tilt, ExitWinV2Material, logicRecCone );
266 AddLumiTracker(
"TopSpecTracker1", 0, size_tr1, pos_tr1_top, logicRecCone);
267 AddLumiTracker(
"BotSpecTracker1", 1, size_tr1, pos_tr1_bot, logicRecCone);
268 AddLumiTracker(
"TopSpecTracker2", 2, size_tr2, pos_tr2_top, logicRecCone);
269 AddLumiTracker(
"BotSpecTracker2", 3, size_tr2, pos_tr2_bot, logicRecCone);
271 AddExitWindowForV3( size_ewV3, pos_lw, size_tr2, pos_tr2, ExitWinV3Material, logicWorld );
275 AddCAL(
"TopSpecTower", size_st,
G4ThreeVector(LumiWin_X, pos_tr2.
y(), LumiSpec_Z), TotalLumiSpecTower, logicWorld );
276 AddCAL(
"BotSpecTower", size_st,
G4ThreeVector(LumiWin_X, -1*pos_tr2.
y(), LumiSpec_Z), TotalLumiSpecTower, logicWorld );
284 std::cout <<
"EICG4Lumi Detector:" << std::endl;
285 if (what ==
"ALL" || what ==
"VOLUME")
287 std::cout <<
"Version 0.1" << std::endl;
288 std::cout <<
"Parameters:" << std::endl;
304 std::string
name =
"LumiWindow";
305 G4Box *solid =
new G4Box(name +
"_solid", (size.
x()/2.0) + 0.3*
cm, size.
y()/2.0, size.
z()/2.0 );
311 logical->SetVisAttributes(vis);
327 std::string
name =
"LumiExitWindow";
331 G4Box *solid =
new G4Box(name +
"_solid", size.
x(), size.
y(), size.
z());
336 logical->SetVisAttributes(vis);
351 std::string
name =
"LumiMag_OuterVessel";
354 G4Tubs *solid =
new G4Tubs(name+
"_solid", size.
x(), size.
y(), size.
z()/2., 0., 360.*
deg);
359 logical->SetVisAttributes( vis );
369 std::string
name =
"LumiMag_MagCore";
381 logical->SetFieldManager(fman,
true);
394 std::string
name =
"LumiTrainTrap";
395 std::vector<G4TwoVector> polygon;
397 double x1 = -1*(size.
x()/2.0)*TMath::Cos(angle);
398 double y1 = -1*(size.
x()/2.0)*TMath::Sin(angle);
400 double x2 = (size.
x()/2.0)*TMath::Cos(angle);
401 double y2 = -1*(size.
x()/2.0)*TMath::Sin(angle);
403 double x3 = (size.
x()/2.0)*TMath::Cos(angle);
404 double y3 = (size.
x()/2.0)*TMath::Sin(angle);
406 polygon.push_back({
x1, y1});
407 polygon.push_back({
x2, y2});
408 polygon.push_back({
x3, y3});
411 std::vector<G4ExtrudedSolid::ZSection> zsections = {
412 {-1*size.
y()/2.0, {0,0}, 1.0}, {size.
y()/2.0, {0,0}, 1.0} };
439 std::string
name =
"LumiCuboid";
440 double dz_cuboid = -1*Mpos.
z() - (Msize.
z()/2.0) - ( -1*Wpos.
z() + ((Wsize.
x()/2.0)*TMath::Sin(angle)));
441 G4Box *solid =
new G4Box(name +
"_solid",(Wsize.
x()/2.0)*TMath::Cos(angle), Wsize.
y()/2.0, dz_cuboid/2.0);
448 double zpos_cuboid = Wpos.
z() - (Wsize.
x()/2.0)*TMath::Sin(angle) - dz_cuboid/2.0 ;
462 double dz_rec_cone = ( -1*Tr2pos.
z() + Tr2size.
z()/2.0 ) - (-1*Mpos.
z() + Msize.
z()/2.0);
463 G4Trd *solid =
new G4Trd(
"solid", Tr2size.
x()/2.0 + 1*
cm,(Wsize.
x()/2.0)*TMath::Cos(angle), Tr2pos.
y() + Tr2size.
y()/2.0 + 2.0*
cm, Wsize.
y()/2.0, dz_rec_cone/2.0);
480 std::string
name =
"LumiExitWinV2";
481 G4Box *solid =
new G4Box(name+
"solid",(Wsize.
x()/2.0)*TMath::Cos(angle), Wsize.
y()/2.0, Wsize.
z()/2.0);
496 G4Box *solid =
new G4Box(name +
"_solid", size.
x()/2.0 , size.
y()/2.0 , size.
z()/2.0);
514 std::string
name =
"LumiExitWinV3";
515 G4Box *solid =
new G4Box(name+
"_solid",Tr2size.
x()/2.0 + 1*
cm, Tr2size.
y() + Tr2pos.
y()/2.0 + 2.0*
cm, Wsize.
z()/2.0);
533 G4int nxy = total_tower;
553 G4Box *mods =
new G4Box(name+
"_mod", modxy/2, modxy/2, modz/2);
563 G4double xypos0 = -(nxy*towerSizeXY)/2 + towerSizeXY/2;
564 for(
G4int ix=0; ix<nxy; ix++) {
565 for(
G4int iy=0; iy<nxy; iy++) {
566 G4double xpos = xypos0 + ix*towerSizeXY;
567 G4double ypos = xypos0 + iy*towerSizeXY;
578 const double dist=1.0;
579 const double tot_len=calorSizeXY;
580 const double h=0.5*sqrt(3)*dist;
582 const int nx1=
int((tot_len-2*offset)/(dist/2))+1;
583 const int ny1=
int((tot_len-offset)/(2*h))+1;
584 const int ny2=
int((tot_len-offset-h)/(2*h))+1;
586 const double x0=-((tot_len/2.0)-
offset);
587 const double y01=((tot_len/2.0)-
offset);
588 const double y02=((tot_len/2.0)-offset-
h);
596 if( ! EMCal_abs_mat ) {
604 G4VSolid* calorimeterEM =
new G4Box(
"CalorimeterEM_", calorSizeXY/2, calorSizeXY/2, calorEMZ/2);
610 calorSizeXY/2, calorSizeXY/2, calorEMZ/2);
616 0.0, 0.235*
mm, calorEMZ/2,0.0,360.0 *
deg);
622 double step_x=(dist/2.0)*
mm;
623 double step_y=(2.0*
h)*
mm;
626 for(
int i=0;i<nx1;i++){
633 int jend=(i%2==0) ? ny1 : ny2;
634 for(
int j=0;j<jend;j++){
637 if(i%2==0) pos_y=y01*
mm-j*step_y;
638 if(i%2!=0) pos_y=y02*
mm-j*step_y;