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 // G4ErrorPropagatorData
0027 //
0028 // Class description:
0029 //
0030 // Utility class to provide access to mode, state, target
0031 // and manager verbosity for the error propagation classes.
0032 
0033 // Author: P.Arce, 2004
0034 // --------------------------------------------------------------------
0035 
0036 #ifndef G4ErrorPropagatorData_hh
0037 #define G4ErrorPropagatorData_hh
0038 
0039 #include "globals.hh"
0040 
0041 enum G4ErrorMode
0042 {
0043   G4ErrorMode_PropForwards = 1,
0044   G4ErrorMode_PropBackwards,
0045   G4ErrorMode_PropTest
0046 };
0047 
0048 enum G4ErrorState
0049 {
0050   G4ErrorState_PreInit = 1,
0051   G4ErrorState_Init,
0052   G4ErrorState_Propagating,
0053   G4ErrorState_TargetCloserThanBoundary,
0054   G4ErrorState_StoppedAtTarget
0055 };
0056 
0057 enum G4ErrorStage
0058 {
0059   G4ErrorStage_Inflation = 1,
0060   G4ErrorStage_Deflation
0061 };
0062 
0063 class G4ErrorTarget;
0064 
0065 class G4ErrorPropagatorData
0066 {
0067  public:
0068   static G4ErrorPropagatorData* GetErrorPropagatorData();
0069   // Singleton instance
0070 
0071   inline G4ErrorMode GetMode() const;
0072   inline void SetMode(G4ErrorMode mode);
0073 
0074   inline G4ErrorState GetState() const;
0075   inline void SetState(G4ErrorState sta);
0076 
0077   inline G4ErrorStage GetStage() const;
0078   inline void SetStage(G4ErrorStage sta);
0079 
0080   inline const G4ErrorTarget* GetTarget(G4bool mustExist = false) const;
0081   inline void SetTarget(const G4ErrorTarget* target);
0082 
0083   static G4int verbose();
0084   static void SetVerbose(G4int ver);
0085 
0086  private:
0087   G4ErrorPropagatorData() = default;
0088   ~G4ErrorPropagatorData();
0089   // constructor and destructor are private
0090 
0091  private:
0092   static G4ThreadLocal G4ErrorPropagatorData* fpInstance;
0093 
0094   G4ErrorMode theMode{G4ErrorMode_PropTest};
0095 
0096   G4ErrorState theState{G4ErrorState_PreInit};
0097 
0098   G4ErrorStage theStage{G4ErrorStage_Inflation};
0099 
0100   G4ErrorTarget* theTarget = nullptr;
0101 
0102   static G4ThreadLocal G4int theVerbosity;
0103 };
0104 
0105 #include "G4ErrorPropagatorData.icc"
0106 
0107 #endif