Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:39

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4MaterialScanner
0027 //
0028 // Class description:
0029 //
0030 // Utility class for scanning of materials through ray-tracing
0031 // in a detector setup.
0032 
0033 // Author: M.Asai, May 2006
0034 // --------------------------------------------------------------------
0035 #ifndef G4MaterialScanner_hh
0036 #define G4MaterialScanner_hh 1
0037 
0038 #include "G4ThreeVector.hh"
0039 #include "globals.hh"
0040 
0041 class G4Event;
0042 class G4EventManager;
0043 class G4UserEventAction;
0044 class G4UserStackingAction;
0045 class G4UserTrackingAction;
0046 class G4UserSteppingAction;
0047 class G4MSSteppingAction;
0048 class G4MatScanMessenger;
0049 class G4RayShooter;
0050 class G4Region;
0051 
0052 class G4MaterialScanner
0053 {
0054   public:
0055     G4MaterialScanner();
0056     ~G4MaterialScanner();
0057 
0058     // The main entry point which triggers ray tracing.
0059     // This method is available only if Geant4 is in Idle state.
0060     void Scan();
0061 
0062     inline void SetEyePosition(const G4ThreeVector& val) { eyePosition = val; }
0063     inline G4ThreeVector GetEyePosition() const { return eyePosition; }
0064     inline void SetNTheta(G4int val) { nTheta = val; }
0065     inline G4int GetNTheta() const { return nTheta; }
0066     inline void SetThetaMin(G4double val) { thetaMin = val; }
0067     inline G4double GetThetaMin() const { return thetaMin; }
0068     inline void SetThetaSpan(G4double val) { thetaSpan = val; }
0069     inline G4double GetThetaSpan() const { return thetaSpan; }
0070     inline void SetNPhi(G4int val) { nPhi = val; }
0071     inline G4int GetNPhi() const { return nPhi; }
0072     inline void SetPhiMin(G4double val) { phiMin = val; }
0073     inline G4double GetPhiMin() const { return phiMin; }
0074     inline void SetPhiSpan(G4double val) { phiSpan = val; }
0075     inline G4double GetPhiSpan() const { return phiSpan; }
0076     inline void SetRegionSensitive(G4bool val = true) { regionSensitive = val; }
0077     inline G4bool GetRegionSensitive() const { return regionSensitive; }
0078     G4bool SetRegionName(const G4String& val);
0079     inline const G4String& GetRegionName() const { return regionName; }
0080 
0081   private:
0082     void DoScan();
0083     // Event loop
0084 
0085     void StoreUserActions();
0086     void RestoreUserActions();
0087     // Store and restore user action classes if defined.
0088 
0089   private:
0090     G4RayShooter* theRayShooter = nullptr;
0091     G4MatScanMessenger* theMessenger = nullptr;
0092 
0093     G4EventManager* theEventManager = nullptr;
0094 
0095     G4UserEventAction* theUserEventAction = nullptr;
0096     G4UserStackingAction* theUserStackingAction = nullptr;
0097     G4UserTrackingAction* theUserTrackingAction = nullptr;
0098     G4UserSteppingAction* theUserSteppingAction = nullptr;
0099 
0100     G4UserEventAction* theMatScannerEventAction = nullptr;
0101     G4UserStackingAction* theMatScannerStackingAction = nullptr;
0102     G4UserTrackingAction* theMatScannerTrackingAction = nullptr;
0103     G4MSSteppingAction* theMatScannerSteppingAction = nullptr;
0104 
0105     G4ThreeVector eyePosition;
0106     G4int nTheta = 91;
0107     G4double thetaMin = 0.0;
0108     G4double thetaSpan = 0.0;
0109     G4int nPhi = 37;
0110     G4double phiMin = 0.0;
0111     G4double phiSpan = 0.0;
0112 
0113     G4ThreeVector eyeDirection;
0114 
0115     G4bool regionSensitive = false;
0116     G4String regionName = "notDefined";
0117     G4Region* theRegion = nullptr;
0118 };
0119 
0120 #endif