GGS(GenericGEANT4Simulation)Software
2.7.0
Main Page
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Macros
include
montecarlo
useractions
GGSMCTruthAction.h
Go to the documentation of this file.
1
/*
2
* GGSMCTruthAction.h
3
*
4
* Created on: 16 Aug 2011
5
* Author: Nicola Mori
6
*/
7
10
#ifndef GGSMCTRUTHACTION_H_
11
#define GGSMCTRUTHACTION_H_
12
13
// Standard headers
14
#include <map>
15
#include <vector>
16
17
// GGS headers
18
#include "montecarlo/dataobjs/GGSTMCTruthInfo.h"
19
#include "
montecarlo/services/GGSRootFileService.h
"
20
#include "
montecarlo/useractions/GGSUserAction.h
"
21
// messenger
22
class
GGSMCTruthMessenger
;
23
24
// ROOT headers
25
#include "TFile.h"
26
#include "TTree.h"
27
33
class
GGSMCTruthAction
:
public
GGSUserAction
{
34
35
public
:
37
GGSMCTruthAction
();
38
40
~GGSMCTruthAction
();
41
46
void
EndOfEventAction
(
const
G4Event *event);
47
52
void
BeginOfRunAction
(
const
G4Run *run);
53
58
void
EndOfRunAction
(
const
G4Run *run);
59
71
void
SetOutputFileBase
(
const
std::string &outFileBase) { _outBase = outFileBase; }
79
void
SetOutputTreeName
(
const
std::string &outTreeName) { _outTreeName = outTreeName; }
80
81
private
:
82
void
_Convert(
const
G4Event *event,
GGSTMCTruthInfo
*&mcTruth);
83
84
GGSTMCTruthInfo
*_mcTruthInfo;
85
GGSTParticle
*_primaryParticle;
86
87
std::string _outBase;
88
std::string _outTreeName;
89
TFile *_outRootFile;
90
TTree *_outTree;
91
92
GGSMCTruthMessenger
*_messenger;
93
};
94
95
#endif
/* GGSMCTRUTHACTION_H_ */
GGSMCTruthAction::~GGSMCTruthAction
~GGSMCTruthAction()
Destructor.
Definition:
GGSMCTruthAction.cpp:36
GGSMCTruthAction::EndOfRunAction
void EndOfRunAction(const G4Run *run)
Closes the output file for the current run.
Definition:
GGSMCTruthAction.cpp:73
GGSMCTruthAction::SetOutputFileBase
void SetOutputFileBase(const std::string &outFileBase)
Sets the output file base name.
Definition:
GGSMCTruthAction.h:71
GGSMCTruthAction::SetOutputTreeName
void SetOutputTreeName(const std::string &outTreeName)
Sets the output tree name.
Definition:
GGSMCTruthAction.h:79
GGSMCTruthAction::EndOfEventAction
void EndOfEventAction(const G4Event *event)
Fills MC truth informations for current event.
Definition:
GGSMCTruthAction.cpp:45
GGSMCTruthAction::BeginOfRunAction
void BeginOfRunAction(const G4Run *run)
Opens the output file for the current run and prepares the output tree.
Definition:
GGSMCTruthAction.cpp:58
GGSMCTruthAction::GGSMCTruthAction
GGSMCTruthAction()
Constructor.
Definition:
GGSMCTruthAction.cpp:27
GGSRootFileService.h
GGSTParticle
Class to store G4 particles.
Definition:
GGSTParticle.h:19
GGSUserAction.h
GGSUserAction
Mother class for user actions in GGS.
Definition:
GGSUserAction.h:27
GGSMCTruthAction
Saves MC truth for each event.
Definition:
GGSMCTruthAction.h:33
GGSTMCTruthInfo
A class to store MC truth informations on ROOT files.
Definition:
GGSTMCTruthInfo.h:20
GGSMCTruthMessenger
A control messenger for GGSMCTruthAction.
Definition:
GGSMCTruthMessenger.h:31
Generated on Wed Jul 8 2020 07:29:44 for GGS(GenericGEANT4Simulation)Software by
1.8.5