15 #include <Geant4/G4ParticleDefinition.hh>
16 #include <Geant4/G4ReferenceCountedHandle.hh>
17 #include <Geant4/G4Step.hh>
18 #include <Geant4/G4StepPoint.hh>
19 #include <Geant4/G4StepStatus.hh>
20 #include <Geant4/G4String.hh>
21 #include <Geant4/G4SystemOfUnits.hh>
22 #include <Geant4/G4ThreeVector.hh>
23 #include <Geant4/G4TouchableHandle.hh>
24 #include <Geant4/G4Track.hh>
25 #include <Geant4/G4TrackStatus.hh>
26 #include <Geant4/G4Types.hh>
27 #include <Geant4/G4VPhysicalVolume.hh>
28 #include <Geant4/G4VTouchable.hh>
29 #include <Geant4/G4VUserTrackInformation.hh>
42 , absorberhits_(nullptr)
50 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
65 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
66 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
68 const G4Track* aTrack = aStep->GetTrack();
73 edep = aTrack->GetKineticEnergy() /
GeV;
74 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
75 killtrack->SetTrackStatus(fStopAndKill);
80 G4int scintSheetCopyNumber, scintSheetLayerNumber;
86 if (volume->GetName() ==
"hcal1AbsLayer")
92 else if (volume->GetName() ==
"hcal2AbsLayer")
98 else if (volume->GetName() ==
"inner1USheet")
101 scintSheetCopyNumber = volume->GetCopyNo();
102 scintSheetLayerNumber = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume(1)->GetCopyNo();
103 scintID = (scintSheetLayerNumber << 2) + (1 << 1) + scintSheetCopyNumber;
107 else if (volume->GetName() ==
"inner2USheet")
110 scintSheetCopyNumber = volume->GetCopyNo();
111 scintSheetLayerNumber = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume(1)->GetCopyNo();
112 scintID = (scintSheetLayerNumber << 2) + (0 << 1) + scintSheetCopyNumber;
116 else if (volume->GetName() ==
"outer1USheet")
119 scintSheetCopyNumber = volume->GetCopyNo();
120 scintSheetLayerNumber = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume(1)->GetCopyNo();
121 scintID = (scintSheetLayerNumber << 2) + (1 << 1) + scintSheetCopyNumber;
125 else if (volume->GetName() ==
"outer2USheet")
128 scintSheetCopyNumber = volume->GetCopyNo();
129 scintSheetLayerNumber = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume(1)->GetCopyNo();
130 scintID = (scintSheetLayerNumber << 2) + (0 << 1) + scintSheetCopyNumber;
142 bool geantino =
false;
146 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
147 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != string::npos)
152 G4StepPoint* prePoint = aStep->GetPreStepPoint();
153 G4StepPoint* postPoint = aStep->GetPostStepPoint();
157 switch (prePoint->GetStepStatus())
165 hit->
set_x(0, prePoint->GetPosition().x() /
cm);
166 hit->
set_y(0, prePoint->GetPosition().y() /
cm);
167 hit->
set_z(0, prePoint->GetPosition().z() /
cm);
169 hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
173 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
192 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
206 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
223 hit->
set_x(1, postPoint->GetPosition().x() /
cm);
224 hit->
set_y(1, postPoint->GetPosition().y() /
cm);
225 hit->
set_z(1, postPoint->GetPosition().z() /
cm);
227 hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
238 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
261 string absorbernodename;
274 hits_ = findNode::getClass<PHG4HitContainer>(topNode, hitnodename.c_str());
275 absorberhits_ = findNode::getClass<PHG4HitContainer>(topNode, absorbernodename.c_str());
280 std::cout <<
"PHG4HcalPrototypeSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;
286 cout <<
"PHG4HcalSteppingAction::SetTopNode - unable to find " << absorbernodename << endl;