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

#include <Doxymodules_biasing.h>

Inheritance diagram for B01RunAction:
G4UserRunAction

Public Member Functions

 B01RunAction ()
 
virtual ~B01RunAction ()
 
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 21 of file Doxymodules_biasing.h.

Constructor & Destructor Documentation

◆ B01RunAction()

B01RunAction::B01RunAction ( )

Definition at line 50 of file B01RunAction.cc.

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

◆ ~B01RunAction()

B01RunAction::~B01RunAction ( )
virtual

Definition at line 63 of file B01RunAction.cc.

64{
65 fSDName.clear();
66}

Member Function Documentation

◆ GenerateRun()

G4Run * B01RunAction::GenerateRun ( )
virtual

Definition at line 70 of file B01RunAction.cc.

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

◆ BeginOfRunAction()

void B01RunAction::BeginOfRunAction ( const G4Run aRun)
virtual

Definition at line 80 of file B01RunAction.cc.

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

◆ EndOfRunAction()

void B01RunAction::EndOfRunAction ( const G4Run aRun)
virtual

Definition at line 87 of file B01RunAction.cc.

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

◆ PrintHeader()

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

Definition at line 204 of file B01RunAction.cc.

205{
206 std::vector<G4String> vecScoreName;
207 vecScoreName.push_back("Tr.Entering");
208 vecScoreName.push_back("Population");
209 vecScoreName.push_back("Collisions");
210 vecScoreName.push_back("Coll*WGT");
211 vecScoreName.push_back("NumWGTedE");
212 vecScoreName.push_back("FluxWGTedE");
213 vecScoreName.push_back("Av.Tr.WGT");
214 vecScoreName.push_back("SL");
215 vecScoreName.push_back("SLW");
216 vecScoreName.push_back("SLW_v");
217 vecScoreName.push_back("SLWE");
218 vecScoreName.push_back("SLWE_v");
219
220 // head line
221// std::string vname;
222// vname = FillString("Volume", ' ', fFieldName+1);
223 //*out << vname << '|';
224 *out << std::setw(fFieldValue) << "Volume" << " |";
225 for (std::vector<G4String>::iterator it = vecScoreName.begin();
226 it != vecScoreName.end(); it++) {
227// vname = FillString((*it),
228// ' ',
229// fFieldValue+1,
230// false);
231// *out << vname << '|';
232 *out << std::setw(fFieldValue) << (*it) << " |";
233 }
234 *out << G4endl;
235}

◆ FillString()

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

Definition at line 239 of file B01RunAction.cc.

241{
242 std::string fname("");
243 G4int k = n - name.size();
244 if (k > 0) {
245 if (back) {
246 fname = name;
247 fname += std::string(k,c);
248 }
249 else {
250 fname = std::string(k,c);
251 fname += name;
252 }
253 }
254 else {
255 fname = name;
256 }
257 return fname;
258}

Member Data Documentation

◆ fSDName

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

Definition at line 69 of file B01RunAction.hh.

◆ fFieldValue

G4int B01RunAction::fFieldValue
private

Definition at line 71 of file B01RunAction.hh.


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

Applications | User Support | Publications | Collaboration