ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Cerenkov.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4Cerenkov.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 //
30 // Cerenkov Radiation Class Definition
32 //
33 // File: G4Cerenkov.hh
34 // Description: Discrete Process - Generation of Cerenkov Photons
35 // Version: 2.0
36 // Created: 1996-02-21
37 // Author: Juliet Armstrong
38 // Updated: 2007-09-30 change inheritance to G4VDiscreteProcess
39 // 2005-07-28 add G4ProcessType to constructor
40 // 1999-10-29 add method and class descriptors
41 // 1997-04-09 by Peter Gumplinger
42 // > G4MaterialPropertiesTable; new physics/tracking scheme
43 // mail: gum@triumf.ca
44 //
46 
47 #ifndef G4Cerenkov_h
48 #define G4Cerenkov_h 1
49 
51 // Includes
53 
55 
56 #include "globals.hh"
57 #include "templates.hh"
58 #include "Randomize.hh"
59 #include "G4ThreeVector.hh"
60 #include "G4ParticleMomentum.hh"
61 #include "G4Step.hh"
62 #include "G4VProcess.hh"
63 #include "G4OpticalPhoton.hh"
64 #include "G4DynamicParticle.hh"
65 #include "G4Material.hh"
66 #include "G4PhysicsTable.hh"
70 
71 // Class Description:
72 // Discrete Process -- Generation of Cerenkov Photons.
73 // Class inherits publicly from G4VDiscreteProcess.
74 // Class Description - End:
75 
77 // Class Definition
79 
80 class G4Cerenkov : public G4VProcess
81 {
82 
83 public:
84 
86  // Constructors and Destructor
88 
89  explicit G4Cerenkov(const G4String& processName = "Cerenkov",
91  ~G4Cerenkov();
92 
93  explicit G4Cerenkov(const G4Cerenkov &right);
94 
95 private:
96 
98  // Operators
100 
101  G4Cerenkov& operator=(const G4Cerenkov &right) = delete;
102 
103 public:
104 
106  // Methods
108 
109  G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override;
110  // Returns true -> 'is applicable', for all charged particles
111  // except short-lived particles.
112 
113  void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override;
114  // Build table at a right time
115 
116  G4double GetMeanFreePath(const G4Track& aTrack,
118  // Returns the discrete step limit and sets the 'StronglyForced'
119  // condition for the DoIt to be invoked at every step.
120 
122  G4double ,
123  G4ForceCondition* ) override;
124  // Returns the discrete step limit and sets the 'StronglyForced'
125  // condition for the DoIt to be invoked at every step.
126 
127  G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
128  const G4Step& aStep) override;
129  // This is the method implementing the Cerenkov process.
130 
131  // no operation in AtRestDoIt and AlongStepDoIt
133  G4double ,
134  G4double ,
135  G4double& ,
137  ) override { return -1.0; };
138 
141  ) override { return -1.0; };
142 
143  // no operation in AtRestDoIt and AlongStepDoIt
144  virtual G4VParticleChange* AtRestDoIt(const G4Track& , const G4Step& )
145  override {return nullptr;};
146 
147  virtual G4VParticleChange* AlongStepDoIt(const G4Track& , const G4Step&)
148  override {return nullptr;};
149 
150  void SetTrackSecondariesFirst(const G4bool state);
151  // If set, the primary particle tracking is interrupted and any
152  // produced Cerenkov photons are tracked next. When all have
153  // been tracked, the tracking of the primary resumes.
154 
156  // Returns the boolean flag for tracking secondaries first.
157 
158  void SetMaxBetaChangePerStep(const G4double d);
159  // Set the maximum allowed change in beta = v/c in % (perCent)
160  // per step.
161 
163  // Returns the maximum allowed change in beta = v/c in % (perCent)
164 
165  void SetMaxNumPhotonsPerStep(const G4int NumPhotons);
166  // Set the maximum number of Cerenkov photons allowed to be
167  // generated during a tracking step. This is an average ONLY;
168  // the actual number will vary around this average. If invoked,
169  // the maximum photon stack will roughly be of the size set.
170  // If not called, the step is not limited by the number of
171  // photons generated.
172 
174  // Returns the maximum number of Cerenkov photons allowed to be
175  // generated during a tracking step.
176 
177  void SetStackPhotons(const G4bool );
178  // Call by the user to set the flag for stacking the scint. photons
179 
180  G4bool GetStackPhotons() const;
181  // Return the boolean for whether or not the scint. photons are stacked
182 
183  G4int GetNumPhotons() const;
184  // Returns the current number of scint. photons (after PostStepDoIt)
185 
187  // Returns the address of the physics table.
188 
189  void DumpPhysicsTable() const;
190  // Prints the physics table.
191 
192 private:
193 
194  void BuildThePhysicsTable();
195 
197  // Helper Functions
199 
201  const G4double beta,
202  const G4Material *aMaterial,
203  G4MaterialPropertyVector* Rindex) const;
204 
206  // Class Data Members
208 
209 protected:
210 
212  // A Physics Table can be either a cross-sections table or
213  // an energy table (or can be used for other specific
214  // purposes).
215 
216 private:
217 
221 
223 
225 };
226 
228  // Inline methods
230 
231 inline
233 {
234  return fTrackSecondariesFirst;
235 }
236 
237 inline
239 {
240  return fMaxBetaChange;
241 }
242 
243 inline
245 {
246  return fMaxPhotons;
247 }
248 
249 inline
250 void G4Cerenkov::SetStackPhotons(const G4bool stackingFlag)
251 {
252  fStackingFlag = stackingFlag;
253 }
254 
255 inline
257 {
258  return fStackingFlag;
259 }
260 
261 inline
263 {
264  return fNumPhotons;
265 }
266 
267 inline
269 {
270  return thePhysicsTable;
271 }
272 
273 #endif /* G4Cerenkov_h */