Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
B03RunAction Class Reference

#include <B03RunAction.hh>

Inheritance diagram for B03RunAction:
Collaboration diagram for B03RunAction:

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)
 
- Public Member Functions inherited from G4UserRunAction
 G4UserRunAction ()
 
virtual ~G4UserRunAction ()
 
virtual void SetMaster (G4bool val=true)
 
G4bool IsMaster () const
 

Additional Inherited Members

- Protected Attributes inherited from G4UserRunAction
G4bool isMaster
 

Detailed Description

Definition at line 49 of file B03RunAction.hh.

Constructor & Destructor Documentation

B03RunAction::B03RunAction ( )

Definition at line 52 of file B03RunAction.cc.

52  :
54  // fFieldName(15),
55  fFieldValue(14)
56 {
57  // - Prepare data member for B03Run.
58  // vector represents a list of MultiFunctionalDetector names.
59  fSDName.push_back(G4String("ConcreteSD"));
60 }
B03RunAction::~B03RunAction ( )
virtual

Definition at line 65 of file B03RunAction.cc.

66 {
67  fSDName.clear();
68 }

Member Function Documentation

void B03RunAction::BeginOfRunAction ( const G4Run aRun)
virtual

Reimplemented from G4UserRunAction.

Definition at line 82 of file B03RunAction.cc.

83 {
84  G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
85 }
G4GLOB_DLL std::ostream G4cout
G4int GetRunID() const
Definition: G4Run.hh:76
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void B03RunAction::EndOfRunAction ( const G4Run aRun)
virtual

Reimplemented from G4UserRunAction.

Definition at line 89 of file B03RunAction.cc.

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

Here is the call graph for this function:

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

Definition at line 249 of file B03RunAction.cc.

251 {
252  std::string fname("");
253  G4int k = n - name.size();
254  if (k > 0) {
255  if (back) {
256  fname = name;
257  fname += std::string(k,c);
258  }
259  else {
260  fname = std::string(k,c);
261  fname += name;
262  }
263  }
264  else {
265  fname = name;
266  }
267  return fname;
268 }
const XML_Char * name
Definition: expat.h:151
int G4int
Definition: G4Types.hh:78
const G4int n
string fname
Definition: test.py:308
tuple c
Definition: test.py:13
G4Run * B03RunAction::GenerateRun ( void  )
virtual

Reimplemented from G4UserRunAction.

Definition at line 72 of file B03RunAction.cc.

73 {
74  // Generate new RUN object, which is specially
75  // dedicated for MultiFunctionalDetector scheme.
76  // Detail description can be found in B03Run.hh/cc.
77  return new B03Run(fSDName);
78 }
Definition: B03Run.hh:50
void B03RunAction::PrintHeader ( std::ostream *  out)

Definition at line 214 of file B03RunAction.cc.

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

Here is the caller graph for this function:


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