Skip to content
Snippets Groups Projects
Commit c19dd56e authored by clantz's avatar clantz
Browse files

Added output to GDML to DetectorMessenger (not fully functional)

parent bd2ccd84
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,7 @@ class DetectorConstruction : public G4VUserDetectorConstruction
void SetRotation (G4ThreeVector arg);
void SetTranslation (G4ThreeVector arg);
void SetPMTTranslation (G4ThreeVector arg);
void SetPMTDiameter (G4double arg);
void SetSurfaceSigmaAlpha (G4double v);
void SetSurfaceFinish (const G4OpticalSurfaceFinish finish);
......
......@@ -67,11 +67,17 @@ class DetectorMessenger: public G4UImessenger{
G4UIcmdWithAString* fSurfaceModelCmd;
G4UIcmdWithADouble* fSurfaceSigmaAlphaCmd;
G4UIcmdWithAString* fSurfaceMatPropVectorCmd;
// the gas
G4UIcmdWithAString* fGasPropVectorCmd;
// the model
G4UIcmdWithAString* fModelCmd;
G4UIcmdWith3VectorAndUnit* fModelRotationCmd;
G4UIcmdWith3VectorAndUnit* fModelTranslationCmd;
G4UIcmdWith3VectorAndUnit* fPMTTranslationCmd;
G4UIcmdWithADoubleAndUnit* fPMTDiameterCmd;
G4UIcmdWithAString* fOutputModelCmd;
};
......
File added
File added
File added
......@@ -51,6 +51,16 @@
#/lightGuide/model/translate 0 -319 0 mm
#/lightGuide/model/translatePMT 0 -119 0 mm
/lightGuide/model/CADmodel ../models/YuvalCone.stl
/lightGuide/model/translate 200 -136.75 0 mm
/lightGuide/model/translatePMT 0 -136.5 0 mm
/lightGuide/model/PMTDiameter 170
#/lightGuide/model/CADmodel ../models/YuvalHad.stl
#/lightGuide/model/translate 0 -319 0 mm
#/lightGuide/model/translatePMT 0 -136.5 0 mm
#/lightGuide/model/PMTDiameter 170
#----- Set surface properties of the light guide -----
/lightGuide/surface/Model unified
......@@ -80,16 +90,17 @@
#----- Set the beam geometry -----
# Circular beam source. Simulates a single fiber optic
#/gps/pos/type Beam
#/gps/pos/shape Circle
/gps/pos/type Beam
/gps/pos/shape Circle
#/gps/pos/radius 0.75 mm
/gps/pos/radius 102 mm
#/gps/pos/sigma_r 0.002 mm
# Rectangular plane for infinite resolution
/gps/pos/type Plane
/gps/pos/shape Rectangle
/gps/pos/halfx 40 mm
/gps/pos/halfy 68 mm
#/gps/pos/type Plane
#/gps/pos/shape Rectangle
#/gps/pos/halfx 40 mm
#/gps/pos/halfy 68 mm
# the incident surface is in the x-z plane just below the gas
/gps/pos/rot1 1 0 0
......@@ -120,6 +131,6 @@
##############################################################
##############################################################
# number of events
/run/beamOn 100
/run/beamOn 10000000
##############################################################
##############################################################
......@@ -445,3 +445,13 @@ void DetectorConstruction::SetPMTTranslation(G4ThreeVector arg){
m_runMan->GeometryHasBeenModified();
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/rebuild");
}
/*
*
*/
void DetectorConstruction::SetPMTDiameter(G4double arg){
m_solidPMT->SetOuterRadius(arg/2.0);
m_runMan->GeometryHasBeenModified();
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/rebuild");
}
......@@ -128,6 +128,20 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
fPMTTranslationCmd->SetDefaultValue(G4ThreeVector(0.,0.,0.));
fPMTTranslationCmd->SetDefaultUnit("mm");
fPMTDiameterCmd =
new G4UIcmdWithADoubleAndUnit("/lightGuide/model/PMTDiameter",this);
fPMTDiameterCmd->SetGuidance("Set PMT diameter");
fPMTDiameterCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
fPMTDiameterCmd->SetToBeBroadcasted(false);
fPMTDiameterCmd->SetParameterName("dia",true);
fPMTDiameterCmd->SetDefaultValue( 65.0*mm );
fPMTDiameterCmd->SetDefaultUnit("mm");
fOutputModelCmd = new G4UIcmdWithAString("/lightGuide/model/OutputModel",this);
fOutputModelCmd->SetGuidance("Creates a .gdml file of the light guide with the given name");
fOutputModelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
fOutputModelCmd->SetToBeBroadcasted(false);
}
/*
......@@ -144,6 +158,8 @@ DetectorMessenger::~DetectorMessenger(){
delete fModelRotationCmd;
delete fModelTranslationCmd;
delete fPMTTranslationCmd;
delete fPMTDiameterCmd;
delete fOutputModelCmd;
}
/*
......@@ -388,4 +404,12 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
else if(command == fPMTTranslationCmd){
fDetector->SetPMTTranslation(fPMTTranslationCmd->GetNew3VectorValue(newValue));
}
// PMT Diameter
else if(command == fPMTDiameterCmd){
fDetector->SetPMTDiameter(fPMTDiameterCmd->GetNewDoubleValue(newValue));
}
// PMT Diameter
else if(command == fOutputModelCmd){
fDetector->OutputToGDML(newValue);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment