// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // $Id: RangeTelescopeConstructionMessenger.cc,v 1.3 2006/06/29 16:58:13 gunter Exp $ // GEANT4 tag $Name: geant4-09-03-patch-02 $ // //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... #include "RangeTelescopeConstructionMessenger.hh" #include "RangeTelescopeConstruction.hh" #include "G4UIdirectory.hh" #include "G4UIcmdWithAString.hh" #include "G4UIcmdWithADoubleAndUnit.hh" #include "G4UIcmdWith3VectorAndUnit.hh" #include "G4UIcmdWithoutParameter.hh" #include "G4UIcmdWithAnInteger.hh" #include "G4UIcmdWithABool.hh" #include "G4PhysicalConstants.hh" #include "G4SystemOfUnits.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... RangeTelescopeConstructionMessenger::RangeTelescopeConstructionMessenger(RangeTelescopeConstruction * Det) :Detector(Det) { testemDir = new G4UIdirectory("/testem/"); testemDir->SetGuidance(" detector control."); detDir = new G4UIdirectory("/RangeTelescope/"); detDir->SetGuidance("detector construction commands"); RTtypeCmd = new G4UIcmdWithAString("/RangeTelescope/setRTtype",this); RTtypeCmd->SetGuidance("Range telescope type: strip / CMOS"); RTtypeCmd->SetParameterName("choice",false); RTtypeCmd->AvailableForStates(G4State_PreInit,G4State_Idle); Abs2MaterCmd = new G4UIcmdWithAString("/RangeTelescope/setAbs2Mat",this); Abs2MaterCmd->SetGuidance("Select material of the 2nd absorber."); Abs2MaterCmd->SetParameterName("choice",false); Abs2MaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle); Abs2SizeXCmd = new G4UIcmdWithADoubleAndUnit("/RangeTelescope/setAbs2Thickness",this); Abs2SizeXCmd->SetGuidance("Set thickness of the the absorber in RT"); Abs2SizeXCmd->SetParameterName("Abs2SizeX",false); Abs2SizeXCmd->SetRange("Abs2SizeX>0."); Abs2SizeXCmd->SetUnitCategory("Length"); Abs2SizeXCmd->AvailableForStates(G4State_PreInit,G4State_Idle); Abs2SizeYZCmd = new G4UIcmdWithADoubleAndUnit("/RangeTelescope/setAbs2SizeXY",this); Abs2SizeYZCmd->SetGuidance("Set sizeXY of the absorber in RT"); Abs2SizeYZCmd->SetParameterName("AbsSizeXY",false); Abs2SizeYZCmd->SetRange("AbsSizeXY>0."); Abs2SizeYZCmd->SetUnitCategory("Length"); Abs2SizeYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle); EpiMaterCmd = new G4UIcmdWithAString("/RangeTelescope/setEpiMat",this); EpiMaterCmd->SetGuidance("Select material of the Epi."); EpiMaterCmd->SetParameterName("choice",false); EpiMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle); EpiSizeXCmd = new G4UIcmdWithADoubleAndUnit("/RangeTelescope/setEpiThickness",this); EpiSizeXCmd->SetGuidance("Set thickness of the Epi layer"); EpiSizeXCmd->SetParameterName("EpiSizeX",false); EpiSizeXCmd->SetRange("EpiSizeX>0."); EpiSizeXCmd->SetUnitCategory("Length"); EpiSizeXCmd->AvailableForStates(G4State_PreInit,G4State_Idle); EpiSizeYZCmd = new G4UIcmdWithADoubleAndUnit("/RangeTelescope/setEpiSizeXY",this); EpiSizeYZCmd->SetGuidance("Set sizeXY of the Epi"); EpiSizeYZCmd->SetParameterName("EpiSizeXY",false); EpiSizeYZCmd->SetRange("EpiSizeXY>0."); EpiSizeYZCmd->SetUnitCategory("Length"); EpiSizeYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle); SubMaterCmd = new G4UIcmdWithAString("/RangeTelescope/setSubMat",this); SubMaterCmd->SetGuidance("Select material of the Sub."); SubMaterCmd->SetParameterName("choice",false); SubMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle); SubSizeXCmd = new G4UIcmdWithADoubleAndUnit("/RangeTelescope/setSubThickness",this); SubSizeXCmd->SetGuidance("Set thickness of the Sub"); SubSizeXCmd->SetParameterName("SubSizeX",false); SubSizeXCmd->SetRange("SubSizeX>0."); SubSizeXCmd->SetUnitCategory("Length"); SubSizeXCmd->AvailableForStates(G4State_PreInit,G4State_Idle); SubSizeYZCmd = new G4UIcmdWithADoubleAndUnit("/RangeTelescope/setSubSizeXY",this); SubSizeYZCmd->SetGuidance("Set sizeXY of the Sub"); SubSizeYZCmd->SetParameterName("SubSizeXY",false); SubSizeYZCmd->SetRange("SubSizeXY>0."); SubSizeYZCmd->SetUnitCategory("Length"); SubSizeYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle); MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/RangeTelescope/setField",this); MagFieldCmd->SetGuidance("Define magnetic field."); MagFieldCmd->SetGuidance("Magnetic field will be in Z direction."); MagFieldCmd->SetParameterName("Bz",false); MagFieldCmd->SetUnitCategory("Magnetic flux density"); MagFieldCmd->AvailableForStates(G4State_PreInit,G4State_Idle); TalMateCmd = new G4UIcmdWithAString("/RangeTelescope/tallyMat",this); TalMateCmd->SetGuidance("Select material of the tallies."); TalMateCmd->SetParameterName("choice",false); TalMateCmd->AvailableForStates(G4State_PreInit,G4State_Idle); TalSizeCmd = new G4UIcmdWith3VectorAndUnit("/RangeTelescope/tallySize",this); TalSizeCmd->SetGuidance("Set size of tally"); TalSizeCmd->SetParameterName("sizeX","sizeY","sizeZ",false,false); TalSizeCmd->SetUnitCategory("Length"); TalSizeCmd->AvailableForStates(G4State_PreInit,G4State_Idle); TalPosiCmd = new G4UIcmdWith3VectorAndUnit("/RangeTelescope/tallyPosition",this); TalPosiCmd->SetGuidance("Set position of tallies"); TalPosiCmd->SetParameterName("Xc","Yc","Zc",false,false); TalPosiCmd->SetUnitCategory("Length"); TalPosiCmd->AvailableForStates(G4State_PreInit,G4State_Idle); StripXCmd = new G4UIcmdWithADoubleAndUnit("/RangeTelescope/setStripX",this); StripXCmd->SetGuidance("Set sizeX of the strip detector for the Tracker&RT"); StripXCmd->SetParameterName("StripX",false); StripXCmd->SetRange("StripX>0."); StripXCmd->SetUnitCategory("Length"); StripXCmd->AvailableForStates(G4State_PreInit,G4State_Idle); StripYZCmd = new G4UIcmdWithADoubleAndUnit("/RangeTelescope/setStripYZ",this); StripYZCmd->SetGuidance("Set sizeYZ of the strip detector for the Tracker&RT"); StripYZCmd->SetParameterName("StripYZ",false); StripYZCmd->SetRange("StripYZ>0."); StripYZCmd->SetUnitCategory("Length"); StripYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle); AirgapSizeXCmd = new G4UIcmdWithADoubleAndUnit("/RangeTelescope/setAirgapSize",this); AirgapSizeXCmd->SetGuidance("Set size of the airgap for the RT"); AirgapSizeXCmd->SetParameterName("AirgapSizeX",false); AirgapSizeXCmd->SetRange("AirgapSizeX>0."); AirgapSizeXCmd->SetUnitCategory("Length"); AirgapSizeXCmd->AvailableForStates(G4State_PreInit,G4State_Idle); NoModuleRTCmd = new G4UIcmdWithAnInteger("/RangeTelescope/setNoModuleRT",this); NoModuleRTCmd->SetGuidance("Set No modules for the RT"); NoModuleRTCmd->SetParameterName("NoModuleRT",false); NoModuleRTCmd->AvailableForStates(G4State_PreInit,G4State_Idle); RTPositionCmd = new G4UIcmdWith3VectorAndUnit("/RangeTelescope/setFrontFacePosition", this); RTPositionCmd->SetGuidance("Set Position of the front face of the Range Telescope"); RTPositionCmd->SetParameterName("posX", "posY", "posZ", false); RTPositionCmd->SetUnitCategory("Length"); RTPositionCmd->AvailableForStates(G4State_PreInit,G4State_Idle); ConstructCmd = new G4UIcmdWithABool("/RangeTelescope/Construct",this); ConstructCmd->SetGuidance("Update calorimeter geometry."); ConstructCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); ConstructCmd->SetGuidance("if you changed geometrical value(s)."); ConstructCmd->SetParameterName("constructRT", false); ConstructCmd->AvailableForStates(G4State_PreInit, G4State_Idle); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... RangeTelescopeConstructionMessenger::~RangeTelescopeConstructionMessenger() { delete Abs2MaterCmd; delete Abs2SizeXCmd; delete Abs2SizeYZCmd; delete EpiMaterCmd; delete EpiSizeXCmd; delete EpiSizeYZCmd; delete SubMaterCmd; delete SubSizeXCmd; delete SubSizeYZCmd; delete MagFieldCmd; delete TalMateCmd; delete TalSizeCmd; delete TalPosiCmd; delete ConstructCmd; delete detDir; delete testemDir; delete StripXCmd; delete AirgapSizeXCmd; delete NoModuleRTCmd; delete RTPositionCmd; delete RTtypeCmd; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void RangeTelescopeConstructionMessenger::SetNewValue(G4UIcommand* command,G4String newValue) { if( command == RTtypeCmd ) { Detector->SetRTtype(newValue);} if( command == Abs2MaterCmd ) { Detector->SetAbs2Material(newValue);} if( command == Abs2SizeXCmd ) { Detector->SetAbs2SizeZ(Abs2SizeXCmd->GetNewDoubleValue(newValue));} if( command == Abs2SizeYZCmd ) { Detector->SetAbs2SizeXY(Abs2SizeYZCmd->GetNewDoubleValue(newValue));} if( command == EpiMaterCmd ) { Detector->SetEpiMaterial(newValue);} if( command == EpiSizeXCmd ) { Detector->SetEpiSizeZ(EpiSizeXCmd->GetNewDoubleValue(newValue));} if( command == EpiSizeYZCmd ) { Detector->SetEpiSizeXY(EpiSizeYZCmd->GetNewDoubleValue(newValue));} if( command == SubMaterCmd ) { Detector->SetSubMaterial(newValue);} if( command == SubSizeXCmd ) { Detector->SetSubSizeZ(SubSizeXCmd->GetNewDoubleValue(newValue));} if( command == SubSizeYZCmd ) { Detector->SetSubSizeXY(SubSizeYZCmd->GetNewDoubleValue(newValue));} if( command == StripXCmd) { Detector->SetStripX(StripXCmd->GetNewDoubleValue(newValue));} if( command == StripYZCmd) { Detector->SetStripYZ(StripYZCmd->GetNewDoubleValue(newValue));} if( command == AirgapSizeXCmd) {Detector->SetAirgapSizeZ(AirgapSizeXCmd->GetNewDoubleValue(newValue));} if( command == NoModuleRTCmd ) { Detector->SetNoModuleRT(NoModuleRTCmd->GetNewIntValue(newValue));} if( command == DisSizeXCmd ) { Detector->SetDisSizeZ(DisSizeXCmd->GetNewDoubleValue(newValue));} if( command == MagFieldCmd ) { Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));} if( command == TalMateCmd ) { Detector->SetTallyMaterial(newValue);} if( command == TalSizeCmd ) { Detector->SetTallySize(TalSizeCmd->GetNew3VectorValue(newValue));} if( command == TalPosiCmd ) { Detector->SetTallyPosition(TalPosiCmd->GetNew3VectorValue(newValue));} if( command == RTPositionCmd ) Detector->SetFrontFacePosition(RTPositionCmd->GetNew3VectorValue(newValue)); if( command == ConstructCmd ) { Detector->ConstructRangeTelescope(ConstructCmd->GetNewBoolValue(newValue));} Detector->SetworldizeX(); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......