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

Uncomment #include to switch to ROOT or XML output file. More...

#include <PurgMagAnalysisManager.hh>

Public Member Functions

 ~PurgMagAnalysisManager ()
 
void book ()
 
void finish ()
 
void fill_Tuple_Electrons (G4double, G4double, G4double, G4double, G4double, G4double, G4double)
 
void fill_Tuple_Gamma (G4double, G4double, G4double, G4double, G4double, G4double, G4double)
 
void fill_Tuple_Positrons (G4double, G4double, G4double, G4double, G4double, G4double, G4double)
 

Static Public Member Functions

static PurgMagAnalysisManagergetInstance ()
 

Detailed Description

Uncomment #include to switch to ROOT or XML output file.

Default here is a CSV file

Definition at line 55 of file PurgMagAnalysisManager.hh.

Constructor & Destructor Documentation

PurgMagAnalysisManager::~PurgMagAnalysisManager ( )

Definition at line 51 of file PurgMagAnalysisManager.cc.

52 {;}

Member Function Documentation

void PurgMagAnalysisManager::book ( )

Definition at line 66 of file PurgMagAnalysisManager.cc.

67 {
68  // Get/create analysis manager
69  G4AnalysisManager* man = G4AnalysisManager::Instance();
70 
71  // Open an output file
72  man->OpenFile("purgmag");
73  man->SetFirstNtupleId(1);
74 
75  // Create 1st ntuple (id = 1)
76  //
77  man->CreateNtuple("n101", "Electron");
78  man->CreateNtupleDColumn("ex");
79  man->CreateNtupleDColumn("ey");
80  man->CreateNtupleDColumn("ez");
81  man->CreateNtupleDColumn("ee");
82  man->CreateNtupleDColumn("epx");
83  man->CreateNtupleDColumn("epy");
84  man->CreateNtupleDColumn("epz");
85  man->FinishNtuple();
86  G4cout << "Ntuple-1 created" << G4endl;
87 
88  // Create 2nd ntuple (id = 2)
89  //
90  man->CreateNtuple("n102", "Gamma");
91  man->CreateNtupleDColumn("gx");
92  man->CreateNtupleDColumn("gy");
93  man->CreateNtupleDColumn("gz");
94  man->CreateNtupleDColumn("ge");
95  man->CreateNtupleDColumn("gpx");
96  man->CreateNtupleDColumn("gpy");
97  man->CreateNtupleDColumn("gpz");
98  man->FinishNtuple();
99  G4cout << "Ntuple-2 created" << G4endl;
100 
101  // Create 3rd ntuple (id = 3)
102  //
103  man->CreateNtuple("n103", "Positron");
104  man->CreateNtupleDColumn("px");
105  man->CreateNtupleDColumn("py");
106  man->CreateNtupleDColumn("pz");
107  man->CreateNtupleDColumn("pe");
108  man->CreateNtupleDColumn("ppx");
109  man->CreateNtupleDColumn("ppy");
110  man->CreateNtupleDColumn("ppz");
111  man->FinishNtuple();
112  G4cout << "Ntuple-3 created" << G4endl;
113 
114  return;
115 }
G4int CreateNtuple(const G4String &name, const G4String &title)
G4bool OpenFile(const G4String &fileName="")
G4GLOB_DLL std::ostream G4cout
G4bool SetFirstNtupleId(G4int firstId)
#define G4endl
Definition: G4ios.hh:61
G4int CreateNtupleDColumn(const G4String &name)

Here is the call graph for this function:

Here is the caller graph for this function:

void PurgMagAnalysisManager::fill_Tuple_Electrons ( G4double  ex,
G4double  ey,
G4double  ez,
G4double  ee,
G4double  epx,
G4double  epy,
G4double  epz 
)

Definition at line 121 of file PurgMagAnalysisManager.cc.

124 {
125  // Get/create analysis manager
126  G4AnalysisManager* man = G4AnalysisManager::Instance();
127 
128  // Fill 1st ntuple ( id = 1)
129  man->FillNtupleDColumn(1,0, ex);
130  man->FillNtupleDColumn(1,1, ey);
131  man->FillNtupleDColumn(1,2, ez);
132  man->FillNtupleDColumn(1,3, ee);
133  man->FillNtupleDColumn(1,4, epx);
134  man->FillNtupleDColumn(1,5, epy);
135  man->FillNtupleDColumn(1,6, epz);
136  man->AddNtupleRow(1);
137 }
G4bool FillNtupleDColumn(G4int id, G4double value)

Here is the call graph for this function:

Here is the caller graph for this function:

void PurgMagAnalysisManager::fill_Tuple_Gamma ( G4double  gx,
G4double  gy,
G4double  gz,
G4double  ge,
G4double  gpx,
G4double  gpy,
G4double  gpz 
)

Definition at line 142 of file PurgMagAnalysisManager.cc.

145 {
146  // Get/create analysis manager
147  G4AnalysisManager* man = G4AnalysisManager::Instance();
148 
149  // Fill 2nd ntuple ( id = 2)
150  man->FillNtupleDColumn(2,0, gx);
151  man->FillNtupleDColumn(2,1, gy);
152  man->FillNtupleDColumn(2,2, gz);
153  man->FillNtupleDColumn(2,3, ge);
154  man->FillNtupleDColumn(2,4, gpx);
155  man->FillNtupleDColumn(2,5, gpy);
156  man->FillNtupleDColumn(2,6, gpz);
157  man->AddNtupleRow(2);
158 
159 }
G4bool FillNtupleDColumn(G4int id, G4double value)

Here is the call graph for this function:

Here is the caller graph for this function:

void PurgMagAnalysisManager::fill_Tuple_Positrons ( G4double  px,
G4double  py,
G4double  pz,
G4double  pe,
G4double  ppx,
G4double  ppy,
G4double  ppz 
)

Definition at line 164 of file PurgMagAnalysisManager.cc.

167 {
168  // Get/create analysis manager
169  G4AnalysisManager* man = G4AnalysisManager::Instance();
170 
171  // Fill 3rd ntuple ( id = 3)
172  man->FillNtupleDColumn(3,0, px);
173  man->FillNtupleDColumn(3,1, py);
174  man->FillNtupleDColumn(3,2, pz);
175  man->FillNtupleDColumn(3,3, pe);
176  man->FillNtupleDColumn(3,4, ppx);
177  man->FillNtupleDColumn(3,5, ppy);
178  man->FillNtupleDColumn(3,6, ppz);
179  man->AddNtupleRow(3);
180 
181 }
G4bool FillNtupleDColumn(G4int id, G4double value)

Here is the call graph for this function:

Here is the caller graph for this function:

void PurgMagAnalysisManager::finish ( )

Definition at line 184 of file PurgMagAnalysisManager.cc.

185 {
186  // Save histograms
187  G4AnalysisManager* man = G4AnalysisManager::Instance();
188  man->Write();
189  man->CloseFile();
190  // Complete clean-up
191  delete G4AnalysisManager::Instance();
192 }

Here is the call graph for this function:

Here is the caller graph for this function:

PurgMagAnalysisManager * PurgMagAnalysisManager::getInstance ( )
static

Definition at line 57 of file PurgMagAnalysisManager.cc.

58 {
59  if (instance == 0) instance = new PurgMagAnalysisManager;
60  return instance;
61 }
Uncomment #include to switch to ROOT or XML output file.

Here is the caller graph for this function:


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