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