Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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......
49 {
50  fPosition = G4ThreeVector(0.,0.,0.);
51  fpMaterial = 0;
52 }
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56  const G4Material* mat)
57 {
58  fPosition = pos;
59  fpMaterial = mat;
60 }
61 
62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
64  : G4VTrajectoryPoint(),fPosition(right.fPosition),fpMaterial(right.fpMaterial)
65 {
66 }
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
70 {
71 }
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74 const std::map<G4String,G4AttDef>* RE04TrajectoryPoint::GetAttDefs() const
75 {
76  G4bool isNew;
77  std::map<G4String,G4AttDef>* store
78  = G4AttDefStore::GetInstance("RE04TrajectoryPoint",isNew);
79  if (isNew) {
80  G4String pos("Pos");
81  (*store)[pos] =
82  G4AttDef(pos, "Position", "Physics","G4BestUnit","G4ThreeVector");
83  G4String mat("Mat");
84  (*store)[mat] =
85  G4AttDef(mat, "Mat", "Physics","Name","G4String");
86  }
87  return store;
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 std::vector<G4AttValue>* RE04TrajectoryPoint::CreateAttValues() const
92 {
93  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
94 
95  values->push_back(G4AttValue("Pos",G4BestUnit(fPosition,"Length"),""));
96  values->push_back(G4AttValue("Mat",fpMaterial->GetName(),""));
97 
98 #ifdef G4ATTDEBUG
99  G4cout << G4AttCheck(values,GetAttDefs());
100 #endif
101 
102  return values;
103 }