Changeset 288 for snovis/trunk/source/G4Lab/cxx/Trajectory.cxx
- Timestamp:
- Sep 25, 2007, 12:24:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
snovis/trunk/source/G4Lab/cxx/Trajectory.cxx
r233 r288 8 8 // Geant4 : 9 9 #include <G4Track.hh> 10 #include <G4VProcess.hh> 10 11 11 12 static G4Allocator<G4Lab::Trajectory> sTrajectoryAllocator; // Beurk. … … 31 32 ) 32 33 :G4Trajectory(aTrack) 34 ,fProcess(0) 35 ,fSave(false) 36 ,fStoppingVolume(0) 33 37 ////////////////////////////////////////////////////////////////////////////// 34 38 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// … … 37 41 fTotalEnergy = aTrack->GetTotalEnergy(); 38 42 fGlobalTime = aTrack->GetGlobalTime(); 43 fProcess = aTrack->GetCreatorProcess(); 44 45 fStoppingPoint = aTrack->GetPosition(); 46 fStoppingVolume = aTrack->GetVolume(); 47 39 48 /* 40 49 printf("debug : G4Lab::Trajectory : \"%s\", kineticEnergy : %g, totalEnergy : %g, globalTime : %g\n", … … 47 56 aTrack->GetGlobalTime()); 48 57 fPoints.push_back(tp); 58 49 59 } 50 60 ////////////////////////////////////////////////////////////////////////////// 51 61 G4Lab::Trajectory::Trajectory( 52 Trajectory& aRight 53 ) 54 :G4Trajectory(aRight) 55 ////////////////////////////////////////////////////////////////////////////// 56 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 57 { 58 fKineticEnergy = aRight.fKineticEnergy; 59 fTotalEnergy = aRight.fTotalEnergy; 60 fGlobalTime = aRight.fGlobalTime; 61 62 size_t number = aRight.fPoints.size(); 62 Trajectory& aFrom 63 ) 64 :G4Trajectory(aFrom) 65 //,IGeant4Trajectory(aFrom) 66 ////////////////////////////////////////////////////////////////////////////// 67 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 68 { 69 fKineticEnergy = aFrom.fKineticEnergy; 70 fTotalEnergy = aFrom.fTotalEnergy; 71 fGlobalTime = aFrom.fGlobalTime; 72 fProcess = aFrom.fProcess; 73 fSave = aFrom.fSave; 74 75 size_t number = aFrom.fPoints.size(); 63 76 for(size_t index=0;index<number;index++) { 64 G4TrajectoryPoint* point = a Right.fPoints[index]->point();77 G4TrajectoryPoint* point = aFrom.fPoints[index]->point(); 65 78 TrajectoryPoint* tp = 66 new TrajectoryPoint(new G4TrajectoryPoint(*point),a Right.fGlobalTime);79 new TrajectoryPoint(new G4TrajectoryPoint(*point),aFrom.fGlobalTime); 67 80 fPoints.push_back(tp); 68 81 } … … 82 95 } 83 96 ////////////////////////////////////////////////////////////////////////////// 84 G4double G4Lab::Trajectory::GetKineticEnergy( 97 ////////////////////////////////////////////////////////////////////////////// 98 ////////////////////////////////////////////////////////////////////////////// 99 ////////////////////////////////////////////////////////////////////////////// 100 double G4Lab::Trajectory::kineticEnergy( 85 101 ) const 86 102 ////////////////////////////////////////////////////////////////////////////// … … 90 106 } 91 107 ////////////////////////////////////////////////////////////////////////////// 92 G4double G4Lab::Trajectory::GetTotalEnergy(108 double G4Lab::Trajectory::totalEnergy( 93 109 ) const 94 110 ////////////////////////////////////////////////////////////////////////////// … … 98 114 } 99 115 ////////////////////////////////////////////////////////////////////////////// 100 G4double G4Lab::Trajectory::GetGlobalTime(116 double G4Lab::Trajectory::globalTime( 101 117 ) const 102 118 ////////////////////////////////////////////////////////////////////////////// … … 106 122 } 107 123 ////////////////////////////////////////////////////////////////////////////// 108 /*inline*/ void* G4Lab::Trajectory::operator new( 124 unsigned int G4Lab::Trajectory::pointEntries( 125 ) const 126 ////////////////////////////////////////////////////////////////////////////// 127 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 128 { 129 return fPoints.size(); 130 } 131 ////////////////////////////////////////////////////////////////////////////// 132 double G4Lab::Trajectory::pointGlobalTime( 133 unsigned int aIndex 134 ) const 135 ////////////////////////////////////////////////////////////////////////////// 136 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 137 { 138 return fPoints[aIndex]->globalTime(); 139 } 140 ////////////////////////////////////////////////////////////////////////////// 141 std::string G4Lab::Trajectory::creatorProcessName( 142 ) const 143 ////////////////////////////////////////////////////////////////////////////// 144 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 145 { 146 if(!fProcess) return ""; 147 return fProcess->GetProcessName(); 148 } 149 ////////////////////////////////////////////////////////////////////////////// 150 std::string G4Lab::Trajectory::creatorProcessType( 151 ) const 152 ////////////////////////////////////////////////////////////////////////////// 153 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 154 { 155 if(!fProcess) return "NotDefined"; 156 switch(fProcess->GetProcessType()){ 157 case fNotDefined: return "NotDefined"; 158 case fTransportation: return "Transportation"; 159 case fElectromagnetic: return "Electromagnetic"; 160 case fOptical: return "Optical"; 161 case fHadronic: return "Hadronic"; 162 case fPhotolepton_hadron: return "Photolepton_hadron"; 163 case fDecay: return "Decay"; 164 case fGeneral: return "General"; 165 case fParameterisation: return "Parameterisation"; 166 case fUserDefined: return "UserDefined"; 167 }; 168 return "NotDefined"; 169 } 170 ////////////////////////////////////////////////////////////////////////////// 171 void G4Lab::Trajectory::setSave( 172 bool aFlag 173 ) 174 ////////////////////////////////////////////////////////////////////////////// 175 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 176 { 177 fSave = aFlag; 178 } 179 ////////////////////////////////////////////////////////////////////////////// 180 bool G4Lab::Trajectory::save( 181 ) const 182 ////////////////////////////////////////////////////////////////////////////// 183 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 184 { 185 return fSave; 186 } 187 ////////////////////////////////////////////////////////////////////////////// 188 std::vector<double> G4Lab::Trajectory::stoppingPoint( 189 ) const 190 ////////////////////////////////////////////////////////////////////////////// 191 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 192 { 193 std::vector<double> v(3); 194 v[0] = fStoppingPoint.x(); 195 v[1] = fStoppingPoint.y(); 196 v[2] = fStoppingPoint.z(); 197 return v; 198 } 199 ////////////////////////////////////////////////////////////////////////////// 200 G4VPhysicalVolume* G4Lab::Trajectory::stoppingPhysicalVolume( 201 ) const 202 ////////////////////////////////////////////////////////////////////////////// 203 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 204 { 205 return fStoppingVolume; 206 } 207 ////////////////////////////////////////////////////////////////////////////// 208 ////////////////////////////////////////////////////////////////////////////// 209 ////////////////////////////////////////////////////////////////////////////// 210 void* G4Lab::Trajectory::operator new( 109 211 size_t 110 212 ) … … 115 217 } 116 218 ////////////////////////////////////////////////////////////////////////////// 117 /*inline*/void G4Lab::Trajectory::operator delete(219 void G4Lab::Trajectory::operator delete( 118 220 void* aTrajectory 119 221 ) … … 124 226 } 125 227 ////////////////////////////////////////////////////////////////////////////// 126 /*inline*/int G4Lab::Trajectory::operator == (228 int G4Lab::Trajectory::operator == ( 127 229 const G4Lab::Trajectory& aRight 128 230 ) const … … 177 279 { 178 280 return fPoints[aIndex]->point(); 179 }180 //////////////////////////////////////////////////////////////////////////////181 G4double G4Lab::Trajectory::GetPointGlobalTime(182 G4int aIndex183 ) const184 //////////////////////////////////////////////////////////////////////////////185 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//186 {187 return fPoints[aIndex]->globalTime();188 281 } 189 282 ////////////////////////////////////////////////////////////////////////////// … … 205 298 tj->fPoints.clear(); 206 299 } 300 ////////////////////////////////////////////////////////////////////////////// 301 const std::map<G4String,G4AttDef>* G4Lab::Trajectory::GetAttDefs() const 302 ////////////////////////////////////////////////////////////////////////////// 303 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 304 { 305 //return G4Trajectory::GetAttDefs(); 306 return 0; 307 } 308 ////////////////////////////////////////////////////////////////////////////// 309 std::vector<G4AttValue>* G4Lab::Trajectory::CreateAttValues() const 310 ////////////////////////////////////////////////////////////////////////////// 311 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 312 { 313 //return G4Trajectory::CreateAttValues(); 314 return 0; 315 } 316
Note: See TracChangeset
for help on using the changeset viewer.