Geant4  v4-10.4-release
모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4SmoothTrajectoryPoint.cc
이 파일의 문서화 페이지로 가기
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 110262 2018-05-17 14:25:55Z 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  return _instance;
52 }
53 
55 : fAuxiliaryPointVector(0)
56 {
57  fPosition = G4ThreeVector(0.,0.,0.);
58 }
59 
61 : fAuxiliaryPointVector(0)
62 {
63  fPosition = pos;
64 }
65 
67  std::vector<G4ThreeVector>* auxiliaryPoints)
68 : fPosition(pos),
69  fAuxiliaryPointVector(auxiliaryPoints)
70 {}
71 
74  fPosition(right.fPosition),fAuxiliaryPointVector(right.fAuxiliaryPointVector)
75 {
76 }
77 
79 {
81  delete fAuxiliaryPointVector;
82  }
83 }
84 
85 
86 const std::map<G4String,G4AttDef>*
88 {
89  G4bool isNew;
90  std::map<G4String,G4AttDef>* store
91  = G4AttDefStore::GetInstance("G4SmoothTrajectoryPoint",isNew);
92  if (isNew) {
93  G4String Pos("Pos");
94  (*store)[Pos] = G4AttDef(Pos, "Step Position",
95  "Physics","G4BestUnit","G4ThreeVector");
96  G4String Aux("Aux");
97  (*store)[Aux] = G4AttDef(Aux, "Auxiliary Point Position",
98  "Physics","G4BestUnit","G4ThreeVector");
99  }
100  return store;
101 }
102 
103 std::vector<G4AttValue>* G4SmoothTrajectoryPoint::CreateAttValues() const
104 {
105  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
106 
107  if (fAuxiliaryPointVector) {
108  std::vector<G4ThreeVector>::iterator iAux;
109  for (iAux = fAuxiliaryPointVector->begin();
110  iAux != fAuxiliaryPointVector->end(); ++iAux) {
111  values->push_back(G4AttValue("Aux",G4BestUnit(*iAux,"Length"),""));
112  }
113  }
114 
115  values->push_back(G4AttValue("Pos",G4BestUnit(fPosition,"Length"),""));
116 
117 #ifdef G4ATTDEBUG
118  G4cout << G4AttCheck(values,GetAttDefs());
119 #endif
120 
121  return values;
122 }
G4TRACKING_DLL G4Allocator< G4SmoothTrajectoryPoint > *& aSmoothTrajectoryPointAllocator()
std::vector< G4ThreeVector > * fAuxiliaryPointVector
CLHEP::Hep3Vector G4ThreeVector
static const G4double pos
ush Pos
Definition: deflate.h:92
#define G4ThreadLocalStatic
Definition: tls.hh:68
bool G4bool
Definition: G4Types.hh:79
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
G4GLOB_DLL std::ostream G4cout