LBNETrackInformation.cc
Go to the documentation of this file.
1 //
2 // LBNETrackInformation.cc
3 //
4 // Refurbished,Using now the more formal and exact G4VUserTrackInformation class
5 // P.L. November 2014.
6 //
7 #include "G4VProcess.hh"
9 #include "G4ios.hh"
10 
11 G4Allocator<LBNETrackInformation> aTrackInformationAllocator;
12 
14  :decay_code(0),
15  tgen(0),
16  Nimpwt(1.0),
17  fPerfectFocusingFlag(0),
18  fParentMomentumAtThisProduction(0.0,0.0,0.0)
19 {
20 // std::cerr << " Creating LBNETrackInformation.. " << (void*) this << std::endl;
21 }
22 
23 
25 {
26  decay_code = aTrackInfo->decay_code; // Why does this work.. decay_code is private..
27  tgen = aTrackInfo->tgen;
28  Nimpwt = aTrackInfo->Nimpwt;
29  fPerfectFocusingFlag = aTrackInfo->GetPFFlag();
31  std::cerr << " LBNETrackInformation copy from const pointer done " << std::endl;
32 }
34 G4VUserTrackInformation()
35 {
36  decay_code = aTrackInfo.GetDecayCode();
37  tgen = aTrackInfo.GetTgen();
38  Nimpwt = aTrackInfo.GetNImpWt();
39  fPerfectFocusingFlag = aTrackInfo.GetPFFlag();
41  std::cerr << " LBNETrackInformation copy constr const by ref done " << std::endl;
42 }
44 {
45  decay_code = aTrackInfo->decay_code; // Why does this work.. decay_code is private..
46  tgen = aTrackInfo->tgen;
47  Nimpwt = aTrackInfo->Nimpwt;
48  fPerfectFocusingFlag = aTrackInfo->GetPFFlag();
50  std::cerr << " LBNETrackInformation copy from pointer done " << std::endl;
51 }
53 G4VUserTrackInformation()
54 {
55  decay_code = aTrackInfo.GetDecayCode();
56  tgen = aTrackInfo.GetTgen();
57  Nimpwt = aTrackInfo.GetNImpWt();
58  fPerfectFocusingFlag = aTrackInfo.GetPFFlag();
60  std::cerr << " LBNETrackInformation copy constr by ref done " << std::endl;
61 }
63 {
64  decay_code = right.GetDecayCode();
65  tgen = right.GetTgen();
66  Nimpwt = right.GetNImpWt();
69  std::cerr << " LBNETrackInformation assignment from const done " << std::endl;
70  return *this;
71 }
73 {
74  decay_code = right.GetDecayCode();
75  tgen = right.GetTgen();
76  Nimpwt = right.GetNImpWt();
79  std::cerr << " LBNETrackInformation assignment done " << std::endl;
80  return *this;
81 }
82 
84 
86 {
87  G4cout
88  << "Decay code = " << decay_code << G4endl;
89  G4cout
90  << "tgen = " << tgen << G4endl;
91  G4cout
92  << "nimpwt = " << Nimpwt << " Perfect Focusing flag " << fPerfectFocusingFlag << G4endl;
93 }
94 
95 void LBNETrackInformation::Print(const G4Track *aTrack) const
96 {
97  const G4String spaces = " ";
98 
99  G4cout << spaces << "Track ID = " << aTrack->GetTrackID() << G4endl
100  << spaces << "Particle Name = " << aTrack->GetDefinition()->GetParticleName() << G4endl
101  << spaces << "Parent ID = " << aTrack->GetParentID() << G4endl;
102  if(aTrack->GetVolume()) G4cout << spaces << "Current volume = " << aTrack->GetVolume()-> GetName() << G4endl;
103  else G4cout << spaces << "Current volume = NOT CURRENTLY AVAILABLE" << G4endl;
104  if(aTrack->GetCreatorProcess()) G4cout << spaces << "Creator Process = "<< aTrack->GetCreatorProcess()->GetProcessName() << G4endl;
105  else G4cout << spaces << "Creator Process = NOT CURRENTLY AVAILABLE" << G4endl;
106 
107 }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:104
G4Allocator< LBNETrackInformation > aTrackInformationAllocator
G4ThreeVector fParentMomentumAtThisProduction
LBNETrackInformation & operator=(const LBNETrackInformation &right)
G4double GetNImpWt() const
QTextStream & endl(QTextStream &s)