00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "gerdaio/MaGeTrajectoryPoint.hh"
00035
00036 #include "G4AttDefStore.hh"
00037 #include "G4AttDef.hh"
00038 #include "G4AttValue.hh"
00039 #include "G4UnitsTable.hh"
00040 #include <strstream>
00041
00042 G4Allocator<MaGeTrajectoryPoint> MaGeTrajectoryPointAllocator;
00043
00044 MaGeTrajectoryPoint::MaGeTrajectoryPoint()
00045 {
00046 fPosition = G4ThreeVector(0.,0.,0.);
00047 fELost=0.0;
00048 fStepLength=0.0;
00049 fTrackLength=0.0;
00050 fVolumeName="World";
00051 fProcessName="null";
00052 }
00053
00054 MaGeTrajectoryPoint::MaGeTrajectoryPoint(G4ThreeVector pos, G4String volname)
00055 {
00056 fPosition = pos;
00057 fELost=0.0;
00058 fStepLength=0.0;
00059 fTrackLength=0.0;
00060 fVolumeName=volname;
00061 fProcessName="initstep";
00062 }
00063
00064 MaGeTrajectoryPoint::MaGeTrajectoryPoint(G4ThreeVector pos)
00065 {
00066 fPosition = pos;
00067 fELost=0.0;
00068 fStepLength=0.0;
00069 fTrackLength=0.0;
00070 fVolumeName="Null";
00071 fProcessName="initstep";
00072 }
00073
00074
00075
00076 MaGeTrajectoryPoint::MaGeTrajectoryPoint(const MaGeTrajectoryPoint &right)
00077 : G4VTrajectoryPoint(),fPosition(right.fPosition),
00078 fELost(right.fELost), fStepLength(right.fStepLength),
00079 fTrackLength(right.fTrackLength),fVolumeName(right.fVolumeName),
00080 fProcessName(right.fProcessName)
00081 {
00082 }
00083
00084 MaGeTrajectoryPoint::~MaGeTrajectoryPoint()
00085 {
00086 }
00087
00088 const std::map<G4String,G4AttDef>* MaGeTrajectoryPoint::GetAttDefs() const
00089 {
00090 G4bool isNew;
00091 std::map<G4String,G4AttDef>* store
00092 = G4AttDefStore::GetInstance("MaGeTrajectoryPoint",isNew);
00093 if (isNew) {
00094 G4String Pos("Pos");
00095 (*store)[Pos] = G4AttDef(Pos, "Position", "Physics","","G4ThreeVector");
00096 }
00097 return store;
00098 }
00099
00100 std::vector<G4AttValue>* MaGeTrajectoryPoint::CreateAttValues() const
00101 {
00102 char c[100];
00103 std::ostrstream s(c,100);
00104
00105 std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
00106
00107 s.seekp(std::ios::beg);
00108 s << G4BestUnit(fPosition,"Length") << std::ends;
00109 values->push_back(G4AttValue("Pos",c,""));
00110
00111 return values;
00112 }