Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
LXeSteppingAction Class Reference

#include <Doxymodules_optical.h>

Inheritance diagram for LXeSteppingAction:
G4UserSteppingAction

Public Member Functions

 LXeSteppingAction (LXeEventAction *)
 
 ~LXeSteppingAction () override
 
void UserSteppingAction (const G4Step *) override
 
void SetOneStepPrimaries (G4bool b)
 
G4bool GetOneStepPrimaries ()
 

Private Attributes

G4bool fOneStepPrimaries = false
 
LXeSteppingMessengerfSteppingMessenger = nullptr
 
LXeEventActionfEventAction = nullptr
 
G4OpBoundaryProcessfBoundary = nullptr
 
G4OpBoundaryProcessStatus fExpectedNextStatus = Undefined
 

Detailed Description

Definition at line 65 of file Doxymodules_optical.h.

Constructor & Destructor Documentation

◆ LXeSteppingAction()

LXeSteppingAction::LXeSteppingAction ( LXeEventAction ea)

Definition at line 51 of file LXeSteppingAction.cc.

52 : fEventAction(ea)
53{
55}
LXeEventAction * fEventAction
LXeSteppingMessenger * fSteppingMessenger

◆ ~LXeSteppingAction()

LXeSteppingAction::~LXeSteppingAction ( )
override

Definition at line 59 of file LXeSteppingAction.cc.

59{ delete fSteppingMessenger; }

Member Function Documentation

◆ UserSteppingAction()

void LXeSteppingAction::UserSteppingAction ( const G4Step theStep)
override

Definition at line 63 of file LXeSteppingAction.cc.

64{
65 G4Track* theTrack = theStep->GetTrack();
66 const G4ParticleDefinition* part = theTrack->GetDefinition();
67 G4int pdg = part->GetPDGEncoding();
68
69 if(theTrack->GetCurrentStepNumber() == 1)
70 fExpectedNextStatus = Undefined;
71
72 auto trackInformation =
73 static_cast<LXeUserTrackInformation*>(theTrack->GetUserInformation());
74
75 G4StepPoint* thePrePoint = theStep->GetPreStepPoint();
76 G4VPhysicalVolume* thePrePV = thePrePoint->GetPhysicalVolume();
77
78 G4StepPoint* thePostPoint = theStep->GetPostStepPoint();
79 G4VPhysicalVolume* thePostPV = thePostPoint->GetPhysicalVolume();
80
81 G4OpBoundaryProcessStatus boundaryStatus = Undefined;
82
83 // find the boundary process only once
84 if(nullptr == fBoundary && pdg == -22)
85 {
86 G4ProcessManager* pm = part->GetProcessManager();
87 G4int nprocesses = pm->GetProcessListLength();
88 G4ProcessVector* pv = pm->GetProcessList();
89 for(G4int i = 0; i < nprocesses; ++i)
90 {
91 if(nullptr != (*pv)[i] && (*pv)[i]->GetProcessName() == "OpBoundary")
92 {
93 fBoundary = dynamic_cast<G4OpBoundaryProcess*>((*pv)[i]);
94 break;
95 }
96 }
97 }
98
99 if(theTrack->GetParentID() == 0)
100 {
101 // This is a primary track
102 auto secondaries = theStep->GetSecondaryInCurrentStep();
103 // If we haven't already found the conversion position and there were
104 // secondaries generated, then search for it
105 // since this is happening before the secondary is being tracked,
106 // the vertex position has not been set yet (set in initial step)
107 if(nullptr != secondaries && !fEventAction->IsConvPosSet())
108 {
109 if(!secondaries->empty())
110 {
111 for(auto & tr : *secondaries)
112 {
113 const G4VProcess* creator = tr->GetCreatorProcess();
114 if(nullptr != creator)
115 {
116 G4int type = creator->GetProcessSubType();
117 // 12 - photoeffect
118 // 13 - Compton scattering
119 // 14 - gamma conversion
120 if(type >= 12 && type <= 14)
121 {
122 fEventAction->SetConvPos(tr->GetPosition());
123 }
124 }
125 }
126 }
127 }
128 if(fOneStepPrimaries && thePrePV->GetName() == "scintillator")
129 theTrack->SetTrackStatus(fStopAndKill);
130 }
131
132 if(nullptr == thePostPV)
133 { // out of world
134 fExpectedNextStatus = Undefined;
135 return;
136 }
137
138 // Optical photon only
139 if(pdg == -22)
140 {
141 if(thePrePV->GetName() == "Slab")
142 // force drawing of photons in WLS slab
143 trackInformation->SetForceDrawTrajectory(true);
144 else if(thePostPV->GetName() == "expHall")
145 // Kill photons entering expHall from something other than Slab
146 theTrack->SetTrackStatus(fStopAndKill);
147
148 // Was the photon absorbed by the absorption process
149 auto proc = thePostPoint->GetProcessDefinedStep();
150 if(nullptr != proc && proc->GetProcessName() == "OpAbsorption")
151 {
153 trackInformation->AddTrackStatusFlag(absorbed);
154 }
155 if(nullptr != fBoundary)
156 boundaryStatus = fBoundary->GetStatus();
157
158 if(thePostPoint->GetStepStatus() == fGeomBoundary)
159 {
160 // Check to see if the particle was actually at a boundary
161 // Otherwise the boundary status may not be valid
162 if(fExpectedNextStatus == StepTooSmall)
163 {
164 if(boundaryStatus != StepTooSmall)
165 {
166 G4cout << "LXeSteppingAction::UserSteppingAction(): "
167 << "trackID=" << theTrack->GetTrackID()
168 << " parentID=" << theTrack->GetParentID()
169 << " " << part->GetParticleName()
170 << " E(MeV)=" << theTrack->GetKineticEnergy()
171 << "n/ at " << theTrack->GetPosition()
172 << " prePV: " << thePrePV->GetName()
173 << " postPV: " << thePostPV->GetName()
174 << G4endl;
175 G4ExceptionDescription ed;
176 ed << "LXeSteppingAction: "
177 << "No reallocation step after reflection!"
178 << "Something is wrong with the surface normal or geometry";
179 G4Exception("LXeSteppingAction:", "LXeExpl01", JustWarning, ed, "");
180 return;
181 }
182 }
183 fExpectedNextStatus = Undefined;
184 switch(boundaryStatus)
185 {
186 case Absorption:
187 trackInformation->AddTrackStatusFlag(boundaryAbsorbed);
189 break;
190 case Detection: // Note, this assumes that the volume causing detection
191 // is the photocathode because it is the only one with
192 // non-zero efficiency
193 {
194 // Trigger sensitive detector manually since photon is
195 // absorbed but status was Detection
196 G4SDManager* SDman = G4SDManager::GetSDMpointer();
197 G4String sdName = "/LXeDet/pmtSD";
198 LXePMTSD* pmtSD = (LXePMTSD*) SDman->FindSensitiveDetector(sdName);
199 if(pmtSD)
200 pmtSD->ProcessHits_boundary(theStep, nullptr);
201 trackInformation->AddTrackStatusFlag(hitPMT);
202 break;
203 }
204 case FresnelReflection:
205 case TotalInternalReflection:
206 case LambertianReflection:
207 case LobeReflection:
208 case SpikeReflection:
209 case BackScattering:
210 trackInformation->IncReflections();
211 fExpectedNextStatus = StepTooSmall;
212 break;
213 default:
214 break;
215 }
216 if(thePostPV->GetName() == "sphere")
217 trackInformation->AddTrackStatusFlag(hitSphere);
218 }
219 }
220}
G4double IsConvPosSet()
void SetConvPos(const G4ThreeVector &p)
void IncBoundaryAbsorption()
G4bool ProcessHits_boundary(const G4Step *, G4TouchableHistory *)
Definition LXePMTSD.cc:104
G4OpBoundaryProcess * fBoundary
G4OpBoundaryProcessStatus fExpectedNextStatus

◆ SetOneStepPrimaries()

void LXeSteppingAction::SetOneStepPrimaries ( G4bool  b)
inline

Definition at line 49 of file LXeSteppingAction.hh.

49{ fOneStepPrimaries = b; }

◆ GetOneStepPrimaries()

G4bool LXeSteppingAction::GetOneStepPrimaries ( )
inline

Definition at line 50 of file LXeSteppingAction.hh.

50{ return fOneStepPrimaries; }

Member Data Documentation

◆ fOneStepPrimaries

G4bool LXeSteppingAction::fOneStepPrimaries = false
private

Definition at line 53 of file LXeSteppingAction.hh.

◆ fSteppingMessenger

LXeSteppingMessenger* LXeSteppingAction::fSteppingMessenger = nullptr
private

Definition at line 54 of file LXeSteppingAction.hh.

◆ fEventAction

LXeEventAction* LXeSteppingAction::fEventAction = nullptr
private

Definition at line 55 of file LXeSteppingAction.hh.

◆ fBoundary

G4OpBoundaryProcess* LXeSteppingAction::fBoundary = nullptr
private

Definition at line 56 of file LXeSteppingAction.hh.

◆ fExpectedNextStatus

G4OpBoundaryProcessStatus LXeSteppingAction::fExpectedNextStatus = Undefined
private

Definition at line 58 of file LXeSteppingAction.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration