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

#include <Analysis.hh>

Public Member Functions

 ~Analysis ()
 
void Update ()
 
void Clear ()
 
void Save (const G4String &fname)
 
void FillIncident (const G4ThreeVector &p)
 
void FillDose (const G4ThreeVector &p, G4double dedx)
 
void ClearIncidentFlag ()
 
 ~Analysis ()
 
void Book ()
 
void EndOfRun ()
 
void Update ()
 
void Clear ()
 
void Save (const G4String &fname)
 
void Close ()
 
void FillIncident (const G4ThreeVector &p)
 
void FillDose (const G4ThreeVector &p, G4double dedx)
 
void ClearIncidentFlag ()
 

Static Public Member Functions

static AnalysisGetAnalysis ()
 
static AnalysisGetAnalysis ()
 

Detailed Description

Definition at line 43 of file Analysis.hh.

Constructor & Destructor Documentation

Analysis::~Analysis ( )

Definition at line 82 of file Analysis.cc.

83 {
84  delete fincident_map;
85  delete fincident_x_hist;
86  delete fdose_map;
87  delete fdose_hist;
88 }
Analysis::~Analysis ( )

Member Function Documentation

void Analysis::Book ( )

Definition at line 65 of file Analysis.cc.

66 {
67  G4AnalysisManager* mgr = G4AnalysisManager::Instance();
68  //mgr->SetVerboseLevel(1);
69  fincident_x_hist = mgr->CreateH1("incident_x", "Incident X", 100, -5 * cm,
70  5 * cm, "cm");
71  fincident_map = mgr->CreateH2("incident_map", "Incident Map", 50, -5 * cm,
72  5 * cm, 50, -5 * cm, 5 * cm, "cm", "cm");
73  fdose_hist
74  = mgr->CreateH1("dose", "Dose distribution", 500, 0, 50 * cm, "cm");
75  fdose_map = mgr->CreateH2("dose_map", "Dose distribution", 500, 0, 50 * cm,
76  200, -10 * cm, 10 * cm, "cm", "cm");
77  fdose_map3d = mgr->CreateH3("dose_map_3d", "Dose distribution", 30, 0,
78  50 * cm, 20, -10 * cm, 10 * cm, 20, -10 * cm, 10 * cm, "cm", "cm", "cm");
79  fdose_prof = mgr->CreateP1("dose_prof", "Dose distribution", 300, 0, 30 * cm,
80  0, 100 * MeV, "cm", "MeV");
81  fdose_map_prof = mgr->CreateP2("dose_map_prof", "Dose distribution", 300, 0,
82  30 * cm, 80, -4 * cm, 4 * cm, 0, 100 * MeV, "cm", "cm", "MeV");
83 
84 }
G4int CreateH3(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4int nzbins, G4double zmin, G4double zmax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear", const G4String &zbinSchemeName="linear")
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 CreateP1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear")
static constexpr double cm
Definition: G4SIunits.hh:119
G4int CreateP2(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4double zmin=0, G4double zmax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
static constexpr double MeV
Definition: G4SIunits.hh:214
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 Analysis::Clear ( )

Definition at line 97 of file Analysis.cc.

98 {
99  fincident_map-> Reset();
100  fincident_x_hist-> Reset();
101  fdose_map-> Reset();
102  fdose_hist-> Reset();
103 
104  return;
105 }
void Analysis::Clear ( )
void Analysis::ClearIncidentFlag ( )
inline

Definition at line 72 of file Analysis.hh.

73 {
74  fincidentFlag = false;
75 }
void Analysis::ClearIncidentFlag ( )
void Analysis::Close ( )

Definition at line 117 of file Analysis.cc.

118 {
119  G4AnalysisManager* mgr = G4AnalysisManager::Instance();
120  mgr->CloseFile();
121  return;
122 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Analysis::EndOfRun ( )
void Analysis::FillDose ( const G4ThreeVector p,
G4double  dedx 
)

Definition at line 137 of file Analysis.cc.

138 {
139  const G4double Z0 = 25.*cm;
140  const G4double dxy = 10.*mm;
141 
142  if ( std::abs(p.y()) < dxy ) {
143  fdose_map-> Fill((p.z()+Z0)/cm, p.x()/cm, dedx/GeV);
144 
145  if ( std::abs(p.x()) < dxy ) {
146  fdose_hist-> Fill((p.z()+Z0)/cm, dedx/GeV);
147  }
148  }
149 }
static constexpr double mm
Definition: G4SIunits.hh:115
double x() const
double z() const
static constexpr double cm
Definition: G4SIunits.hh:119
double y() const
static constexpr double GeV
Definition: G4SIunits.hh:217
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void Analysis::FillDose ( const G4ThreeVector p,
G4double  dedx 
)
void Analysis::FillIncident ( const G4ThreeVector p)

Definition at line 126 of file Analysis.cc.

127 {
128  if ( ! fincidentFlag ) {
129  fincident_map-> Fill(p.x()/cm, p.y()/cm);
130  fincident_x_hist-> Fill(p.x()/cm);
131 
132  fincidentFlag = true;
133  }
134 }
double x() const
static constexpr double cm
Definition: G4SIunits.hh:119
double y() const

Here is the call graph for this function:

void Analysis::FillIncident ( const G4ThreeVector p)
static Analysis* Analysis::GetAnalysis ( )
static
Analysis * Analysis::GetAnalysis ( )
static

Definition at line 45 of file Analysis.cc.

46 {
47  if ( ! the_analysis ) the_analysis = new Analysis;
48  return the_analysis;
49 }
G4ThreadLocal Analysis * the_analysis
Definition: Analysis.cc:40

Here is the caller graph for this function:

void Analysis::Save ( const G4String fname)

Definition at line 108 of file Analysis.cc.

109 {
110  G4AutoLock l(&rootm);
111  TFile* file = new TFile(fname.c_str(), "RECREATE", "Geant4 ROOT analysis");
112 
113  fincident_map-> Write();
114  fincident_x_hist-> Write();
115  fdose_map-> Write();
116  fdose_hist-> Write();
117 
118  file-> Close();
119 
120  delete file;
121 
122  return;
123 }
void Close()
Definition: Analysis.cc:117
G4Mutex rootm
Definition: Analysis.cc:42

Here is the call graph for this function:

void Analysis::Save ( const G4String fname)
void Analysis::Update ( )

Definition at line 91 of file Analysis.cc.

92 {
93  return;
94 }
void Analysis::Update ( )

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