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>
38 , m_LightBalanceInnerRadius(NAN)
39 , m_LightBalanceInnerCorr(NAN)
40 , m_LightBalanceOuterRadius(NAN)
41 , m_LightBalanceOuterCorr(NAN)
51 double light_yield = 0;
53 const G4Track* aTrack = step->GetTrack();
54 const G4Material* aMaterial = aTrack->GetMaterial();
55 G4MaterialPropertiesTable* aMaterialPropertiesTable =
56 aMaterial->GetMaterialPropertiesTable();
57 if (!aMaterialPropertiesTable)
59 string mname(aMaterial->GetName());
61 std::set<std::string>::const_iterator
it =
68 cout <<
"PHG4SteppingAction::GetScintLightYield - WARNING - "
69 <<
"can not find Material Properties Table for material " << mname
70 <<
", will assume it do NOT scintillate. "
71 <<
"Please ignore this warning if you do not expect scintillation light from "
78 if (aMaterialPropertiesTable->ConstPropertyExists(
"SCINTILLATIONYIELD"))
80 light_yield = aMaterialPropertiesTable->GetConstProperty(
81 "SCINTILLATIONYIELD") *
88 string mname(aMaterial->GetName());
90 std::set<std::string>::const_iterator
it =
97 cout <<
"PHG4SteppingAction::GetScintLightYield - WARNING - "
98 <<
"can not find scintillation light yield for material " << mname
99 <<
", will assume it do NOT scintillate. "
100 <<
"Please ignore this warning if you do not expect scintillation light from "
113 G4EmSaturation* emSaturation = G4LossTableManager::Instance()->EmSaturation();
120 double visen = emSaturation->VisibleEnergyDepositionAtAStep(step) /
GeV;
126 <<
"PHG4SteppingAction::GetScintLightYield - ERROR - can NOT initialize G4EmSaturation!"
134 const bool do_prepoint,
const bool do_postpoint)
139 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
140 G4TouchableHandle theTouchable = preStepPoint->GetTouchableHandle();
144 G4ThreeVector worldPosition = preStepPoint->GetPosition();
145 G4ThreeVector localPosition =
146 theTouchable->GetHistory()->GetTopTransform().TransformPoint(
155 G4StepPoint* postPoint = aStep->GetPostStepPoint();
157 G4ThreeVector worldPosition = postPoint->GetPosition();
158 G4ThreeVector localPosition =
159 theTouchable->GetHistory()->GetTopTransform().TransformPoint(
179 double r = sqrt(xpos * xpos + ypos * ypos);
186 double correction = 1.;
191 correction = slope * r + b;
192 correction =
std::min(correction, 1.);
193 correction =
std::max(correction, 0.);