Skip to content

Commit

Permalink
Merge pull request #205 from paolafer/g4-11-1
Browse files Browse the repository at this point in the history
Use total drift length of EL gap to generate EL photons
  • Loading branch information
paolafer authored Apr 26, 2023
2 parents 8ae6374 + 5f504f6 commit 4960b3b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions source/physics/BaseDriftField.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ namespace nexus {
GeneratePointAlongDriftLine(const G4LorentzVector&, const G4LorentzVector&) = 0;

virtual G4double LightYield() const;
virtual G4double GetTotalDriftLength() const;

private:
void Print() const;
Expand All @@ -53,6 +54,8 @@ namespace nexus {

inline G4double BaseDriftField::LightYield() const {return 0.;}

inline G4double BaseDriftField::GetTotalDriftLength() const {return 0.;}

inline void BaseDriftField::Print() const {}

} // end namespace nexus
Expand Down
2 changes: 1 addition & 1 deletion source/physics/Electroluminescence.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Electroluminescence::PostStepDoIt(const G4Track& track, const G4Step& step)

// Get the light yield from the field
const G4double yield = field->LightYield();
G4double step_length = step.GetStepLength();
G4double step_length = field->GetTotalDriftLength();

if (yield <= 0.)
return G4VDiscreteProcess::PostStepDoIt(track, step);
Expand Down
7 changes: 7 additions & 0 deletions source/physics/UniformElectricDriftField.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,11 @@ namespace nexus {
}



G4double UniformElectricDriftField::GetTotalDriftLength() const
{
return std::abs(anode_pos_ - cathode_pos_);
}


} // end namespace nexus
2 changes: 2 additions & 0 deletions source/physics/UniformElectricDriftField.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ namespace nexus {
void SetNumberOfPhotons(G4double);
G4double GetNumberOfPhotons() const;

virtual G4double GetTotalDriftLength() const;

private:
/// Returns true if coordinate is between anode and cathode
G4bool CheckCoordinate(G4double);
Expand Down

0 comments on commit 4960b3b

Please sign in to comment.