Geant4  10.03
G4SmoothTrajectoryPoint.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: G4SmoothTrajectoryPoint.cc 69003 2013-04-15 09:25:23Z gcosmo $
28 //
29 //
30 // ---------------------------------------------------------------
31 //
32 // G4SmoothTrajectoryPoint.cc
33 //
34 // ---------------------------------------------------------------
35 
37 
38 #include "G4AttDefStore.hh"
39 #include "G4AttDef.hh"
40 #include "G4AttValue.hh"
41 #include "G4UnitsTable.hh"
42 
43 //#define G4ATTDEBUG
44 #ifdef G4ATTDEBUG
45 #include "G4AttCheck.hh"
46 #endif
47 
49 
51 : fAuxiliaryPointVector(0)
52 {
53  fPosition = G4ThreeVector(0.,0.,0.);
54 }
55 
57 : fAuxiliaryPointVector(0)
58 {
59  fPosition = pos;
60 }
61 
63  std::vector<G4ThreeVector>* auxiliaryPoints)
64 : fPosition(pos),
65  fAuxiliaryPointVector(auxiliaryPoints)
66 {}
67 
70  fPosition(right.fPosition),fAuxiliaryPointVector(right.fAuxiliaryPointVector)
71 {
72 }
73 
75 {
77  delete fAuxiliaryPointVector;
78  }
79 }
80 
81 
82 const std::map<G4String,G4AttDef>*
84 {
85  G4bool isNew;
86  std::map<G4String,G4AttDef>* store
87  = G4AttDefStore::GetInstance("G4SmoothTrajectoryPoint",isNew);
88  if (isNew) {
89  G4String Pos("Pos");
90  (*store)[Pos] = G4AttDef(Pos, "Step Position",
91  "Physics","G4BestUnit","G4ThreeVector");
92  G4String Aux("Aux");
93  (*store)[Aux] = G4AttDef(Aux, "Auxiliary Point Position",
94  "Physics","G4BestUnit","G4ThreeVector");
95  }
96  return store;
97 }
98 
99 std::vector<G4AttValue>* G4SmoothTrajectoryPoint::CreateAttValues() const
100 {
101  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
102 
103  if (fAuxiliaryPointVector) {
104  std::vector<G4ThreeVector>::iterator iAux;
105  for (iAux = fAuxiliaryPointVector->begin();
106  iAux != fAuxiliaryPointVector->end(); ++iAux) {
107  values->push_back(G4AttValue("Aux",G4BestUnit(*iAux,"Length"),""));
108  }
109  }
110 
111  values->push_back(G4AttValue("Pos",G4BestUnit(fPosition,"Length"),""));
112 
113 #ifdef G4ATTDEBUG
114  G4cout << G4AttCheck(values,GetAttDefs());
115 #endif
116 
117  return values;
118 }
CLHEP::Hep3Vector G4ThreeVector
G4ThreadLocal G4Allocator< G4SmoothTrajectoryPoint > * aSmoothTrajectoryPointAllocator
std::vector< G4ThreeVector > * fAuxiliaryPointVector
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
#define G4ThreadLocal
Definition: tls.hh:89
virtual std::vector< G4AttValue > * CreateAttValues() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
static const G4double pos