Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
LXeSteppingAction Class Reference

#include <LXeSteppingAction.hh>

Inheritance diagram for LXeSteppingAction:
G4UserSteppingAction

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)
 

Additional Inherited Members

- Protected Attributes inherited from G4UserSteppingAction
G4SteppingManagerfpSteppingManager
 

Detailed Description

Definition at line 44 of file LXeSteppingAction.hh.

Constructor & Destructor Documentation

LXeSteppingAction::LXeSteppingAction ( LXeRecorderBase r)

Definition at line 57 of file LXeSteppingAction.cc.

References Undefined.

58  : fRecorder(r),fOneStepPrimaries(false)
59 {
60  fSteppingMessenger = new LXeSteppingMessenger(this);
61 
62  fExpectedNextStatus = Undefined;
63 }
LXeSteppingAction::~LXeSteppingAction ( )
virtual

Definition at line 67 of file LXeSteppingAction.cc.

67 {}

Member Function Documentation

G4bool LXeSteppingAction::GetOneStepPrimaries ( )
inline

Definition at line 53 of file LXeSteppingAction.hh.

53 {return fOneStepPrimaries;}
void LXeSteppingAction::SetOneStepPrimaries ( G4bool  b)
inline

Definition at line 52 of file LXeSteppingAction.hh.

References test::b.

Referenced by LXeSteppingMessenger::SetNewValue().

52 {fOneStepPrimaries=b;}
void LXeSteppingAction::UserSteppingAction ( const G4Step theStep)
virtual

Reimplemented from G4UserSteppingAction.

Definition at line 71 of file LXeSteppingAction.cc.

References absorbed, Absorption, LXeUserTrackInformation::AddTrackStatusFlag(), BackScattering, boundaryAbsorbed, Detection, FatalException, fGeomBoundary, G4SDManager::FindSensitiveDetector(), G4UserSteppingAction::fpSteppingManager, FresnelReflection, fStopAndKill, G4endl, G4Exception(), G4ThreadLocal, G4EventManager::GetConstCurrentEvent(), G4Track::GetCurrentStepNumber(), G4Track::GetDefinition(), G4EventManager::GetEventManager(), G4SteppingManager::GetfN2ndariesAlongStepDoIt(), G4SteppingManager::GetfN2ndariesAtRestDoIt(), G4SteppingManager::GetfN2ndariesPostStepDoIt(), G4SteppingManager::GetfSecondary(), G4VPhysicalVolume::GetName(), G4Track::GetParentID(), G4StepPoint::GetPhysicalVolume(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4StepPoint::GetProcessDefinedStep(), G4ProcessManager::GetProcessList(), G4ProcessManager::GetProcessListLength(), G4ParticleDefinition::GetProcessManager(), G4VProcess::GetProcessName(), G4SDManager::GetSDMpointer(), G4StepPoint::GetStepStatus(), G4Step::GetTrack(), G4Event::GetUserInformation(), G4Track::GetUserInformation(), hitPMT, hitSphere, LXeUserEventInformation::IncAbsorption(), LXeUserEventInformation::IncBoundaryAbsorption(), LXeUserTrackInformation::IncReflections(), LXeUserEventInformation::IsConvPosSet(), LambertianReflection, LobeReflection, G4OpticalPhoton::OpticalPhotonDefinition(), LXePMTSD::ProcessHits_constStep(), LXeRecorderBase::RecordStep(), LXeUserEventInformation::SetConvPos(), LXeUserTrackInformation::SetForceDrawTrajectory(), G4Track::SetTrackStatus(), SpikeReflection, StepTooSmall, TotalInternalReflection, and Undefined.

71  {
72 
73  G4Track* theTrack = theStep->GetTrack();
74 
75  if ( theTrack->GetCurrentStepNumber() == 1 ) fExpectedNextStatus = Undefined;
76 
77  LXeUserTrackInformation* trackInformation
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 
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
137  fExpectedNextStatus=Undefined;
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){
165  if(fExpectedNextStatus==StepTooSmall){
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  }
176  fExpectedNextStatus=Undefined;
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();
202  fExpectedNextStatus=StepTooSmall;
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 }
void SetTrackStatus(const G4TrackStatus aTrackStatus)
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
G4VUserEventInformation * GetUserInformation() const
Definition: G4Event.hh:188
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4StepStatus GetStepStatus() const
G4OpBoundaryProcessStatus
void SetConvPos(const G4ThreeVector &p)
G4bool ProcessHits_constStep(const G4Step *, G4TouchableHistory *)
Definition: LXePMTSD.cc:96
#define G4ThreadLocal
Definition: tls.hh:52
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
G4VUserTrackInformation * GetUserInformation() const
G4StepPoint * GetPreStepPoint() const
G4int GetCurrentStepNumber() const
G4VPhysicalVolume * GetPhysicalVolume() const
const G4String & GetName() const
G4SteppingManager * fpSteppingManager
G4VSensitiveDetector * FindSensitiveDetector(G4String dName, G4bool warning=true)
Definition: G4SDManager.cc:124
G4int GetfN2ndariesAlongStepDoIt()
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
const G4VProcess * GetProcessDefinedStep() const
std::vector< G4Track * > G4TrackVector
virtual void RecordStep(const G4Step *)
G4StepPoint * GetPostStepPoint() const
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
static G4EventManager * GetEventManager()
#define G4endl
Definition: G4ios.hh:61
static G4OpticalPhoton * OpticalPhotonDefinition()
const G4Event * GetConstCurrentEvent()
G4Track * GetTrack() const
G4int GetProcessListLength() const
G4TrackVector * GetfSecondary()
G4ProcessVector * GetProcessList() const

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