Geant4  10.03
G4TrajectoryPoint.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4TrajectoryPoint.cc 69003 2013-04-15 09:25:23Z gcosmo $
28 //
29 // ---------------------------------------------------------------
30 //
31 // G4TrajectoryPoint.cc
32 //
33 // ---------------------------------------------------------------
34 
35 #include "G4TrajectoryPoint.hh"
36 
37 #include "G4AttDefStore.hh"
38 #include "G4AttDef.hh"
39 #include "G4AttValue.hh"
40 #include "G4UnitsTable.hh"
41 
42 //#define G4ATTDEBUG
43 #ifdef G4ATTDEBUG
44 #include "G4AttCheck.hh"
45 #endif
46 
48 
50 {
51  fPosition = G4ThreeVector(0.,0.,0.);
52 }
53 
55 {
56  fPosition = pos;
57 }
58 
60  : G4VTrajectoryPoint(),fPosition(right.fPosition)
61 {
62 }
63 
65 {
66 }
67 
68 const std::map<G4String,G4AttDef>* G4TrajectoryPoint::GetAttDefs() const
69 {
70  G4bool isNew;
71  std::map<G4String,G4AttDef>* store
72  = G4AttDefStore::GetInstance("G4TrajectoryPoint",isNew);
73  if (isNew) {
74  G4String Pos("Pos");
75  (*store)[Pos] =
76  G4AttDef(Pos, "Position", "Physics","G4BestUnit","G4ThreeVector");
77  }
78  return store;
79 }
80 
81 std::vector<G4AttValue>* G4TrajectoryPoint::CreateAttValues() const
82 {
83  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
84 
85  values->push_back(G4AttValue("Pos",G4BestUnit(fPosition,"Length"),""));
86 
87 #ifdef G4ATTDEBUG
88  G4cout << G4AttCheck(values,GetAttDefs());
89 #endif
90 
91  return values;
92 }
virtual ~G4TrajectoryPoint()
CLHEP::Hep3Vector G4ThreeVector
virtual std::vector< G4AttValue > * CreateAttValues() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4ThreeVector fPosition
#define G4ThreadLocal
Definition: tls.hh:89
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
G4ThreadLocal G4Allocator< G4TrajectoryPoint > * aTrajectoryPointAllocator
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
static const G4double pos
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const