00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // $Id: G4TrackingInformation.cc 64057 2012-10-30 15:04:49Z gcosmo $ 00027 // 00028 // Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr) 00029 // 00030 // History: 00031 // ----------- 00032 // 10 Oct 2011 M.Karamitros created 00033 // 00034 // ------------------------------------------------------------------- 00035 00036 #include "G4TrackingInformation.hh" 00037 #include "G4VITProcess.hh" 00038 #include "G4ITNavigator.hh" 00039 //#include "G4Navigator.hh" 00040 00041 G4TrackingInformation::G4TrackingInformation() : 00042 fStepLeader (false), 00043 fProcessState ((size_t)G4VITProcess::GetMaxProcessIndex(),0) 00044 { 00045 //ctor 00046 fpTrajectory_Lock = 0; 00047 fRecordedTrackGlobalTime = -1; 00048 fRecordedTrackLocalTime = -1; 00049 fpStepProcessorState = 0; 00050 fNavigatorState = 0; 00051 } 00052 00053 G4TrackingInformation::~G4TrackingInformation() 00054 { 00055 //dtor 00056 for(int i = 0 ; i < (int) fProcessState.size() - 1 ; i++) 00057 { 00058 if(fProcessState[i]) 00059 { 00060 delete fProcessState[i]; 00061 fProcessState[i] = 0; 00062 } 00063 } 00064 fProcessState.clear(); 00065 if(fpStepProcessorState) delete fpStepProcessorState; 00066 fpStepProcessorState = 0; 00067 if(fNavigatorState) delete fNavigatorState; 00068 fNavigatorState = 0; 00069 } 00070 00071 // should not be used 00072 G4TrackingInformation::G4TrackingInformation(const G4TrackingInformation& /*other*/) : 00073 fStepLeader (false), 00074 fpStepProcessorState (0) 00075 { 00076 //copy ctor 00077 fpTrajectory_Lock = 0; 00078 fRecordedTrackGlobalTime = -1; 00079 fRecordedTrackLocalTime = -1; 00080 fNavigatorState = 0; 00081 } 00082 00083 // should not be used 00084 G4TrackingInformation& G4TrackingInformation::operator=(const G4TrackingInformation& rhs) 00085 { 00086 if (this == &rhs) return *this; // handle self assignment 00087 //assignment operator 00088 return *this; 00089 } 00090 00091 G4ProcessState_Lock* G4TrackingInformation::GetProcessState(size_t index) 00092 { 00093 if(index> G4VITProcess::GetMaxProcessIndex()) 00094 { 00095 G4ExceptionDescription exceptionDescription ; 00096 exceptionDescription << "G4TrackingInformation::GetProcInfo : Wrong process subType : " ; 00097 exceptionDescription << index ; 00098 G4Exception("G4TrackingInformation::GetProcessState","G4TrackingInformation003", 00099 FatalErrorInArgument,exceptionDescription); 00100 } 00101 00102 return fProcessState[index]; 00103 } 00104 00105 void G4TrackingInformation::RecordCurrentPositionNTime(G4Track* track) 00106 { 00107 if(track) 00108 { 00109 fRecordedTrackPosition = track->GetPosition(); 00110 fRecordedTrackLocalTime = track->GetLocalTime(); 00111 fRecordedTrackGlobalTime = track->GetGlobalTime(); 00112 } 00113 } 00114