Back to home page

EIC code displayed by LXR

 
 

    


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

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 //
0027 //
0028 // Class Description:
0029 //
0030 // This is the class manager of the GEANT4e package.
0031 // It is the main interface for the user to define the setup and
0032 // start the propagation. Initializes GEANT4 for the propagation.
0033 
0034 // History:
0035 // - Created:   Pedro Arce, February 2001
0036 // --------------------------------------------------------------------
0037 
0038 #ifndef G4ErrorPropagatorManager_hh
0039 #define G4ErrorPropagatorManager_hh
0040 
0041 #include "globals.hh"
0042 #include "G4ErrorPropagatorData.hh"
0043 #include "G4ErrorPropagator.hh"
0044 #include "G4ApplicationState.hh"
0045 
0046 class G4ErrorPropagationNavigator;
0047 class G4ErrorRunManagerHelper;
0048 class G4ErrorTarget;
0049 class G4ErrorTrajState;
0050 
0051 class G4VUserDetectorConstruction;
0052 class G4VPhysicalVolume;
0053 class G4VUserPhysicsList;
0054 class G4UserRunAction;
0055 class G4UserEventAction;
0056 class G4UserStackingAction;
0057 class G4UserTrackingAction;
0058 class G4UserSteppingAction;
0059 class G4Mag_UsualEqRhs;
0060 class G4Track;
0061 
0062 class G4ErrorPropagatorManager
0063 {
0064  public:  // with description
0065   G4ErrorPropagatorManager();
0066   // Initialise data to 0. Starts the G4ErrorRunManagerHelper and
0067   // G4ErrorPropagationNavigator.
0068 
0069   ~G4ErrorPropagatorManager();
0070 
0071   static G4ErrorPropagatorManager* GetErrorPropagatorManager();
0072   // Get only instance of G4ErrorPropagatorManager. If it does not exists,
0073   // creates it
0074 
0075   void EventTermination();
0076   // Set state to G4ErrorState_Init
0077 
0078   void RunTermination();
0079   // Set state to G4ErrorState_Init and invoke
0080   // G4ErrorRunManagerHelper::RunTermination()
0081 
0082   void InitGeant4e();
0083   // Initializes Geant4 and Geant4e
0084 
0085   void InitTrackPropagation();
0086   // Set the propagator step number to 0 and the G4ErrorState to Propagating
0087 
0088   G4bool InitFieldForBackwards();
0089   // Creates the G4ErrorMag_UsualEqRhs, that will control backwards tracking
0090 
0091   G4int Propagate(G4ErrorTrajState* currentTS, const G4ErrorTarget* target,
0092                   G4ErrorMode mode = G4ErrorMode_PropForwards);
0093   // Inits track propagation, invokes G4ErrorPropagator::Propagate and
0094   // terminates "event"
0095 
0096   G4int PropagateOneStep(G4ErrorTrajState* currentTS,
0097                          G4ErrorMode mode = G4ErrorMode_PropForwards);
0098   // Invokes G4ErrorPropagator::PropagateOneStep
0099 
0100   G4bool CloseGeometry();
0101   // Close Geant4 geometry
0102 
0103   void SetUserInitialization(G4VUserDetectorConstruction* userInit);
0104   // Invokes G4ErrorRunManagerHelper to construct detector and set
0105   // world volume
0106   void SetUserInitialization(G4VPhysicalVolume* userInit);
0107   // Invokes G4ErrorRunManagerHelper to  set world volume
0108   void SetUserInitialization(G4VUserPhysicsList* userInit);
0109   // Invokes G4ErrorRunManagerHelper to initialize physics
0110 
0111   void SetUserAction(G4UserTrackingAction* userAction);
0112   // Invokes G4EventManager to set a G4UserTrackingAction
0113   void SetUserAction(G4UserSteppingAction* userAction);
0114   // Invokes G4EventManager to set a G4UserSteppingAction
0115 
0116   G4String PrintG4ErrorState();
0117   G4String PrintG4ErrorState(G4ErrorState state);
0118   // Print Geant4e state
0119 
0120   G4String PrintG4State();
0121   G4String PrintG4State(G4ApplicationState state);
0122   // Print Geant4 state
0123 
0124   // Set and Get methods
0125 
0126   G4ErrorRunManagerHelper* GetErrorRunManagerHelper() const
0127   {
0128     return theG4ErrorRunManagerHelper;
0129   }
0130 
0131   void SetSteppingManagerVerboseLevel();
0132 
0133   G4ErrorPropagationNavigator* GetErrorPropagationNavigator() const
0134   {
0135     return theG4ErrorPropagationNavigator;
0136   }
0137 
0138   G4ErrorPropagator* GetPropagator() const { return thePropagator; }
0139 
0140  private:
0141   void StartG4ErrorRunManagerHelper();
0142   // Create a G4ErrorRunManagerHelper if it does not exist and set to it
0143   // the G4ErrorPhysicsList
0144 
0145   void StartNavigator();
0146   // create a G4ErrorPropagationNavigator
0147 
0148  private:
0149   static G4ThreadLocal G4ErrorPropagatorManager* theG4ErrorPropagatorManager;
0150 
0151   G4ErrorRunManagerHelper* theG4ErrorRunManagerHelper;
0152 
0153   G4ErrorPropagator* thePropagator;
0154 
0155   G4Mag_UsualEqRhs* theEquationOfMotion;
0156 
0157   G4ErrorPropagationNavigator* theG4ErrorPropagationNavigator;
0158 };
0159 
0160 #endif