Geant4  10.02.p01
RE04TrajectoryPoint.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 //
28 //
29 // $Id: $
30 //
31 #include "RE04TrajectoryPoint.hh"
32 
33 #include "G4AttDefStore.hh"
34 #include "G4AttDef.hh"
35 #include "G4AttValue.hh"
36 #include "G4UnitsTable.hh"
37 
38 #include "G4Material.hh"
39 
40 //#define G4ATTDEBUG
41 #ifdef G4ATTDEBUG
42 #include "G4AttCheck.hh"
43 #endif
44 
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50  fPosition(G4ThreeVector(0.,0.,0.)),
51  fpMaterial(0)
52 {
53 }
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57  const G4Material* mat)
59  fPosition(pos),
60  fpMaterial(mat)
61 {
62 }
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67  fPosition(right.fPosition),
68  fpMaterial(right.fpMaterial)
69 {
70 }
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74 {
75 }
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 const std::map<G4String,G4AttDef>* RE04TrajectoryPoint::GetAttDefs() const
79 {
80  G4bool isNew;
81  std::map<G4String,G4AttDef>* store
82  = G4AttDefStore::GetInstance("RE04TrajectoryPoint",isNew);
83  if (isNew) {
84  G4String pos("Pos");
85  (*store)[pos] =
86  G4AttDef(pos, "Position", "Physics","G4BestUnit","G4ThreeVector");
87  G4String mat("Mat");
88  (*store)[mat] =
89  G4AttDef(mat, "Mat", "Physics","Name","G4String");
90  }
91  return store;
92 }
93 
94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
95 std::vector<G4AttValue>* RE04TrajectoryPoint::CreateAttValues() const
96 {
97  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
98 
99  values->push_back(G4AttValue("Pos",G4BestUnit(fPosition,"Length"),""));
100  values->push_back(G4AttValue("Mat",fpMaterial->GetName(),""));
101 
102 #ifdef G4ATTDEBUG
103  G4cout << G4AttCheck(values,GetAttDefs());
104 #endif
105 
106  return values;
107 }
CLHEP::Hep3Vector G4ThreeVector
const G4String & GetName() const
Definition: G4Material.hh:178
Definition of the RE04TrajectoryPoint class.
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
#define G4ThreadLocal
Definition: tls.hh:89
Trajectory point class.
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
G4ThreadLocal G4Allocator< RE04TrajectoryPoint > * faTrajPointAllocator
virtual std::vector< G4AttValue > * CreateAttValues() const
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
const G4Material * fpMaterial
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
static const G4double pos