Geant4  10.02.p03
LXeSteppingAction Class Reference

#include <LXeSteppingAction.hh>

Inheritance diagram for LXeSteppingAction:
Collaboration diagram for LXeSteppingAction:

Public Member Functions

 LXeSteppingAction (LXeRecorderBase *)
 
virtual ~LXeSteppingAction ()
 
virtual void UserSteppingAction (const G4Step *)
 
void SetOneStepPrimaries (G4bool b)
 
G4bool GetOneStepPrimaries ()
 
- Public Member Functions inherited from G4UserSteppingAction
 G4UserSteppingAction ()
 
virtual ~G4UserSteppingAction ()
 
void SetSteppingManagerPointer (G4SteppingManager *pValue)
 

Private Attributes

LXeRecorderBasefRecorder
 
G4bool fOneStepPrimaries
 
LXeSteppingMessengerfSteppingMessenger
 
G4OpBoundaryProcessStatus fExpectedNextStatus
 

Additional Inherited Members

- Protected Attributes inherited from G4UserSteppingAction
G4SteppingManagerfpSteppingManager
 

Detailed Description

Definition at line 44 of file LXeSteppingAction.hh.

Constructor & Destructor Documentation

◆ LXeSteppingAction()

LXeSteppingAction::LXeSteppingAction ( LXeRecorderBase r)

Definition at line 57 of file LXeSteppingAction.cc.

58  : fRecorder(r),fOneStepPrimaries(false)
59 {
61 
63 }
LXeSteppingMessenger * fSteppingMessenger
G4OpBoundaryProcessStatus fExpectedNextStatus
LXeRecorderBase * fRecorder

◆ ~LXeSteppingAction()

LXeSteppingAction::~LXeSteppingAction ( )
virtual

Definition at line 67 of file LXeSteppingAction.cc.

67 {}

Member Function Documentation

◆ GetOneStepPrimaries()

G4bool LXeSteppingAction::GetOneStepPrimaries ( )
inline

Definition at line 53 of file LXeSteppingAction.hh.

53 {return fOneStepPrimaries;}

◆ SetOneStepPrimaries()

void LXeSteppingAction::SetOneStepPrimaries ( G4bool  b)
inline

Definition at line 52 of file LXeSteppingAction.hh.

Here is the caller graph for this function:

◆ UserSteppingAction()

void LXeSteppingAction::UserSteppingAction ( const G4Step *  theStep)
virtual

Reimplemented from G4UserSteppingAction.

Definition at line 71 of file LXeSteppingAction.cc.

71  {
72 
73  G4Track* theTrack = theStep->GetTrack();
74 
75  if ( theTrack->GetCurrentStepNumber() == 1 ) fExpectedNextStatus = Undefined;
76 
77  LXeUserTrackInformation* trackInformation
78  =(LXeUserTrackInformation*)theTrack->GetUserInformation();
79  LXeUserEventInformation* eventInformation
82 
83  G4StepPoint* thePrePoint = theStep->GetPreStepPoint();
84  G4VPhysicalVolume* thePrePV = thePrePoint->GetPhysicalVolume();
85 
86  G4StepPoint* thePostPoint = theStep->GetPostStepPoint();
87  G4VPhysicalVolume* thePostPV = thePostPoint->GetPhysicalVolume();
88 
89  G4OpBoundaryProcessStatus boundaryStatus=Undefined;
90  static G4ThreadLocal G4OpBoundaryProcess* boundary=NULL;
91 
92  //find the boundary process only once
93  if(!boundary){
95  = theStep->GetTrack()->GetDefinition()->GetProcessManager();
96  G4int nprocesses = pm->GetProcessListLength();
97  G4ProcessVector* pv = pm->GetProcessList();
98  G4int i;
99  for( i=0;i<nprocesses;i++){
100  if((*pv)[i]->GetProcessName()=="OpBoundary"){
101  boundary = (G4OpBoundaryProcess*)(*pv)[i];
102  break;
103  }
104  }
105  }
106 
107  if(theTrack->GetParentID()==0){
108  //This is a primary track
109 
110  G4TrackVector* fSecondary=fpSteppingManager->GetfSecondary();
114 
115  //If we havent already found the conversion position and there were
116  //secondaries generated, then search for it
117  if(!eventInformation->IsConvPosSet() && tN2ndariesTot>0 ){
118  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
119  lp1<(*fSecondary).size(); lp1++){
120  const G4VProcess* creator=(*fSecondary)[lp1]->GetCreatorProcess();
121  if(creator){
122  G4String creatorName=creator->GetProcessName();
123  if(creatorName=="phot"||creatorName=="compt"||creatorName=="conv"){
124  //since this is happening before the secondary is being tracked
125  //the Vertex position has not been set yet(set in initial step)
126  eventInformation->SetConvPos((*fSecondary)[lp1]->GetPosition());
127  }
128  }
129  }
130  }
131 
132  if(fOneStepPrimaries&&thePrePV->GetName()=="scintillator")
133  theTrack->SetTrackStatus(fStopAndKill);
134  }
135 
136  if(!thePostPV){//out of world
138  return;
139  }
140 
141  G4ParticleDefinition* particleType = theTrack->GetDefinition();
142  if(particleType==G4OpticalPhoton::OpticalPhotonDefinition()){
143  //Optical photon only
144 
145  if(thePrePV->GetName()=="Slab")
146  //force drawing of photons in WLS slab
147  trackInformation->SetForceDrawTrajectory(true);
148  else if(thePostPV->GetName()=="expHall")
149  //Kill photons entering expHall from something other than Slab
150  theTrack->SetTrackStatus(fStopAndKill);
151 
152  //Was the photon absorbed by the absorption process
153  if(thePostPoint->GetProcessDefinedStep()->GetProcessName()
154  =="OpAbsorption"){
155  eventInformation->IncAbsorption();
156  trackInformation->AddTrackStatusFlag(absorbed);
157  }
158 
159  boundaryStatus=boundary->GetStatus();
160 
161  //Check to see if the partcile was actually at a boundary
162  //Otherwise the boundary status may not be valid
163  //Prior to Geant4.6.0-p1 this would not have been enough to check
164  if(thePostPoint->GetStepStatus()==fGeomBoundary){
166  if(boundaryStatus!=StepTooSmall){
168  ed << "LXeSteppingAction::UserSteppingAction(): "
169  << "No reallocation step after reflection!"
170  << G4endl;
171  G4Exception("LXeSteppingAction::UserSteppingAction()", "LXeExpl01",
172  FatalException,ed,
173  "Something is wrong with the surface normal or geometry");
174  }
175  }
177  switch(boundaryStatus){
178  case Absorption:
179  trackInformation->AddTrackStatusFlag(boundaryAbsorbed);
180  eventInformation->IncBoundaryAbsorption();
181  break;
182  case Detection: //Note, this assumes that the volume causing detection
183  //is the photocathode because it is the only one with
184  //non-zero efficiency
185  {
186  //Triger sensitive detector manually since photon is
187  //absorbed but status was Detection
189  G4String sdName="/LXeDet/pmtSD";
190  LXePMTSD* pmtSD = (LXePMTSD*)SDman->FindSensitiveDetector(sdName);
191  if(pmtSD)pmtSD->ProcessHits_constStep(theStep,NULL);
192  trackInformation->AddTrackStatusFlag(hitPMT);
193  break;
194  }
195  case FresnelReflection:
198  case LobeReflection:
199  case SpikeReflection:
200  case BackScattering:
201  trackInformation->IncReflections();
203  break;
204  default:
205  break;
206  }
207  if(thePostPV->GetName()=="sphere")
208  trackInformation->AddTrackStatusFlag(hitSphere);
209  }
210  }
211 
212  if(fRecorder)fRecorder->RecordStep(theStep);
213 }
G4ProcessVector * GetProcessList() const
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4OpBoundaryProcessStatus
void SetConvPos(const G4ThreeVector &p)
G4bool ProcessHits_constStep(const G4Step *, G4TouchableHistory *)
Definition: LXePMTSD.cc:96
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4VUserEventInformation * GetUserInformation() const
Definition: G4Event.hh:199
G4SteppingManager * fpSteppingManager
G4VSensitiveDetector * FindSensitiveDetector(G4String dName, G4bool warning=true)
Definition: G4SDManager.cc:128
G4int GetfN2ndariesAlongStepDoIt()
G4OpBoundaryProcessStatus fExpectedNextStatus
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
const G4String & GetName() const
virtual void RecordStep(const G4Step *)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
static G4EventManager * GetEventManager()
G4int GetProcessListLength() const
#define G4endl
Definition: G4ios.hh:61
static G4OpticalPhoton * OpticalPhotonDefinition()
const G4Event * GetConstCurrentEvent()
G4TrackVector * GetfSecondary()
LXeRecorderBase * fRecorder
Here is the call graph for this function:

Member Data Documentation

◆ fExpectedNextStatus

G4OpBoundaryProcessStatus LXeSteppingAction::fExpectedNextStatus
private

Definition at line 61 of file LXeSteppingAction.hh.

◆ fOneStepPrimaries

G4bool LXeSteppingAction::fOneStepPrimaries
private

Definition at line 58 of file LXeSteppingAction.hh.

◆ fRecorder

LXeRecorderBase* LXeSteppingAction::fRecorder
private

Definition at line 57 of file LXeSteppingAction.hh.

◆ fSteppingMessenger

LXeSteppingMessenger* LXeSteppingAction::fSteppingMessenger
private

Definition at line 59 of file LXeSteppingAction.hh.


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