55 if (AcceleratorName==
"acc1")
56 {
delete accelerator1;}
59 delete acceleratorConstructionMessenger;
74 if (AcceleratorName==
"acc1")
76 accelerator1->
reset();
81 bool CML2AcceleratorConstruction::design(
void)
84 std::cout <<
"I'm building "<< AcceleratorName<<
" accelerator"<<
G4endl;
85 bool bAccExists=
false;
86 if (AcceleratorName==
"acc1")
89 if (bAccExists && AcceleratorMacFileName!=
"")
93 G4String command =
"/control/execute ";
97 if (rotationsX.size()<1)
112 initialCentre.
set(0.*
mm, 0.*
mm, -isoCentre);
119 accWorldLV->SetVisAttributes(simpleAlSVisAtt);
121 PVAccWorld=
new G4PVPlacement(0, initialCentre,
"acceleratorBox", accWorldLV, PVWorld,
false, 0);
124 if (AcceleratorName==
"acc1")
126 accelerator1->
Construct(PVAccWorld, isoCentre);
141 {std::cout <<
"Actual rotation: "<<idCurrentRotationX<<
"/"<<rotationsX.size() <<
" "<<
G4endl;}
142 std::cout <<
"Accelerator angle: "<< currentRotationX/
deg <<
" [deg]"<<
G4endl;
148 if (idCurrentRotationX <(
int) rotationsX.size())
150 currentRotationX=rotationsX[idCurrentRotationX];
152 idCurrentRotationX++;
160 currentRotationX=angleX;
171 NewCentre=*rmInv*initialCentre;
181 sprintf(cR,
"%d",cRI);
184 {rotationName=
"_Ro90Y"+rotationName;}
186 {rotationName=
"_Ro"+rotationName;}
void set(double x, double y, double z)
void GeometryHasBeenModified(G4bool prop=true)
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static constexpr double mm
CML2AcceleratorConstruction(void)
HepRotation & rotateX(double delta)
CLHEP::HepRotation G4RotationMatrix
static CML2AcceleratorConstruction * GetInstance(void)
HepRotation & rotateY(double delta)
static G4NistManager * Instance()
G4String getCurrentRotationString()
void SetRotation(G4RotationMatrix *)
static G4UImanager * GetUIpointer()
HepBoost inverseOf(const HepBoost <)
void Construct(G4VPhysicalVolume *PVWorld, G4double isoCentre)
~CML2AcceleratorConstruction(void)
void SetVisibility(G4bool=true)
void SetTranslation(const G4ThreeVector &v)
static G4GeometryManager * GetInstance()
static G4RunManager * GetRunManager()
bool Construct(G4VPhysicalVolume *PVWorld, G4bool bOnlyVisio)
void addAcceleratorRotationsX(G4double val)
G4RotationMatrix * rotateAccelerator()
void OpenGeometry(G4VPhysicalVolume *vol=0)
G4double getBeforeJaws_Z_PhaseSpacePosition()
static CML2Acc1 * GetInstance(void)
static constexpr double deg
void SetReferenceWorld(G4bool bOV)
G4bool CloseGeometry(G4bool pOptimise=true, G4bool verbose=false, G4VPhysicalVolume *vol=0)
G4int ApplyCommand(const char *aCommand)