Skip to content
Snippets Groups Projects
Commit 1c87482c authored by Shaojun Lu's avatar Shaojun Lu
Browse files

Added a BirksLaw function from Geant4 G4EmSaturation into DDG4...

 Added a BirksLaw function from Geant4 G4EmSaturation into DDG4 Geant4StepHandler. It may be called within function 'totalEnery()' for each G4Step.
parent 6f45e633
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@
#include "G4StepPoint.hh"
#include "G4VTouchable.hh"
#include "G4VSensitiveDetector.hh"
#include "G4EmSaturation.hh"
/// Namespace for the AIDA detector description toolkit
......@@ -195,6 +196,24 @@ namespace DD4hep {
Position localToGlobal(const G4ThreeVector& local) const;
/// Coordinate transformation to global coordinates in MM
Position localToGlobal(double x, double y, double z) const;
/// Apply BirksLaw
double BirkAttenuation(const G4Step* aStep) const
{
double energyDeposition = aStep->GetTotalEnergyDeposit();
double length = aStep->GetStepLength();
double niel = aStep->GetNonIonizingEnergyDeposit();
const G4Track* track = aStep->GetTrack();
const G4ParticleDefinition* particle = track->GetDefinition();
const G4MaterialCutsCouple* couple = track->GetMaterialCutsCouple();
G4EmSaturation* emSaturation = new G4EmSaturation();
double engyVis = emSaturation->VisibleEnergyDeposition(particle,
couple,
length,
energyDeposition,
niel);
delete emSaturation;
return engyVis;
}
};
} // End namespace Simulation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment