| 1 | #include "ELYSE/DetectorMessenger.hh"
 | 
|---|
| 2 | 
 | 
|---|
| 3 | //Geant 4
 | 
|---|
| 4 | #include "G4UIdirectory.hh"
 | 
|---|
| 5 | #include "G4UIcommand.hh"
 | 
|---|
| 6 | #include "G4UIparameter.hh"
 | 
|---|
| 7 | #include "G4UIcmdWith3VectorAndUnit.hh"
 | 
|---|
| 8 | #include "G4UIcmdWithADoubleAndUnit.hh"
 | 
|---|
| 9 | 
 | 
|---|
| 10 | //ELYSE
 | 
|---|
| 11 | #include "ELYSE/DetectorConstruction.hh"
 | 
|---|
| 12 | 
 | 
|---|
| 13 | ELYSE::DetectorMessenger::DetectorMessenger(ELYSE::DetectorConstruction* ELYSEDet)
 | 
|---|
| 14 | : ELYSEDetector(ELYSEDet) { 
 | 
|---|
| 15 | 
 | 
|---|
| 16 |   ELYSEDir = new G4UIdirectory("/ELYSE/Geometry/");
 | 
|---|
| 17 |   ELYSEDir->SetGuidance("Geometry control");
 | 
|---|
| 18 |   
 | 
|---|
| 19 |   waterDimensionsCmd = 
 | 
|---|
| 20 |     new G4UIcmdWith3VectorAndUnit("/ELYSE/Geometry/Water",this);
 | 
|---|
| 21 |   waterDimensionsCmd->SetGuidance("Set the dimensions of the Water volume.");
 | 
|---|
| 22 |   waterDimensionsCmd->SetParameterName("water_x","water_y","water_z",false);
 | 
|---|
| 23 |   waterDimensionsCmd->SetDefaultUnit("cm");
 | 
|---|
| 24 | 
 | 
|---|
| 25 |   tyvekThicknessCmd =
 | 
|---|
| 26 |     new G4UIcmdWithADoubleAndUnit
 | 
|---|
| 27 |     ("/ELYSE/Geometry/TyvekThickness",this);
 | 
|---|
| 28 |   tyvekThicknessCmd->SetGuidance("Set the thickness of the tyvek.");
 | 
|---|
| 29 |   tyvekThicknessCmd->SetParameterName("tyvek_thickness",false);
 | 
|---|
| 30 |   tyvekThicknessCmd->SetDefaultUnit("cm");
 | 
|---|
| 31 | 
 | 
|---|
| 32 | } //ELYSEDetectorMessenger
 | 
|---|
| 33 | 
 | 
|---|
| 34 | ELYSE::DetectorMessenger::~DetectorMessenger()
 | 
|---|
| 35 | {
 | 
|---|
| 36 |   
 | 
|---|
| 37 |   delete waterDimensionsCmd;
 | 
|---|
| 38 |   delete tyvekThicknessCmd;
 | 
|---|
| 39 | 
 | 
|---|
| 40 | } //ELYSEDetectorMessenger
 | 
|---|
| 41 | 
 | 
|---|
| 42 | void ELYSE::DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue) {    
 | 
|---|
| 43 | 
 | 
|---|
| 44 |   if( command ==  waterDimensionsCmd ){ 
 | 
|---|
| 45 |     ELYSEDetector->SetWaterDimensions(waterDimensionsCmd->GetNew3VectorValue(newValue));
 | 
|---|
| 46 |   }
 | 
|---|
| 47 |   else if (command == tyvekThicknessCmd){
 | 
|---|
| 48 |     ELYSEDetector->SetTyvekThickness(tyvekThicknessCmd->GetNewDoubleValue(newValue));
 | 
|---|
| 49 |   }
 | 
|---|
| 50 |  
 | 
|---|
| 51 | }//SetNewValue
 | 
|---|