Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4VTrajectory.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4VTrajectory
0027 //
0028 // Class description:
0029 //
0030 // This class is the abstract base class representing a trajectory of
0031 // a particle being tracked.
0032 // Its concrete class includes information of:
0033 //     1) List of trajectory points composing the trajectory;
0034 //     2) Static information of the particle which generated the trajectory;
0035 //     3) Track ID and parent particle ID of the trajectory.
0036 
0037 // Contact:
0038 //   Questions and comments to this code should be sent to
0039 //     Katsuya Amako  (e-mail: Katsuya.Amako@kek.jp)
0040 //     Makoto  Asai   (e-mail: asai@slac.stanford.edu)
0041 //     Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
0042 // --------------------------------------------------------------------
0043 #ifndef G4VTrajectory_hh
0044 #define G4VTrajectory_hh 1
0045 
0046 #include "G4ThreeVector.hh"
0047 #include "globals.hh"
0048 
0049 #include <map>
0050 #include <vector>
0051 
0052 class G4Step;
0053 class G4VTrajectoryPoint;
0054 class G4AttDef;
0055 class G4AttValue;
0056 
0057 class G4VTrajectory
0058 {
0059  public:
0060   // Constructor/Destrcutor
0061   G4VTrajectory() = default;
0062   virtual ~G4VTrajectory() = default;
0063 
0064   // Equality operator
0065   G4bool operator==(const G4VTrajectory& right) const;
0066 
0067   // Accessors
0068   virtual G4int GetTrackID() const = 0;
0069   virtual G4int GetParentID() const = 0;
0070   virtual G4String GetParticleName() const = 0;
0071 
0072   // Charge is that of G4DynamicParticle
0073   virtual G4double GetCharge() const = 0;
0074 
0075   // Zero will be returned if the particle does not have PDG code.
0076   virtual G4int GetPDGEncoding() const = 0;
0077 
0078   // Momentum at the origin of the track in global coordinate system
0079   virtual G4ThreeVector GetInitialMomentum() const = 0;
0080 
0081   // Returns the number of trajectory points
0082   virtual G4int GetPointEntries() const = 0;
0083 
0084   // Returns i-th trajectory point
0085   virtual G4VTrajectoryPoint* GetPoint(G4int i) const = 0;
0086 
0087   // Converts attributes in trajectory (and trajectory point if
0088   // needed) to ostream. A default implementation in this base class
0089   // may be used or may be overridden in the concrete class. Note:
0090   // the user needs to follow with new-line or end-of-string,
0091   // depending on the nature of os
0092   virtual void ShowTrajectory(std::ostream& os = G4cout) const;
0093 
0094   // Draw the trajectory. A default implementation in this base
0095   // class may be used or may be overridden in the concrete class
0096   virtual void DrawTrajectory() const;
0097 
0098   // If implemented by a derived class, returns a pointer to a map of
0099   // attribute definitions for the attribute values below. The user
0100   // must test the validity of this pointer. See G4Trajectory for an
0101   // example of a concrete implementation of this method
0102   virtual const std::map<G4String, G4AttDef>* GetAttDefs() const { return nullptr; }
0103 
0104   // If implemented by a derived class, returns a pointer to a list
0105   // of attribute values suitable, e.g., for picking. Each must
0106   // refer to an attribute definition in the above map; its name is
0107   // the key. The user must test the validity of this pointer (it
0108   // must be non-zero and conform to the G4AttDefs, which may be
0109   // checked with G4AttCheck) and delete the list after use. See
0110   // G4Trajectory for an example of a concrete implementation of this
0111   // method and G4VTrajectory::ShowTrajectory for an example of its use.
0112   virtual std::vector<G4AttValue>* CreateAttValues() const { return nullptr; }
0113 
0114   // Methods invoked exclusively by G4TrackingManager
0115   virtual void AppendStep(const G4Step* aStep) = 0;
0116   virtual void MergeTrajectory(G4VTrajectory* secondTrajectory) = 0;
0117 };
0118 
0119 #endif