| [807] | 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 | #include "PhotInSteppingAction.hh"
|
|---|
| 28 | #include "G4SteppingManager.hh"
|
|---|
| 29 | #include "G4Track.hh"
|
|---|
| 30 | #include "G4Step.hh"
|
|---|
| 31 | #include "G4StepPoint.hh"
|
|---|
| 32 | #include "G4TrackStatus.hh"
|
|---|
| 33 | #include "G4TrackVector.hh"
|
|---|
| 34 | #include "G4VPhysicalVolume.hh"
|
|---|
| 35 | #include "G4ParticleDefinition.hh"
|
|---|
| 36 | #include "G4ParticleTypes.hh"
|
|---|
| 37 | #include "G4ios.hh"
|
|---|
| 38 | #include <iomanip>
|
|---|
| 39 |
|
|---|
| 40 | PhotInSteppingAction::PhotInSteppingAction() {;}
|
|---|
| 41 |
|
|---|
| 42 | PhotInSteppingAction::~PhotInSteppingAction() {;}
|
|---|
| 43 |
|
|---|
| 44 | void PhotInSteppingAction::UserSteppingAction(const G4Step* theStep)
|
|---|
| 45 | {
|
|---|
| 46 | G4SteppingManager* SM = fpSteppingManager;
|
|---|
| 47 | G4Track* theTrack = theStep->GetTrack();
|
|---|
| 48 | G4cout<<"PhotInSteppingAction::UserSteppingAction: *** Material = "
|
|---|
| 49 | <<theTrack->GetMaterial()->GetName()<<" ***"<<G4endl;
|
|---|
| 50 | G4TrackVector* fSecondary = SM->GetfSecondary();
|
|---|
| 51 | G4int nSec = (*fSecondary).size(); // #of secondaries
|
|---|
| 52 | G4cout << std::setw( 5) << "#Step#"
|
|---|
| 53 | << std::setw( 9) << "X(mm)" << " "
|
|---|
| 54 | << std::setw( 9) << "Y(mm)" << " "
|
|---|
| 55 | << std::setw( 9) << "Z(mm)" << " "
|
|---|
| 56 | << std::setw( 9) << "KineE(MeV)"
|
|---|
| 57 | << std::setw( 9) << "dE(MeV)" << " "
|
|---|
| 58 | << std::setw( 9) << "StepLeng" << " "
|
|---|
| 59 | << std::setw( 9) << "TrackLeng" << " "
|
|---|
| 60 | << std::setw( 9) << "Particle" << " "
|
|---|
| 61 | << std::setw( 9) << "ProcName" << G4endl;
|
|---|
| 62 | G4cout.precision(3);
|
|---|
| 63 | G4cout << std::setw( 5) << theTrack->GetCurrentStepNumber() << " "
|
|---|
| 64 | << std::setw( 9) << theTrack->GetPosition().x() / mm << " "
|
|---|
| 65 | << std::setw( 9) << theTrack->GetPosition().y() / mm << " "
|
|---|
| 66 | << std::setw( 9) << theTrack->GetPosition().z() / mm << " "
|
|---|
| 67 | << std::setw( 9) << theTrack->GetKineticEnergy() / MeV << " "
|
|---|
| 68 | << std::setw( 9) << theStep->GetTotalEnergyDeposit() /MeV << " "
|
|---|
| 69 | << std::setw( 9) << theStep->GetStepLength() / mm << " "
|
|---|
| 70 | << std::setw( 9) << theTrack->GetTrackLength() / mm << " "
|
|---|
| 71 | << std::setw( 9) << theTrack->GetDefinition()->GetParticleName()<< " ";
|
|---|
| 72 | if(theStep->GetPostStepPoint()->GetProcessDefinedStep() != 0)
|
|---|
| 73 | G4cout<<theStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
|
|---|
| 74 | else G4cout<<"User Limit";
|
|---|
| 75 | G4cout << G4endl;
|
|---|
| 76 |
|
|---|
| 77 | // Dump processes for the particle
|
|---|
| 78 | G4ProcessManager* procMan=theTrack->GetDefinition()->GetProcessManager();
|
|---|
| 79 | procMan->DumpInfo();
|
|---|
| 80 | G4ProcessVector* procVec = procMan->GetProcessList();
|
|---|
| 81 | G4int nofProc=procMan->GetProcessListLength();
|
|---|
| 82 | if(nofProc) for(G4int np=0; np<nofProc; np++)
|
|---|
| 83 | {
|
|---|
| 84 | G4VProcess* proc = (*procVec)[np];
|
|---|
| 85 | G4cout<<"PhotInSteppingAction::UserSteppingAction: "<<np<<", ProcName="
|
|---|
| 86 | <<proc->GetProcessName()<<", ProcType="<<proc->GetProcessType()<<G4endl;
|
|---|
| 87 | }
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 | // check if it is alive and quit if no secondaries
|
|---|
| 91 | if(theTrack->GetTrackStatus()==fAlive)
|
|---|
| 92 | {
|
|---|
| 93 | G4cout<<"PhotInSteppingAction::UserSteppingAction:-TRACK IS ALIVE->, N="<<nSec<<G4endl;
|
|---|
| 94 | if(!nSec) return;
|
|---|
| 95 | }
|
|---|
| 96 |
|
|---|
| 97 | G4cout<<"PhotInSteppingAction::UserSteppingAction:Secondaries, N="<<nSec<<" ***"<<G4endl;
|
|---|
| 98 | G4cout<< " "<<std::setw( 9)<<"X(mm)"
|
|---|
| 99 | << ", "<<std::setw( 9)<<"Y(mm)"
|
|---|
| 100 | << ", "<<std::setw( 9)<<"Z(mm)"
|
|---|
| 101 | << ", "<<std::setw( 9)<<"KineE(MeV)"
|
|---|
| 102 | << ", "<<std::setw( 9)<<"Time(ns)"
|
|---|
| 103 | << ", "<<std::setw(18)<<"Particle" <<G4endl;
|
|---|
| 104 | if(nSec) for(G4int lp1=0; lp1<nSec; lp1++)
|
|---|
| 105 | {
|
|---|
| 106 | G4cout<<" "<<std::setw( 9)<<(*fSecondary)[lp1]->GetPosition().x() / mm
|
|---|
| 107 | <<", "<<std::setw( 9)<<(*fSecondary)[lp1]->GetPosition().y() / mm
|
|---|
| 108 | <<", "<<std::setw( 9)<<(*fSecondary)[lp1]->GetPosition().z() / mm
|
|---|
| 109 | <<", "<<std::setw( 9)<<(*fSecondary)[lp1]->GetKineticEnergy() / MeV
|
|---|
| 110 | <<", "<<std::setw( 9)<<(*fSecondary)[lp1]->GetGlobalTime() / ns
|
|---|
| 111 | <<", "<<std::setw(18)<<(*fSecondary)[lp1]->GetDefinition()->GetParticleName();
|
|---|
| 112 | G4cout<<G4endl;
|
|---|
| 113 | }
|
|---|
| 114 | }
|
|---|
| 115 |
|
|---|