Geant4  10.02.p03
AnalysisManager Class Reference

#include <AnalysisManager.hh>

Collaboration diagram for AnalysisManager:

Public Member Functions

void Score (G4double eDep)
 
 AnalysisManager ()
 
 ~AnalysisManager ()
 
void book ()
 
void SetPrimaryEnergy (G4double energy)
 
void StoreEnergyDeposition (G4double edep)
 
void FillSecondaries (G4int AA, G4double charge, G4double energy)
 
void finish ()
 

Static Public Member Functions

static AnalysisManagerInstance ()
 
static void Destroy ()
 

Protected Member Functions

 AnalysisManager ()
 
virtual ~AnalysisManager ()
 
 AnalysisManager (const AnalysisManager &only)
 
const AnalysisManageroperator= (const AnalysisManager &only)
 

Private Attributes

std::ofstream outFile
 
std::ofstream outFileT
 
G4bool factoryOn
 
G4int fNtColId [MaxNtCol]
 

Static Private Attributes

static AnalysisManagerinstance = 0
 

Detailed Description

Constructor & Destructor Documentation

◆ AnalysisManager() [1/3]

AnalysisManager::AnalysisManager ( )
protected

Definition at line 58 of file eRosita/application/src/AnalysisManager.cc.

59 {
60  outFile.open("TrackerPhotonEnergy.out");
61 // outFileT.open("eTot.out");
62 }
Here is the caller graph for this function:

◆ ~AnalysisManager() [1/2]

AnalysisManager::~AnalysisManager ( )
protectedvirtual

Definition at line 65 of file eRosita/application/src/AnalysisManager.cc.

66 {
67  outFile.close();
68  outFileT.close();
69 }

◆ AnalysisManager() [2/3]

AnalysisManager::AnalysisManager ( const AnalysisManager only)
protected

◆ AnalysisManager() [3/3]

AnalysisManager::AnalysisManager ( )

◆ ~AnalysisManager() [2/2]

AnalysisManager::~AnalysisManager ( )

Member Function Documentation

◆ book()

void AnalysisManager::book ( )

Definition at line 54 of file radioprotection/src/AnalysisManager.cc.

55 {
56  G4AnalysisManager* manager = G4AnalysisManager::Instance();
57 
58  manager->SetVerboseLevel(2);
59 
60  // Create a root file
61  G4String fileName = "radioprotection.root";
62 
63  // Create directories
64  manager->SetNtupleDirectoryName("radioprotection_ntuple");
65 
66 
67  G4bool fileOpen = manager->OpenFile(fileName);
68  if (!fileOpen) {
69  G4cout << "\n---> HistoManager::book(): cannot open "
70  << fileName << G4endl;
71  return;
72  }
73 
74  manager->SetFirstNtupleId(1);
75 
76  //Create Primary Energy Ntuple
77  manager -> CreateNtuple("101", "Primary Energy");
78  fNtColId[0] = manager -> CreateNtupleDColumn("Ek");
79  manager -> FinishNtuple();
80 
81  //Create Energy Deposition within SV Ntuple
82  manager -> CreateNtuple("102", "Edep");
83  fNtColId[1] = manager -> CreateNtupleDColumn("edep");
84  manager -> FinishNtuple();
85 
86  //creating a ntuple, containing the information about secondary particles
87  manager -> CreateNtuple("103", "secondary");
88  fNtColId[2] = manager -> CreateNtupleDColumn("AA");
89  fNtColId[3] = manager -> CreateNtupleDColumn("ZZ");
90  fNtColId[4] = manager -> CreateNtupleDColumn("KE");
91  manager -> FinishNtuple();
92 
93 
94  factoryOn = true;
95 }
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
ExG4HbookAnalysisManager G4AnalysisManager
Definition: g4hbook_defs.hh:66
#define G4endl
Definition: G4ios.hh:61

◆ Destroy()

void AnalysisManager::Destroy ( void  )
static

Definition at line 46 of file eRosita/application/src/AnalysisManager.cc.

47 {
48 
49  // The AnalysisManager instance is deleted if it exists:
50  if (instance != 0)
51  {
52  delete instance;
53  instance = 0;
54  }
55 }
Here is the caller graph for this function:

◆ FillSecondaries()

void AnalysisManager::FillSecondaries ( G4int  AA,
G4double  charge,
G4double  energy 
)

Definition at line 112 of file radioprotection/src/AnalysisManager.cc.

113 {
114 
115  G4AnalysisManager* manager = G4AnalysisManager::Instance();
116  manager -> FillNtupleDColumn(3, fNtColId[2], AA);
117  manager -> FillNtupleDColumn(3, fNtColId[3], charge);
118  manager -> FillNtupleDColumn(3, fNtColId[4], energy);
119  manager -> AddNtupleRow(3);
120 }
double energy
Definition: plottest35.C:25
ExG4HbookAnalysisManager G4AnalysisManager
Definition: g4hbook_defs.hh:66

◆ finish()

void AnalysisManager::finish ( )

Definition at line 122 of file radioprotection/src/AnalysisManager.cc.

123 {
124  if (factoryOn)
125  {
126  G4AnalysisManager* manager = G4AnalysisManager::Instance();
127  manager -> Write();
128  manager -> CloseFile();
129 
130  delete G4AnalysisManager::Instance();
131  factoryOn = false;
132  }
133 }
ExG4HbookAnalysisManager G4AnalysisManager
Definition: g4hbook_defs.hh:66

◆ Instance()

AnalysisManager * AnalysisManager::Instance ( void  )
static

Definition at line 32 of file eRosita/application/src/AnalysisManager.cc.

33 {
34 
35  // A new instance of AnalysisManager is created if it does not exist:
36  if (instance == 0)
37  {
38  instance = new AnalysisManager();
39  }
40 
41  // The instance of AnalysisManager is returned:
42  return instance;
43 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

const AnalysisManager& AnalysisManager::operator= ( const AnalysisManager only)
protected

◆ Score()

void AnalysisManager::Score ( G4double  eDep)

Definition at line 72 of file eRosita/application/src/AnalysisManager.cc.

73 {
74 // outFile << id << " "
75 // << eDep << " "
76 // << x << " "
77 // << y << " "
78 // << z << " "
79 // << std::endl;
80  outFile << eDep << std::endl;
81 }
Here is the caller graph for this function:

◆ SetPrimaryEnergy()

void AnalysisManager::SetPrimaryEnergy ( G4double  energy)

Definition at line 98 of file radioprotection/src/AnalysisManager.cc.

99 {
100  G4AnalysisManager* manager = G4AnalysisManager::Instance();
101  manager -> FillNtupleDColumn(1, fNtColId[0], energy);
102  manager -> AddNtupleRow(1);
103 }
double energy
Definition: plottest35.C:25
ExG4HbookAnalysisManager G4AnalysisManager
Definition: g4hbook_defs.hh:66

◆ StoreEnergyDeposition()

void AnalysisManager::StoreEnergyDeposition ( G4double  edep)

Definition at line 105 of file radioprotection/src/AnalysisManager.cc.

106 {
107  G4AnalysisManager* manager = G4AnalysisManager::Instance();
108  manager -> FillNtupleDColumn(2, fNtColId[1], edep);
109  manager -> AddNtupleRow(2);
110 }
Double_t edep
ExG4HbookAnalysisManager G4AnalysisManager
Definition: g4hbook_defs.hh:66

Member Data Documentation

◆ factoryOn

G4bool AnalysisManager::factoryOn
private

Definition at line 60 of file radioprotection/include/AnalysisManager.hh.

◆ fNtColId

G4int AnalysisManager::fNtColId[MaxNtCol]
private

Definition at line 61 of file radioprotection/include/AnalysisManager.hh.

◆ instance

AnalysisManager * AnalysisManager::instance = 0
staticprivate

◆ outFile

std::ofstream AnalysisManager::outFile
private

◆ outFileT

std::ofstream AnalysisManager::outFileT
private

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