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

Alternative here is a XML file. More...

#include <CCalAnalysis.hh>

Public Member Functions

virtual ~CCalAnalysis ()
 
void BeginOfRun (G4int n)
 
void EndOfRun (G4int n)
 
void EndOfEvent (G4int flag)
 
void Init ()
 
void Finish ()
 
int maxbin ()
 
void InsertEnergyHcal (float *)
 
void InsertEnergyEcal (float *)
 
void InsertEnergy (float v)
 
void InsertLateralProfile (float *)
 
void InsertTime (float *)
 
void InsertTimeProfile (int, double, double)
 
void setNtuple (float *hcalE, float *ecalE, float elab, float x, float y, float z, float edep, float edec, float edhc)
 

Static Public Member Functions

static CCalAnalysisgetInstance ()
 

Detailed Description

Alternative here is a XML file.

Defines the format which is used for the output file default is a ROOT file. Comment the g4root and un-comment one of the others, to change the output format

Definition at line 44 of file CCalAnalysis.hh.

Constructor & Destructor Documentation

CCalAnalysis::~CCalAnalysis ( )
virtual

Definition at line 140 of file CCalAnalysis.cc.

140  {
141  Finish();
142  delete G4AnalysisManager::Instance();
143 }

Here is the call graph for this function:

Member Function Documentation

void CCalAnalysis::BeginOfRun ( G4int  n)

Definition at line 312 of file CCalAnalysis.cc.

313 {
314  G4AnalysisManager* man = G4AnalysisManager::Instance();
315  for (int i=0; i<numberOfTimeSlices; i++){
316  man->GetH1(timeHist+1)->reset();
317  }
318 }
tools::histo::h1d * GetH1(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const

Here is the call graph for this function:

Here is the caller graph for this function:

void CCalAnalysis::EndOfEvent ( G4int  flag)

Definition at line 333 of file CCalAnalysis.cc.

333  {
334  // The plotter is updated only if there is some
335  // hits in the event
336  if (!flag) return;
337 }

Here is the caller graph for this function:

void CCalAnalysis::EndOfRun ( G4int  n)

Definition at line 323 of file CCalAnalysis.cc.

324 {
325  // Save histograms
326  G4AnalysisManager* man = G4AnalysisManager::Instance();
327  man->Write();
328  man->CloseFile();
329 }

Here is the call graph for this function:

Here is the caller graph for this function:

void CCalAnalysis::Finish ( )

Definition at line 149 of file CCalAnalysis.cc.

150 {;}

Here is the caller graph for this function:

CCalAnalysis * CCalAnalysis::getInstance ( )
static

Definition at line 152 of file CCalAnalysis.cc.

152  {
153  if (instance == 0) instance = new CCalAnalysis();
154  return instance;
155 }
Alternative here is a XML file.
Definition: CCalAnalysis.hh:44
static MCTruthManager * instance

Here is the caller graph for this function:

void CCalAnalysis::Init ( )

Definition at line 146 of file CCalAnalysis.cc.

146  {
147 }
void CCalAnalysis::InsertEnergy ( float  v)

Definition at line 225 of file CCalAnalysis.cc.

226 {
227 
228  G4double x = v;
229  G4AnalysisManager::Instance()->FillH1(energy,x);
230  if (fVerbosity)
231  G4cout << "CCalAnalysis::InsertEnergy: Fill Total energy Hcal histo with "
232  << x << G4endl;
233 }
tuple x
Definition: test.py:50
G4GLOB_DLL std::ostream G4cout
tuple v
Definition: test.py:18
G4double energy(const ThreeVector &p, const G4double m)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

void CCalAnalysis::InsertEnergyEcal ( float *  v)

Definition at line 181 of file CCalAnalysis.cc.

182 {
183  G4AnalysisManager* man = G4AnalysisManager::Instance();
184 
185  G4double totalFilledEnergyEcal = 0.0;
186 
187  for (G4int i=0; i<49; i++) {
188  G4double x = v[i];
189  man->FillH1(ecalE+i,x);
190  if (fVerbosity)
191  {
192  G4cout << "Fill Ecal histo " << i << " with " << x << G4endl;
193  totalFilledEnergyEcal += x;
194  }
195  }
196  if (fVerbosity)
197  G4cout <<
198  "CCalAnalysis::InsertEnergyEcal: Total filled Energy Ecal histo "
199  << totalFilledEnergyEcal << G4endl;
200 }
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
tuple v
Definition: test.py:18
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void CCalAnalysis::InsertEnergyHcal ( float *  v)

Definition at line 159 of file CCalAnalysis.cc.

160 {
161  G4AnalysisManager* man = G4AnalysisManager::Instance();
162  G4double totalFilledEnergyHcal = 0.0;
163  for (int i=0; i<28; i++) {
164  G4double x = v[i];
165  man->FillH1(hcalE+i,x);
166  if (fVerbosity)
167  {
168  G4cout << "Fill Hcal histo " << i << " with " << x << G4endl;
169  totalFilledEnergyHcal += x;
170  }
171  }
172 
173  if (fVerbosity)
174  G4cout <<
175  "CCalAnalysis::InsertEnergyHcal: Total filled Energy Hcal histo "
176  << totalFilledEnergyHcal << G4endl;
177 }
tuple x
Definition: test.py:50
G4GLOB_DLL std::ostream G4cout
tuple v
Definition: test.py:18
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void CCalAnalysis::InsertLateralProfile ( float *  v)

Definition at line 204 of file CCalAnalysis.cc.

205 {
206  G4AnalysisManager* man = G4AnalysisManager::Instance();
207  G4double totalFilledProfileHcal = 0.0;
208 
209  for (G4int i=0; i<70; i++) {
210  G4double x = v[i];
211  man->FillH1(lateralProfile+1,x);
212  if (fVerbosity)
213  {
214  G4cout << "Fill Profile Hcal histo " << i << " with " << x << G4endl;
215  totalFilledProfileHcal += x;
216  }
217  }
218  if (fVerbosity)
219  G4cout << "CCalAnalysis::InsertLateralProfile: Total filled Profile Hcal"
220  << " histo " << totalFilledProfileHcal << G4endl;
221 }
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
tuple v
Definition: test.py:18
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void CCalAnalysis::InsertTime ( float *  v)

Definition at line 237 of file CCalAnalysis.cc.

238 {
239  G4AnalysisManager* man = G4AnalysisManager::Instance();
240 
241  G4double totalFilledTimeProfile = 0.0;
242  for (G4int j=0; j<numberOfTimeSlices; j++)
243  {
244  G4double x = v[j];
245  man->FillH1(timeHist+j,x);
246  if (fVerbosity)
247  {
248  G4cout << "Fill Time slice histo " << j << " with " << x << G4endl;
249  totalFilledTimeProfile += x;
250  }
251 
252  G4double t = j + 0.5;
253  man->FillH1(timeProfile+1,t,x);
254  if (fVerbosity)
255  G4cout << "Fill Time profile histo 1 with " << t << " " << x << G4endl;
256  }
257  if (fVerbosity)
258  G4cout << "CCalAnalysis::InsertTime: Total filled Time profile histo "
259  << totalFilledTimeProfile << G4endl;
260 }
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
tuple v
Definition: test.py:18
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void CCalAnalysis::InsertTimeProfile ( int  hit,
double  time,
double  edep 
)

Definition at line 264 of file CCalAnalysis.cc.

265 {
266  G4AnalysisManager* man = G4AnalysisManager::Instance();
267  man->FillH1(timeProfile,time,edep);
268 
269  if (fVerbosity)
270  G4cout << "CCalAnalysis:: Fill Time Profile with Hit " << hit
271  << " Edeposit " << edep << " Gev at " << time << " ns" << G4endl;
272 }
G4GLOB_DLL std::ostream G4cout
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

int CCalAnalysis::maxbin ( )
inline

Definition at line 56 of file CCalAnalysis.hh.

56 {return numberOfTimeSlices;}
void CCalAnalysis::setNtuple ( float *  hcalE,
float *  ecalE,
float  elab,
float  x,
float  y,
float  z,
float  edep,
float  edec,
float  edhc 
)

Definition at line 276 of file CCalAnalysis.cc.

279 {
280  G4AnalysisManager* man = G4AnalysisManager::Instance();
281  G4int counter=0;
282  for (int i=0; i<28; i++)
283  {
284  man->FillNtupleFColumn(counter,HCalE[i]);
285  counter++;
286  }
287  for (int i=0; i<49; i++)
288  {
289  man->FillNtupleFColumn(counter,ECalE[i]);
290  counter++;
291  }
292  man->FillNtupleFColumn(counter,elab);
293  man->FillNtupleFColumn(counter+1,x);
294  man->FillNtupleFColumn(counter+2,y);
295  man->FillNtupleFColumn(counter+3,z);
296  man->FillNtupleFColumn(counter+4,edep);
297  man->FillNtupleFColumn(counter+5,edec);
298  man->FillNtupleFColumn(counter+6,edhc);
299 
300  man->AddNtupleRow();
301 
302  if (fVerbosity)
303  G4cout << "CCalAnalysis:: Fill Ntuple " << G4endl;
304 }
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
G4bool FillNtupleFColumn(G4int id, G4float value)
G4GLOB_DLL std::ostream G4cout
tuple z
Definition: test.py:28
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:


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