ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Scintillation.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4Scintillation.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 // Scintillation Light Class Definition
32 //
33 // File: G4Scintillation.hh
34 // Description: Discrete Process - Generation of Scintillation Photons
35 // Version: 1.0
36 // Created: 1998-11-07
37 // Author: Peter Gumplinger
38 // Updated: 2010-10-20 Allow the scintillation yield to be a function
39 // of energy deposited by particle type
40 // Thanks to Zach Hartwig (Department of Nuclear
41 // Science and Engineeering - MIT)
42 // 2005-07-28 add G4ProcessType to constructor
43 // 2002-11-21 change to user G4Poisson for small MeanNumPotons
44 // 2002-11-07 allow for fast and slow scintillation
45 // 2002-11-05 make use of constant material properties
46 // 2002-05-16 changed to inherit from VRestDiscreteProcess
47 // 2002-05-09 changed IsApplicable method
48 // 1999-10-29 add method and class descriptors
49 //
50 // mail: gum@triumf.ca
51 //
53 
54 #ifndef G4Scintillation_h
55 #define G4Scintillation_h 1
56 
58 // Includes
60 
61 #include "globals.hh"
62 #include "templates.hh"
63 #include "Randomize.hh"
64 #include "G4Poisson.hh"
65 #include "G4ThreeVector.hh"
66 #include "G4ParticleMomentum.hh"
67 #include "G4Step.hh"
69 #include "G4OpticalPhoton.hh"
70 #include "G4DynamicParticle.hh"
71 #include "G4Material.hh"
72 #include "G4PhysicsTable.hh"
75 
76 #include "G4EmSaturation.hh"
77 
78 // Class Description:
79 // RestDiscrete Process - Generation of Scintillation Photons.
80 // Class inherits publicly from G4VRestDiscreteProcess.
81 // Class Description - End:
82 
84 // Class Definition
86 
88 {
89 
90 public:
91 
93  // Constructors and Destructor
95 
96  explicit G4Scintillation(const G4String& processName = "Scintillation",
99 
100 private:
101 
102  G4Scintillation(const G4Scintillation &right) = delete;
103 
105  // Operators
107 
108  G4Scintillation& operator=(const G4Scintillation &right) = delete;
109 
110 public:
111 
113  // Methods
115 
116  // G4Scintillation Process has both PostStepDoIt (for energy
117  // deposition of particles in flight) and AtRestDoIt (for energy
118  // given to the medium by particles at rest)
119 
121  const G4ParticleDefinition& aParticleType) override;
122  // Returns true -> 'is applicable', for any particle type except
123  // for an 'opticalphoton' and for short-lived particles
124 
125  void BuildPhysicsTable(
126  const G4ParticleDefinition& aParticleType) override;
127  // Build table at the right time
128 
129  G4double GetMeanFreePath(const G4Track& aTrack,
130  G4double ,
131  G4ForceCondition* ) override;
132  // Returns infinity; i. e. the process does not limit the step,
133  // but sets the 'StronglyForced' condition for the DoIt to be
134  // invoked at every step.
135 
136  G4double GetMeanLifeTime(const G4Track& aTrack,
137  G4ForceCondition* ) override;
138  // Returns infinity; i. e. the process does not limit the time,
139  // but sets the 'StronglyForced' condition for the DoIt to be
140  // invoked at every step.
141 
142  G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
143  const G4Step& aStep) override;
144  G4VParticleChange* AtRestDoIt (const G4Track& aTrack,
145  const G4Step& aStep) override;
146 
148  const G4Step &aStep);
149  // Returns the number of scintillation photons calculated when
150  // scintillation depends on the particle type and energy
151  // deposited (includes nonlinear dependendency)
152 
153  // These are the methods implementing the scintillation process.
154 
155  void SetTrackSecondariesFirst(const G4bool state);
156  // If set, the primary particle tracking is interrupted and any
157  // produced scintillation photons are tracked next. When all
158  // have been tracked, the tracking of the primary resumes.
159 
161  // Returns the boolean flag for tracking secondaries first.
162 
163  void SetFiniteRiseTime(const G4bool state);
164  // If set, the G4Scintillation process expects the user to have
165  // set the constant material property FAST/SLOWSCINTILLATIONRISETIME.
166 
167  G4bool GetFiniteRiseTime() const;
168  // Returns the boolean flag for a finite scintillation rise time.
169 
170  void SetScintillationYieldFactor(const G4double yieldfactor);
171  // Called to set the scintillation photon yield factor, needed when
172  // the yield is different for different types of particles. This
173  // scales the yield obtained from the G4MaterialPropertiesTable.
174 
176  // Returns the photon yield factor.
177 
179  // Called to set the scintillation exciation ratio, needed when
180  // the scintillation level excitation is different for different
181  // types of particles. This overwrites the YieldRatio obtained
182  // from the G4MaterialPropertiesTable.
183 
185  // Returns the scintillation level excitation ratio.
186 
188  // Returns the address of the fast scintillation integral table.
189 
191  // Returns the address of the slow scintillation integral table.
192 
193  void AddSaturation(G4EmSaturation* sat);
194  // Adds Birks Saturation to the process.
195 
196  void RemoveSaturation();
197  // Removes the Birks Saturation from the process.
198 
199  G4EmSaturation* GetSaturation() const;
200  // Returns the Birks Saturation.
201 
203  // Called by the user to set the scintillation yield as a function
204  // of energy deposited by particle type
205 
207  // Return the boolean that determines the method of scintillation
208  // production
209 
210  void SetScintillationTrackInfo(const G4bool trackType);
211  // Call by the user to set the G4ScintillationTrackInformation
212  // to scintillation photon track
213 
215  // Return the boolean for whether or not the
216  // G4ScintillationTrackInformation is set to the scint. photon track
217 
218  void SetStackPhotons(const G4bool );
219  // Call by the user to set the flag for stacking the scint. photons
220 
221  G4bool GetStackPhotons() const;
222  // Return the boolean for whether or not the scint. photons are stacked
223 
224  G4int GetNumPhotons() const;
225  // Returns the current number of scint. photons (after PostStepDoIt)
226 
227  void DumpPhysicsTable() const;
228  // Prints the fast and slow scintillation integral tables.
229 
230 protected:
231 
232  void BuildThePhysicsTable();
233  // It builds either the fast or slow scintillation integral table;
234  // or both.
235 
237  // Class Data Members
239 
242 
243 private:
244 
247 
249 
251 
253 
255 
257 
259 
260 #ifdef G4DEBUG_SCINTILLATION
261  G4double ScintTrackEDep, ScintTrackYield;
262 #endif
263 
265  G4double bi_exp(G4double t, G4double tau1, G4double tau2);
266 
267  // emission time distribution when there is a finite rise time
269 
271 
272 };
273 
275 // Inline methods
277 
278 inline
280 {
281  fTrackSecondariesFirst = state;
282 }
283 
284 inline
286 {
287  return fTrackSecondariesFirst;
288 }
289 
290 inline
292 {
293  fFiniteRiseTime = state;
294 }
295 
296 inline
298 {
299  return fFiniteRiseTime;
300 }
301 
302 inline
304 {
305  fYieldFactor = yieldfactor;
306 }
307 
308 inline
310 {
311  return fYieldFactor;
312 }
313 
314 inline
316 {
318 }
319 
320 inline
322 {
323  return fExcitationRatio;
324 }
325 
326 inline
328 {
329  return fSlowIntegralTable;
330 }
331 
332 inline
334 {
335  return fFastIntegralTable;
336 }
337 
338 inline
340 {
341  fEmSaturation = sat;
342 }
343 
344 inline
346 {
347  fEmSaturation = nullptr;
348 }
349 
350 inline
352 {
353  return fEmSaturation;
354 }
355 
356 inline
358 {
360 }
361 
362 inline
364 {
365  fScintillationTrackInfo = trackType;
366 }
367 
368 inline
370 {
372 }
373 
374 inline
375 void G4Scintillation::SetStackPhotons(const G4bool stackingFlag)
376 {
377  fStackingFlag = stackingFlag;
378 }
379 
380 inline
382 {
383  return fStackingFlag;
384 }
385 
386 inline
388 {
389  return fNumPhotons;
390 }
391 
392 
393 inline
395 {
396  return std::exp(-1.0*t/tau2)/tau2;
397 }
398 
399 inline
401 {
402  return std::exp(-1.0*t/tau2)*(1-std::exp(-1.0*t/tau1))/tau2/tau2*(tau1+tau2);
403 }
404 
405 #endif /* G4Scintillation_h */