Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-13 08:26:58

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file DetectorConstructionMessenger.cc
0027 /// \brief Implementation of the DetectorConstruction messenger class
0028 //
0029 //
0030 //
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 
0033 #include "DetectorConstructionMessenger.hh"
0034 #include "DetectorConstruction.hh"
0035 
0036 #include "G4UIdirectory.hh"
0037 #include "G4UIcmdWithADoubleAndUnit.hh"
0038 #include "G4UIcmdWithADouble.hh"
0039 #include "G4UIcmdWithAnInteger.hh"
0040 #include "G4UIcmdWith3VectorAndUnit.hh"
0041 #include "G4UIcmdWithABool.hh"
0042 #include "G4UIcmdWithAString.hh"
0043 
0044 #include "G4RunManager.hh"
0045 #include "G4ios.hh"
0046 
0047 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0048 
0049 DetectorConstructionMessenger::DetectorConstructionMessenger(DetectorConstruction* det):
0050 fDetector(det)
0051 {
0052     fCmdDir = new G4UIdirectory("/crystal/");
0053     fCmdDir->SetGuidance("crystal Control");
0054     
0055     fCrystalMaterialCmd = new G4UIcmdWithAString("/crystal/setCrystalMaterial",this);
0056     fCrystalMaterialCmd->SetGuidance("Set Crystal Material");
0057     fCrystalMaterialCmd->SetParameterName("matname",false);
0058     fCrystalMaterialCmd->SetDefaultValue("G4_Si");
0059                
0060     fCrystalSizeCmd = new G4UIcmdWith3VectorAndUnit("/crystal/setCrystalSize",this);
0061     fCrystalSizeCmd->SetGuidance("Set Crystal size");
0062     fCrystalSizeCmd->SetParameterName("dimCrX","dimCrY","dimCrZ",false);
0063     fCrystalSizeCmd->SetUnitCategory("Length");
0064     fCrystalSizeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0065     
0066     fCrystalLatticeCmd = new G4UIcmdWithAString("/crystal/setCrystalLattice",this);
0067     fCrystalLatticeCmd->
0068      SetGuidance("Set Crystal Lattice, use brackets (...) for planes and <...> for axes");
0069     fCrystalLatticeCmd->SetParameterName("lattice",false);
0070     fCrystalLatticeCmd->SetDefaultValue("(111)");
0071       
0072     fCrystalAngleXCmd = new G4UIcmdWithADoubleAndUnit("/crystal/setCrystalAngleX",this);
0073     fCrystalAngleXCmd->SetGuidance("Set crystal orientation with respect to the beam");
0074     fCrystalAngleXCmd->SetUnitCategory("Angle");
0075     fCrystalAngleXCmd->SetParameterName("angX",false);
0076     fCrystalAngleXCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0077     
0078     fCrystalAngleYCmd = new G4UIcmdWithADoubleAndUnit("/crystal/setCrystalAngleY",this);
0079     fCrystalAngleYCmd->SetGuidance("Set crystal orientation with respect to the beam");
0080     fCrystalAngleYCmd->SetUnitCategory("Angle");
0081     fCrystalAngleYCmd->SetParameterName("angY",false);
0082     fCrystalAngleYCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0083     
0084     fCrystalBendingAngleCmd =
0085             new G4UIcmdWithADoubleAndUnit("/crystal/setCrystalBendingAngle",this);
0086     fCrystalBendingAngleCmd->SetGuidance("Set crystal bending angle");
0087     fCrystalBendingAngleCmd->SetParameterName("bendingAngle",false);
0088     fCrystalBendingAngleCmd->SetUnitCategory("Angle");
0089     fCrystalBendingAngleCmd->SetRange("bendingAngle >= 0");
0090     fCrystalBendingAngleCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0091 
0092     fCrystallineUndulatorAmplitudeCmd =
0093             new G4UIcmdWithADoubleAndUnit
0094             ("/crystal/setCrystallineUndulatorAmplitude",this);
0095     fCrystallineUndulatorAmplitudeCmd->
0096             SetGuidance("Set crystalline undulator amplitude");
0097     fCrystallineUndulatorAmplitudeCmd->SetUnitCategory("Length");
0098     fCrystallineUndulatorAmplitudeCmd->
0099             SetParameterName("CrystallineUndulatorAmplitude",false);
0100     fCrystallineUndulatorAmplitudeCmd->
0101             SetRange("CrystallineUndulatorAmplitude > 0");
0102     fCrystallineUndulatorAmplitudeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0103 
0104     fCrystallineUndulatorPeriodCmd =
0105             new G4UIcmdWithADoubleAndUnit("/crystal/setCrystallineUndulatorPeriod",this);
0106     fCrystallineUndulatorPeriodCmd->
0107             SetGuidance("Set crystalline undulator Period");
0108     fCrystallineUndulatorPeriodCmd->SetUnitCategory("Length");
0109     fCrystallineUndulatorPeriodCmd->
0110             SetParameterName("CrystallineUndulatorPeriod",false);
0111     fCrystallineUndulatorPeriodCmd->
0112             SetRange("CrystallineUndulatorPeriod > 0");
0113     fCrystallineUndulatorPeriodCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0114 
0115     fCrystallineUndulatorPhaseCmd =
0116             new G4UIcmdWithADouble("/crystal/setCrystallineUndulatorPhase",this);
0117     fCrystallineUndulatorPhaseCmd->
0118             SetGuidance("Set crystalline undulator phase");
0119     fCrystallineUndulatorPhaseCmd->
0120             SetParameterName("CrystallineUndulatorPhase",false);
0121     fCrystallineUndulatorPhaseCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0122     
0123     fDetectorSizeCmd = new G4UIcmdWith3VectorAndUnit("/crystal/setDetectorSize",this);
0124     fDetectorSizeCmd->SetGuidance("Set detector size");
0125     fDetectorSizeCmd->SetParameterName("dimDetX","dimDetY","dimDetZ",false);
0126     fDetectorSizeCmd->SetUnitCategory("Length");
0127     fDetectorSizeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0128 
0129     fDetectorFrontPosZCmd =
0130             new G4UIcmdWithADoubleAndUnit("/crystal/setFrontPositionZ",this);
0131     fDetectorFrontPosZCmd->SetGuidance("Set detector front position Z");
0132     fDetectorFrontPosZCmd->SetParameterName("frontPosDetZ",false);
0133     fDetectorFrontPosZCmd->SetUnitCategory("Length");
0134     fDetectorFrontPosZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0135 
0136     fPotentialPathCmd = new G4UIcmdWithAString("/crystal/setChannelingDataPath",this);
0137     fPotentialPathCmd->
0138             SetGuidance("Set the path where to find the available data "
0139                         "for the G4ChannelingFastSimModel "
0140                         "if different from G4CHANNELINGDATA");
0141     fPotentialPathCmd->SetParameterName("channelingDataPath",false);
0142     fPotentialPathCmd->SetDefaultValue("");
0143 
0144     fChannelingModelCmd = new G4UIcmdWithABool("/crystal/setChannelingModel", this);
0145     fChannelingModelCmd->SetGuidance("Activate/deactivate G4ChannelingFastSimModel");
0146     fChannelingModelCmd->SetParameterName("ChannelingModel",true);
0147     fChannelingModelCmd->SetDefaultValue(false);
0148 
0149     fRadModelCmd = new G4UIcmdWithABool("/crystal/setRadiationModel", this);
0150     fRadModelCmd->SetGuidance("Activate/deactivate G4BaierKatkov");
0151     fRadModelCmd->SetParameterName("ActivateRadiationModel",true);
0152     fRadModelCmd->SetDefaultValue(false);
0153 
0154     fMinPhotonEnergyCmd =
0155             new G4UIcmdWithADoubleAndUnit("/crystal/setMinPhotonEnergy",this);
0156     fMinPhotonEnergyCmd->
0157             SetGuidance("Set the low energy threshold for "
0158                         "the photons emitted in G4BaierKatkov");
0159     fMinPhotonEnergyCmd->SetParameterName("MinPhotonEnergy",false);
0160     fMinPhotonEnergyCmd->SetUnitCategory("Energy");
0161     fMinPhotonEnergyCmd->SetRange("MinPhotonEnergy > 0");
0162     fMinPhotonEnergyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0163     
0164     fSamplingPhotonsNumberCmd =
0165             new G4UIcmdWithAnInteger("/crystal/setSamplingPhotonsNumber",this);
0166     fSamplingPhotonsNumberCmd->
0167             SetGuidance("Set SamplingPhotonsNumber in G4BaierKatkov");
0168     fSamplingPhotonsNumberCmd->SetParameterName("SamplingPhotonsNumber",false);
0169     fSamplingPhotonsNumberCmd->SetRange("SamplingPhotonsNumber>1");
0170     fSamplingPhotonsNumberCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0171     
0172     fNSmallTrajectoryStepsCmd =
0173             new G4UIcmdWithAnInteger("/crystal/setNSmallTrajectorySteps",this);
0174     fNSmallTrajectoryStepsCmd->
0175             SetGuidance("Set NSmallTrajectorySteps in G4BaierKatkov");
0176     fNSmallTrajectoryStepsCmd->SetParameterName("NSmallTrajectorySteps",false);
0177     fNSmallTrajectoryStepsCmd->SetRange("NSmallTrajectorySteps>1");
0178     fNSmallTrajectoryStepsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0179     
0180     fRadiationAngleFactorCmd =
0181             new G4UIcmdWithADouble("/crystal/setRadiationAngleFactor",this);
0182     fRadiationAngleFactorCmd->SetGuidance("Set Radiation Angle Factor");
0183     fRadiationAngleFactorCmd->SetParameterName("RadiationAngleFactor",false);
0184     fRadiationAngleFactorCmd->SetRange("RadiationAngleFactor > 0");
0185     fRadiationAngleFactorCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0186 
0187     fMinPhotonEnergyAddStatCmd =
0188     new G4UIcmdWithADoubleAndUnit("/crystal/AddPhotonStatistics/setMinPhotonEnergy",this);
0189     fMinPhotonEnergyAddStatCmd->
0190             SetGuidance("Set the min energy in the range to increase "
0191                         "the sampling photon statistics in G4BaierKatkov");
0192     fMinPhotonEnergyAddStatCmd->SetParameterName("addStatMinPhotonEnergy",false);
0193     fMinPhotonEnergyAddStatCmd->SetUnitCategory("Energy");
0194     fMinPhotonEnergyAddStatCmd->SetRange("addStatMinPhotonEnergy > 0");
0195     fMinPhotonEnergyAddStatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0196 
0197     fMaxPhotonEnergyAddStatCmd =
0198     new G4UIcmdWithADoubleAndUnit("/crystal/AddPhotonStatistics/setMaxPhotonEnergy",this);
0199     fMaxPhotonEnergyAddStatCmd->
0200             SetGuidance("Set the max energy in the range to increase "
0201                         "the sampling photon statistics in G4BaierKatkov");
0202     fMaxPhotonEnergyAddStatCmd->SetParameterName("addStatMaxPhotonEnergy",false);
0203     fMaxPhotonEnergyAddStatCmd->SetUnitCategory("Energy");
0204     fMaxPhotonEnergyAddStatCmd->SetRange("addStatMaxPhotonEnergy > 0");
0205     fMaxPhotonEnergyAddStatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0206 
0207     fTimesPhotonStatisticsCmd =
0208     new G4UIcmdWithAnInteger("/crystal/AddPhotonStatistics/setMultiplePhotonStatistics",
0209                              this);
0210     fTimesPhotonStatisticsCmd->
0211            SetGuidance("Set multiple of the sampling photon statistics in G4BaierKatkov");
0212     fTimesPhotonStatisticsCmd->SetParameterName("timesPhotonStatistics",false);
0213     fTimesPhotonStatisticsCmd->SetRange("timesPhotonStatistics > 1");
0214     fTimesPhotonStatisticsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0215     
0216     fParticleMinKinEnergyCmd =
0217             new G4UIcmdWithADoubleAndUnit("/crystal/setParticleMinKinEnergy",this);
0218     fParticleMinKinEnergyCmd->
0219             SetGuidance("Set the low energy threshold for particle "
0220                         "to enter the G4ChannelingFastSimModel");
0221     fParticleMinKinEnergyCmd->SetParameterName("partLEth",false);
0222     fParticleMinKinEnergyCmd->SetUnitCategory("Energy");
0223     fParticleMinKinEnergyCmd->SetRange("partLEth > 0");
0224     fParticleMinKinEnergyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0225 
0226     fProtonMinKinEnergyCmd =
0227             new G4UIcmdWithADoubleAndUnit("/crystal/setParticleMinKinEnergy/proton",this);
0228     fProtonMinKinEnergyCmd->
0229             SetGuidance("Set the low energy threshold for proton "
0230                         "to enter the G4ChannelingFastSimModel");
0231     fProtonMinKinEnergyCmd->SetParameterName("protonLEth",false);
0232     fProtonMinKinEnergyCmd->SetUnitCategory("Energy");
0233     fProtonMinKinEnergyCmd->SetRange("protonLEth > 0");
0234     fProtonMinKinEnergyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0235 
0236     fAntiprotonMinKinEnergyCmd =
0237        new G4UIcmdWithADoubleAndUnit("/crystal/setParticleMinKinEnergy/anti_proton",this);
0238     fAntiprotonMinKinEnergyCmd->SetGuidance("Set the low energy threshold for anti_proton"
0239                                             " to enter the G4ChannelingFastSimModel");
0240     fAntiprotonMinKinEnergyCmd->SetParameterName("anti_protonLEth",false);
0241     fAntiprotonMinKinEnergyCmd->SetUnitCategory("Energy");
0242     fAntiprotonMinKinEnergyCmd->SetRange("anti_protonLEth > 0");
0243     fAntiprotonMinKinEnergyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0244 
0245     fPiPlusMinKinEnergyCmd =
0246             new G4UIcmdWithADoubleAndUnit("/crystal/setParticleMinKinEnergy/pi+",this);
0247     fPiPlusMinKinEnergyCmd->
0248             SetGuidance("Set the low energy threshold for pi+ "
0249                         "to enter the G4ChannelingFastSimModel");
0250     fPiPlusMinKinEnergyCmd->SetParameterName("piPlusLEth",false);
0251     fPiPlusMinKinEnergyCmd->SetUnitCategory("Energy");
0252     fPiPlusMinKinEnergyCmd->SetRange("piPlusLEth > 0");
0253     fPiPlusMinKinEnergyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0254 
0255     fPiMinusMinKinEnergyCmd =
0256             new G4UIcmdWithADoubleAndUnit("/crystal/setParticleMinKinEnergy/pi-",this);
0257     fPiMinusMinKinEnergyCmd->SetGuidance("Set the low energy threshold for pi- "
0258                                          "to enter the G4ChannelingFastSimModel");
0259     fPiMinusMinKinEnergyCmd->SetParameterName("piMinusLEth",false);
0260     fPiMinusMinKinEnergyCmd->SetUnitCategory("Energy");
0261     fPiMinusMinKinEnergyCmd->SetRange("piMinusLEth > 0");
0262     fPiMinusMinKinEnergyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0263 
0264     fPositronMinKinEnergyCmd =
0265             new G4UIcmdWithADoubleAndUnit("/crystal/setParticleMinKinEnergy/e+",this);
0266     fPositronMinKinEnergyCmd->SetGuidance("Set the low energy threshold for e+ "
0267                                           "to enter the G4ChannelingFastSimModel");
0268     fPositronMinKinEnergyCmd->SetParameterName("ePlusLEth",false);
0269     fPositronMinKinEnergyCmd->SetUnitCategory("Energy");
0270     fPositronMinKinEnergyCmd->SetRange("ePlusLEth > 0");
0271     fPositronMinKinEnergyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0272 
0273     fElectronMinKinEnergyCmd =
0274             new G4UIcmdWithADoubleAndUnit("/crystal/setParticleMinKinEnergy/e-",this);
0275     fElectronMinKinEnergyCmd->SetGuidance("Set the low energy threshold for e- "
0276                                           "to enter the G4ChannelingFastSimModel");
0277     fElectronMinKinEnergyCmd->SetParameterName("eMinusLEth",false);
0278     fElectronMinKinEnergyCmd->SetUnitCategory("Energy");
0279     fElectronMinKinEnergyCmd->SetRange("eMinusLEth > 0");
0280     fElectronMinKinEnergyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0281 
0282     fMuPlusMinKinEnergyCmd =
0283             new G4UIcmdWithADoubleAndUnit("/crystal/setParticleMinKinEnergy/mu+",this);
0284     fMuPlusMinKinEnergyCmd->SetGuidance("Set the low energy threshold for mu+ "
0285                                         "to enter the G4ChannelingFastSimModel");
0286     fMuPlusMinKinEnergyCmd->SetParameterName("muPlusLEth",false);
0287     fMuPlusMinKinEnergyCmd->SetUnitCategory("Energy");
0288     fMuPlusMinKinEnergyCmd->SetRange("muPlusLEth > 0");
0289     fMuPlusMinKinEnergyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0290 
0291     fMuMinusMinKinEnergyCmd =
0292             new G4UIcmdWithADoubleAndUnit("/crystal/setParticleMinKinEnergy/mu-",this);
0293     fMuMinusMinKinEnergyCmd->SetGuidance("Set the low energy threshold for mu- "
0294                                          "to enter the G4ChannelingFastSimModel");
0295     fMuMinusMinKinEnergyCmd->SetParameterName("muMinusLEth",false);
0296     fMuMinusMinKinEnergyCmd->SetUnitCategory("Energy");
0297     fMuMinusMinKinEnergyCmd->SetRange("muMinusLEth > 0");
0298     fMuMinusMinKinEnergyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0299     
0300     fLindhardAnglesCmd = new G4UIcmdWithADouble("/crystal/setLindhardAngles",this);
0301     fLindhardAnglesCmd->
0302             SetGuidance("Set high angular threshold for particle to enter "
0303                         "the G4ChannelingFastSimModel expressed in Lindhard angles");
0304     fLindhardAnglesCmd->SetParameterName("LindhardAngles",false);
0305     fLindhardAnglesCmd->SetRange("LindhardAngles >= 0");
0306     fLindhardAnglesCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0307 
0308     fLindhardAnglesProtonCmd =
0309             new G4UIcmdWithADouble("/crystal/setLindhardAngles/proton",this);
0310     fLindhardAnglesProtonCmd->
0311             SetGuidance("Set high angular threshold for proton to enter "
0312                         "the G4ChannelingFastSimModel expressed in Lindhard angles");
0313     fLindhardAnglesProtonCmd->SetParameterName("LindhardAnglesProton",false);
0314     fLindhardAnglesProtonCmd->SetRange("LindhardAnglesProton >= 0");
0315     fLindhardAnglesProtonCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0316 
0317     fLindhardAnglesAntiprotonCmd =
0318             new G4UIcmdWithADouble("/crystal/setLindhardAngles/anti_proton",this);
0319     fLindhardAnglesAntiprotonCmd->
0320             SetGuidance("Set high angular threshold for anti_proton to enter "
0321                         "the G4ChannelingFastSimModel expressed in Lindhard angles");
0322     fLindhardAnglesAntiprotonCmd->SetParameterName("LindhardAnglesAnti_proton",false);
0323     fLindhardAnglesAntiprotonCmd->SetRange("LindhardAnglesAnti_proton >= 0");
0324     fLindhardAnglesAntiprotonCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0325 
0326     fLindhardAnglesPiPlusCmd =
0327             new G4UIcmdWithADouble("/crystal/setLindhardAngles/pi+",this);
0328     fLindhardAnglesPiPlusCmd->
0329             SetGuidance("Set high angular threshold for pi+ to enter "
0330                         "the G4ChannelingFastSimModel expressed in Lindhard angles");
0331     fLindhardAnglesPiPlusCmd->SetParameterName("LindhardAnglesPiPlus",false);
0332     fLindhardAnglesPiPlusCmd->SetRange("LindhardAnglesPiPlus >= 0");
0333     fLindhardAnglesPiPlusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0334 
0335     fLindhardAnglesPiMinusCmd =
0336             new G4UIcmdWithADouble("/crystal/setLindhardAngles/pi-",this);
0337     fLindhardAnglesPiMinusCmd->
0338             SetGuidance("Set high angular threshold for pi- to enter "
0339                         "the G4ChannelingFastSimModel expressed in Lindhard angles");
0340     fLindhardAnglesPiMinusCmd->SetParameterName("LindhardAnglesPiMinus",false);
0341     fLindhardAnglesPiMinusCmd->SetRange("LindhardAnglesPiMinus >= 0");
0342     fLindhardAnglesPiMinusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0343 
0344     fLindhardAnglesPositronCmd =
0345             new G4UIcmdWithADouble("/crystal/setLindhardAngles/e+",this);
0346     fLindhardAnglesPositronCmd->
0347             SetGuidance("Set high angular threshold for e+ to enter "
0348                         "the G4ChannelingFastSimModel expressed in Lindhard angles");
0349     fLindhardAnglesPositronCmd->SetParameterName("LindhardAnglesPositron",false);
0350     fLindhardAnglesPositronCmd->SetRange("LindhardAnglesPositron >= 0");
0351     fLindhardAnglesPositronCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0352 
0353     fLindhardAnglesElectronCmd =
0354             new G4UIcmdWithADouble("/crystal/setLindhardAngles/e-",this);
0355     fLindhardAnglesElectronCmd->
0356             SetGuidance("Set high angular threshold for e- to enter "
0357                         "the G4ChannelingFastSimModel expressed in Lindhard angles");
0358     fLindhardAnglesElectronCmd->SetParameterName("LindhardAnglesElectron",false);
0359     fLindhardAnglesElectronCmd->SetRange("LindhardAnglesElectron >= 0");
0360     fLindhardAnglesElectronCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0361 
0362     fLindhardAnglesMuPlusCmd =
0363             new G4UIcmdWithADouble("/crystal/setLindhardAngles/mu+",this);
0364     fLindhardAnglesMuPlusCmd->
0365             SetGuidance("Set high angular threshold for mu+ to enter "
0366                         "the G4ChannelingFastSimModel expressed in Lindhard angles");
0367     fLindhardAnglesMuPlusCmd->SetParameterName("LindhardAnglesMuPlus",false);
0368     fLindhardAnglesMuPlusCmd->SetRange("LindhardAnglesMuPlus >= 0");
0369     fLindhardAnglesMuPlusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0370 
0371     fLindhardAnglesMuMinusCmd =
0372             new G4UIcmdWithADouble("/crystal/setLindhardAngles/mu-",this);
0373     fLindhardAnglesMuMinusCmd->
0374             SetGuidance("Set high angular threshold for mu- to enter "
0375                         "the G4ChannelingFastSimModel expressed in Lindhard angles");
0376     fLindhardAnglesMuMinusCmd->SetParameterName("LindhardAnglesMuMinus",false);
0377     fLindhardAnglesMuMinusCmd->SetRange("LindhardAnglesMuMinus >= 0");
0378     fLindhardAnglesMuMinusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0379 
0380 }
0381 
0382 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0383 
0384 DetectorConstructionMessenger::~DetectorConstructionMessenger()
0385 {
0386     delete fCmdDir;
0387     delete fCrystalMaterialCmd;
0388     delete fCrystalSizeCmd;
0389     delete fCrystalLatticeCmd;
0390     delete fCrystalAngleXCmd;
0391     delete fCrystalAngleYCmd;
0392     delete fCrystalBendingAngleCmd;
0393     delete fRadModelCmd;
0394     delete fChannelingModelCmd;
0395     
0396     delete fCrystallineUndulatorAmplitudeCmd;
0397     delete fCrystallineUndulatorPeriodCmd;
0398     delete fCrystallineUndulatorPhaseCmd;
0399     
0400     delete fDetectorSizeCmd;
0401     delete fDetectorFrontPosZCmd;
0402 
0403     delete fPotentialPathCmd;
0404     
0405     delete fMinPhotonEnergyCmd;
0406     delete fSamplingPhotonsNumberCmd;
0407     delete fNSmallTrajectoryStepsCmd;
0408     delete fRadiationAngleFactorCmd;
0409     delete fMinPhotonEnergyAddStatCmd;
0410     delete fMaxPhotonEnergyAddStatCmd;
0411     delete fTimesPhotonStatisticsCmd;
0412 
0413     delete fParticleMinKinEnergyCmd;
0414     delete fProtonMinKinEnergyCmd;
0415     delete fAntiprotonMinKinEnergyCmd;
0416     delete fPiPlusMinKinEnergyCmd;
0417     delete fPiMinusMinKinEnergyCmd;
0418     delete fElectronMinKinEnergyCmd;
0419     delete fPositronMinKinEnergyCmd;
0420     delete fMuPlusMinKinEnergyCmd;
0421     delete fMuMinusMinKinEnergyCmd;
0422 
0423     delete fLindhardAnglesCmd;
0424     delete fLindhardAnglesProtonCmd;
0425     delete fLindhardAnglesAntiprotonCmd;
0426     delete fLindhardAnglesPiPlusCmd;
0427     delete fLindhardAnglesPiMinusCmd;
0428     delete fLindhardAnglesElectronCmd;
0429     delete fLindhardAnglesPositronCmd;
0430     delete fLindhardAnglesMuPlusCmd;
0431     delete fLindhardAnglesMuMinusCmd;
0432 }
0433 
0434 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0435 
0436 void DetectorConstructionMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0437 {
0438     if (command == fCrystalMaterialCmd)
0439         {fDetector->SetCrystalMaterial(newValue);}
0440     if (command == fCrystalSizeCmd) 
0441         {fDetector->SetCrystalSize(fCrystalSizeCmd->GetNew3VectorValue(newValue));}
0442     if (command == fCrystalLatticeCmd)
0443         {fDetector->SetCrystalLattice(newValue);}
0444     if (command == fCrystalAngleXCmd) 
0445         {fDetector->SetCrystalAngleX(fCrystalAngleXCmd->GetNewDoubleValue(newValue));}
0446     if (command == fCrystalAngleYCmd) 
0447         {fDetector->SetCrystalAngleY(fCrystalAngleYCmd->GetNewDoubleValue(newValue));}
0448     if (command == fCrystalBendingAngleCmd) 
0449         {fDetector->SetCrystalBendingAngle(
0450                     fCrystalBendingAngleCmd->GetNewDoubleValue(newValue));}
0451     if (command == fRadModelCmd) 
0452         {fDetector->SetRadiationModel(fRadModelCmd->GetNewBoolValue(newValue));}
0453     if (command == fChannelingModelCmd)
0454         {fDetector->SetChannelingModel(fChannelingModelCmd->GetNewBoolValue(newValue));}
0455     
0456     if (command == fCrystallineUndulatorAmplitudeCmd)
0457         {fDetector->SetCrystallineUndulatorAmplitude
0458                 (fCrystallineUndulatorAmplitudeCmd->GetNewDoubleValue(newValue));}
0459     if (command == fCrystallineUndulatorPeriodCmd)
0460         {fDetector->SetCrystallineUndulatorPeriod
0461                 (fCrystallineUndulatorPeriodCmd->GetNewDoubleValue(newValue));}
0462     if (command == fCrystallineUndulatorPhaseCmd)
0463         {fDetector->SetCrystallineUndulatorPhase
0464                 (fCrystallineUndulatorPhaseCmd->GetNewDoubleValue(newValue));}
0465 
0466     if (command == fDetectorSizeCmd)
0467         {fDetector->SetDetectorSize(fDetectorSizeCmd->GetNew3VectorValue(newValue));}
0468     if (command == fDetectorFrontPosZCmd)
0469         {fDetector->SetDetectorFrontPositionZ(
0470                     fDetectorFrontPosZCmd->GetNewDoubleValue(newValue));}
0471 
0472     if (command == fPotentialPathCmd)
0473         {fDetector->SetPotentialPath(newValue);}
0474                 
0475     if (command == fMinPhotonEnergyCmd)
0476         {fDetector->SetMinPhotonEnergy(
0477                     fMinPhotonEnergyCmd->GetNewDoubleValue(newValue));}
0478     if (command == fSamplingPhotonsNumberCmd)
0479         {fDetector->SetSamplingPhotonsNumber(
0480                     fSamplingPhotonsNumberCmd->GetNewIntValue(newValue));}
0481     if (command == fNSmallTrajectoryStepsCmd)
0482         {fDetector->SetNSmallTrajectorySteps(
0483                     fNSmallTrajectoryStepsCmd->GetNewIntValue(newValue));}
0484     if (command == fRadiationAngleFactorCmd)
0485         {fDetector->SetRadiationAngleFactor(
0486                     fRadiationAngleFactorCmd->GetNewDoubleValue(newValue));}
0487 
0488     if (command == fMinPhotonEnergyAddStatCmd)
0489         {fDetector->SetMinPhotonEnergyAddStat(
0490                     fMinPhotonEnergyAddStatCmd->GetNewDoubleValue(newValue));}
0491     if (command == fMaxPhotonEnergyAddStatCmd)
0492         {fDetector->SetMaxPhotonEnergyAddStat(
0493                     fMaxPhotonEnergyAddStatCmd->GetNewDoubleValue(newValue));}
0494     if (command == fTimesPhotonStatisticsCmd)
0495         {fDetector->SetMultiplePhotonStatistics(
0496                     fTimesPhotonStatisticsCmd->GetNewIntValue(newValue));}
0497 
0498     if (command == fParticleMinKinEnergyCmd)
0499         {fDetector->SetParticleMinKinEnergy(
0500                     fParticleMinKinEnergyCmd->GetNewDoubleValue(newValue));}
0501     if (command == fProtonMinKinEnergyCmd)
0502         {fDetector->SetProtonMinKinEnergy(
0503                     fProtonMinKinEnergyCmd->GetNewDoubleValue(newValue));}
0504     if (command == fAntiprotonMinKinEnergyCmd)
0505         {fDetector->SetAntiprotonMinKinEnergy(
0506                     fAntiprotonMinKinEnergyCmd->GetNewDoubleValue(newValue));}
0507     if (command == fPiPlusMinKinEnergyCmd)
0508         {fDetector->SetPiPlusMinKinEnergy(
0509                     fPiPlusMinKinEnergyCmd->GetNewDoubleValue(newValue));}
0510     if (command == fPiMinusMinKinEnergyCmd)
0511         {fDetector->SetPiMinusMinKinEnergy(
0512                     fPiMinusMinKinEnergyCmd->GetNewDoubleValue(newValue));}
0513     if (command == fElectronMinKinEnergyCmd)
0514         {fDetector->SetElectronMinKinEnergy(
0515                     fElectronMinKinEnergyCmd->GetNewDoubleValue(newValue));}
0516     if (command == fPositronMinKinEnergyCmd)
0517         {fDetector->SetPositronMinKinEnergy(
0518                     fPositronMinKinEnergyCmd->GetNewDoubleValue(newValue));}
0519     if (command == fMuPlusMinKinEnergyCmd)
0520         {fDetector->SetMuPlusMinKinEnergy(
0521                     fMuPlusMinKinEnergyCmd->GetNewDoubleValue(newValue));}
0522     if (command == fMuMinusMinKinEnergyCmd)
0523         {fDetector->SetMuMinusMinKinEnergy(
0524                     fMuMinusMinKinEnergyCmd->GetNewDoubleValue(newValue));}
0525 
0526     if (command == fLindhardAnglesCmd) 
0527         {fDetector->SetLindhardAngles(
0528                     fLindhardAnglesCmd->GetNewDoubleValue(newValue));}
0529     if (command == fLindhardAnglesProtonCmd)
0530         {fDetector->SetLindhardAnglesProton(
0531                     fLindhardAnglesProtonCmd->GetNewDoubleValue(newValue));}
0532     if (command == fLindhardAnglesAntiprotonCmd)
0533         {fDetector->SetLindhardAnglesAntiproton(
0534                     fLindhardAnglesAntiprotonCmd->GetNewDoubleValue(newValue));}
0535     if (command == fLindhardAnglesPiPlusCmd)
0536         {fDetector->SetLindhardAnglesPiPlus(
0537                     fLindhardAnglesPiPlusCmd->GetNewDoubleValue(newValue));}
0538     if (command == fLindhardAnglesPiMinusCmd)
0539         {fDetector->SetLindhardAnglesPiMinus(
0540                     fLindhardAnglesPiMinusCmd->GetNewDoubleValue(newValue));}
0541     if (command == fLindhardAnglesElectronCmd)
0542         {fDetector->SetLindhardAnglesElectron(
0543                     fLindhardAnglesElectronCmd->GetNewDoubleValue(newValue));}
0544     if (command == fLindhardAnglesPositronCmd)
0545         {fDetector->SetLindhardAnglesPositron(
0546                     fLindhardAnglesPositronCmd->GetNewDoubleValue(newValue));}
0547     if (command == fLindhardAnglesMuPlusCmd)
0548         {fDetector->SetLindhardAnglesMuPlus(
0549                     fLindhardAnglesMuPlusCmd->GetNewDoubleValue(newValue));}
0550     if (command == fLindhardAnglesMuMinusCmd)
0551         {fDetector->SetLindhardAnglesMuMinus(
0552                     fLindhardAnglesMuMinusCmd->GetNewDoubleValue(newValue));}
0553 }
0554 
0555 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....