14 #include <Geant4/G4ParticleDefinition.hh>
15 #include <Geant4/G4ReferenceCountedHandle.hh>
16 #include <Geant4/G4Step.hh>
17 #include <Geant4/G4StepPoint.hh>
18 #include <Geant4/G4StepStatus.hh>
19 #include <Geant4/G4String.hh>
20 #include <Geant4/G4SystemOfUnits.hh>
21 #include <Geant4/G4ThreeVector.hh>
22 #include <Geant4/G4TouchableHandle.hh>
23 #include <Geant4/G4Track.hh>
24 #include <Geant4/G4TrackStatus.hh>
25 #include <Geant4/G4Types.hh>
26 #include <Geant4/G4VTouchable.hh>
27 #include <Geant4/G4VUserTrackInformation.hh>
32 class G4VPhysicalVolume;
40 detector_( detector ),
49 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
50 G4VPhysicalVolume*
volume = touch->GetVolume();
60 int tower_id = touch->GetCopyNumber();
64 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
67 const G4Track* aTrack = aStep->GetTrack();
70 G4double edep = aTrack->GetKineticEnergy() /
GeV;
71 G4Track* killtrack =
const_cast<G4Track *
> (aTrack);
72 killtrack->SetTrackStatus(fStopAndKill);
78 bool geantino =
false;
79 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 && aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != string::npos)
85 G4StepPoint * prePoint = aStep->GetPreStepPoint();
86 G4StepPoint * postPoint = aStep->GetPostStepPoint();
88 switch (prePoint->GetStepStatus())
105 hit->
set_x( 0, prePoint->GetPosition().x() /
cm);
106 hit->
set_y( 0, prePoint->GetPosition().y() /
cm );
107 hit->
set_z( 0, prePoint->GetPosition().z() /
cm );
110 hit->
set_x( 0, prePoint->GetMomentum().x() /
GeV );
111 hit->
set_y( 0, prePoint->GetMomentum().y() /
GeV );
112 hit->
set_z( 0, prePoint->GetMomentum().z() /
GeV );
115 hit->
set_t( 0, prePoint->GetGlobalTime() / nanosecond );
120 if ( G4VUserTrackInformation*
p = aTrack->GetUserInformation() )
137 if ( G4VUserTrackInformation*
p = aTrack->GetUserInformation() )
153 hit->
set_x( 1, postPoint->GetPosition().x() /
cm );
154 hit->
set_y( 1, postPoint->GetPosition().y() /
cm );
155 hit->
set_z( 1, postPoint->GetPosition().z() /
cm );
157 hit->
set_t( 1, postPoint->GetGlobalTime() / nanosecond );
170 if ( G4VUserTrackInformation*
p = aTrack->GetUserInformation() )
199 hits_ = findNode::getClass<PHG4HitContainer>( topNode , hitnodename.c_str() );
204 std::cout <<
"PHG4CrystalCalorimeterSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;