source: trunk/examples/extended/runAndEvent/RE01/src/RE01TrackInformation.cc @ 1337

Last change on this file since 1337 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 5.1 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: RE01TrackInformation.cc,v 1.2 2006/06/29 17:44:25 gunter Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-01 $
29//
30
31#include "RE01TrackInformation.hh"
32#include "G4ios.hh"
33
34G4Allocator<RE01TrackInformation> aTrackInformationAllocator;
35
36RE01TrackInformation::RE01TrackInformation()
37{
38    originalTrackID = 0;
39    particleDefinition = 0;
40    originalPosition = G4ThreeVector(0.,0.,0.);
41    originalMomentum = G4ThreeVector(0.,0.,0.);
42    originalEnergy = 0.;
43    originalTime = 0.;
44    trackingStatus = 1;
45    sourceTrackID = -1;
46    sourceTrackID = -1;
47    sourceDefinition = 0;
48    sourcePosition = G4ThreeVector(0.,0.,0.);
49    sourceMomentum = G4ThreeVector(0.,0.,0.);
50    sourceEnergy = 0.;
51    sourceTime = 0.;
52}
53
54RE01TrackInformation::RE01TrackInformation(const G4Track* aTrack)
55{
56    originalTrackID = aTrack->GetTrackID();
57    particleDefinition = aTrack->GetDefinition();
58    originalPosition = aTrack->GetPosition();
59    originalMomentum = aTrack->GetMomentum();
60    originalEnergy = aTrack->GetTotalEnergy();
61    originalTime = aTrack->GetGlobalTime();
62    trackingStatus = 1;
63    sourceTrackID = -1;
64    sourceDefinition = 0;
65    sourcePosition = G4ThreeVector(0.,0.,0.);
66    sourceMomentum = G4ThreeVector(0.,0.,0.);
67    sourceEnergy = 0.;
68    sourceTime = 0.;
69}
70
71RE01TrackInformation::RE01TrackInformation(const RE01TrackInformation* aTrackInfo)
72{
73    originalTrackID = aTrackInfo->originalTrackID;
74    particleDefinition = aTrackInfo->particleDefinition;
75    originalPosition = aTrackInfo->originalPosition;
76    originalMomentum = aTrackInfo->originalMomentum;
77    originalEnergy = aTrackInfo->originalEnergy;
78    originalTime = aTrackInfo->originalTime;
79    trackingStatus = aTrackInfo->trackingStatus;
80    sourceTrackID = aTrackInfo->sourceTrackID;
81    sourceDefinition = aTrackInfo->sourceDefinition;
82    sourcePosition = aTrackInfo->sourcePosition;
83    sourceMomentum = aTrackInfo->sourceMomentum;
84    sourceEnergy = aTrackInfo->sourceEnergy;
85    sourceTime = aTrackInfo->sourceTime;
86}
87
88RE01TrackInformation::~RE01TrackInformation()
89{ ; }
90
91RE01TrackInformation& RE01TrackInformation::operator =(const RE01TrackInformation& aTrackInfo)
92{
93    originalTrackID = aTrackInfo.originalTrackID;
94    particleDefinition = aTrackInfo.particleDefinition;
95    originalPosition = aTrackInfo.originalPosition;
96    originalMomentum = aTrackInfo.originalMomentum;
97    originalEnergy = aTrackInfo.originalEnergy;
98    originalTime = aTrackInfo.originalTime;
99    trackingStatus = aTrackInfo.trackingStatus;
100    sourceTrackID = aTrackInfo.sourceTrackID;
101    sourceDefinition = aTrackInfo.sourceDefinition;
102    sourcePosition = aTrackInfo.sourcePosition;
103    sourceMomentum = aTrackInfo.sourceMomentum;
104    sourceEnergy = aTrackInfo.sourceEnergy;
105    sourceTime = aTrackInfo.sourceTime;
106
107    return *this;
108}
109
110void RE01TrackInformation::SetSourceTrackInformation(const G4Track* aTrack)
111{
112    sourceTrackID = aTrack->GetTrackID();
113    sourceDefinition = aTrack->GetDefinition();
114    sourcePosition = aTrack->GetPosition();
115    sourceMomentum = aTrack->GetMomentum();
116    sourceEnergy = aTrack->GetTotalEnergy();
117    sourceTime = aTrack->GetGlobalTime();
118}
119
120void RE01TrackInformation::Print() const
121{
122    G4cout
123     << "Source track ID " << sourceTrackID << " (" << sourceDefinition->GetParticleName() << ","
124     << sourceEnergy/GeV << "[GeV]) at " << sourcePosition << G4endl;
125    G4cout
126     << "Original primary track ID " << originalTrackID << " (" << particleDefinition->GetParticleName() << ","
127     << originalEnergy/GeV << "[GeV])" << G4endl;
128}
129
Note: See TracBrowser for help on using the repository browser.