G4S2Light.hh
Go to the documentation of this file.
1 #ifndef G4S2Light_h
2 #define G4S2Light_h 1
3 
4 #include "globals.hh"
5 #include "templates.hh"
6 #include "Randomize.hh"
7 #include "G4Poisson.hh"
8 #include "G4ThreeVector.hh"
9 #include "G4ParticleMomentum.hh"
10 #include "G4Step.hh"
11 #include "G4VRestDiscreteProcess.hh"
12 #include "G4OpticalPhoton.hh"
13 #include "G4DynamicParticle.hh"
14 #include "G4Material.hh"
15 #include "G4MaterialPropertiesTable.hh"
16 #include "G4PhysicsOrderedFreeVector.hh"
17 #include "G4ThermalElectron.hh"
18 
19 //#include "LUXSimManager.hh"
20 
21 // this entire file is adapted from G4Scintillation.hh from Geant4.9.4
22 class G4S2Light : public G4VRestDiscreteProcess //class definition
23 {
24  // Class inherits publicly from G4VRestDiscreteProcess
25 private:
26 
27 public: // constructor and destructor
28 
29  G4S2Light(const G4String& processName = "S2",
30  G4ProcessType type = fElectromagnetic);
31  ~G4S2Light();
32 
33 public: // methods, with descriptions
34 
35  G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
36  // Returns true -> 'is applicable', only for thermalelectrons
37 
38  G4double GetMeanFreePath(const G4Track& aTrack,
39  G4double ,
40  G4ForceCondition* );
41 
42  G4double GetMeanLifeTime(const G4Track& aTrack,
43  G4ForceCondition* );
44 
45  // For in-flight particles losing energy (or those stopped)
46  G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
47  const G4Step& aStep);
48  G4VParticleChange* AtRestDoIt ( const G4Track& aTrack,
49  const G4Step& aStep);
50 
51  // These are the methods implementing the scintillation process.
52 
53  void SetTrackSecondariesFirst(const G4bool state);
54  // If set, the primary particle tracking is interrupted and any
55  // produced scintillation quanta are tracked next. When all have been
56  // tracked, the tracking of the primary resumes.
57 
58  G4bool GetTrackSecondariesFirst() const;
59  // Returns the boolean flag for tracking secondaries first.
60 
61  void SetScintillationYieldFactor(const G4double yieldfactor);
62  // Called to set the scintillation quantum yield factor, useful for
63  // shutting off scintillation entirely, or for producing a universal
64  // re-scaling to for example represent detector effects.
65 
66  G4double GetScintillationYieldFactor() const;
67  // Returns the quantum (thermalelectron) yield factor. (See above.)
68 
69  void SetScintillationExcitationRatio(const G4double excitationratio);
70  // Inherited from the S1 code. Unused...
71 
72  G4double GetScintillationExcitationRatio() const;
73 
74 protected:
75 
76  G4bool fTrackSecondariesFirst; // see above
77  G4double YieldFactor; // turns scint. on/off
78  G4double ExcitationRatio; // N_ex/N_i
79 
80 private:
81  //LUXSimManager *luxManager;
82 
83 };
84 
85 ////////////////////
86 // Inline methods
87 ////////////////////
88 
89 inline
90 G4bool G4S2Light::IsApplicable(const G4ParticleDefinition& aParticleType)
91 {
92  if (aParticleType.GetParticleName() != "thermalelectron") return false;
93 
94  return true;
95 }
96 
97 inline
98 void G4S2Light::SetTrackSecondariesFirst(const G4bool state)
99 {
100  fTrackSecondariesFirst = state;
101 }
102 
103 inline
105 {
106  return fTrackSecondariesFirst;
107 }
108 
109 inline
110 void G4S2Light::SetScintillationYieldFactor(const G4double yieldfactor)
111 {
112  YieldFactor = yieldfactor;
113 }
114 
115 inline
117 {
118  return YieldFactor;
119 }
120 
121 inline
122 void G4S2Light::SetScintillationExcitationRatio(const G4double excitationratio)
123 {
124  ExcitationRatio = excitationratio;
125 }
126 
127 inline
129 {
130  return ExcitationRatio;
131 }
132 
133 #endif /* G4S2Light_h */
G4double YieldFactor
Definition: G4S2Light.hh:77
void SetScintillationExcitationRatio(const G4double excitationratio)
Definition: G4S2Light.hh:122
~G4S2Light()
Definition: G4S2Light.cc:82
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)
Definition: G4S2Light.cc:91
G4bool GetTrackSecondariesFirst() const
Definition: G4S2Light.hh:104
G4S2Light(const G4String &processName="S2", G4ProcessType type=fElectromagnetic)
Definition: G4S2Light.cc:66
G4bool fTrackSecondariesFirst
Definition: G4S2Light.hh:76
G4double ExcitationRatio
Definition: G4S2Light.hh:78
G4double GetScintillationYieldFactor() const
Definition: G4S2Light.hh:116
G4double GetMeanLifeTime(const G4Track &aTrack, G4ForceCondition *)
Definition: G4S2Light.cc:308
G4double GetScintillationExcitationRatio() const
Definition: G4S2Light.hh:128
G4VParticleChange * AtRestDoIt(const G4Track &aTrack, const G4Step &aStep)
Definition: G4S2Light.cc:85
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
Definition: G4S2Light.cc:258
void SetTrackSecondariesFirst(const G4bool state)
Definition: G4S2Light.hh:98
void SetScintillationYieldFactor(const G4double yieldfactor)
Definition: G4S2Light.hh:110
G4bool IsApplicable(const G4ParticleDefinition &aParticleType)
Definition: G4S2Light.hh:90