1 | #include "ELYSE/SteppingVerbose.hh"
|
---|
2 |
|
---|
3 | #include "G4SteppingManager.hh"
|
---|
4 | #include "G4UnitsTable.hh"
|
---|
5 |
|
---|
6 | //---------------------------------------------------------
|
---|
7 | ELYSE::SteppingVerbose::SteppingVerbose() {}
|
---|
8 |
|
---|
9 | //---------------------------------------------------------
|
---|
10 | ELYSE::SteppingVerbose::~SteppingVerbose() {}
|
---|
11 |
|
---|
12 | //---------------------------------------------------------
|
---|
13 | void ELYSE::SteppingVerbose::StepInfo() {
|
---|
14 | CopyState();
|
---|
15 |
|
---|
16 | G4int prec = G4cout.precision(3);
|
---|
17 |
|
---|
18 | // G4cout << "(JEC):: ELYSE::SteppingVerbose::StepInfo"
|
---|
19 | // << G4endl;
|
---|
20 |
|
---|
21 | if( verboseLevel >= 1 ){
|
---|
22 | if( verboseLevel >= 4 ) VerboseTrack();
|
---|
23 | if( verboseLevel >= 3 ){
|
---|
24 | G4cout << G4endl;
|
---|
25 | G4cout << std::setw( 5) << "#Step#" << " "
|
---|
26 | << std::setw( 6) << "X" << " "
|
---|
27 | << std::setw( 6) << "Y" << " "
|
---|
28 | << std::setw( 6) << "Z" << " "
|
---|
29 | << std::setw( 9) << "KineE" << " "
|
---|
30 | << std::setw( 9) << "dEStep" << " "
|
---|
31 | << std::setw(10) << "StepLeng"
|
---|
32 | << std::setw(10) << "TrakLeng"
|
---|
33 | << std::setw(10) << "Volume" << " "
|
---|
34 | << std::setw(10) << "Process" << G4endl;
|
---|
35 | }
|
---|
36 |
|
---|
37 | G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
|
---|
38 | << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
---|
39 | << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
---|
40 | << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
---|
41 | << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
---|
42 | << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
---|
43 | << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
---|
44 | << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
---|
45 | << " ";
|
---|
46 |
|
---|
47 | // if( fStepStatus != fWorldBoundary){
|
---|
48 | if( fTrack->GetNextVolume() != 0 ) {
|
---|
49 | G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
|
---|
50 | } else {
|
---|
51 | G4cout << std::setw(10) << "OutOfWorld";
|
---|
52 | }
|
---|
53 |
|
---|
54 | if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
|
---|
55 | G4cout << " "
|
---|
56 | << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
|
---|
57 | ->GetProcessName();
|
---|
58 | } else {
|
---|
59 | G4cout << " UserLimit";
|
---|
60 | }
|
---|
61 |
|
---|
62 | G4cout << G4endl;
|
---|
63 |
|
---|
64 | if( verboseLevel == 2 ){
|
---|
65 | G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
|
---|
66 | fN2ndariesAlongStepDoIt +
|
---|
67 | fN2ndariesPostStepDoIt;
|
---|
68 | if(tN2ndariesTot>0){
|
---|
69 | G4cout << " :----- List of 2ndaries - "
|
---|
70 | << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
|
---|
71 | << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
|
---|
72 | << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
|
---|
73 | << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
|
---|
74 | << "), "
|
---|
75 | << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
|
---|
76 | << " ---------------"
|
---|
77 | << G4endl;
|
---|
78 |
|
---|
79 | for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
|
---|
80 | lp1<(*fSecondary).size(); lp1++){
|
---|
81 | G4cout << " : "
|
---|
82 | << std::setw(6)
|
---|
83 | << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
|
---|
84 | << std::setw(6)
|
---|
85 | << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
|
---|
86 | << std::setw(6)
|
---|
87 | << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
|
---|
88 | << std::setw(6)
|
---|
89 | << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
|
---|
90 | << std::setw(10)
|
---|
91 | << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
|
---|
92 | G4cout << G4endl;
|
---|
93 | }
|
---|
94 |
|
---|
95 | G4cout << " :-----------------------------"
|
---|
96 | << "----------------------------------"
|
---|
97 | << "-- EndOf2ndaries Info ---------------"
|
---|
98 | << G4endl;
|
---|
99 | }
|
---|
100 | }
|
---|
101 |
|
---|
102 | }
|
---|
103 | G4cout.precision(prec);
|
---|
104 | }
|
---|
105 |
|
---|
106 | //---------------------------------------------------------
|
---|
107 | void ELYSE::SteppingVerbose::TrackingStarted() {
|
---|
108 |
|
---|
109 | CopyState();
|
---|
110 |
|
---|
111 | // G4cout << "(JEC) ELYSE::SteppingVerbose::TrackingStarted"
|
---|
112 | // << G4endl;
|
---|
113 |
|
---|
114 | G4int prec = G4cout.precision(3);
|
---|
115 | if( verboseLevel > 0 ){
|
---|
116 |
|
---|
117 | // G4cout << "(JEC)SteppingVerbose::TrackingStarted: dump processes of the particle ("
|
---|
118 | // << fTrack->GetDefinition()->GetParticleName()
|
---|
119 | // << ")"
|
---|
120 | // << G4endl;
|
---|
121 | // fTrack->GetDefinition()->GetProcessManager()->DumpInfo();
|
---|
122 |
|
---|
123 | G4cout << std::setw( 5) << "Step#" << " "
|
---|
124 | << std::setw( 6) << "X" << " "
|
---|
125 | << std::setw( 6) << "Y" << " "
|
---|
126 | << std::setw( 6) << "Z" << " "
|
---|
127 | << std::setw( 9) << "KineE" << " "
|
---|
128 | << std::setw( 9) << "dEStep" << " "
|
---|
129 | << std::setw(10) << "StepLeng"
|
---|
130 | << std::setw(10) << "TrakLeng"
|
---|
131 | << std::setw(10) << "Volume" << " "
|
---|
132 | << std::setw(10) << "Process" << G4endl;
|
---|
133 |
|
---|
134 | G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
|
---|
135 | << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
---|
136 | << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
---|
137 | << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
---|
138 | << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
---|
139 | << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
---|
140 | << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
---|
141 | << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
---|
142 | << " ";
|
---|
143 |
|
---|
144 | if(fTrack->GetNextVolume()){
|
---|
145 | G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
|
---|
146 | } else {
|
---|
147 | G4cout << std::setw(10) << "OutOfWorld";
|
---|
148 | }
|
---|
149 | G4cout << " initStep" << G4endl;
|
---|
150 | }
|
---|
151 | G4cout.precision(prec);
|
---|
152 | }
|
---|
153 |
|
---|