22 #include <Geant4/G4ExceptionSeverity.hh>
23 #include <Geant4/G4OpBoundaryProcess.hh>
24 #include <Geant4/G4OpticalPhoton.hh>
25 #include <Geant4/G4ParticleDefinition.hh>
26 #include <Geant4/G4ProcessManager.hh>
27 #include <Geant4/G4ProcessVector.hh>
28 #include <Geant4/G4Step.hh>
29 #include <Geant4/G4StepPoint.hh>
30 #include <Geant4/G4StepStatus.hh>
31 #include <Geant4/G4String.hh>
32 #include <Geant4/G4SystemOfUnits.hh>
33 #include <Geant4/G4ThreeVector.hh>
34 #include <Geant4/G4Track.hh>
35 #include <Geant4/G4Types.hh>
36 #include <Geant4/G4VPhysicalVolume.hh>
37 #include <Geant4/G4VProcess.hh>
38 #include <Geant4/G4VTouchable.hh>
39 #include <Geant4/G4VUserTrackInformation.hh>
40 #include <Geant4/globals.hh>
57 G4Track* theTrack = aStep->GetTrack();
59 G4StepPoint* thePostPoint = aStep->GetPostStepPoint();
60 G4VPhysicalVolume* thePostPV = thePostPoint->GetPhysicalVolume();
62 G4OpBoundaryProcessStatus boundaryStatus =
Undefined;
63 static G4OpBoundaryProcess* boundary =
nullptr;
68 G4ProcessManager*
pm = aStep->GetTrack()->GetDefinition()->GetProcessManager();
69 G4int nprocesses = pm->GetProcessListLength();
70 G4ProcessVector* pv = pm->GetProcessList();
72 for (i = 0; i < nprocesses; i++)
74 if ((*pv)[i]->GetProcessName() ==
"OpBoundary")
76 boundary = (G4OpBoundaryProcess*) (*pv)[i];
88 G4ParticleDefinition* particleType = theTrack->GetDefinition();
89 if (particleType == G4OpticalPhoton::OpticalPhotonDefinition())
92 if (thePostPoint->GetProcessDefinedStep()->GetProcessName() ==
"OpAbsorption")
95 assert(boundary !=
nullptr);
96 boundaryStatus = boundary->GetStatus();
101 if (thePostPoint->GetStepStatus() == fGeomBoundary)
105 if (boundaryStatus != StepTooSmall)
107 G4ExceptionDescription ed;
108 ed <<
"EicRichGemTbSteppingAction::UserSteppingAction(): "
109 <<
"No reallocation step after reflection!"
111 G4Exception(
"EicRichGemTbSteppingAction::UserSteppingAction()",
"EicRichGemTbExpl01",
113 "Something is wrong with the surface normal or geometry");
117 switch (boundaryStatus)
126 if (thePostPV->GetName() ==
"RICHHBDGEMFrontCu1Physical")
132 case FresnelReflection:
133 case TotalInternalReflection:
134 case LambertianReflection:
136 case SpikeReflection:
152 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
153 const G4Track* aTrack = aStep->GetTrack();
154 const G4VTouchable* aTouch = aTrack->GetTouchable();
155 G4StepPoint* postPoint = aStep->GetPostStepPoint();
158 int sector_id = -999;
159 bool sector_found =
false;
162 if (
detector_->ePHENIXRICHConstruction::is_in_sector(aTouch->GetVolume(1)) > -1)
164 sector_id = aTouch->GetCopyNumber(1);
167 else if (
detector_->ePHENIXRICHConstruction::is_in_sector(aTouch->GetVolume()) > -1)
169 sector_id = aTouch->GetCopyNumber();
175 if (!aTouch->GetVolume(1) || !aTouch->GetVolume())
176 cout <<
"WARNING: Missing volumes for hit!" << endl;
178 cout <<
"WARNING: Photon hit volume is not the RICH readout plane volume!" << endl;
184 hit->
set_x(0, postPoint->GetPosition().x() /
cm);
185 hit->
set_y(0, postPoint->GetPosition().y() /
cm);
186 hit->
set_z(0, postPoint->GetPosition().z() /
cm);
189 hit->
set_t(0, postPoint->GetGlobalTime() / nanosecond);
192 hit->
set_x(1, postPoint->GetPosition().x() /
cm);
193 hit->
set_y(1, postPoint->GetPosition().y() /
cm);
194 hit->
set_z(1, postPoint->GetPosition().z() /
cm);
196 hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
201 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
220 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
236 hits_ = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_RICH");
242 <<
"PHG4RICHSteppingAction::SetTopNode - unable to find G4HIT_RICH"