| [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 | //
|
|---|
| [1228] | 27 | // $Id: G4RichTrajectory.hh,v 1.6 2009/11/24 10:04:14 perl Exp $
|
|---|
| 28 | // GEANT4 tag $Name: geant4-09-03 $
|
|---|
| [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;
|
|---|
| [1228] | 44 | // ...and much more.
|
|---|
| [827] | 45 | //
|
|---|
| 46 | // Contact:
|
|---|
| 47 | // Questions and comments on G4Trajectory should be sent to
|
|---|
| 48 | // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
|---|
| 49 | // Makoto Asai (e-mail: asai@kekvax.kek.jp)
|
|---|
| 50 | // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
|---|
| 51 | // and on the extended code to:
|
|---|
| 52 | // John Allison (e-mail: John.Allison@manchester.ac.uk)
|
|---|
| 53 | // Joseph Perl (e-mail: perl@slac.stanford.edu)
|
|---|
| 54 | //
|
|---|
| 55 | // ---------------------------------------------------------------
|
|---|
| 56 |
|
|---|
| 57 | #ifndef G4RICHTRAJECTORY_HH
|
|---|
| 58 | #define G4RICHTRAJECTORY_HH
|
|---|
| 59 |
|
|---|
| 60 | #include "G4Trajectory.hh"
|
|---|
| 61 |
|
|---|
| [1228] | 62 | #include "G4TouchableHandle.hh"
|
|---|
| 63 |
|
|---|
| [827] | 64 | typedef std::vector<G4VTrajectoryPoint*> RichTrajectoryPointsContainer;
|
|---|
| 65 |
|
|---|
| 66 | class G4RichTrajectory : public G4Trajectory {
|
|---|
| 67 |
|
|---|
| 68 | public: // with description
|
|---|
| 69 |
|
|---|
| 70 | // Constructors/destructors
|
|---|
| 71 | G4RichTrajectory();
|
|---|
| 72 | G4RichTrajectory(const G4Track* aTrack);
|
|---|
| 73 | G4RichTrajectory(G4RichTrajectory &);
|
|---|
| 74 | virtual ~G4RichTrajectory();
|
|---|
| 75 |
|
|---|
| 76 | // Operators
|
|---|
| 77 | inline void* operator new(size_t);
|
|---|
| 78 | inline void operator delete(void*);
|
|---|
| 79 | inline int operator == (const G4RichTrajectory& right) const
|
|---|
| 80 | {return (this==&right);}
|
|---|
| 81 |
|
|---|
| 82 | // Other (virtual) member functions
|
|---|
| 83 | void AppendStep(const G4Step* aStep);
|
|---|
| 84 | void MergeTrajectory(G4VTrajectory* secondTrajectory);
|
|---|
| 85 | int GetPointEntries() const { return fpRichPointsContainer->size(); }
|
|---|
| 86 | G4VTrajectoryPoint* GetPoint(G4int i) const
|
|---|
| 87 | { return (*fpRichPointsContainer)[i]; }
|
|---|
| 88 |
|
|---|
| 89 | // Get methods for HepRep style attributes
|
|---|
| 90 | virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
|
|---|
| 91 | virtual std::vector<G4AttValue>* CreateAttValues() const;
|
|---|
| 92 |
|
|---|
| 93 | private:
|
|---|
| 94 |
|
|---|
| 95 | // Extended information (only publicly accessible through AttValues)...
|
|---|
| 96 | RichTrajectoryPointsContainer* fpRichPointsContainer;
|
|---|
| [1228] | 97 | G4TouchableHandle fpInitialVolume;
|
|---|
| 98 | G4TouchableHandle fpInitialNextVolume;
|
|---|
| 99 | const G4VProcess* fpCreatorProcess;
|
|---|
| 100 | G4TouchableHandle fpFinalVolume;
|
|---|
| 101 | G4TouchableHandle fpFinalNextVolume;
|
|---|
| 102 | const G4VProcess* fpEndingProcess;
|
|---|
| 103 | G4double fFinalKineticEnergy;
|
|---|
| [827] | 104 |
|
|---|
| 105 | };
|
|---|
| 106 |
|
|---|
| 107 | #if defined G4TRACKING_ALLOC_EXPORT
|
|---|
| 108 | extern G4DLLEXPORT G4Allocator<G4RichTrajectory>
|
|---|
| 109 | aRichTrajectoryAllocator;
|
|---|
| 110 | #else
|
|---|
| 111 | extern G4DLLIMPORT G4Allocator<G4RichTrajectory>
|
|---|
| 112 | aRichTrajectoryAllocator;
|
|---|
| 113 | #endif
|
|---|
| 114 |
|
|---|
| 115 | inline void* G4RichTrajectory::operator new(size_t)
|
|---|
| 116 | {
|
|---|
| 117 | void* aRichTrajectory;
|
|---|
| 118 | aRichTrajectory = (void*)aRichTrajectoryAllocator.MallocSingle();
|
|---|
| 119 | return aRichTrajectory;
|
|---|
| 120 | }
|
|---|
| 121 |
|
|---|
| 122 | inline void G4RichTrajectory::operator delete(void* aRichTrajectory)
|
|---|
| 123 | {
|
|---|
| 124 | aRichTrajectoryAllocator.FreeSingle
|
|---|
| 125 | ((G4RichTrajectory*)aRichTrajectory);
|
|---|
| 126 | }
|
|---|
| 127 |
|
|---|
| 128 | #endif
|
|---|