source: trunk/examples/extended/runAndEvent/RE01/include/RE01Trajectory.hh

Last change on this file was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 4.6 KB
Line 
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: RE01Trajectory.hh,v 1.4 2010/06/06 05:15:41 perl Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-01 $
29//
30
31#ifndef RE01Trajectory_h
32#define RE01Trajectory_h 1
33
34#include "G4VTrajectory.hh"
35#include "G4Allocator.hh"
36#include <stdlib.h>
37#include "G4ThreeVector.hh"
38#include "G4ios.hh"     
39#include "globals.hh"
40#include "G4ParticleDefinition.hh"
41#include "G4TrajectoryPoint.hh"   
42#include "G4Track.hh"
43#include "G4Step.hh"
44#include <vector>
45
46class G4Polyline;
47class G4AttDef;
48class G4AttValue;
49
50typedef std::vector<G4VTrajectoryPoint*> RE01TrajectoryPointContainer;
51
52class RE01Trajectory : public G4VTrajectory
53{
54 public:
55   RE01Trajectory();
56   RE01Trajectory(const G4Track* aTrack);
57   RE01Trajectory(RE01Trajectory &);
58   virtual ~RE01Trajectory();
59
60   inline void* operator new(size_t);
61   inline void  operator delete(void*);
62   inline int operator == (const RE01Trajectory& right) const
63   {return (this==&right);} 
64
65   virtual G4int GetTrackID() const
66   { return fTrackID; }
67   virtual G4int GetParentID() const
68   { return fParentID; }
69   virtual G4String GetParticleName() const
70   { return ParticleName; }
71   virtual G4double GetCharge() const
72   { return PDGCharge; }
73   virtual G4int GetPDGEncoding() const
74   { return PDGEncoding; }
75   virtual G4ThreeVector GetInitialMomentum() const
76   { return momentum; }
77   virtual int GetPointEntries() const
78   { return positionRecord->size(); }
79   virtual G4VTrajectoryPoint* GetPoint(G4int i) const 
80   { return (*positionRecord)[i]; }
81
82   virtual void ShowTrajectory(std::ostream& os=G4cout) const;
83   virtual void DrawTrajectory() const;
84   virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
85   virtual std::vector<G4AttValue>* CreateAttValues() const;
86   virtual void AppendStep(const G4Step* aStep);
87   virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
88
89   G4ParticleDefinition* GetParticleDefinition();
90
91   inline const G4int GetTrackStatus() const
92   { return fTrackStatus; }
93   inline const G4ThreeVector& GetVertexPosition() const
94   { return vertexPosition; }
95   inline G4double GetGlobalTime() const
96   { return globalTime; }
97 private:
98   RE01TrajectoryPointContainer* positionRecord;
99   G4int                        fTrackID;
100   G4int                        fParentID;
101   G4int                        fTrackStatus;
102   G4ParticleDefinition*        fpParticleDefinition;
103   G4String                     ParticleName;
104   G4double                     PDGCharge;
105   G4int                        PDGEncoding;
106   G4ThreeVector                momentum;
107   G4ThreeVector                vertexPosition;
108   G4double                     globalTime;
109
110};
111
112extern G4Allocator<RE01Trajectory> myTrajectoryAllocator;
113
114inline void* RE01Trajectory::operator new(size_t)
115{
116  void* aTrajectory;
117  aTrajectory = (void*)myTrajectoryAllocator.MallocSingle();
118  return aTrajectory;
119}
120
121inline void RE01Trajectory::operator delete(void* aTrajectory)
122{
123  myTrajectoryAllocator.FreeSingle((RE01Trajectory*)aTrajectory);
124}
125
126#endif
127
Note: See TracBrowser for help on using the repository browser.