Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // G4MaterialScanner 27 // 28 // Class description: 29 // 30 // Utility class for scanning of materials through ray-tracing 31 // in a detector setup. 32 33 // Author: M.Asai, May 2006 34 // -------------------------------------------------------------------- 35 #ifndef G4MaterialScanner_hh 36 #define G4MaterialScanner_hh 1 37 38 #include "G4ThreeVector.hh" 39 #include "globals.hh" 40 41 class G4Event; 42 class G4EventManager; 43 class G4UserEventAction; 44 class G4UserStackingAction; 45 class G4UserTrackingAction; 46 class G4UserSteppingAction; 47 class G4MSSteppingAction; 48 class G4MatScanMessenger; 49 class G4RayShooter; 50 class G4Region; 51 52 class G4MaterialScanner 53 { 54 public: 55 G4MaterialScanner(); 56 ~G4MaterialScanner(); 57 58 // The main entry point which triggers ray tracing. 59 // This method is available only if Geant4 is in Idle state. 60 void Scan(); 61 62 inline void SetEyePosition(const G4ThreeVector& val) { eyePosition = val; } 63 inline G4ThreeVector GetEyePosition() const { return eyePosition; } 64 inline void SetNTheta(G4int val) { nTheta = val; } 65 inline G4int GetNTheta() const { return nTheta; } 66 inline void SetThetaMin(G4double val) { thetaMin = val; } 67 inline G4double GetThetaMin() const { return thetaMin; } 68 inline void SetThetaSpan(G4double val) { thetaSpan = val; } 69 inline G4double GetThetaSpan() const { return thetaSpan; } 70 inline void SetNPhi(G4int val) { nPhi = val; } 71 inline G4int GetNPhi() const { return nPhi; } 72 inline void SetPhiMin(G4double val) { phiMin = val; } 73 inline G4double GetPhiMin() const { return phiMin; } 74 inline void SetPhiSpan(G4double val) { phiSpan = val; } 75 inline G4double GetPhiSpan() const { return phiSpan; } 76 inline void SetRegionSensitive(G4bool val = true) { regionSensitive = val; } 77 inline G4bool GetRegionSensitive() const { return regionSensitive; } 78 G4bool SetRegionName(const G4String& val); 79 inline const G4String& GetRegionName() const { return regionName; } 80 inline void SetVerbosity(G4int v) { verbosity = v; }; 81 82 private: 83 void DoScan(); 84 // Event loop 85 86 void StoreUserActions(); 87 void RestoreUserActions(); 88 // Store and restore user action classes if defined. 89 90 private: 91 G4RayShooter* theRayShooter = nullptr; 92 G4MatScanMessenger* theMessenger = nullptr; 93 94 G4EventManager* theEventManager = nullptr; 95 96 G4UserEventAction* theUserEventAction = nullptr; 97 G4UserStackingAction* theUserStackingAction = nullptr; 98 G4UserTrackingAction* theUserTrackingAction = nullptr; 99 G4UserSteppingAction* theUserSteppingAction = nullptr; 100 101 G4UserEventAction* theMatScannerEventAction = nullptr; 102 G4UserStackingAction* theMatScannerStackingAction = nullptr; 103 G4UserTrackingAction* theMatScannerTrackingAction = nullptr; 104 G4MSSteppingAction* theMatScannerSteppingAction = nullptr; 105 106 G4ThreeVector eyePosition; 107 G4int nTheta = 91; 108 G4double thetaMin = 0.0; 109 G4double thetaSpan = 0.0; 110 G4int nPhi = 37; 111 G4double phiMin = 0.0; 112 G4double phiSpan = 0.0; 113 114 G4ThreeVector eyeDirection; 115 116 G4bool regionSensitive = false; 117 G4String regionName = "notDefined"; 118 G4Region* theRegion = nullptr; 119 120 /// Configure degree of verbosity of Material Scan 121 /// verbosity 0: default 122 /// verbosity 1: call PrintIntegratedMaterialVerbose 123 /// verbosity 2: call PrintEachMaterialVerbose 124 G4int verbosity = 0; 125 }; 126 127 #endif 128