ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4GammaGeneralProcess.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4GammaGeneralProcess.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 // GEANT4 Class header file
30 //
31 //
32 // File name: G4GammaGeneralProcess
33 //
34 // Author: Vladimir Ivanchenko
35 //
36 // Creation date: 19.07.2018
37 //
38 // Modifications:
39 //
40 // Class Description:
41 //
42 // It is the gamma super process
43 
44 // -------------------------------------------------------------------
45 //
46 
47 #ifndef G4GammaGeneralProcess_h
48 #define G4GammaGeneralProcess_h 1
49 
51 
52 #include "G4VEmProcess.hh"
53 #include "globals.hh"
54 #include "G4EmDataHandler.hh"
55 
56 class G4Step;
57 class G4Track;
59 class G4VParticleChange;
61 class G4HadronicProcess;
62 class G4LossTableManager;
64 class G4EmParameters;
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
67 
69 {
70 public:
71 
72  explicit G4GammaGeneralProcess();
73 
74  virtual ~G4GammaGeneralProcess();
75 
77 
79 
81 
83 
84  void ProcessDescription(std::ostream& outFile) const final;
85 
86 protected:
87 
88  void InitialiseProcess(const G4ParticleDefinition*) final;
89 
90 public:
91 
92  // Initialise for build of tables
93  void PreparePhysicsTable(const G4ParticleDefinition&) final;
94 
95  // Build physics table during initialisation
96  void BuildPhysicsTable(const G4ParticleDefinition&) final;
97 
98  // Called before tracking of each new G4Track
99  void StartTracking(G4Track*) final;
100 
101  // implementation of virtual method, specific for G4GammaGeneralProcess
103  const G4Track& track,
104  G4double previousStepSize,
105  G4ForceCondition* condition) final;
106 
107  // implementation of virtual method, specific for G4GammaGeneralProcess
108  G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) final;
109 
110  // Store PhysicsTable in a file.
111  // Return false in case of failure at I/O
113  const G4String& directory,
114  G4bool ascii = false) final;
115 
116  // Retrieve Physics from a file.
117  // (return true if the Physics Table can be build by using file)
118  // (return false if the process has no functionality or in case of failure)
119  // File name should is constructed as processName+particleName and the
120  // should be placed under the directory specifed by the argument.
122  const G4String& directory,
123  G4bool ascii) final;
124 
125  const G4String& GetProcessName() const;
126 
127  G4int GetProcessSubType() const;
128 
129  G4VEmProcess* GetEmProcess(const G4String& name) final;
130 
131 protected:
132 
133  G4double GetMeanFreePath(const G4Track& track, G4double previousStepSize,
134  G4ForceCondition* condition) final;
135 
136 private:
137 
138  // It returns the cross section per volume for energy/ material
140 
141  inline G4double ComputeGeneralLambda(size_t idxe, size_t idxt);
142 
143  inline G4double GetProbability(size_t idxt);
144 
145  inline void SelectedProcess(const G4Track& track, G4VProcess* ptr);
146 
147  inline G4VParticleChange* SampleSecondaries(const G4Track&, const G4Step&,
148  G4VEmProcess*);
149 
152 
153  // hide copy constructor and assignment operator
156 
158  static const size_t nTables = 15;
159  static G4bool theT[nTables];
161 
169 
176 
177  size_t nLowE;
178  size_t nHighE;
179  size_t idxEnergy;
181 };
182 
183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
184 
185 inline G4double
187 {
188  idxEnergy = idxe;
191 }
192 
193 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
194 
196 {
197  return (theT[idxt]) ? theHandler->GetVector(idxt, basedCoupleIndex)
199 }
200 
201 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
202 
203 inline void
205 {
206  selectedProc = ptr;
207  const_cast<G4Track*>(&track)->SetCreatorProcess(ptr);
208 }
209 
210 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
211 
212 inline G4VParticleChange*
214  G4VEmProcess* proc)
215 {
217  SelectedProcess(track, proc);
218  return proc->PostStepDoIt(track, step);
219 }
220 
221 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
222 
223 #endif