Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
B03RunAction Class Reference

#include <Doxymodules_biasing.h>

Inheritance diagram for B03RunAction:
G4UserRunAction

Public Member Functions

 B03RunAction ()
 
virtual ~B03RunAction ()
 
virtual G4RunGenerateRun ()
 
virtual void BeginOfRunAction (const G4Run *)
 
virtual void EndOfRunAction (const G4Run *)
 
void PrintHeader (std::ostream *out)
 
std::string FillString (const std::string &name, char c, G4int n, G4bool back=true)
 

Private Attributes

std::vector< G4StringfSDName
 
G4int fFieldValue
 

Detailed Description

Definition at line 55 of file Doxymodules_biasing.h.

Constructor & Destructor Documentation

◆ B03RunAction()

B03RunAction::B03RunAction ( )

Definition at line 51 of file B03RunAction.cc.

51 :
53 // fFieldName(15),
54 fFieldValue(14)
55{
56 // - Prepare data member for B03Run.
57 // vector represents a list of MultiFunctionalDetector names.
58 fSDName.push_back(G4String("ConcreteSD"));
59}
std::vector< G4String > fSDName

◆ ~B03RunAction()

B03RunAction::~B03RunAction ( )
virtual

Definition at line 64 of file B03RunAction.cc.

65{
66 fSDName.clear();
67}

Member Function Documentation

◆ GenerateRun()

G4Run * B03RunAction::GenerateRun ( )
virtual

Definition at line 71 of file B03RunAction.cc.

72{
73 // Generate new RUN object, which is specially
74 // dedicated for MultiFunctionalDetector scheme.
75 // Detail description can be found in B03Run.hh/cc.
76 return new B03Run(fSDName);
77}

◆ BeginOfRunAction()

void B03RunAction::BeginOfRunAction ( const G4Run aRun)
virtual

Definition at line 81 of file B03RunAction.cc.

82{
83 G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
84}

◆ EndOfRunAction()

void B03RunAction::EndOfRunAction ( const G4Run aRun)
virtual

Definition at line 88 of file B03RunAction.cc.

89{
90 G4cout << " ###### EndOfRunAction " <<G4endl;
91 //- B03Run object.
92 B03Run* b02Run = (B03Run*)aRun;
93 //--- Dump all socred quantities involved in B03Run.
94 // b02Run->DumpAllScorer();
95 //---
96 G4RunManager* mgr = G4RunManager::GetRunManager();
97 //
98
99 for ( G4int i = 0; i < (G4int)fSDName.size(); i++ ){
100 const G4VUserDetectorConstruction* vdet =
101 mgr->GetUserDetectorConstruction();
102 // B03DetectorConstruction* bdet = (B03DetectorConstruction*)vdet;
105 //
106
107 //---------------------------------------------
108 // Dump accumulated quantities for this RUN.
109 // (Display only central region of x-y plane)
110 // 0 ConcreteSD/Collisions
111 // 1 ConcreteSD/CollWeight
112 // 2 ConcreteSD/Population
113 // 3 ConcreteSD/TrackEnter
114 // 4 ConcreteSD/SL
115 // 5 ConcreteSD/SLW
116 // 6 ConcreteSD/SLWE
117 // 7 ConcreteSD/SLW_V
118 // 8 ConcreteSD/SLWE_V
119 //---------------------------------------------
120 G4THitsMap<G4double>* Collisions =
121 b02Run->GetHitsMap(fSDName[i]+"/Collisions");
122 G4THitsMap<G4double>* CollWeight =
123 b02Run->GetHitsMap(fSDName[i]+"/CollWeight");
124 G4THitsMap<G4double>* Population =
125 b02Run->GetHitsMap(fSDName[i]+"/Population");
126 G4THitsMap<G4double>* TrackEnter =
127 b02Run->GetHitsMap(fSDName[i]+"/TrackEnter");
129 b02Run->GetHitsMap(fSDName[i]+"/SL");
131 b02Run->GetHitsMap(fSDName[i]+"/SLW");
132 G4THitsMap<G4double>* SLWE =
133 b02Run->GetHitsMap(fSDName[i]+"/SLWE");
134 G4THitsMap<G4double>* SLW_V =
135 b02Run->GetHitsMap(fSDName[i]+"/SLW_V");
136 G4THitsMap<G4double>* SLWE_V =
137 b02Run->GetHitsMap(fSDName[i]+"/SLWE_V");
138
139 if (IsMaster())
140 {
141 G4cout <<
142 "\n--------------------End of Global Run-----------------------" <<
143 G4endl;
144 G4cout <<
145 " Number of event processed : "<< aRun->GetNumberOfEvent() << G4endl;
146 }
147 else
148 {
149 G4cout <<
150 "\n--------------------End of Local Run------------------------" <<
151 G4endl;
152 G4cout << " Number of event processed : "<< aRun->GetNumberOfEvent() <<
153 G4endl;
154 }
155
156 G4cout << "============================================================="
157 <<G4endl;
158 G4cout << "============================================================="
159 <<G4endl;
160
161 std::ostream *myout = &G4cout;
162 PrintHeader(myout);
163
164 for ( G4int iz = 0; iz < 20; iz++){
165 G4double* SumCollisions = (*Collisions)[iz];
166 G4double* SumCollWeight = (*CollWeight)[iz];
167 G4double* Populations = (*Population)[iz];
168 G4double* TrackEnters = (*TrackEnter)[iz];
169 G4double* SLs = (*SL)[iz];
170 G4double* SLWs = (*SLW)[iz];
171 G4double* SLWEs = (*SLWE)[iz];
172 G4double* SLW_Vs = (*SLW_V)[iz];
173 G4double* SLWE_Vs = (*SLWE_V)[iz];
174 if ( !SumCollisions ) SumCollisions = new G4double(0.0);
175 if ( !SumCollWeight ) SumCollWeight = new G4double(0.0);
176 if ( !Populations ) Populations = new G4double(0.0);
177 if ( !TrackEnters ) { G4cout << " NO TRACKS - WHY? " << G4endl;
178 TrackEnters = new G4double(0.0);}
179 if ( !SLs ) SLs = new G4double(0.0);
180 if ( !SLWs ) SLWs = new G4double(0.0);
181 if ( !SLWEs ) SLWEs = new G4double(0.0);
182 if ( !SLW_Vs ) SLW_Vs = new G4double(0.0);
183 if ( !SLWE_Vs ) SLWE_Vs = new G4double(0.0);
184 G4double NumWeightedEnergy =0.0;
185 G4double FluxWeightedEnergy=0.0;
186 G4double AverageTrackWeight=0.0;
187 if ( *SLW_Vs !=0. ) NumWeightedEnergy = (*SLWE_Vs)/(*SLW_Vs);
188 if ( *SLWs !=0. ) FluxWeightedEnergy = (*SLWEs)/(*SLWs);
189 if ( *SLs !=0. ) AverageTrackWeight = (*SLWs)/(*SLs);
190 G4String cname = bdet->GetCellName(iz);
191 G4cout
192 << std::setw(fFieldValue) << cname << " |"
193 << std::setw(fFieldValue) << (*TrackEnters) << " |"
194 << std::setw(fFieldValue) << (*Populations) << " |"
195 << std::setw(fFieldValue) << (*SumCollisions) << " |"
196 << std::setw(fFieldValue) << (*SumCollWeight) << " |"
197 << std::setw(fFieldValue) << NumWeightedEnergy << " |"
198 << std::setw(fFieldValue) << FluxWeightedEnergy << " |"
199 << std::setw(fFieldValue) << AverageTrackWeight << " |"
200 << std::setw(fFieldValue) << (*SLs) << " |"
201 << std::setw(fFieldValue) << (*SLWs) << " |"
202 << std::setw(fFieldValue) << (*SLW_Vs) << " |"
203 << std::setw(fFieldValue) << (*SLWEs) << " |"
204 << std::setw(fFieldValue) << (*SLWE_Vs) << " |"
205 << G4endl;
206 }
207 G4cout << "============================================="<<G4endl;
208 }
209}
void PrintHeader(std::ostream *out)
G4THitsMap< G4double > * GetHitsMap(G4int i)
Definition B03Run.hh:69

◆ PrintHeader()

void B03RunAction::PrintHeader ( std::ostream *  out)

Definition at line 213 of file B03RunAction.cc.

214{
215 std::vector<G4String> vecScoreName;
216 vecScoreName.push_back("Tr.Entering");
217 vecScoreName.push_back("Population");
218 vecScoreName.push_back("Collisions");
219 vecScoreName.push_back("Coll*WGT");
220 vecScoreName.push_back("NumWGTedE");
221 vecScoreName.push_back("FluxWGTedE");
222 vecScoreName.push_back("Av.Tr.WGT");
223 vecScoreName.push_back("SL");
224 vecScoreName.push_back("SLW");
225 vecScoreName.push_back("SLW_v");
226 vecScoreName.push_back("SLWE");
227 vecScoreName.push_back("SLWE_v");
228
229 // head line
230 //std::string vname = FillString("Volume", ' ', FieldName+1);
231 //*out << vname << '|';
232 std::string vname;
233 *out << std::setw(fFieldValue) << "Volume" << " |";
234 for (std::vector<G4String>::iterator it = vecScoreName.begin();
235 it != vecScoreName.end(); it++) {
236 //vname = FillString((*it),
237// ' ',
238// fFieldValue+1,
239// false);
240// *out << vname << '|';
241 *out << std::setw(fFieldValue) << (*it) << " |";
242 }
243 *out << G4endl;
244}

◆ FillString()

std::string B03RunAction::FillString ( const std::string &  name,
char  c,
G4int  n,
G4bool  back = true 
)

Definition at line 248 of file B03RunAction.cc.

250{
251 std::string fname("");
252 G4int k = n - name.size();
253 if (k > 0) {
254 if (back) {
255 fname = name;
256 fname += std::string(k,c);
257 }
258 else {
259 fname = std::string(k,c);
260 fname += name;
261 }
262 }
263 else {
264 fname = name;
265 }
266 return fname;
267}

Member Data Documentation

◆ fSDName

std::vector<G4String> B03RunAction::fSDName
private

Definition at line 69 of file B03RunAction.hh.

◆ fFieldValue

G4int B03RunAction::fFieldValue
private

Definition at line 71 of file B03RunAction.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration