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: G4RichTrajectory.hh 67009 2013-01-29 16:00:21Z gcosmo $ 00028 // 00029 //--------------------------------------------------------------- 00030 // 00031 // G4RichTrajectory.hh 00032 // 00033 // class description: 00034 // This class extends G4Trajectory, which includes the following: 00035 // 1) List of trajectory points which compose the trajectory, 00036 // 2) static information of particle which generated the 00037 // trajectory, 00038 // 3) trackID and parent particle ID of the trajectory. 00039 // The extended information, only publicly accessible through AttValues, 00040 // includes: 00041 // 4) physical volume and next physical volume; 00042 // 5) creator process; 00043 // ...and much more. 00044 // 00045 // Contact: 00046 // Questions and comments on G4Trajectory should be sent to 00047 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp) 00048 // Makoto Asai (e-mail: asai@kekvax.kek.jp) 00049 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp) 00050 // and on the extended code to: 00051 // John Allison (e-mail: John.Allison@manchester.ac.uk) 00052 // Joseph Perl (e-mail: perl@slac.stanford.edu) 00053 // 00054 // --------------------------------------------------------------- 00055 00056 #ifndef G4RICHTRAJECTORY_HH 00057 #define G4RICHTRAJECTORY_HH 00058 00059 #include "G4Trajectory.hh" 00060 00061 #include "G4TouchableHandle.hh" 00062 00063 typedef std::vector<G4VTrajectoryPoint*> RichTrajectoryPointsContainer; 00064 00065 class G4RichTrajectory : public G4Trajectory { 00066 00067 public: // with description 00068 00069 // Constructors/destructors 00070 G4RichTrajectory(); 00071 G4RichTrajectory(const G4Track* aTrack); 00072 G4RichTrajectory(G4RichTrajectory &); 00073 virtual ~G4RichTrajectory(); 00074 00075 private: 00076 G4RichTrajectory& operator= (const G4RichTrajectory &); 00077 00078 // Operators 00079 public: 00080 inline void* operator new(size_t); 00081 inline void operator delete(void*); 00082 inline int operator == (const G4RichTrajectory& right) const 00083 {return (this==&right);} 00084 00085 // Other (virtual) member functions 00086 void AppendStep(const G4Step* aStep); 00087 void MergeTrajectory(G4VTrajectory* secondTrajectory); 00088 int GetPointEntries() const { return fpRichPointsContainer->size(); } 00089 G4VTrajectoryPoint* GetPoint(G4int i) const 00090 { return (*fpRichPointsContainer)[i]; } 00091 00092 // Get methods for HepRep style attributes 00093 virtual const std::map<G4String,G4AttDef>* GetAttDefs() const; 00094 virtual std::vector<G4AttValue>* CreateAttValues() const; 00095 00096 private: 00097 00098 // Extended information (only publicly accessible through AttValues)... 00099 RichTrajectoryPointsContainer* fpRichPointsContainer; 00100 G4TouchableHandle fpInitialVolume; 00101 G4TouchableHandle fpInitialNextVolume; 00102 const G4VProcess* fpCreatorProcess; 00103 G4TouchableHandle fpFinalVolume; 00104 G4TouchableHandle fpFinalNextVolume; 00105 const G4VProcess* fpEndingProcess; 00106 G4double fFinalKineticEnergy; 00107 00108 }; 00109 00110 #if defined G4TRACKING_ALLOC_EXPORT 00111 extern G4DLLEXPORT G4Allocator<G4RichTrajectory> 00112 aRichTrajectoryAllocator; 00113 #else 00114 extern G4DLLIMPORT G4Allocator<G4RichTrajectory> 00115 aRichTrajectoryAllocator; 00116 #endif 00117 00118 inline void* G4RichTrajectory::operator new(size_t) 00119 { 00120 void* aRichTrajectory; 00121 aRichTrajectory = (void*)aRichTrajectoryAllocator.MallocSingle(); 00122 return aRichTrajectory; 00123 } 00124 00125 inline void G4RichTrajectory::operator delete(void* aRichTrajectory) 00126 { 00127 aRichTrajectoryAllocator.FreeSingle 00128 ((G4RichTrajectory*)aRichTrajectory); 00129 } 00130 00131 #endif