Loading...
Searching...
No Matches
OpNoviceSteppingAction.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27/// \file OpNoviceSteppingAction.cc
28/// \brief Implementation of the OpNoviceSteppingAction class
29
31#include "OpNoviceRun.hh"
32#include "G4Event.hh"
33#include "G4OpBoundaryProcess.hh"
34#include "G4OpticalPhoton.hh"
35#include "G4RunManager.hh"
36#include "G4Step.hh"
37#include "G4Track.hh"
38
39//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40
45
46//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48{
49 static G4ParticleDefinition* opticalphoton =
50 G4OpticalPhoton::OpticalPhotonDefinition();
51
52 const G4ParticleDefinition* particleDef =
53 step->GetTrack()->GetDynamicParticle()->GetParticleDefinition();
54
55 if(particleDef == opticalphoton)
56 {
57 G4StepPoint* endPoint = step->GetPostStepPoint();
58 const G4VProcess* pds = endPoint->GetProcessDefinedStep();
59 G4String procname = pds->GetProcessName();
60 if(procname == "OpRayleigh")
62 else if(procname == "OpAbsorption")
64 else if(procname == "OpMieHG")
66
67 // for boundary scattering, process name in 'transportation'.
68 // Need to check differently:
69 if(endPoint->GetStepStatus() == fGeomBoundary)
70 {
71 G4OpBoundaryProcessStatus theStatus = Undefined;
72 G4ProcessManager* opManager = opticalphoton->GetProcessManager();
73 G4int n_proc = opManager->GetPostStepProcessVector(typeDoIt)->entries();
74 G4ProcessVector* postStepDoItVector =
75 opManager->GetPostStepProcessVector(typeDoIt);
76 for(G4int i = 0; i < n_proc; ++i)
77 {
78 G4VProcess* currentProcess = (*postStepDoItVector)[i];
79
80 auto opProc = dynamic_cast<G4OpBoundaryProcess*>(currentProcess);
81 if(opProc)
82 theStatus = opProc->GetStatus();
83 }
84 if(theStatus != Undefined && theStatus != NotAtBoundary &&
85 theStatus != StepTooSmall)
86 {
88 }
89 }
90 }
91}
92//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Definition of the OpNoviceRun class.
Definition of the OpNoviceSteppingAction class.
OpNoviceSteppingAction(OpNoviceEventAction *)
void UserSteppingAction(const G4Step *) override
OpNoviceEventAction * fEventAction

Applications | User Support | Publications | Collaboration