Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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$
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{
76 if(fAuxiliaryPointVector) {
77 delete fAuxiliaryPointVector;
78 }
79}
80
81
82const 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
99std::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}
G4Allocator< G4SmoothTrajectoryPoint > aSmoothTrajectoryPointAllocator
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
CLHEP::Hep3Vector G4ThreeVector
bool G4bool
Definition: G4Types.hh:67
G4DLLIMPORT std::ostream G4cout
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual std::vector< G4AttValue > * CreateAttValues() const
ush Pos
Definition: deflate.h:82
std::map< G4String, G4AttDef > * GetInstance(G4String storeKey, G4bool &isNew)