[827] | 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: G4RichTrajectory.hh,v 1.4 2006/06/29 21:15:23 gunter Exp $ |
---|
[1011] | 28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $ |
---|
[827] | 29 | // |
---|
| 30 | //--------------------------------------------------------------- |
---|
| 31 | // |
---|
| 32 | // G4RichTrajectory.hh |
---|
| 33 | // |
---|
| 34 | // class description: |
---|
| 35 | // This class extends G4Trajectory, which includes the following: |
---|
| 36 | // 1) List of trajectory points which compose the trajectory, |
---|
| 37 | // 2) static information of particle which generated the |
---|
| 38 | // trajectory, |
---|
| 39 | // 3) trackID and parent particle ID of the trajectory. |
---|
| 40 | // The extended information, only publicly accessible through AttValues, |
---|
| 41 | // includes: |
---|
| 42 | // 4) physical volume and next physical volume; |
---|
| 43 | // 5) creator process; |
---|
| 44 | // |
---|
| 45 | // Contact: |
---|
| 46 | // Questions and comments on G4Trajectory should be sent to |
---|
| 47 | // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp) |
---|
| 48 | // Makoto Asai (e-mail: asai@kekvax.kek.jp) |
---|
| 49 | // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp) |
---|
| 50 | // and on the extended code to: |
---|
| 51 | // John Allison (e-mail: John.Allison@manchester.ac.uk) |
---|
| 52 | // Joseph Perl (e-mail: perl@slac.stanford.edu) |
---|
| 53 | // |
---|
| 54 | // --------------------------------------------------------------- |
---|
| 55 | |
---|
| 56 | #ifndef G4RICHTRAJECTORY_HH |
---|
| 57 | #define G4RICHTRAJECTORY_HH |
---|
| 58 | |
---|
| 59 | #include "G4Trajectory.hh" |
---|
| 60 | |
---|
| 61 | typedef std::vector<G4VTrajectoryPoint*> RichTrajectoryPointsContainer; |
---|
| 62 | |
---|
| 63 | class G4RichTrajectory : public G4Trajectory { |
---|
| 64 | |
---|
| 65 | public: // with description |
---|
| 66 | |
---|
| 67 | // Constructors/destructors |
---|
| 68 | G4RichTrajectory(); |
---|
| 69 | G4RichTrajectory(const G4Track* aTrack); |
---|
| 70 | G4RichTrajectory(G4RichTrajectory &); |
---|
| 71 | virtual ~G4RichTrajectory(); |
---|
| 72 | |
---|
| 73 | // Operators |
---|
| 74 | inline void* operator new(size_t); |
---|
| 75 | inline void operator delete(void*); |
---|
| 76 | inline int operator == (const G4RichTrajectory& right) const |
---|
| 77 | {return (this==&right);} |
---|
| 78 | |
---|
| 79 | // Other (virtual) member functions |
---|
| 80 | void AppendStep(const G4Step* aStep); |
---|
| 81 | void MergeTrajectory(G4VTrajectory* secondTrajectory); |
---|
| 82 | int GetPointEntries() const { return fpRichPointsContainer->size(); } |
---|
| 83 | G4VTrajectoryPoint* GetPoint(G4int i) const |
---|
| 84 | { return (*fpRichPointsContainer)[i]; } |
---|
| 85 | |
---|
| 86 | // Get methods for HepRep style attributes |
---|
| 87 | virtual const std::map<G4String,G4AttDef>* GetAttDefs() const; |
---|
| 88 | virtual std::vector<G4AttValue>* CreateAttValues() const; |
---|
| 89 | |
---|
| 90 | private: |
---|
| 91 | |
---|
| 92 | // Extended information (only publicly accessible through AttValues)... |
---|
| 93 | RichTrajectoryPointsContainer* fpRichPointsContainer; |
---|
| 94 | G4VPhysicalVolume* fpInitialVolume; |
---|
| 95 | G4VPhysicalVolume* fpInitialNextVolume; |
---|
| 96 | const G4VProcess* fpCreatorProcess; |
---|
| 97 | |
---|
| 98 | }; |
---|
| 99 | |
---|
| 100 | #if defined G4TRACKING_ALLOC_EXPORT |
---|
| 101 | extern G4DLLEXPORT G4Allocator<G4RichTrajectory> |
---|
| 102 | aRichTrajectoryAllocator; |
---|
| 103 | #else |
---|
| 104 | extern G4DLLIMPORT G4Allocator<G4RichTrajectory> |
---|
| 105 | aRichTrajectoryAllocator; |
---|
| 106 | #endif |
---|
| 107 | |
---|
| 108 | inline void* G4RichTrajectory::operator new(size_t) |
---|
| 109 | { |
---|
| 110 | void* aRichTrajectory; |
---|
| 111 | aRichTrajectory = (void*)aRichTrajectoryAllocator.MallocSingle(); |
---|
| 112 | return aRichTrajectory; |
---|
| 113 | } |
---|
| 114 | |
---|
| 115 | inline void G4RichTrajectory::operator delete(void* aRichTrajectory) |
---|
| 116 | { |
---|
| 117 | aRichTrajectoryAllocator.FreeSingle |
---|
| 118 | ((G4RichTrajectory*)aRichTrajectory); |
---|
| 119 | } |
---|
| 120 | |
---|
| 121 | #endif |
---|