00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id: G4VTrajectory.hh 67009 2013-01-29 16:00:21Z gcosmo $ 00028 // 00029 //--------------------------------------------------------------- 00030 // 00031 // G4VTrajectory.hh 00032 // 00033 // class description: 00034 // This class is the abstract base class which represents a trajectory of 00035 // a particle tracked. 00036 // Its concrete class includes information of 00037 // 1) List of trajectory points which compose the trajectory, 00038 // 2) static information of particle which generated the 00039 // trajectory, 00040 // 3) trackID and parent particle ID of the trajectory, 00041 // 00042 // --------------------------------------------------------------- 00043 00044 #ifndef G4VTrajectory_h 00045 #define G4VTrajectory_h 1 00046 00047 #include "globals.hh" 00048 #include <vector> 00049 #include <map> 00050 #include "G4ThreeVector.hh" 00051 00052 class G4Step; 00053 class G4VTrajectoryPoint; 00054 class G4AttDef; 00055 class G4AttValue; 00056 00057 class G4VTrajectory 00058 { 00059 public: // with description 00060 00061 // Constructor/Destrcutor 00062 00063 G4VTrajectory(); 00064 virtual ~G4VTrajectory(); 00065 00066 // Operators 00067 G4bool operator == (const G4VTrajectory& right) const; 00068 00069 // Get/Set functions 00070 virtual G4int GetTrackID() const = 0; 00071 virtual G4int GetParentID() const = 0; 00072 virtual G4String GetParticleName() const = 0; 00073 virtual G4double GetCharge() const = 0; 00074 // Charge is that of G4DynamicParticle 00075 virtual G4int GetPDGEncoding() const = 0; 00076 // Zero will be returned if the particle does not have PDG code. 00077 virtual G4ThreeVector GetInitialMomentum() const = 0; 00078 // Momentum at the origin of the track in global coordinate system. 00079 00080 // Other member functions 00081 virtual int GetPointEntries() const = 0; 00082 // Returns the number of trajectory points 00083 virtual G4VTrajectoryPoint* GetPoint(G4int i) const = 0; 00084 // Returns i-th trajectory point. 00085 virtual void ShowTrajectory(std::ostream& os=G4cout) const; 00086 // Convert attributes in trajectory (and trajectory point if 00087 // needed) to ostream. A default implementation in this base class 00088 // may be used or may be overridden in the concrete class. Note: 00089 // the user needs to follow with new-line or end-of-string, 00090 // depending on the nature of os. 00091 virtual void DrawTrajectory(G4int i_mode =0) const; 00092 //virtual void DrawTrajectory() const; 00093 //virtual void DrawTrajectory(G4int i_mode) const; 00094 // Draw the trajectory. A default implementation in this base 00095 // class may be used or may be overridden in the concrete class. 00096 virtual const std::map<G4String,G4AttDef>* GetAttDefs() const 00097 { return 0; } 00098 // If implemented by a derived class, returns a pointer to a map of 00099 // attribute definitions for the attribute values below. The user 00100 // must test the validity of this pointer. See G4Trajectory for an 00101 // example of a concrete implementation of this method. 00102 virtual std::vector<G4AttValue>* CreateAttValues() const 00103 { return 0; } 00104 // If implemented by a derived class, returns a pointer to a list 00105 // of attribute values suitable, e.g., for picking. Each must 00106 // refer to an attribute definition in the above map; its name is 00107 // the key. The user must test the validity of this pointer (it 00108 // must be non-zero and conform to the G4AttDefs, which may be 00109 // checked with G4AttCheck) and delete the list after use. See 00110 // G4Trajectory for an example of a concrete implementation of this 00111 // method and G4VTrajectory::ShowTrajectory for an example of its 00112 // use. 00113 00114 public: 00115 // Following methods MUST be invoked exclusively by G4TrackingManager 00116 virtual void AppendStep(const G4Step* aStep) = 0; 00117 virtual void MergeTrajectory(G4VTrajectory* secondTrajectory) = 0; 00118 00119 }; 00120 00121 #endif 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131