Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:15:37

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 // G4RichTrajectoryPoint
0027 //
0028 // Class description:
0029 //
0030 // This class extends G4TrajectoryPoint.
0031 // From G4Trajectory, the following information is included:
0032 //   1) Position (end of step).
0033 // The extended information, only publicly accessible through AttValues,
0034 // includes:
0035 //   2) Auxiliary points, as in G4SmoothTrajectory.
0036 //   3) Total energy deposit.
0037 //   4) Remaining energy.
0038 //   5) Process defining end of step.
0039 //   6) Global time (from start of event) at pre- amd post-step.
0040 // ...and more.
0041 
0042 // Contact:
0043 //   Questions and comments to this code should be sent to
0044 //     Katsuya Amako  (e-mail: Katsuya.Amako@kek.jp)
0045 //     Makoto  Asai   (e-mail: asai@slac.stanford.edu)
0046 //     Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
0047 //   and on the extended code to:
0048 //     John Allison   (e-mail: John.Allison@manchester.ac.uk)
0049 //     Joseph Perl    (e-mail: perl@slac.stanford.edu)
0050 // --------------------------------------------------------------------
0051 #ifndef G4RICHTRAJECTORYPOINT_HH
0052 #define G4RICHTRAJECTORYPOINT_HH
0053 
0054 #include "G4StepStatus.hh"
0055 #include "G4ThreeVector.hh"
0056 #include "G4TouchableHandle.hh"
0057 #include "G4VTrajectoryPoint.hh"
0058 #include "globals.hh"  // Include from 'global'
0059 
0060 #include "trkgdefs.hh"
0061 class G4ClonedRichTrajectoryPoint;
0062 
0063 #include "trkgdefs.hh"
0064 
0065 #include <vector>
0066 
0067 class G4Track;
0068 class G4Step;
0069 class G4VProcess;
0070 
0071 class G4RichTrajectoryPoint : public G4VTrajectoryPoint
0072 {
0073 
0074   friend class G4ClonedRichTrajectoryPoint;
0075 
0076  public:  // without description
0077   // Constructors/Destructor
0078   //
0079   G4RichTrajectoryPoint();
0080   G4RichTrajectoryPoint(const G4Track*);  // For first point.
0081   G4RichTrajectoryPoint(const G4Step*);  // For subsequent points.
0082   G4RichTrajectoryPoint(const G4RichTrajectoryPoint& right);
0083   ~G4RichTrajectoryPoint() override;
0084 
0085   // Operators
0086   //
0087   G4RichTrajectoryPoint& operator=(const G4RichTrajectoryPoint&) = delete;
0088   inline G4bool operator==(const G4RichTrajectoryPoint& right) const;
0089   inline void* operator new(size_t);
0090   inline void operator delete(void* aRichTrajectoryPoint);
0091 
0092   // Get/Set functions
0093   //
0094 
0095   inline const G4ThreeVector GetPosition() const override { return fPosition; }
0096 
0097   inline const std::vector<G4ThreeVector>* GetAuxiliaryPoints() const override;
0098   const std::map<G4String, G4AttDef>* GetAttDefs() const override;
0099   std::vector<G4AttValue>* CreateAttValues() const override;
0100 
0101  private:
0102   G4ThreeVector fPosition{0., 0., 0.};
0103 
0104   // Extended member data
0105   //
0106   std::vector<G4ThreeVector>* fpAuxiliaryPointVector = nullptr;
0107   G4double fTotEDep = 0.0;
0108   G4double fRemainingEnergy = 0.0;
0109   const G4VProcess* fpProcess = nullptr;
0110   G4StepStatus fPreStepPointStatus = fUndefined;
0111   G4StepStatus fPostStepPointStatus = fUndefined;
0112   G4double fPreStepPointGlobalTime = 0.0;
0113   G4double fPostStepPointGlobalTime = 0.0;
0114   G4TouchableHandle fpPreStepPointVolume;
0115   G4TouchableHandle fpPostStepPointVolume;
0116   G4double fPreStepPointWeight = 0.0;
0117   G4double fPostStepPointWeight = 0.0;
0118 };
0119 
0120 extern G4TRACKING_DLL G4Allocator<G4RichTrajectoryPoint>*& aRichTrajectoryPointAllocator();
0121 
0122 inline void* G4RichTrajectoryPoint::operator new(size_t)
0123 {
0124   if (aRichTrajectoryPointAllocator() == nullptr) {
0125     aRichTrajectoryPointAllocator() = new G4Allocator<G4RichTrajectoryPoint>;
0126   }
0127   return (void*)aRichTrajectoryPointAllocator()->MallocSingle();
0128 }
0129 
0130 inline void G4RichTrajectoryPoint::operator delete(void* aRichTrajectoryPoint)
0131 {
0132   aRichTrajectoryPointAllocator()->FreeSingle((G4RichTrajectoryPoint*)aRichTrajectoryPoint);
0133 }
0134 
0135 inline G4bool G4RichTrajectoryPoint::operator==(const G4RichTrajectoryPoint& r) const
0136 {
0137   return (this == &r);
0138 }
0139 
0140 inline const std::vector<G4ThreeVector>* G4RichTrajectoryPoint::GetAuxiliaryPoints() const
0141 {
0142   return fpAuxiliaryPointVector;
0143 }
0144 
0145 #endif