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

#include <B02RunAction.hh>

Inheritance diagram for B02RunAction:
Collaboration diagram for B02RunAction:

Public Member Functions

 B02RunAction ()
 
virtual ~B02RunAction ()
 
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 B02RunAction.hh.

Constructor & Destructor Documentation

B02RunAction::B02RunAction ( )

Definition at line 52 of file B02RunAction.cc.

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

Definition at line 65 of file B02RunAction.cc.

66 {
67  fSDName.clear();
68 }

Member Function Documentation

void B02RunAction::BeginOfRunAction ( const G4Run aRun)
virtual

Reimplemented from G4UserRunAction.

Definition at line 82 of file B02RunAction.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 B02RunAction::EndOfRunAction ( const G4Run aRun)
virtual

Reimplemented from G4UserRunAction.

Definition at line 89 of file B02RunAction.cc.

90 {
91  G4cout << " ###### EndOfRunAction " <<G4endl;
92  //- B02Run object.
93  B02Run* b02Run = (B02Run*)aRun;
94  //--- Dump all socred quantities involved in B02Run.
95  // re02Run->DumpAllScorer();
96  //---
98  //
99 
100  for ( G4int i = 0; i < (G4int)fSDName.size(); i++ ){
101  const G4VUserDetectorConstruction* 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");
128  G4THitsMap<G4double>* SL = b02Run->GetHitsMap(fSDName[i]+"/SL");
129  G4THitsMap<G4double>* SLW = b02Run->GetHitsMap(fSDName[i]+"/SLW");
130  G4THitsMap<G4double>* SLWE = b02Run->GetHitsMap(fSDName[i]+"/SLWE");
131  G4THitsMap<G4double>* SLW_V = b02Run->GetHitsMap(fSDName[i]+"/SLW_V");
132  G4THitsMap<G4double>* SLWE_V = b02Run->GetHitsMap(fSDName[i]+"/SLWE_V");
133 
134  if (IsMaster())
135  {
136  G4cout <<
137  "\n--------------------End of Global Run-----------------------" <<
138  G4endl;
139  G4cout <<
140  " Number of event processed : "<< aRun->GetNumberOfEvent() << G4endl;
141  }
142  else
143  {
144  G4cout <<
145  "\n--------------------End of Local Run------------------------" <<
146  G4endl;
147  G4cout <<
148  " Number of event processed : "<< aRun->GetNumberOfEvent() << G4endl;
149  }
150 
151  G4cout << "============================================================="
152  <<G4endl;
153  G4cout << "============================================================="
154  <<G4endl;
155 
156  std::ostream *myout = &G4cout;
157  PrintHeader(myout);
158 
159  for ( G4int iz = 0; iz < 20; iz++){
160  G4double* SumCollisions = (*Collisions)[iz];
161  G4double* SumCollWeight = (*CollWeight)[iz];
162  G4double* Populations = (*Population)[iz];
163  G4double* TrackEnters = (*TrackEnter)[iz];
164  G4double* SLs = (*SL)[iz];
165  G4double* SLWs = (*SLW)[iz];
166  G4double* SLWEs = (*SLWE)[iz];
167  G4double* SLW_Vs = (*SLW_V)[iz];
168  G4double* SLWE_Vs = (*SLWE_V)[iz];
169  if ( !SumCollisions ) SumCollisions = new G4double(0.0);
170  if ( !SumCollWeight ) SumCollWeight = new G4double(0.0);
171  if ( !Populations ) Populations = new G4double(0.0);
172  if ( !TrackEnters ) TrackEnters = new G4double(0.0);
173  if ( !SLs ) SLs = new G4double(0.0);
174  if ( !SLWs ) SLWs = new G4double(0.0);
175  if ( !SLWEs ) SLWEs = new G4double(0.0);
176  if ( !SLW_Vs ) SLW_Vs = new G4double(0.0);
177  if ( !SLWE_Vs ) SLWE_Vs = new G4double(0.0);
178  G4double NumWeightedEnergy =0.0;
179  G4double FluxWeightedEnergy=0.0;
180  G4double AverageTrackWeight=0.0;
181  if ( *SLW_Vs !=0. ) NumWeightedEnergy = (*SLWE_Vs)/(*SLW_Vs);
182  if ( *SLWs !=0. ) FluxWeightedEnergy = (*SLWEs)/(*SLWs);
183  if ( *SLs !=0. ) AverageTrackWeight = (*SLWs)/(*SLs);
184  G4String cname = bdet->GetCellName(iz);
185  G4cout
186  << std::setw(fFieldValue) << cname << " |"
187  << std::setw(fFieldValue) << (*TrackEnters) << " |"
188  << std::setw(fFieldValue) << (*Populations) << " |"
189  << std::setw(fFieldValue) << (*SumCollisions) << " |"
190  << std::setw(fFieldValue) << (*SumCollWeight) << " |"
191  << std::setw(fFieldValue) << NumWeightedEnergy << " |"
192  << std::setw(fFieldValue) << FluxWeightedEnergy << " |"
193  << std::setw(fFieldValue) << AverageTrackWeight << " |"
194  << std::setw(fFieldValue) << (*SLs) << " |"
195  << std::setw(fFieldValue) << (*SLWs) << " |"
196  << std::setw(fFieldValue) << (*SLW_Vs) << " |"
197  << std::setw(fFieldValue) << (*SLWEs) << " |"
198  << std::setw(fFieldValue) << (*SLWE_Vs) << " |"
199  << G4endl;
200  }
201  G4cout << "============================================="<<G4endl;
202  }
203 }
void PrintHeader(std::ostream *out)
const G4VUserDetectorConstruction * GetUserDetectorConstruction() const
G4THitsMap< G4double > * GetHitsMap(G4int i)
Definition: B02Run.hh:70
Definition: B02Run.hh:50
int G4int
Definition: G4Types.hh:78
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

Here is the call graph for this function:

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

Definition at line 242 of file B02RunAction.cc.

244 {
245  std::string fname("");
246  G4int k = n - name.size();
247  if (k > 0) {
248  if (back) {
249  fname = name;
250  fname += std::string(k,c);
251  }
252  else {
253  fname = std::string(k,c);
254  fname += name;
255  }
256  }
257  else {
258  fname = name;
259  }
260  return fname;
261 }
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 * B02RunAction::GenerateRun ( void  )
virtual

Reimplemented from G4UserRunAction.

Definition at line 72 of file B02RunAction.cc.

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

Definition at line 207 of file B02RunAction.cc.

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