File indexing completed on 2025-01-18 09:17:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #include "XrayFluoActionInitializer.hh"
0031 #include "XrayFluoDetectorConstruction.hh"
0032 #include "XrayFluoPlaneDetectorConstruction.hh"
0033 #include "XrayFluoMercuryDetectorConstruction.hh"
0034 #include "XrayFluoPrimaryGeneratorAction.hh"
0035 #include "XrayFluoPlanePrimaryGeneratorAction.hh"
0036 #include "XrayFluoMercuryPrimaryGeneratorAction.hh"
0037 #include "XrayFluoRunAction.hh"
0038 #include "XrayFluoEventAction.hh"
0039 #include "XrayFluoSteppingAction.hh"
0040 #include "XrayFluoSteppingVerbose.hh"
0041
0042 #include "G4RunManager.hh"
0043
0044
0045
0046 XrayFluoActionInitializer::XrayFluoActionInitializer(G4int geometryFlag) :
0047 G4VUserActionInitialization(),fGeometryFlag(geometryFlag)
0048 {;}
0049
0050
0051
0052 void XrayFluoActionInitializer::Build() const
0053 {
0054
0055 XrayFluoEventAction* eventAction = 0;
0056 XrayFluoSteppingAction* stepAction = new XrayFluoSteppingAction();
0057
0058
0059 if (fGeometryFlag == 1 || fGeometryFlag == 4)
0060 {
0061 const XrayFluoDetectorConstruction* testBeamDetector =
0062 static_cast<const XrayFluoDetectorConstruction*>
0063 (G4RunManager::GetRunManager()->GetUserDetectorConstruction());
0064
0065 eventAction = new XrayFluoEventAction(testBeamDetector);
0066 SetUserAction(new XrayFluoPrimaryGeneratorAction(testBeamDetector));
0067 }
0068 else if (fGeometryFlag == 2)
0069 {
0070 const XrayFluoPlaneDetectorConstruction* planeDetector =
0071 static_cast<const XrayFluoPlaneDetectorConstruction*>
0072 (G4RunManager::GetRunManager()->GetUserDetectorConstruction());
0073
0074 eventAction = new XrayFluoEventAction(planeDetector);
0075 SetUserAction(new XrayFluoPlanePrimaryGeneratorAction(planeDetector));
0076 }
0077 else if (fGeometryFlag == 3)
0078 {
0079 const XrayFluoMercuryDetectorConstruction* mercuryDetector =
0080 static_cast<const XrayFluoMercuryDetectorConstruction*>
0081 (G4RunManager::GetRunManager()->GetUserDetectorConstruction());
0082 eventAction = new XrayFluoEventAction(mercuryDetector);
0083 stepAction->SetMercuryFlag(true);
0084 SetUserAction(new XrayFluoMercuryPrimaryGeneratorAction(mercuryDetector));
0085 }
0086 SetUserAction(eventAction);
0087 SetUserAction(new XrayFluoRunAction());
0088 SetUserAction(stepAction);
0089
0090 }
0091
0092
0093
0094 void XrayFluoActionInitializer::BuildForMaster() const
0095 {
0096 SetUserAction(new XrayFluoRunAction());
0097 }
0098
0099
0100
0101
0102 G4VSteppingVerbose* XrayFluoActionInitializer::InitializeSteppingVerbose() const
0103 {
0104
0105 return new XrayFluoSteppingVerbose();
0106 }