diff --git a/include/DetectorConstruction.hh b/include/DetectorConstruction.hh index 935c319e905922546e05792acb6a9cf791c01846..07918c27b4494d6a52bd501373f31a5fdbc8e08c 100644 --- a/include/DetectorConstruction.hh +++ b/include/DetectorConstruction.hh @@ -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); diff --git a/include/DetectorMessenger.hh b/include/DetectorMessenger.hh index 93028674af7610f7784e67fb21674e140adc977e..213687907b289f14893af947031d114b8caf1417 100644 --- a/include/DetectorMessenger.hh +++ b/include/DetectorMessenger.hh @@ -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; }; diff --git a/models/WC_channel.stl b/models/WC_channel.stl new file mode 100644 index 0000000000000000000000000000000000000000..cd5e0db1c859ca2dcb9490876d97e1a1cd59cfef Binary files /dev/null and b/models/WC_channel.stl differ diff --git a/models/YuvalCone.stl b/models/YuvalCone.stl new file mode 100644 index 0000000000000000000000000000000000000000..748c6788d44af96eba8def05d207a1aff87124a3 Binary files /dev/null and b/models/YuvalCone.stl differ diff --git a/models/YuvalHad.stl b/models/YuvalHad.stl new file mode 100644 index 0000000000000000000000000000000000000000..a0fd2ae3c159f6e25a648e0bf5574812d1362a08 Binary files /dev/null and b/models/YuvalHad.stl differ diff --git a/run1.mac b/run1.mac index 1322fc3ee3c2a5934e7700d0f03500e31f7ae1ed..bfb325ac4eace3f91e3a0c6b7921b183e7f23ac5 100644 --- a/run1.mac +++ b/run1.mac @@ -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 ############################################################## ############################################################## diff --git a/src/DetectorConstruction.cc b/src/DetectorConstruction.cc index 3e82d4f79e6b45c90ddf01d5c0b005797289f852..af4d9ac1f67e0dc323f95bcbdf5373bd656499e7 100644 --- a/src/DetectorConstruction.cc +++ b/src/DetectorConstruction.cc @@ -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"); +} diff --git a/src/DetectorMessenger.cc b/src/DetectorMessenger.cc index cef0f409cf552c4bb33480170f9b2600631d7419..d9a363db4a8a9ec4168e5d057ca0a58133f5bee2 100644 --- a/src/DetectorMessenger.cc +++ b/src/DetectorMessenger.cc @@ -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); + } }