Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:02

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 "G4TrajectoryPoint.hh"
0058 
0059 #include "trkgdefs.hh"
0060 
0061 #include <vector>
0062 
0063 class G4Track;
0064 class G4Step;
0065 class G4VProcess;
0066 
0067 class G4RichTrajectoryPoint : public G4TrajectoryPoint
0068 {
0069  public:  // without description
0070   // Constructors/Destructor
0071   //
0072   G4RichTrajectoryPoint();
0073   G4RichTrajectoryPoint(const G4Track*);  // For first point.
0074   G4RichTrajectoryPoint(const G4Step*);  // For subsequent points.
0075   G4RichTrajectoryPoint(const G4RichTrajectoryPoint& right);
0076   ~G4RichTrajectoryPoint() override;
0077 
0078   // Operators
0079   //
0080   G4RichTrajectoryPoint& operator=(const G4RichTrajectoryPoint&) = delete;
0081   inline G4bool operator==(const G4RichTrajectoryPoint& right) const;
0082   inline void* operator new(size_t);
0083   inline void operator delete(void* aRichTrajectoryPoint);
0084 
0085   // Get/Set functions
0086   //
0087   inline const std::vector<G4ThreeVector>* GetAuxiliaryPoints() const override;
0088   const std::map<G4String, G4AttDef>* GetAttDefs() const override;
0089   std::vector<G4AttValue>* CreateAttValues() const override;
0090 
0091  private:
0092   // Extended member data
0093   //
0094   std::vector<G4ThreeVector>* fpAuxiliaryPointVector = nullptr;
0095   G4double fTotEDep = 0.0;
0096   G4double fRemainingEnergy = 0.0;
0097   const G4VProcess* fpProcess = nullptr;
0098   G4StepStatus fPreStepPointStatus = fUndefined;
0099   G4StepStatus fPostStepPointStatus = fUndefined;
0100   G4double fPreStepPointGlobalTime = 0.0;
0101   G4double fPostStepPointGlobalTime = 0.0;
0102   G4TouchableHandle fpPreStepPointVolume;
0103   G4TouchableHandle fpPostStepPointVolume;
0104   G4double fPreStepPointWeight = 0.0;
0105   G4double fPostStepPointWeight = 0.0;
0106 };
0107 
0108 extern G4TRACKING_DLL G4Allocator<G4RichTrajectoryPoint>*& aRichTrajectoryPointAllocator();
0109 
0110 inline void* G4RichTrajectoryPoint::operator new(size_t)
0111 {
0112   if (aRichTrajectoryPointAllocator() == nullptr) {
0113     aRichTrajectoryPointAllocator() = new G4Allocator<G4RichTrajectoryPoint>;
0114   }
0115   return (void*)aRichTrajectoryPointAllocator()->MallocSingle();
0116 }
0117 
0118 inline void G4RichTrajectoryPoint::operator delete(void* aRichTrajectoryPoint)
0119 {
0120   aRichTrajectoryPointAllocator()->FreeSingle((G4RichTrajectoryPoint*)aRichTrajectoryPoint);
0121 }
0122 
0123 inline G4bool G4RichTrajectoryPoint::operator==(const G4RichTrajectoryPoint& r) const
0124 {
0125   return (this == &r);
0126 }
0127 
0128 inline const std::vector<G4ThreeVector>* G4RichTrajectoryPoint::GetAuxiliaryPoints() const
0129 {
0130   return fpAuxiliaryPointVector;
0131 }
0132 
0133 #endif