Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:29

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 // G4WrapperProcess
0027 //
0028 // Class description:
0029 //
0030 // Virtual class for wrapper process objects. 
0031 
0032 // Author: H.Kurahige, 18 December 1996
0033 // --------------------------------------------------------------------
0034 #ifndef G4WrapperProcess_hh 
0035 #define G4WrapperProcess_hh 1
0036 
0037 #include "globals.hh"
0038 #include "G4ios.hh"
0039 #include "G4VProcess.hh"
0040 
0041 class G4WrapperProcess : public G4VProcess
0042 {
0043   public:
0044 
0045     G4WrapperProcess(const G4String& aName =  "Wrapped",
0046                      G4ProcessType aType = fNotDefined);
0047       // Constructor requires the process name and type
0048 
0049     G4WrapperProcess(const G4WrapperProcess& right);
0050       // Copy constructor copies the name but does not copy the 
0051       // physics table (null pointer is assigned)
0052 
0053     virtual ~G4WrapperProcess();
0054       // Destructor 
0055 
0056     G4WrapperProcess& operator=(const G4WrapperProcess&) = delete;
0057 
0058     inline G4bool operator==(const G4WrapperProcess& right) const;
0059     inline G4bool operator!=(const G4WrapperProcess& right) const;
0060       // Equality operators
0061 
0062     virtual void RegisterProcess(G4VProcess*);
0063     virtual const G4VProcess* GetRegisteredProcess() const;
0064 
0065     ////////////////////////////
0066     // DoIt    /////////////////
0067     ///////////////////////////
0068 
0069     virtual G4VParticleChange* PostStepDoIt(
0070                              const G4Track& track,
0071                              const G4Step&  stepData
0072                             );
0073 
0074     virtual G4VParticleChange* AlongStepDoIt(
0075                              const G4Track& track,
0076                              const G4Step& stepData
0077                             );
0078     virtual G4VParticleChange* AtRestDoIt(
0079                              const G4Track& track,
0080                              const G4Step& stepData
0081                             );
0082 
0083     //////////////////////////
0084     // GPIL    //////////////
0085     /////////////////////////  
0086 
0087     virtual G4double AlongStepGetPhysicalInteractionLength(
0088                              const G4Track& track,
0089                              G4double  previousStepSize,
0090                              G4double  currentMinimumStep,
0091                              G4double& proposedSafety,
0092                              G4GPILSelection* selection);
0093 
0094     virtual G4double AtRestGetPhysicalInteractionLength(
0095                              const G4Track& track,
0096                              G4ForceCondition* condition
0097                             );
0098 
0099     virtual G4double PostStepGetPhysicalInteractionLength(
0100                              const G4Track& track,
0101                              G4double   previousStepSize,
0102                              G4ForceCondition* condition
0103                             );
0104   
0105     virtual G4bool IsApplicable(const G4ParticleDefinition&);
0106       // Returns true if this process object is applicable to
0107       // the particle type
0108       // Process will not be registered to a particle if IsApplicable is false   
0109 
0110     virtual void BuildPhysicsTable(const G4ParticleDefinition&);
0111       // Messaged by the Particle definition (via the Process manager)
0112       // whenever cross-section tables have to be rebuilt (i.e. if new
0113       // materials have been defined). 
0114       // It is overloaded by individual processes when they need physics
0115       // tables
0116 
0117     // Processes which build (for example in their constructors)
0118     // physics tables independent of cuts should preferably use a private
0119     // void BuildThePhysicsTable() function.
0120     // **Not** another BuildPhysicsTable().
0121  
0122     virtual void PreparePhysicsTable(const G4ParticleDefinition&);
0123       // Messaged by the Particle definition (via the Process manager)
0124       // whenever cross-section tables have to be prepare for rebuilt 
0125       // (i.e. if new materials have been defined). 
0126       // It is overloaded by individual processes when they need physics
0127       // tables
0128 
0129 
0130     virtual G4bool StorePhysicsTable(const G4ParticleDefinition* ,
0131                                      const G4String& directory, 
0132                                      G4bool ascii = false); 
0133       // Store PhysicsTable in a file. 
0134       // Return false in case of failure at I/O 
0135  
0136     virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* ,
0137                                          const G4String& directory, 
0138                                          G4bool ascii = false);
0139       // Retrieve Physics from a file. 
0140       // Return true if the Physics Table can be build by using file.
0141       // Return false if the process has no functionality or in case of failure.
0142       // File name should be defined by each process and the file should be
0143       // placed under the directory specified by the argument
0144 
0145     virtual void StartTracking(G4Track*);
0146     virtual void EndTracking();
0147       // inform Start/End of tracking for each track to the physics process 
0148  
0149     virtual void SetProcessManager(const G4ProcessManager*); 
0150       // A process manager sets its own pointer when the process is registered
0151       // in the process Manager
0152     virtual  const G4ProcessManager* GetProcessManager(); 
0153       // Get the process manager which the process belongs to
0154   
0155     virtual void ResetNumberOfInteractionLengthLeft();
0156       // Reset (determine the value of) NumberOfInteractionLengthLeft
0157     virtual void SetMasterProcess(G4VProcess* masterP);
0158       // Needed for MT, forward call to underlying process 
0159 
0160   protected:
0161 
0162     G4VProcess* pRegProcess = nullptr;
0163 };
0164 
0165 // ------------------------
0166 // Inline operators
0167 // ------------------------
0168 
0169 inline
0170 G4bool G4WrapperProcess::operator==(const G4WrapperProcess& right) const
0171 {
0172   return (this == &right);
0173 }
0174 
0175 inline
0176 G4bool G4WrapperProcess::operator!=(const G4WrapperProcess& right) const
0177 {
0178   return (this != &right);
0179 }
0180 
0181 #endif