13 #include <Geant4/G4AffineTransform.hh>
14 #include <Geant4/G4EmSaturation.hh>
15 #include <Geant4/G4LossTableManager.hh>
16 #include <Geant4/G4Material.hh>
17 #include <Geant4/G4MaterialPropertiesTable.hh>
18 #include <Geant4/G4NavigationHistory.hh>
19 #include <Geant4/G4ReferenceCountedHandle.hh>
20 #include <Geant4/G4Step.hh>
21 #include <Geant4/G4StepPoint.hh>
22 #include <Geant4/G4String.hh>
23 #include <Geant4/G4SystemOfUnits.hh>
24 #include <Geant4/G4ThreeVector.hh>
25 #include <Geant4/G4TouchableHandle.hh>
26 #include <Geant4/G4Track.hh>
27 #include <Geant4/G4VTouchable.hh>
36 , m_LightBalanceInnerRadius(NAN)
37 , m_LightBalanceInnerCorr(NAN)
38 , m_LightBalanceOuterRadius(NAN)
39 , m_LightBalanceOuterCorr(NAN)
49 double light_yield = 0;
51 const G4Track* aTrack = step->GetTrack();
52 const G4Material* aMaterial = aTrack->GetMaterial();
53 G4MaterialPropertiesTable* aMaterialPropertiesTable =
54 aMaterial->GetMaterialPropertiesTable();
55 if (!aMaterialPropertiesTable)
59 std::set<std::string>::const_iterator
it =
66 std::cout <<
"PHG4SteppingAction::GetScintLightYield - WARNING - "
67 <<
"can not find Material Properties Table for material " << mname
68 <<
", will assume it do NOT scintillate. "
69 <<
"Please ignore this warning if you do not expect scintillation light from "
70 << mname << std::endl;
76 if (aMaterialPropertiesTable->ConstPropertyExists(
"SCINTILLATIONYIELD"))
86 std::set<std::string>::const_iterator
it =
93 std::cout <<
"PHG4SteppingAction::GetScintLightYield - WARNING - "
94 <<
"can not find scintillation light yield for material " << mname
95 <<
", will assume it do NOT scintillate. "
96 <<
"Please ignore this warning if you do not expect scintillation light from "
97 << mname << std::endl;
109 G4EmSaturation* emSaturation = G4LossTableManager::Instance()->EmSaturation();
116 double visen = emSaturation->VisibleEnergyDepositionAtAStep(step) /
GeV;
122 <<
"PHG4SteppingAction::GetScintLightYield - ERROR - can NOT initialize G4EmSaturation!"
130 const bool do_prepoint,
const bool do_postpoint)
135 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
136 const G4TouchableHandle& theTouchable = preStepPoint->GetTouchableHandle();
140 const G4ThreeVector& worldPosition = preStepPoint->GetPosition();
141 G4ThreeVector localPosition =
142 theTouchable->GetHistory()->GetTopTransform().TransformPoint(worldPosition);
150 G4StepPoint* postPoint = aStep->GetPostStepPoint();
152 const G4ThreeVector& worldPosition = postPoint->GetPosition();
153 G4ThreeVector localPosition =
154 theTouchable->GetHistory()->GetTopTransform().TransformPoint(worldPosition);
173 double r = sqrt(xpos * xpos + ypos * ypos);
180 double correction = 1.;
185 correction = slope * r +
b;
186 correction =
std::min(correction, 1.);
187 correction = std::max(correction, 0.);