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

#include <GammaRayTelAnalysis.hh>

Public Member Functions

virtual ~GammaRayTelAnalysis ()
 
void BeginOfRun ()
 
void EndOfRun ()
 
void EndOfEvent (G4int flag)
 
void Init ()
 
void Finish ()
 
void SetHisto2DMode (G4String str)
 
G4String GetHisto2DMode ()
 
void InsertPositionXZ (double x, double z)
 
void InsertPositionYZ (double y, double z)
 
void InsertEnergy (double en)
 
void InsertHits (int nplane)
 
void setNtuple (float E, float p, float x, float y, float z)
 

Static Public Member Functions

static GammaRayTelAnalysisgetInstance ()
 

Detailed Description

Definition at line 71 of file GammaRayTelAnalysis.hh.

Constructor & Destructor Documentation

GammaRayTelAnalysis::~GammaRayTelAnalysis ( )
virtual

Definition at line 81 of file GammaRayTelAnalysis.cc.

81  {
82  Finish();
83  // Complete clean-up
84  delete G4AnalysisManager::Instance();
85 }

Here is the call graph for this function:

Member Function Documentation

void GammaRayTelAnalysis::BeginOfRun ( )

Definition at line 150 of file GammaRayTelAnalysis.cc.

151 {
152  G4AnalysisManager* man = G4AnalysisManager::Instance();
153 
154  // Open an output file
155 
156  G4cout << "Opening output file " << histoFileName << " ... ";
157  man->OpenFile(histoFileName);
158  man->SetFirstHistoId(1);
159  G4cout << " done" << G4endl;
160 
161 
162  int Nplane = GammaRayTelDetector->GetNbOfTKRLayers();
163  int Nstrip = GammaRayTelDetector->GetNbOfTKRStrips();
164  int Ntile = GammaRayTelDetector->GetNbOfTKRTiles();
165  double sizexy = GammaRayTelDetector->GetTKRSizeXY();
166  double sizez = GammaRayTelDetector->GetTKRSizeZ();
167  int N = Nstrip*Ntile;
168 
169  // Book1D histograms
170  //------------------
171 
172  // 1D histogram that store the energy deposition of the
173  // particle in the last (number 0) TKR X-plane
174  man->CreateH1("1","Edep in the last X plane (keV)", 100, 50, 200);
175 
176  // 1D histogram that store the hits distribution along the TKR X-planes
177  man->CreateH1("2","Hits dist in TKR X planes",Nplane, 0, Nplane-1);
178 
179  // Book 2D histograms
180  //-------------------
181 
182  // 2D histogram that store the position (mm) of the hits (XZ projection)
183 
184  if (histo2DMode == "strip")
185  {
186  man->CreateH2("1","Tracker Hits XZ (strip,plane)",
187  N, 0, N-1,
188  2*Nplane, 0, Nplane-1);
189  }
190  else
191  {
192  man->CreateH2("1","Tracker Hits XZ (x,z) in mm",
193  int(sizexy/5), -sizexy/2, sizexy/2,
194  int(sizez/5), -sizez/2, sizez/2);
195  }
196 
197  // 2D histogram that store the position (mm) of the hits (YZ projection)
198  if (histo2DMode == "strip")
199  {
200  man->CreateH2("2","Tracker Hits YZ (strip,plane)",
201  N, 0, N-1,
202  2*Nplane, 0, Nplane-1);
203  }
204  else
205  {
206  man->CreateH2("2","Tracker Hits YZ (x,z) in mm",
207  int(sizexy/5), -sizexy/2, sizexy/2,
208  int(sizez/5), -sizez/2, sizez/2);
209  }
210 
211 
212  // Book Ntuples (energy / plane/ x / y / z)
213  //------------------------------------------
214  man->CreateNtuple("1","Track ntuple");
215  man->CreateNtupleDColumn("energy");
216  man->CreateNtupleDColumn("plane"); // can I use Int values?
217  man->CreateNtupleDColumn("x"); // can I use Int values?
218  man->CreateNtupleDColumn("y"); // can I use Int values?
219  man->CreateNtupleDColumn("z"); // can I use Int values?
220  man->FinishNtuple();
221 
222 }
G4bool SetFirstHistoId(G4int firstId)
G4int CreateH1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
G4int CreateNtuple(const G4String &name, const G4String &title)
G4bool OpenFile(const G4String &fileName="")
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
**D E S C R I P T I O N
Definition: HEPEvtcom.cc:77
G4int CreateNtupleDColumn(const G4String &name)
G4int CreateH2(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")

Here is the call graph for this function:

Here is the caller graph for this function:

void GammaRayTelAnalysis::EndOfEvent ( G4int  flag)

Definition at line 239 of file GammaRayTelAnalysis.cc.

240 {;}

Here is the caller graph for this function:

void GammaRayTelAnalysis::EndOfRun ( )

Definition at line 229 of file GammaRayTelAnalysis.cc.

230 {
231  //Save histograms
232  G4AnalysisManager* man = G4AnalysisManager::Instance();
233  man->Write();
234  man->CloseFile();
235 }

Here is the call graph for this function:

Here is the caller graph for this function:

void GammaRayTelAnalysis::Finish ( )

Definition at line 91 of file GammaRayTelAnalysis.cc.

92 {
93  delete analysisMessenger;
94  analysisMessenger = 0;
95 }

Here is the caller graph for this function:

G4String GammaRayTelAnalysis::GetHisto2DMode ( )
inline

Definition at line 88 of file GammaRayTelAnalysis.hh.

88 {return histo2DMode;};

Here is the caller graph for this function:

GammaRayTelAnalysis * GammaRayTelAnalysis::getInstance ( )
static

Definition at line 97 of file GammaRayTelAnalysis.cc.

98 {
99  if (instance == 0) instance = new GammaRayTelAnalysis();
100  return instance;
101 }

Here is the caller graph for this function:

void GammaRayTelAnalysis::Init ( )

Definition at line 88 of file GammaRayTelAnalysis.cc.

89 {;}
void GammaRayTelAnalysis::InsertEnergy ( double  en)

Definition at line 118 of file GammaRayTelAnalysis.cc.

119 {
120  G4AnalysisManager* man = G4AnalysisManager::Instance();
121  man->FillH1(1,en);
122 }
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)

Here is the call graph for this function:

Here is the caller graph for this function:

void GammaRayTelAnalysis::InsertHits ( int  nplane)

Definition at line 125 of file GammaRayTelAnalysis.cc.

126 {
127  G4AnalysisManager* man = G4AnalysisManager::Instance();
128  man->FillH1(2,nplane);
129 }
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)

Here is the call graph for this function:

Here is the caller graph for this function:

void GammaRayTelAnalysis::InsertPositionXZ ( double  x,
double  z 
)

Definition at line 104 of file GammaRayTelAnalysis.cc.

105 {
106  G4AnalysisManager* man = G4AnalysisManager::Instance();
107  man->FillH2(1,x,z);
108 }
tuple x
Definition: test.py:50
G4bool FillH2(G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0)
tuple z
Definition: test.py:28

Here is the call graph for this function:

Here is the caller graph for this function:

void GammaRayTelAnalysis::InsertPositionYZ ( double  y,
double  z 
)

Definition at line 111 of file GammaRayTelAnalysis.cc.

112 {
113  G4AnalysisManager* man = G4AnalysisManager::Instance();
114  man->FillH2(2,y,z);
115 }
G4bool FillH2(G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0)
tuple z
Definition: test.py:28

Here is the call graph for this function:

Here is the caller graph for this function:

void GammaRayTelAnalysis::SetHisto2DMode ( G4String  str)
inline

Definition at line 87 of file GammaRayTelAnalysis.hh.

87 {histo2DMode = str;};

Here is the caller graph for this function:

void GammaRayTelAnalysis::setNtuple ( float  E,
float  p,
float  x,
float  y,
float  z 
)

Definition at line 131 of file GammaRayTelAnalysis.cc.

133 {
134  G4AnalysisManager* man = G4AnalysisManager::Instance();
135  man->FillNtupleDColumn(0,E);
136  man->FillNtupleDColumn(1,p);
137  man->FillNtupleDColumn(2,x);
138  man->FillNtupleDColumn(3,y);
139  man->FillNtupleDColumn(4,z);
140  man->AddNtupleRow();
141 }
const char * p
Definition: xmltok.h:285
tuple x
Definition: test.py:50
G4bool FillNtupleDColumn(G4int id, G4double value)
tuple z
Definition: test.py:28

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: