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 // G4TrajectoryPoint class implementation << 27 // 26 // 28 // Contact: << 27 // $Id: G4TrajectoryPoint.cc 69003 2013-04-15 09:25:23Z gcosmo $ 29 // Questions and comments to this code shoul << 28 // 30 // Katsuya Amako (e-mail: Katsuya.Amako@k << 29 // --------------------------------------------------------------- 31 // Takashi Sasaki (e-mail: Takashi.Sasaki@ << 30 // 32 // ------------------------------------------- << 31 // G4TrajectoryPoint.cc >> 32 // >> 33 // --------------------------------------------------------------- 33 34 34 #include "G4TrajectoryPoint.hh" 35 #include "G4TrajectoryPoint.hh" 35 36 36 #include "G4AttDef.hh" << 37 #include "G4AttDefStore.hh" 37 #include "G4AttDefStore.hh" >> 38 #include "G4AttDef.hh" 38 #include "G4AttValue.hh" 39 #include "G4AttValue.hh" 39 #include "G4UnitsTable.hh" 40 #include "G4UnitsTable.hh" 40 41 41 // #define G4ATTDEBUG << 42 //#define G4ATTDEBUG 42 #ifdef G4ATTDEBUG 43 #ifdef G4ATTDEBUG 43 # include "G4AttCheck.hh" << 44 #include "G4AttCheck.hh" 44 #endif 45 #endif 45 46 46 G4Allocator<G4TrajectoryPoint>*& aTrajectoryPo << 47 G4ThreadLocal G4Allocator<G4TrajectoryPoint> *aTrajectoryPointAllocator = 0; >> 48 >> 49 G4TrajectoryPoint::G4TrajectoryPoint() 47 { 50 { 48 G4ThreadLocalStatic G4Allocator<G4Trajectory << 51 fPosition = G4ThreeVector(0.,0.,0.); 49 return _instance; << 50 } 52 } 51 53 52 G4Allocator<G4TrajectoryPoint>*& masterTraject << 54 G4TrajectoryPoint::G4TrajectoryPoint(G4ThreeVector pos) 53 { 55 { 54 static G4Allocator<G4TrajectoryPoint>* maste << 56 fPosition = pos; 55 return master_instance; << 56 } 57 } 57 58 58 G4TrajectoryPoint::G4TrajectoryPoint(G4ThreeVe << 59 G4TrajectoryPoint::G4TrajectoryPoint(const G4TrajectoryPoint &right) 59 << 60 : G4VTrajectoryPoint(),fPosition(right.fPosition) 60 G4TrajectoryPoint::G4TrajectoryPoint(const G4T << 61 { >> 62 } 61 63 62 G4TrajectoryPoint::~G4TrajectoryPoint() = defa << 64 G4TrajectoryPoint::~G4TrajectoryPoint() >> 65 { >> 66 } 63 67 64 const std::map<G4String, G4AttDef>* G4Trajecto << 68 const std::map<G4String,G4AttDef>* G4TrajectoryPoint::GetAttDefs() const 65 { 69 { 66 G4bool isNew; 70 G4bool isNew; 67 std::map<G4String, G4AttDef>* store = G4AttD << 71 std::map<G4String,G4AttDef>* store >> 72 = G4AttDefStore::GetInstance("G4TrajectoryPoint",isNew); 68 if (isNew) { 73 if (isNew) { 69 G4String Pos("Pos"); 74 G4String Pos("Pos"); 70 (*store)[Pos] = G4AttDef(Pos, "Position", << 75 (*store)[Pos] = >> 76 G4AttDef(Pos, "Position", "Physics","G4BestUnit","G4ThreeVector"); 71 } 77 } 72 return store; 78 return store; 73 } 79 } 74 80 75 std::vector<G4AttValue>* G4TrajectoryPoint::Cr 81 std::vector<G4AttValue>* G4TrajectoryPoint::CreateAttValues() const 76 { 82 { 77 auto values = new std::vector<G4AttValue>; << 83 std::vector<G4AttValue>* values = new std::vector<G4AttValue>; 78 84 79 values->push_back(G4AttValue("Pos", G4BestUn << 85 values->push_back(G4AttValue("Pos",G4BestUnit(fPosition,"Length"),"")); 80 86 81 #ifdef G4ATTDEBUG 87 #ifdef G4ATTDEBUG 82 G4cout << G4AttCheck(values, GetAttDefs()); << 88 G4cout << G4AttCheck(values,GetAttDefs()); 83 #endif 89 #endif 84 90 85 return values; 91 return values; 86 } 92 } 87 93