/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/physics/include/RAT/G4CerenkovProcess.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/physics/include/RAT/G4CerenkovProcess.hh Source File
Ratpac-two
G4CerenkovProcess.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 //
27 // Cerenkov Radiation Class Definition
29 //
30 // Class: RAT::G4CerenkovProcess
31 // File: G4CerenkovProcess.hh
32 // Description: Discrete Process - Generation of Cerenkov Photons
33 // Version: 2.0
34 // Created: 1996-02-21
35 // Author: Juliet Armstrong
36 // Updated: 2007-09-30 change inheritance to G4VDiscreteProcess
37 // 2005-07-28 add G4ProcessType to constructor
38 // 1999-10-29 add method and class descriptors
39 // 1997-04-09 by Peter Gumplinger
40 // > G4MaterialPropertiesTable; new physics/tracking scheme
41 //
43 
44 #ifndef __RAT_G4CerenkovProcess_h
45 #define __RAT_G4CerenkovProcess_h 1
46 
47 #include <memory>
48 #include <vector>
49 
50 #include "G4DynamicParticle.hh"
51 #include "G4ForceCondition.hh"
52 #include "G4GPILSelection.hh"
53 #include "G4MaterialPropertyVector.hh"
54 #include "G4VProcess.hh"
55 #include "globals.hh"
56 
57 class G4Material;
58 class G4ParticleDefinition;
59 class G4PhysicsTable;
60 class G4Step;
61 class G4Track;
62 class G4VParticleChange;
63 
64 namespace RAT {
65 
66 class G4CerenkovProcess : public G4VProcess {
67  public:
68  explicit G4CerenkovProcess(const G4String& processName = "G4CerenkovProcess", G4ProcessType type = fElectromagnetic);
70 
71  explicit G4CerenkovProcess(const G4CerenkovProcess& right);
72 
73  G4CerenkovProcess& operator=(const G4CerenkovProcess& right) = delete;
74 
75  G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override;
76  // Returns true -> 'is applicable', for all charged particles
77  // except short-lived particles.
78 
79  void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override;
80  // Build table at a right time
81  void PreparePhysicsTable(const G4ParticleDefinition& part) override;
82  void Initialise();
83 
84  G4double GetMeanFreePath(const G4Track& aTrack, G4double, G4ForceCondition*);
85  // Returns the discrete step limit and sets the 'StronglyForced'
86  // condition for the DoIt to be invoked at every step.
87 
88  G4double PostStepGetPhysicalInteractionLength(const G4Track& aTrack, G4double, G4ForceCondition*) override;
89  // Returns the discrete step limit and sets the 'StronglyForced'
90  // condition for the DoIt to be invoked at every step.
91 
92  G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep) override;
93  // This is the method implementing the Cerenkov process.
94 
95  // no operation in AtRestDoIt and AlongStepDoIt
96  virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track&, G4double, G4double, G4double&,
97  G4GPILSelection*) override {
98  return -1.0;
99  };
100 
101  virtual G4double AtRestGetPhysicalInteractionLength(const G4Track&, G4ForceCondition*) override { return -1.0; };
102 
103  // no operation in AtRestDoIt and AlongStepDoIt
104  virtual G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) override { return nullptr; };
105 
106  virtual G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&) override { return nullptr; };
107 
108  void SetTrackSecondariesFirst(const G4bool state);
109  // If set, the primary particle tracking is interrupted and any
110  // produced Cerenkov photons are tracked next. When all have
111  // been tracked, the tracking of the primary resumes.
112 
113  G4bool GetTrackSecondariesFirst() const;
114  // Returns the boolean flag for tracking secondaries first.
115 
116  void SetMaxBetaChangePerStep(const G4double d);
117  // Set the maximum allowed change in beta = v/c in % (perCent) per step.
118 
119  G4double GetMaxBetaChangePerStep() const;
120  // Returns the maximum allowed change in beta = v/c in % (perCent)
121 
122  void SetMaxNumPhotonsPerStep(const G4int NumPhotons);
123  // Set the maximum number of Cerenkov photons allowed to be generated during
124  // a tracking step. This is an average ONLY; the actual number will vary
125  // around this average. If invoked, the maximum photon stack will roughly be
126  // of the size set. If not called, the step is not limited by the number of
127  // photons generated.
128 
129  G4int GetMaxNumPhotonsPerStep() const;
130  // Returns the maximum number of Cerenkov photons allowed to be
131  // generated during a tracking step.
132 
133  void SetStackPhotons(const G4bool);
134  // Call by the user to set the flag for stacking the scint. photons
135 
136  G4bool GetStackPhotons() const;
137  // Return the boolean for whether or not the scint. photons are stacked
138 
139  G4int GetNumPhotons() const;
140  // Returns the current number of scint. photons (after PostStepDoIt)
141 
142  G4PhysicsTable* GetPhysicsTable() const;
143  // Returns the address of the physics table.
144 
145  void DumpPhysicsTable() const;
146  // Prints the physics table.
147 
148  G4double GetAverageNumberOfPhotons(const G4double charge, const G4double beta, const G4Material* aMaterial,
149  G4MaterialPropertyVector* Rindex) const;
150 
151  void DumpInfo() const override { ProcessDescription(G4cout); };
152  void ProcessDescription(std::ostream& out) const override;
153 
154  void SetVerboseLevel(G4int);
155  // sets verbosity
156 
157  protected:
158  G4PhysicsTable* thePhysicsTable;
159  std::shared_ptr<std::vector<std::vector<G4double>>> refractiveIndexValuesVectors =
160  std::make_shared<std::vector<std::vector<G4double>>>();
161  std::shared_ptr<std::vector<std::vector<G4double>>> refractiveIndexEnergyVectors =
162  std::make_shared<std::vector<std::vector<G4double>>>();
163 
164  std::vector<G4double> fMinRindex;
165  std::vector<G4double> fMaxRindex;
166 
167  private:
168  G4double fMaxBetaChange;
169 
170  G4int fMaxPhotons;
171  G4int fNumPhotons;
172 
173  G4bool fStackingFlag;
174  G4bool fTrackSecondariesFirst;
175 
176  G4int secID = -1; // creator modelID
177 };
178 
179 inline G4bool G4CerenkovProcess::GetTrackSecondariesFirst() const { return fTrackSecondariesFirst; }
180 
181 inline G4double G4CerenkovProcess::GetMaxBetaChangePerStep() const { return fMaxBetaChange; }
182 
183 inline G4int G4CerenkovProcess::GetMaxNumPhotonsPerStep() const { return fMaxPhotons; }
184 
185 inline G4bool G4CerenkovProcess::GetStackPhotons() const { return fStackingFlag; }
186 
187 inline G4int G4CerenkovProcess::GetNumPhotons() const { return fNumPhotons; }
188 
189 inline G4PhysicsTable* G4CerenkovProcess::GetPhysicsTable() const { return thePhysicsTable; }
190 
191 } // namespace RAT
192 
193 #endif /* __RAT_G4CerenkovProcess_h */
Definition: G4CerenkovProcess.hh:66
Definition: CCCrossSecMessenger.hh:29