Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file runAndEvent/RE01/src/RE01TrackInform << 27 /// \brief Implementation of the RE01TrackInfo << 28 // << 29 // 26 // >> 27 // $Id: RE01TrackInformation.cc,v 1.2 2006/06/29 17:44:25 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-08-01-patch-01 $ 30 // 29 // 31 30 32 #include "RE01TrackInformation.hh" 31 #include "RE01TrackInformation.hh" 33 << 34 #include "G4SystemOfUnits.hh" << 35 #include "G4ios.hh" 32 #include "G4ios.hh" 36 33 37 G4ThreadLocal G4Allocator<RE01TrackInformation << 34 G4Allocator<RE01TrackInformation> aTrackInformationAllocator; 38 35 39 //....oooOO0OOooo........oooOO0OOooo........oo << 36 RE01TrackInformation::RE01TrackInformation() 40 RE01TrackInformation::RE01TrackInformation() : << 41 { 37 { 42 fOriginalTrackID = 0; << 38 originalTrackID = 0; 43 fParticleDefinition = 0; << 39 particleDefinition = 0; 44 fOriginalPosition = G4ThreeVector(0., 0., 0. << 40 originalPosition = G4ThreeVector(0.,0.,0.); 45 fOriginalMomentum = G4ThreeVector(0., 0., 0. << 41 originalMomentum = G4ThreeVector(0.,0.,0.); 46 fOriginalEnergy = 0.; << 42 originalEnergy = 0.; 47 fOriginalTime = 0.; << 43 originalTime = 0.; 48 fTrackingStatus = 1; << 44 trackingStatus = 1; 49 fSourceTrackID = -1; << 45 sourceTrackID = -1; 50 fSourceDefinition = 0; << 46 sourceTrackID = -1; 51 fSourcePosition = G4ThreeVector(0., 0., 0.); << 47 sourceDefinition = 0; 52 fSourceMomentum = G4ThreeVector(0., 0., 0.); << 48 sourcePosition = G4ThreeVector(0.,0.,0.); 53 fSourceEnergy = 0.; << 49 sourceMomentum = G4ThreeVector(0.,0.,0.); 54 fSourceTime = 0.; << 50 sourceEnergy = 0.; 55 fSuspendedStepID = -1; << 51 sourceTime = 0.; 56 } << 52 } 57 << 53 58 //....oooOO0OOooo........oooOO0OOooo........oo << 54 RE01TrackInformation::RE01TrackInformation(const G4Track* aTrack) 59 RE01TrackInformation::RE01TrackInformation(con << 55 { 60 { << 56 originalTrackID = aTrack->GetTrackID(); 61 fOriginalTrackID = aTrack->GetTrackID(); << 57 particleDefinition = aTrack->GetDefinition(); 62 fParticleDefinition = aTrack->GetDefinition( << 58 originalPosition = aTrack->GetPosition(); 63 fOriginalPosition = aTrack->GetPosition(); << 59 originalMomentum = aTrack->GetMomentum(); 64 fOriginalMomentum = aTrack->GetMomentum(); << 60 originalEnergy = aTrack->GetTotalEnergy(); 65 fOriginalEnergy = aTrack->GetTotalEnergy(); << 61 originalTime = aTrack->GetGlobalTime(); 66 fOriginalTime = aTrack->GetGlobalTime(); << 62 trackingStatus = 1; 67 fTrackingStatus = 1; << 63 sourceTrackID = -1; 68 fSourceTrackID = -1; << 64 sourceDefinition = 0; 69 fSourceDefinition = 0; << 65 sourcePosition = G4ThreeVector(0.,0.,0.); 70 fSourcePosition = G4ThreeVector(0., 0., 0.); << 66 sourceMomentum = G4ThreeVector(0.,0.,0.); 71 fSourceMomentum = G4ThreeVector(0., 0., 0.); << 67 sourceEnergy = 0.; 72 fSourceEnergy = 0.; << 68 sourceTime = 0.; 73 fSourceTime = 0.; << 69 } 74 fSuspendedStepID = -1; << 70 75 } << 71 RE01TrackInformation::RE01TrackInformation(const RE01TrackInformation* aTrackInfo) 76 << 72 { 77 //....oooOO0OOooo........oooOO0OOooo........oo << 73 originalTrackID = aTrackInfo->originalTrackID; 78 RE01TrackInformation ::RE01TrackInformation(co << 74 particleDefinition = aTrackInfo->particleDefinition; 79 : G4VUserTrackInformation() << 75 originalPosition = aTrackInfo->originalPosition; 80 { << 76 originalMomentum = aTrackInfo->originalMomentum; 81 fOriginalTrackID = aTrackInfo->fOriginalTrac << 77 originalEnergy = aTrackInfo->originalEnergy; 82 fParticleDefinition = aTrackInfo->fParticleD << 78 originalTime = aTrackInfo->originalTime; 83 fOriginalPosition = aTrackInfo->fOriginalPos << 79 trackingStatus = aTrackInfo->trackingStatus; 84 fOriginalMomentum = aTrackInfo->fOriginalMom << 80 sourceTrackID = aTrackInfo->sourceTrackID; 85 fOriginalEnergy = aTrackInfo->fOriginalEnerg << 81 sourceDefinition = aTrackInfo->sourceDefinition; 86 fOriginalTime = aTrackInfo->fOriginalTime; << 82 sourcePosition = aTrackInfo->sourcePosition; 87 fTrackingStatus = aTrackInfo->fTrackingStatu << 83 sourceMomentum = aTrackInfo->sourceMomentum; 88 fSourceTrackID = aTrackInfo->fSourceTrackID; << 84 sourceEnergy = aTrackInfo->sourceEnergy; 89 fSourceDefinition = aTrackInfo->fSourceDefin << 85 sourceTime = aTrackInfo->sourceTime; 90 fSourcePosition = aTrackInfo->fSourcePositio << 91 fSourceMomentum = aTrackInfo->fSourceMomentu << 92 fSourceEnergy = aTrackInfo->fSourceEnergy; << 93 fSourceTime = aTrackInfo->fSourceTime; << 94 fSuspendedStepID = -1; << 95 } 86 } 96 87 97 //....oooOO0OOooo........oooOO0OOooo........oo << 98 RE01TrackInformation::~RE01TrackInformation() 88 RE01TrackInformation::~RE01TrackInformation() 99 { << 89 { ; } 100 ; << 101 } << 102 90 103 //....oooOO0OOooo........oooOO0OOooo........oo << 91 RE01TrackInformation& RE01TrackInformation::operator =(const RE01TrackInformation& aTrackInfo) 104 RE01TrackInformation& RE01TrackInformation ::o << 105 { 92 { 106 fOriginalTrackID = aTrackInfo.fOriginalTrack << 93 originalTrackID = aTrackInfo.originalTrackID; 107 fParticleDefinition = aTrackInfo.fParticleDe << 94 particleDefinition = aTrackInfo.particleDefinition; 108 fOriginalPosition = aTrackInfo.fOriginalPosi << 95 originalPosition = aTrackInfo.originalPosition; 109 fOriginalMomentum = aTrackInfo.fOriginalMome << 96 originalMomentum = aTrackInfo.originalMomentum; 110 fOriginalEnergy = aTrackInfo.fOriginalEnergy << 97 originalEnergy = aTrackInfo.originalEnergy; 111 fOriginalTime = aTrackInfo.fOriginalTime; << 98 originalTime = aTrackInfo.originalTime; 112 fTrackingStatus = aTrackInfo.fTrackingStatus << 99 trackingStatus = aTrackInfo.trackingStatus; 113 fSourceTrackID = aTrackInfo.fSourceTrackID; << 100 sourceTrackID = aTrackInfo.sourceTrackID; 114 fSourceDefinition = aTrackInfo.fSourceDefini << 101 sourceDefinition = aTrackInfo.sourceDefinition; 115 fSourcePosition = aTrackInfo.fSourcePosition << 102 sourcePosition = aTrackInfo.sourcePosition; 116 fSourceMomentum = aTrackInfo.fSourceMomentum << 103 sourceMomentum = aTrackInfo.sourceMomentum; 117 fSourceEnergy = aTrackInfo.fSourceEnergy; << 104 sourceEnergy = aTrackInfo.sourceEnergy; 118 fSourceTime = aTrackInfo.fSourceTime; << 105 sourceTime = aTrackInfo.sourceTime; 119 fSuspendedStepID = -1; << 120 106 121 return *this; << 107 return *this; 122 } 108 } 123 109 124 //....oooOO0OOooo........oooOO0OOooo........oo << 125 void RE01TrackInformation::SetSourceTrackInfor 110 void RE01TrackInformation::SetSourceTrackInformation(const G4Track* aTrack) 126 { 111 { 127 fSourceTrackID = aTrack->GetTrackID(); << 112 sourceTrackID = aTrack->GetTrackID(); 128 fSourceDefinition = aTrack->GetDefinition(); << 113 sourceDefinition = aTrack->GetDefinition(); 129 fSourcePosition = aTrack->GetPosition(); << 114 sourcePosition = aTrack->GetPosition(); 130 fSourceMomentum = aTrack->GetMomentum(); << 115 sourceMomentum = aTrack->GetMomentum(); 131 fSourceEnergy = aTrack->GetTotalEnergy(); << 116 sourceEnergy = aTrack->GetTotalEnergy(); 132 fSourceTime = aTrack->GetGlobalTime(); << 117 sourceTime = aTrack->GetGlobalTime(); 133 } 118 } 134 119 135 //....oooOO0OOooo........oooOO0OOooo........oo << 136 void RE01TrackInformation::Print() const 120 void RE01TrackInformation::Print() const 137 { 121 { 138 G4cout << "Source track ID " << fSourceTrack << 122 G4cout 139 << "," << fSourceEnergy / GeV << "[Ge << 123 << "Source track ID " << sourceTrackID << " (" << sourceDefinition->GetParticleName() << "," 140 G4cout << "Original primary track ID " << fO << 124 << sourceEnergy/GeV << "[GeV]) at " << sourcePosition << G4endl; 141 << fParticleDefinition->GetParticleNa << 125 G4cout 142 << G4endl; << 126 << "Original primary track ID " << originalTrackID << " (" << particleDefinition->GetParticleName() << "," >> 127 << originalEnergy/GeV << "[GeV])" << G4endl; 143 } 128 } >> 129 144 130