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

#include <AnalysisManager.hh>

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)
 

Detailed Description

Definition at line 34 of file AnalysisManager.hh.

Constructor & Destructor Documentation

AnalysisManager::AnalysisManager ( )
protected

Definition at line 58 of file AnalysisManager.cc.

59 {
60  outFile.open("TrackerPhotonEnergy.out");
61 // outFileT.open("eTot.out");
62 }

Here is the caller graph for this function:

AnalysisManager::~AnalysisManager ( )
protectedvirtual

Definition at line 65 of file AnalysisManager.cc.

66 {
67  outFile.close();
68  outFileT.close();
69 }
AnalysisManager::AnalysisManager ( const AnalysisManager only)
protected
AnalysisManager::AnalysisManager ( )
AnalysisManager::~AnalysisManager ( )

Member Function Documentation

void AnalysisManager::book ( )

Definition at line 54 of file 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
#define G4endl
Definition: G4ios.hh:61
G4CsvAnalysisManager G4AnalysisManager
Definition: g4csv_defs.hh:77
void AnalysisManager::Destroy ( void  )
static

Definition at line 46 of file 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 }
static MCTruthManager * instance

Here is the caller graph for this function:

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

Definition at line 112 of file 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 }
G4double energy(const ThreeVector &p, const G4double m)
G4CsvAnalysisManager G4AnalysisManager
Definition: g4csv_defs.hh:77
void AnalysisManager::finish ( )

Definition at line 122 of file 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 }
G4CsvAnalysisManager G4AnalysisManager
Definition: g4csv_defs.hh:77
AnalysisManager * AnalysisManager::Instance ( void  )
static

Definition at line 32 of file 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 }
static MCTruthManager * instance

Here is the call graph for this function:

Here is the caller graph for this function:

const AnalysisManager& AnalysisManager::operator= ( const AnalysisManager only)
protected
void AnalysisManager::Score ( G4double  eDep)

Definition at line 72 of file 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:

void AnalysisManager::SetPrimaryEnergy ( G4double  energy)

Definition at line 98 of file AnalysisManager.cc.

99 {
100  G4AnalysisManager* manager = G4AnalysisManager::Instance();
101  manager -> FillNtupleDColumn(1, fNtColId[0], energy);
102  manager -> AddNtupleRow(1);
103 }
G4double energy(const ThreeVector &p, const G4double m)
G4CsvAnalysisManager G4AnalysisManager
Definition: g4csv_defs.hh:77
void AnalysisManager::StoreEnergyDeposition ( G4double  edep)

Definition at line 105 of file AnalysisManager.cc.

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

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