Back to home page

EIC code displayed by LXR

 
 

    


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

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