36 #include "RunAction.hh"
38 #include "TrackingAction.hh"
41 #include "Analysis.hh"
43 #include "CommandLineParser.hh"
45 using namespace G4DNAPARSER;
47 void PrintNParticles(std::map<const G4ParticleDefinition*, int>& container);
52 fpTrackingAction(0), fInitialized(0), fDebug(false)
109 G4cout <<
"===================================" <<
G4endl;
111 G4cout <<
"================ RunAction::BeginMaster" <<
G4endl;
113 G4cout <<
"===================================" <<
G4endl;
123 G4cout <<
"===================================" <<
G4endl;
124 G4cout <<
"================ RunAction::BeginWorker" <<
G4endl;
126 G4cout <<
"===================================" <<
G4endl;
145 G4cout <<
"===================================" <<
G4endl;
146 G4cout <<
"================ RunAction::EndWorker" <<
G4endl;
148 G4cout <<
"===================================" <<
G4endl;
152 if ( nofEvents == 0 )
156 G4cout <<
"================ NO EVENTS TREATED IN THIS RUN ==> Exit"
170 delete G4AnalysisManager::Instance();
175 std::map<const G4ParticleDefinition*, int>&
178 G4cout <<
"Number and type of particles created outside region \"Target\" :"
185 std::map<const G4ParticleDefinition*, int>&
188 G4cout <<
"Number and type of particles created in region \"Target\" :"
203 GetUserTrackingAction();
208 exDescrption <<
"fpTrackingAction is a null pointer. "
209 "Has it been correctly initialized ?";
232 G4cout <<
"##### Create analysis manager " <<
" " <<
this <<
G4endl;
235 G4cout <<
"Using " << analysisManager->GetType() <<
236 " analysis manager" <<
G4endl;
242 analysisManager->SetVerboseLevel(1);
246 if(command->GetOption().empty() ==
false)
248 fileName = command->GetOption();
252 fileName =
"microdosimetry";
254 analysisManager->OpenFile(fileName);
258 analysisManager->CreateNtuple(
"microdosimetry",
"physics");
259 analysisManager->CreateNtupleDColumn(
"flagParticle");
260 analysisManager->CreateNtupleDColumn(
"flagProcess");
261 analysisManager->CreateNtupleDColumn(
"x");
262 analysisManager->CreateNtupleDColumn(
"y");
263 analysisManager->CreateNtupleDColumn(
"z");
264 analysisManager->CreateNtupleDColumn(
"totalEnergyDeposit");
265 analysisManager->CreateNtupleDColumn(
"stepLength");
266 analysisManager->CreateNtupleDColumn(
"kineticEnergyDifference");
267 analysisManager->CreateNtupleDColumn(
"kineticEnergy");
268 analysisManager->CreateNtupleDColumn(
"cosTheta");
269 analysisManager->CreateNtupleIColumn(
"eventID");
270 analysisManager->CreateNtupleIColumn(
"trackID");
271 analysisManager->CreateNtupleIColumn(
"parentID");
272 analysisManager->CreateNtupleIColumn(
"stepID");
273 analysisManager->FinishNtuple();
291 analysisManager->Write();
292 analysisManager->CloseFile();
296 G4cout <<
"================ ROOT FILES HAVE BEEN WRITTEN"
305 G4cout <<
"================ Run is = "
307 G4cout <<
"================ Run type is = "
309 G4cout <<
"================ Event processed = "
311 G4cout <<
"================ Nevent = "
317 void PrintNParticles(std::map<const G4ParticleDefinition*, int>& container)
319 std::map<const G4ParticleDefinition*, int>::iterator it;
320 for(it = container.begin() ;
321 it != container.end(); it ++)
323 G4cout <<
"N " << it->first->GetParticleName() <<
" : "
static G4RunManager * GetRunManager()
TrackingAction * fpTrackingAction
std::ostringstream G4ExceptionDescription
void EndOfRunAction(const G4Run *)
void EndMaster(const G4Run *)
void PrintRunInfo(const G4Run *run)
std::map< const G4ParticleDefinition *, int > & GetNParticlesCreatedInWorld()
std::map< const G4ParticleDefinition *, int > & GetNParticlesCreatedInTarget()
void BeginOfRunAction(const G4Run *)
G4int GetNumberOfEvent() const
void BeginWorker(const G4Run *)
void BeginMaster(const G4Run *)
static RunInitManager * Instance()
void PrintNParticles(std::map< const G4ParticleDefinition *, int > &container)
G4CsvAnalysisManager G4AnalysisManager
CommandLineParser * parser(0)
G4int GetNumberOfEventToBeProcessed() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Command * GetCommandIfActive(const G4String &marker)
G4GLOB_DLL std::ostream G4cout
void EndWorker(const G4Run *)
RMType GetRunManagerType() const
void InitializeWorker(const G4Run *)