source: trunk/source/processes/electromagnetic/xrays/include/G4Scintillation.hh @ 1315

Last change on this file since 1315 was 1315, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 10.6 KB
Line 
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// $Id: G4Scintillation.hh,v 1.17 2010/05/27 20:48:35 gum Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
29//
30//
31////////////////////////////////////////////////////////////////////////
32// Scintillation Light Class Definition
33////////////////////////////////////////////////////////////////////////
34//
35// File:        G4Scintillation.hh 
36// Description: Discrete Process - Generation of Scintillation Photons
37// Version:     1.0
38// Created:     1998-11-07
39// Author:      Peter Gumplinger
40// Updated:     2005-07-28 add G4ProcessType to constructor
41//              2002-11-21 change to user G4Poisson for small MeanNumPotons
42//              2002-11-07 allow for fast and slow scintillation
43//              2002-11-05 make use of constant material properties
44//              2002-05-16 changed to inherit from VRestDiscreteProcess
45//              2002-05-09 changed IsApplicable method
46//              1999-10-29 add method and class descriptors
47//
48// mail:        gum@triumf.ca
49//
50////////////////////////////////////////////////////////////////////////
51
52#ifndef G4Scintillation_h
53#define G4Scintillation_h 1
54
55/////////////
56// Includes
57/////////////
58
59#include "globals.hh"
60#include "templates.hh"
61#include "Randomize.hh"
62#include "G4Poisson.hh"
63#include "G4ThreeVector.hh"
64#include "G4ParticleMomentum.hh"
65#include "G4Step.hh"
66#include "G4VRestDiscreteProcess.hh"
67#include "G4OpticalPhoton.hh"
68#include "G4DynamicParticle.hh"
69#include "G4Material.hh"
70#include "G4PhysicsTable.hh"
71#include "G4MaterialPropertiesTable.hh"
72#include "G4PhysicsOrderedFreeVector.hh"
73
74#include "G4EmSaturation.hh"
75
76// Class Description:
77// RestDiscrete Process - Generation of Scintillation Photons.
78// Class inherits publicly from G4VRestDiscreteProcess.
79// Class Description - End:
80
81/////////////////////
82// Class Definition
83/////////////////////
84
85class G4Scintillation : public G4VRestDiscreteProcess
86{
87
88private:
89
90        //////////////
91        // Operators
92        //////////////
93
94        // G4Scintillation& operator=(const G4Scintillation &right);
95
96public: // Without description
97
98        ////////////////////////////////
99        // Constructors and Destructor
100        ////////////////////////////////
101
102        G4Scintillation(const G4String& processName = "Scintillation",
103                                 G4ProcessType type = fElectromagnetic);
104
105        // G4Scintillation(const G4Scintillation &right);
106
107        ~G4Scintillation();     
108
109        ////////////
110        // Methods
111        ////////////
112
113public: // With description
114
115        // G4Scintillation Process has both PostStepDoIt (for energy
116        // deposition of particles in flight) and AtRestDoIt (for energy
117        // given to the medium by particles at rest)
118
119        G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
120        // Returns true -> 'is applicable', for any particle type except
121        // for an 'opticalphoton' and for short-lived particles
122
123        G4double GetMeanFreePath(const G4Track& aTrack,
124                                       G4double ,
125                                       G4ForceCondition* );
126        // Returns infinity; i. e. the process does not limit the step,
127        // but sets the 'StronglyForced' condition for the DoIt to be
128        // invoked at every step.
129
130        G4double GetMeanLifeTime(const G4Track& aTrack,
131                                 G4ForceCondition* );
132        // Returns infinity; i. e. the process does not limit the time,
133        // but sets the 'StronglyForced' condition for the DoIt to be
134        // invoked at every step.
135
136        G4VParticleChange* PostStepDoIt(const G4Track& aTrack, 
137                                        const G4Step&  aStep);
138        G4VParticleChange* AtRestDoIt (const G4Track& aTrack,
139                                       const G4Step& aStep);
140
141        // These are the methods implementing the scintillation process.
142
143        void SetTrackSecondariesFirst(const G4bool state);
144        // If set, the primary particle tracking is interrupted and any
145        // produced scintillation photons are tracked next. When all
146        // have been tracked, the tracking of the primary resumes.
147
148        void SetFiniteRiseTime(const G4bool state);
149        // If set, the G4Scintillation process expects the user to have
150        // set the constant material property FAST/SLOWSCINTILLATIONRISETIME.
151
152        G4bool GetTrackSecondariesFirst() const;
153        // Returns the boolean flag for tracking secondaries first.
154
155        G4bool GetFiniteRiseTime() const;
156        // Returns the boolean flag for a finite scintillation rise time.
157       
158        void SetScintillationYieldFactor(const G4double yieldfactor);
159        // Called to set the scintillation photon yield factor, needed when
160        // the yield is different for different types of particles. This
161        // scales the yield obtained from the G4MaterialPropertiesTable.
162
163        G4double GetScintillationYieldFactor() const;
164        // Returns the photon yield factor.
165
166        void SetScintillationExcitationRatio(const G4double excitationratio);
167        // Called to set the scintillation exciation ratio, needed when
168        // the scintillation level excitation is different for different
169        // types of particles. This overwrites the YieldRatio obtained
170        // from the G4MaterialPropertiesTable.
171
172        G4double GetScintillationExcitationRatio() const;
173        // Returns the scintillation level excitation ratio.
174
175        G4PhysicsTable* GetFastIntegralTable() const;
176        // Returns the address of the fast scintillation integral table.
177
178        G4PhysicsTable* GetSlowIntegralTable() const;
179        // Returns the address of the slow scintillation integral table.
180
181        void AddSaturation(G4EmSaturation* sat) { emSaturation = sat; }
182        // Adds Birks Saturation to the process.
183
184        G4EmSaturation* GetSaturation() const { return emSaturation; }
185        // Returns the Birks Saturation.
186
187        void DumpPhysicsTable() const;
188        // Prints the fast and slow scintillation integral tables.
189
190protected:
191
192        void BuildThePhysicsTable();
193        // It builds either the fast or slow scintillation integral table;
194        // or both.
195
196        ///////////////////////
197        // Class Data Members
198        ///////////////////////
199
200
201        G4PhysicsTable* theSlowIntegralTable;
202        G4PhysicsTable* theFastIntegralTable;
203
204
205
206        G4bool fTrackSecondariesFirst;
207        G4bool fFiniteRiseTime;
208
209        G4double YieldFactor;
210
211        G4double ExcitationRatio;
212
213private:
214
215        G4double single_exp(G4double t, G4double tau2);
216        G4double bi_exp(G4double t, G4double tau1, G4double tau2);
217
218        // emission time distribution when there is a finite rise time
219        G4double sample_time(G4double tau1, G4double tau2);
220
221        G4EmSaturation* emSaturation;
222
223};
224
225////////////////////
226// Inline methods
227////////////////////
228
229inline 
230G4bool G4Scintillation::IsApplicable(const G4ParticleDefinition& aParticleType)
231{
232       if (aParticleType.GetParticleName() == "opticalphoton") return false;
233       if (aParticleType.IsShortLived()) return false;
234
235       return true;
236}
237
238inline 
239void G4Scintillation::SetTrackSecondariesFirst(const G4bool state) 
240{ 
241        fTrackSecondariesFirst = state;
242}
243
244inline
245void G4Scintillation::SetFiniteRiseTime(const G4bool state)
246{
247        fFiniteRiseTime = state;
248}
249
250inline
251G4bool G4Scintillation::GetTrackSecondariesFirst() const
252{
253        return fTrackSecondariesFirst;
254}
255
256inline 
257G4bool G4Scintillation::GetFiniteRiseTime() const
258{
259        return fFiniteRiseTime;
260}
261
262inline
263void G4Scintillation::SetScintillationYieldFactor(const G4double yieldfactor)
264{
265        YieldFactor = yieldfactor;
266}
267
268inline
269G4double G4Scintillation::GetScintillationYieldFactor() const
270{
271        return YieldFactor;
272}
273
274inline
275void G4Scintillation::SetScintillationExcitationRatio(const G4double excitationratio)
276{
277        ExcitationRatio = excitationratio;
278}
279
280inline
281G4double G4Scintillation::GetScintillationExcitationRatio() const
282{
283        return ExcitationRatio;
284}
285
286inline
287G4PhysicsTable* G4Scintillation::GetSlowIntegralTable() const
288{
289        return theSlowIntegralTable;
290}
291
292inline
293G4PhysicsTable* G4Scintillation::GetFastIntegralTable() const
294{
295        return theFastIntegralTable;
296}
297
298inline
299void G4Scintillation::DumpPhysicsTable() const
300{
301        if (theFastIntegralTable) {
302           G4int PhysicsTableSize = theFastIntegralTable->entries();
303           G4PhysicsOrderedFreeVector *v;
304
305           for (G4int i = 0 ; i < PhysicsTableSize ; i++ )
306           {
307                v = (G4PhysicsOrderedFreeVector*)(*theFastIntegralTable)[i];
308                v->DumpValues();
309           }
310         }
311
312        if (theSlowIntegralTable) {
313           G4int PhysicsTableSize = theSlowIntegralTable->entries();
314           G4PhysicsOrderedFreeVector *v;
315
316           for (G4int i = 0 ; i < PhysicsTableSize ; i++ )
317           {
318                v = (G4PhysicsOrderedFreeVector*)(*theSlowIntegralTable)[i];
319                v->DumpValues();
320           }
321         }
322}
323
324inline
325G4double G4Scintillation::single_exp(G4double t, G4double tau2)
326{
327         return exp(-1.0*t/tau2)/tau2;
328}
329
330inline
331G4double G4Scintillation::bi_exp(G4double t, G4double tau1, G4double tau2)
332{
333         return exp(-1.0*t/tau2)*(1-exp(-1.0*t/tau1))/tau2/tau2*(tau1+tau2);
334}
335
336#endif /* G4Scintillation_h */
Note: See TracBrowser for help on using the repository browser.