Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:42

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