Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-30 07:51:14

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.cc
0027 /// \brief Implementation of the RE01TrackInformation class
0028 
0029 #include "RE01TrackInformation.hh"
0030 
0031 #include "G4SystemOfUnits.hh"
0032 #include "G4ios.hh"
0033 
0034 G4ThreadLocal G4Allocator<RE01TrackInformation>* aTrackInformationAllocator = 0;
0035 
0036 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0037 RE01TrackInformation::RE01TrackInformation() : G4VUserTrackInformation()
0038 {
0039   fOriginalTrackID = 0;
0040   fParticleDefinition = 0;
0041   fOriginalPosition = G4ThreeVector(0., 0., 0.);
0042   fOriginalMomentum = G4ThreeVector(0., 0., 0.);
0043   fOriginalEnergy = 0.;
0044   fOriginalTime = 0.;
0045   fTrackingStatus = 1;
0046   fSourceTrackID = -1;
0047   fSourceDefinition = 0;
0048   fSourcePosition = G4ThreeVector(0., 0., 0.);
0049   fSourceMomentum = G4ThreeVector(0., 0., 0.);
0050   fSourceEnergy = 0.;
0051   fSourceTime = 0.;
0052   fSuspendedStepID = -1;
0053 }
0054 
0055 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0056 RE01TrackInformation::RE01TrackInformation(const G4Track* aTrack) : G4VUserTrackInformation()
0057 {
0058   fOriginalTrackID = aTrack->GetTrackID();
0059   fParticleDefinition = aTrack->GetDefinition();
0060   fOriginalPosition = aTrack->GetPosition();
0061   fOriginalMomentum = aTrack->GetMomentum();
0062   fOriginalEnergy = aTrack->GetTotalEnergy();
0063   fOriginalTime = aTrack->GetGlobalTime();
0064   fTrackingStatus = 1;
0065   fSourceTrackID = -1;
0066   fSourceDefinition = 0;
0067   fSourcePosition = G4ThreeVector(0., 0., 0.);
0068   fSourceMomentum = G4ThreeVector(0., 0., 0.);
0069   fSourceEnergy = 0.;
0070   fSourceTime = 0.;
0071   fSuspendedStepID = -1;
0072 }
0073 
0074 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0075 RE01TrackInformation ::RE01TrackInformation(const RE01TrackInformation* aTrackInfo)
0076   : G4VUserTrackInformation()
0077 {
0078   fOriginalTrackID = aTrackInfo->fOriginalTrackID;
0079   fParticleDefinition = aTrackInfo->fParticleDefinition;
0080   fOriginalPosition = aTrackInfo->fOriginalPosition;
0081   fOriginalMomentum = aTrackInfo->fOriginalMomentum;
0082   fOriginalEnergy = aTrackInfo->fOriginalEnergy;
0083   fOriginalTime = aTrackInfo->fOriginalTime;
0084   fTrackingStatus = aTrackInfo->fTrackingStatus;
0085   fSourceTrackID = aTrackInfo->fSourceTrackID;
0086   fSourceDefinition = aTrackInfo->fSourceDefinition;
0087   fSourcePosition = aTrackInfo->fSourcePosition;
0088   fSourceMomentum = aTrackInfo->fSourceMomentum;
0089   fSourceEnergy = aTrackInfo->fSourceEnergy;
0090   fSourceTime = aTrackInfo->fSourceTime;
0091   fSuspendedStepID = -1;
0092 }
0093 
0094 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0095 RE01TrackInformation::~RE01TrackInformation()
0096 {
0097   ;
0098 }
0099 
0100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0101 RE01TrackInformation& RE01TrackInformation ::operator=(const RE01TrackInformation& aTrackInfo)
0102 {
0103   fOriginalTrackID = aTrackInfo.fOriginalTrackID;
0104   fParticleDefinition = aTrackInfo.fParticleDefinition;
0105   fOriginalPosition = aTrackInfo.fOriginalPosition;
0106   fOriginalMomentum = aTrackInfo.fOriginalMomentum;
0107   fOriginalEnergy = aTrackInfo.fOriginalEnergy;
0108   fOriginalTime = aTrackInfo.fOriginalTime;
0109   fTrackingStatus = aTrackInfo.fTrackingStatus;
0110   fSourceTrackID = aTrackInfo.fSourceTrackID;
0111   fSourceDefinition = aTrackInfo.fSourceDefinition;
0112   fSourcePosition = aTrackInfo.fSourcePosition;
0113   fSourceMomentum = aTrackInfo.fSourceMomentum;
0114   fSourceEnergy = aTrackInfo.fSourceEnergy;
0115   fSourceTime = aTrackInfo.fSourceTime;
0116   fSuspendedStepID = -1;
0117 
0118   return *this;
0119 }
0120 
0121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0122 void RE01TrackInformation::SetSourceTrackInformation(const G4Track* aTrack)
0123 {
0124   fSourceTrackID = aTrack->GetTrackID();
0125   fSourceDefinition = aTrack->GetDefinition();
0126   fSourcePosition = aTrack->GetPosition();
0127   fSourceMomentum = aTrack->GetMomentum();
0128   fSourceEnergy = aTrack->GetTotalEnergy();
0129   fSourceTime = aTrack->GetGlobalTime();
0130 }
0131 
0132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0133 void RE01TrackInformation::Print() const
0134 {
0135   G4cout << "Source track ID " << fSourceTrackID << " (" << fSourceDefinition->GetParticleName()
0136          << "," << fSourceEnergy / GeV << "[GeV]) at " << fSourcePosition << G4endl;
0137   G4cout << "Original primary track ID " << fOriginalTrackID << " ("
0138          << fParticleDefinition->GetParticleName() << "," << fOriginalEnergy / GeV << "[GeV])"
0139          << G4endl;
0140 }