Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-31 07:50:54

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 /// \file RE01TrackInformation.hh
0027 /// \brief Definition of the RE01TrackInformation class
0028 
0029 #ifndef RE01TrackInformation_h
0030 #define RE01TrackInformation_h 1
0031 
0032 #include "G4Allocator.hh"
0033 #include "G4ParticleDefinition.hh"
0034 #include "G4ThreeVector.hh"
0035 #include "G4Track.hh"
0036 #include "G4VUserTrackInformation.hh"
0037 #include "globals.hh"
0038 
0039 class RE01TrackInformation : public G4VUserTrackInformation
0040 {
0041   public:
0042     RE01TrackInformation();
0043     RE01TrackInformation(const G4Track* aTrack);
0044     RE01TrackInformation(const RE01TrackInformation* aTrackInfo);
0045     virtual ~RE01TrackInformation();
0046 
0047     inline void* operator new(size_t);
0048     inline void operator delete(void* aTrackInfo);
0049 
0050     RE01TrackInformation& operator=(const RE01TrackInformation& right);
0051 
0052     void SetSourceTrackInformation(const G4Track* aTrack);
0053     virtual void Print() const;
0054 
0055   public:
0056     inline G4int GetTrackingStatus() const { return fTrackingStatus; }
0057     inline void SetTrackingStatus(G4int i) { fTrackingStatus = i; }
0058     inline G4int GetSourceTrackID() const { return fSourceTrackID; }
0059     inline void SetSuspendedStepID(G4int i) { fSuspendedStepID = i; }
0060     inline G4int GetSuspendedStepID() const { return fSuspendedStepID; }
0061 
0062   private:
0063     // Information of the primary track at the primary vertex
0064     G4int fOriginalTrackID;  // Track ID of primary particle
0065     G4ParticleDefinition* fParticleDefinition;
0066     G4ThreeVector fOriginalPosition;
0067     G4ThreeVector fOriginalMomentum;
0068     G4double fOriginalEnergy;
0069     G4double fOriginalTime;
0070 
0071     G4int fTrackingStatus;
0072     // trackingStatus = 1 : primary or secondary track which has not yet reached
0073     //                      to calorimeter
0074     //                = 0 : track which or ancester of which has reached to
0075     //                      calorimeter
0076     //                = 2 : track or its ancester had reached to calorimeter
0077     //                      and then escaped from it
0078     // Information of the track which reached to the calorimeter boundary at the
0079     // boundary surface.
0080     // This information is valid only for trackingStatus = 0 or 2
0081     G4int fSourceTrackID;
0082     G4ParticleDefinition* fSourceDefinition;
0083     G4ThreeVector fSourcePosition;
0084     G4ThreeVector fSourceMomentum;
0085     G4double fSourceEnergy;
0086     G4double fSourceTime;
0087     G4int fSuspendedStepID;
0088 };
0089 
0090 extern G4ThreadLocal G4Allocator<RE01TrackInformation>* aTrackInformationAllocator;
0091 
0092 inline void* RE01TrackInformation::operator new(size_t)
0093 {
0094   if (!aTrackInformationAllocator)
0095     aTrackInformationAllocator = new G4Allocator<RE01TrackInformation>;
0096   return (void*)aTrackInformationAllocator->MallocSingle();
0097 }
0098 
0099 inline void RE01TrackInformation::operator delete(void* aTrackInfo)
0100 {
0101   aTrackInformationAllocator->FreeSingle((RE01TrackInformation*)aTrackInfo);
0102 }
0103 
0104 #endif