68 std::cout <<
"\n\n\tnominal beam energy: "<<idEnergy <<
G4endl;
69 std::cout <<
"\tJaw X aperture: 1) "<< jaw1XAperture/
mm<<
"[mm]\t2) " << jaw2XAperture/
mm<<
" [mm]"<<
G4endl;
70 std::cout <<
"\tJaw Y aperture: 1) "<< jaw1YAperture/
mm<<
"[mm]\t2) " << jaw2YAperture/
mm<<
" [mm]\n"<<
G4endl;
107 if (materialName==
"steel1")
111 steel1 -> AddElement(elFe, 0.935);
112 steel1 -> AddElement(elS,0.01);
113 steel1 -> AddElement(elMn,0.05);
114 steel1 -> AddElement(elC,0.005);
117 else if (materialName==
"steel2")
121 steel2 -> AddElement(elFe, 0.759);
122 steel2 -> AddElement(elNi, 0.11);
123 steel2 -> AddElement(elSi,0.01);
124 steel2 -> AddElement(elCr,0.12);
125 steel2 -> AddElement(elP,0.001);
128 else if (materialName==
"steel3")
132 steel3 -> AddElement(elFe, 0.69);
133 steel3 -> AddElement(elNi, 0.1);
134 steel3 -> AddElement(elSi,0.01);
135 steel3 -> AddElement(elCr,0.18);
136 steel3 -> AddElement(elMn,0.02);
139 else if (materialName==
"EZcut")
143 EZcut20 -> AddElement(elFe, 0.98);
144 EZcut20 -> AddElement(elMn,0.02);
147 else if (materialName==
"W")
151 W -> AddElement(elW, 1.);
178 bool CML2Acc1::target()
199 G4Box* targetA_box =
new G4Box(
"targetA_box",targetADim_x,targetADim_y,targetADim_z);
206 "targetA",targetA_log,PVWorld,
false,0);
211 G4Box* targetB_box =
new G4Box(
"targetB_box",targetBDim_x,targetBDim_y,targetBDim_z);
218 "targetB",targetB_log,PVWorld,
false,0);
251 bool CML2Acc1::primaryCollimator()
276 G4Tubs* UpperCollimator =
new G4Tubs(
"UpperCollimator",innerRadiusOfTheTubeEx,
277 outerRadiusOfTheTubeEx,hightOfTheTubeEx,
278 startAngleOfTheTubeEx,spanningAngleOfTheTubeEx);
286 UpperCollimatorPosZ),
"UpperCollimator",
287 UpperCollimator_log,PVWorld,
false,0);
301 G4Cons* collim_cone =
new G4Cons(
"collim_cone",pRmin1,pRmax1,pRmin2,
302 pRmax2,hightOfTheCone,startAngleOfTheCone,
303 spanningAngleOfTheCone);
312 G4Tubs* tracker_tube =
new G4Tubs(
"tracker_tube",innerRadiusOfTheTube,
313 outerRadiusOfTheTube,hightOfTheTube,
314 startAngleOfTheTube,spanningAngleOfTheTube);
319 tracker_tube,collim_cone);
326 "CylMinusCone",CylMinusCone_log,PVWorld,
false,0);
357 bool CML2Acc1::BeWindow()
384 bool CML2Acc1::flatteningFilter()
394 regVol=
new G4Region(
"flatfilterR");
404 centre.
set(0.,0.,z0);
407 FFL1A_1PV=
new G4PVPlacement(0, centre,
"FFL1A_1PV", FFL1A_1LV, PVWorld,
false, 0);
417 FFL2_1PV=
new G4PVPlacement(0, centre,
"FFL2_1PV", FFL2_1LV, PVWorld,
false, 0);
435 bool CML2Acc1::ionizationChamber()
443 regVol=
new G4Region(
"ionizationChamber");
448 G4Tubs* ICTubeW =
new G4Tubs(
"ionizationChamberTube", 0., 2.*2.54*10.*
mm, 0.016*25.4*
mm, 0.*
deg, 360.*
deg);
449 G4Tubs* ICTubeP =
new G4Tubs(
"ionizationChamberTube", 0., 2.*2.54*10.*
mm, 0.010*25.4*
mm, 0.*
deg, 360.*
deg);
453 centre.
set(0.,0.,157.*
mm);
455 PCUtubeW1PV=
new G4PVPlacement(0, centre,
"ionizationChamberTubeW1PV", PCUTubeW1LV, PVWorld,
false, 0);
464 centre.
set(0.,0.,158.*
mm);
466 PCUtubeP1PV=
new G4PVPlacement(0, centre,
"ionizationChamberTubeP1PV", PCUTubeP1LV, PVWorld,
false, 0);
475 centre.
set(0.,0.,159.*
mm);
477 PCUtubeW2PV=
new G4PVPlacement(0, centre,
"ionizationChamberTubeW2PV", PCUTubeW2LV, PVWorld,
false, 0);
486 centre.
set(0.,0.,160.*
mm);
488 PCUtubeP2PV=
new G4PVPlacement(0, centre,
"ionizationChamberTubeP2PV", PCUTubeP2LV, PVWorld,
false, 0);
497 centre.
set(0.,0.,161.*
mm);
499 PCUtubeW3PV=
new G4PVPlacement(0, centre,
"ionizationChamberTubeW3PV", PCUTubeW3LV, PVWorld,
false, 0);
508 centre.
set(0.,0.,162.*
mm);
510 PCUtubeP3PV=
new G4PVPlacement(0, centre,
"ionizationChamberTubeP3PV", PCUTubeP3LV, PVWorld,
false, 0);
521 bool CML2Acc1::mirror()
556 theta=fabs(atan(aperture/isoCentre));
566 centre.
set(
z*sin(theta)+dx*cos(theta), y,
z*cos(theta)-dx*sin(theta));
575 halfSize.
set(fabs(dx*cos(theta)+dz*sin(theta)), fabs(dy), fabs(dz*cos(theta)+dx*sin(theta)));
578 centre.
set(-(
z*sin(theta)+dx*cos(theta)), y,
z*cos(theta)-dx*sin(theta));
587 halfSize.
set(fabs(dx*cos(theta)+dz*sin(theta)), fabs(dy), fabs(dz*cos(theta)+dx*sin(theta)));
590 centre.
set(
x,
z*sin(theta)+dy*cos(theta),
z*cos(theta)-dy*sin(theta));
599 halfSize.
set(fabs(dx), fabs(dy*cos(theta)+dz*sin(theta)), fabs(dz*cos(theta)+dy*sin(theta)));
602 centre.
set(
x, -(
z*sin(theta)+dy*cos(theta)),
z*cos(theta)-dy*sin(theta));
611 halfSize.
set(fabs(dx), fabs(dy*cos(theta)+dz*sin(theta)), fabs(dz*cos(theta)+dy*sin(theta)));
618 bool CML2Acc1::Jaw1X()
629 centre.
set(0.,0.,(320.+80./2.)*
mm);
633 SetJawAperture(1, centre, halfSize, jaw1XAperture, cRotation);
634 phVol1X=
new G4PVPlacement(cRotation, centre, name+
"PV", logVol, PVWorld,
false, 0);
642 logVol->SetRegion(regVol);
649 logVol->SetVisAttributes(simpleAlSVisAtt);
654 bool CML2Acc1::Jaw2X()
665 centre.
set(0.,0.,(320.+80./2.)*
mm);
669 SetJawAperture(2, centre, halfSize, jaw2XAperture, cRotation);
670 phVol2X=
new G4PVPlacement(cRotation, centre, name+
"PV", logVol, PVWorld,
false, 0);
678 logVol->SetRegion(regVol);
685 logVol->SetVisAttributes(simpleAlSVisAtt);
690 bool CML2Acc1::Jaw1Y()
701 centre.
set(0.,0.,(230.+80./2.)*
mm);
705 SetJawAperture(3, centre, halfSize, jaw1YAperture, cRotation);
706 phVol1Y=
new G4PVPlacement(cRotation, centre, name+
"PV", logVol, PVWorld,
false, 0);
714 logVol->SetRegion(regVol);
721 logVol->SetVisAttributes(simpleAlSVisAtt);
726 bool CML2Acc1::Jaw2Y()
737 centre.
set(0.,0.,(230.+80./2.)*
mm);
741 SetJawAperture(4, centre, halfSize, jaw2YAperture, cRotation);
742 phVol2Y=
new G4PVPlacement(cRotation, centre, name+
"PV", logVol, PVWorld,
false, 0);
751 logVol->SetRegion(regVol);
758 logVol->SetVisAttributes(simpleAlSVisAtt);
779 centreStart.
set(0.,0.,(330.+600.)/2.*
mm);
781 boxSize.
set(6./2.*
mm, 180./2.*
mm, 50./2.*
mm);
792 leafLVA->SetVisAttributes(simpleAlSVisAtt);
793 leafLVA->SetRegion(regVol);
808 int nhalfLeaves=(
int)(leavesA.size()/2.);
810 for (i=1;i<(
int)leavesA.size(); i++)
814 sprintf(appo,
"%d",i);
818 centre.
setY(-boxSize.
getY()-leavesA[i]);
819 leafPhys=
new G4PVPlacement(0, centre, PVname, leafLVA, PVWorld,
false, i);
822 nhalfLeaves=(
int)(leavesB.size()/2.);
824 for (i=1;i<(
int)leavesB.size(); i++)
828 sprintf(appo,
"%d",i);
832 centre.
setY(+boxSize.
getY()+leavesB[i]);
833 leafPhys=
new G4PVPlacement(0, centre, PVname, leafLVB, PVWorld,
false, i);
void set(double x, double y, double z)
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static constexpr double mm
CLHEP::Hep3Vector G4ThreeVector
void AddRootLogicalVolume(G4LogicalVolume *lv)
HepRotation & rotateX(double delta)
CLHEP::HepRotation G4RotationMatrix
static G4Colour Magenta()
void SetProductionCut(G4double cut, G4int index=-1)
HepRotation & rotateY(double delta)
static G4NistManager * Instance()
void Construct(G4VPhysicalVolume *PVWorld, G4double isoCentre)
void SetRegion(G4Region *reg)
double A(double temperature)
static constexpr double m
void SetVisibility(G4bool=true)
static constexpr double cm
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
void setIsoCentre(G4double val)
static constexpr double cm3
void SetProductionCuts(G4ProductionCuts *cut)
static CML2Acc1 * GetInstance(void)
static constexpr double deg
static constexpr double mole
void SetVisAttributes(const G4VisAttributes *pVA)