ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4WrapperProcess.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4WrapperProcess.hh
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 //
27 //
28 //
29 // ------------------------------------------------------------
30 // GEANT 4 class header file
31 //
32 // Class Description
33 //
34 // This class is the virtual class for wrapper process objects.
35 
36 // ------------------------------------------------------------
37 // New Physics scheme 18 Dec. 1996 H.Kurahige
38 // ------------------------------------------------------------
39 
40 #ifndef G4WrapperProcess_h
41 #define G4WrapperProcess_h 1
42 
43 #include "globals.hh"
44 #include "G4ios.hh"
45 #include "G4VProcess.hh"
46 
48 {
49  // A virtual class for wrapper process objects.
50 
51  private:
52  // hide default constructor and assignment operator as private
53  // do not hide default constructor for alpha version
55 
56  public: // with description
57  // constructor requires the process name and type
58  G4WrapperProcess(const G4String& aName = "Wrapped",
59  G4ProcessType aType = fNotDefined );
60 
61  // copy constructor copys the name but does not copy the
62  // physics table (0 pointer is assigned)
63  G4WrapperProcess(const G4WrapperProcess &right);
64 
65  public:
66  // destructor
67  virtual ~G4WrapperProcess();
68 
69  // equality opperators
70  inline G4bool operator==(const G4WrapperProcess &right) const;
71  inline G4bool operator!=(const G4WrapperProcess &right) const;
72 
73  public: // with description
74  virtual void RegisterProcess(G4VProcess*);
75  virtual const G4VProcess* GetRegisteredProcess() const;
76 
77  protected:
79 
80  public: // with description
82  // DoIt /////////////////
85  const G4Track& track,
86  const G4Step& stepData
87  );
88 
90  const G4Track& track,
91  const G4Step& stepData
92  );
94  const G4Track& track,
95  const G4Step& stepData
96  );
98  // GPIL //////////////
101  const G4Track& track,
102  G4double previousStepSize,
103  G4double currentMinimumStep,
104  G4double& proposedSafety,
105  G4GPILSelection* selection);
106 
108  const G4Track& track,
110  );
111 
113  const G4Track& track,
114  G4double previousStepSize,
116  ) ;
117 
119  virtual G4bool IsApplicable(const G4ParticleDefinition&);
120  // Returns true if this process object is applicable to
121  // the particle type
122  // Process will not be registered to a particle if IsApplicable is false
123 
124  virtual void BuildPhysicsTable(const G4ParticleDefinition&);
125  // Messaged by the Particle definition (via the Process manager)
126  // whenever cross section tables have to be rebuilt (i.e. if new
127  // materials have been defined).
128  // It is overloaded by individual processes when they need physics
129  // tables.
130 
131  // Processes which Build (for example in their
132  // constructors) physics tables independent of cuts
133  // should preferably use a
134  // private void BuildThePhysicsTable()
135  // function. Not another BuildPhysicsTable, please.
136 
137  virtual void PreparePhysicsTable(const G4ParticleDefinition&);
138  // Messaged by the Particle definition (via the Process manager)
139  // whenever cross section tables have to be prepare for rebuilt
140  // (i.e. if new materials have been defined).
141  // It is overloaded by individual processes when they need physics
142  // tables.
143 
144  // Processes which Build physics tables independent of cuts
145  // (for example in their constructors)
146  // should preferably use private
147  // void BuildThePhysicsTable() and void PreparePhysicsTable().
148  // Not another BuildPhysicsTable, please.
149 
150 
152  const G4String& directory,
153  G4bool ascii = false);
154  // Store PhysicsTable in a file.
155  // (return false in case of failure at I/O )
156 
158  const G4String& directory,
159  G4bool ascii = false);
160  // Retrieve Physics from a file.
161  // (return true if the Physics Table can be build by using file)
162  // (return false if the process has no functionality or in case of failure)
163  // File name should be defined by each process
164  // and the file should be placed under the directory specifed by the argument.
166  virtual void StartTracking(G4Track*);
167  virtual void EndTracking();
168  // inform Start/End of tracking for each track to the physics process
169 
170  public:
171  virtual void SetProcessManager(const G4ProcessManager*);
172  // A process manager set its own pointer when the process is registered
173  // the process Manager
174  virtual const G4ProcessManager* GetProcessManager();
175  // Get the process manager which the process belongs to
176 
177  public:
178  virtual void ResetNumberOfInteractionLengthLeft();
179  // reset (determine the value of)NumberOfInteractionLengthLeft
180  virtual void SetMasterProcess(G4VProcess* masterP);
181  // Needed for MT, forward call to underlying process
182 };
183 
184 inline
186 {
187  G4Exception("G4WrapperProcess::operator=","Illegal operation",
188  JustWarning,"Assignment operator is called");
189  return *this;
190 }
191 
192 inline
194 {
195  return (this == &right);
196 }
197 
198 inline
200 {
201  return (this != &right);
202 }
203 
204 #endif