Geant4  10.02.p03
Analysis Class Reference

#include <Analysis.hh>

Collaboration diagram for Analysis:

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 ()
 

Private Member Functions

 Analysis ()
 
 DISALLOW_COPY_AND_ASSIGN (Analysis)
 
 Analysis ()
 
 DISALLOW_COPY_AND_ASSIGN (Analysis)
 

Private Attributes

TH2D * fincident_map
 
TH1D * fincident_x_hist
 
TH2D * fdose_map
 
TH1D * fdose_hist
 
G4int fincident_x_hist
 
G4int fincident_map
 
G4int fdose_hist
 
G4int fdose_map
 
G4int fdose_prof
 
G4int fdose_map_prof
 
G4int fdose_map3d
 

Static Private Attributes

static G4ThreadLocal G4int fincidentFlag = false
 

Detailed Description

Constructor & Destructor Documentation

◆ ~Analysis() [1/2]

Analysis::~Analysis ( )

Definition at line 82 of file exMPI02/src/Analysis.cc.

Here is the caller graph for this function:

◆ Analysis() [1/2]

Analysis::Analysis ( )
private

Definition at line 52 of file exMPI02/src/Analysis.cc.

53 {
54  G4AutoLock l(&rootm);
55  // define histograms
56  fincident_map = new TH2D("incident map", "Incident Distributuon",
57  50, -5., 5.,
58  50, -5., 5.);
59  fincident_map-> GetXaxis()-> SetTitle("X (cm)");
60  fincident_map-> GetYaxis()-> SetTitle("Y (cm)");
62 
63  fincident_x_hist = new TH1D("incident x", "Incident X", 100, -5., 5.);
64  fincident_x_hist-> GetXaxis()-> SetTitle("X (cm)");
66 
67  fdose_map = new TH2D("dose map", "Dose Distribution",
68  500, 0., 50.,
69  200, -10., 10.);
70  fdose_map-> GetXaxis()-> SetTitle("Z (cm)");
71  fdose_map-> GetYaxis()-> SetTitle("X (cm)");
72  fdose_map-> SetStats(0);
73 
74  fdose_hist = new TH1D("dose", "Dose Distribution", 500, 0., 50.);
75  fdose_hist-> GetXaxis()-> SetTitle("Z (cm)");
76  fdose_hist-> GetYaxis()-> SetTitle("Dose (GeV)");
77  fdose_hist-> SetFillColor(kBlue);
78  fdose_hist-> SetStats(0);
79 }
hist SetTitle("Cytoplasm intensity on transverse section")
h1 GetXaxis() -> SetLabelSize(0.025)
G4Mutex rootm
hipStyle SetFillColor(0)
h1 SetStats(kFALSE)
h1 GetYaxis() -> SetLabelSize(0.025)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~Analysis() [2/2]

Analysis::~Analysis ( )

◆ Analysis() [2/2]

Analysis::Analysis ( )
private

Member Function Documentation

◆ Book()

void Analysis::Book ( )

Definition at line 65 of file exMPI03/src/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");
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")
static const double cm
Definition: G4SIunits.hh:118
static const double MeV
Definition: G4SIunits.hh:211
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")
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")
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:

◆ Clear() [1/2]

void Analysis::Clear ( )

Definition at line 97 of file exMPI02/src/Analysis.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Clear() [2/2]

void Analysis::Clear ( )

◆ ClearIncidentFlag() [1/2]

void Analysis::ClearIncidentFlag ( )
inline

Definition at line 72 of file extended/parallel/MPI/examples/exMPI02/include/Analysis.hh.

73 {
74  fincidentFlag = false;
75 }

◆ ClearIncidentFlag() [2/2]

void Analysis::ClearIncidentFlag ( )

◆ Close()

void Analysis::Close ( )

Definition at line 117 of file exMPI03/src/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:

◆ DISALLOW_COPY_AND_ASSIGN() [1/2]

Analysis::DISALLOW_COPY_AND_ASSIGN ( Analysis  )
private

◆ DISALLOW_COPY_AND_ASSIGN() [2/2]

Analysis::DISALLOW_COPY_AND_ASSIGN ( Analysis  )
private

◆ EndOfRun()

void Analysis::EndOfRun ( )

◆ FillDose() [1/2]

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

Definition at line 137 of file exMPI02/src/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 const double cm
Definition: G4SIunits.hh:118
static const double GeV
Definition: G4SIunits.hh:214
TNtupleSim Fill(f1, f2, f3, f4)
double x() const
double y() const
double z() const
double G4double
Definition: G4Types.hh:76
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillDose() [2/2]

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

◆ FillIncident() [1/2]

void Analysis::FillIncident ( const G4ThreeVector p)

Definition at line 126 of file exMPI02/src/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 }
static const double cm
Definition: G4SIunits.hh:118
TNtupleSim Fill(f1, f2, f3, f4)
double x() const
double y() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillIncident() [2/2]

void Analysis::FillIncident ( const G4ThreeVector p)

◆ GetAnalysis() [1/2]

static Analysis* Analysis::GetAnalysis ( )
static

◆ GetAnalysis() [2/2]

Analysis * Analysis::GetAnalysis ( )
static

Definition at line 45 of file exMPI02/src/Analysis.cc.

46 {
47  if ( ! the_analysis ) the_analysis = new Analysis;
48  return the_analysis;
49 }
G4ThreadLocal Analysis * the_analysis
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Save() [1/2]

void Analysis::Save ( const G4String fname)

Definition at line 108 of file exMPI02/src/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 }
TFile * file
G4Mutex rootm
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Save() [2/2]

void Analysis::Save ( const G4String fname)

◆ Update() [1/2]

void Analysis::Update ( )

Definition at line 91 of file exMPI02/src/Analysis.cc.

92 {
93  return;
94 }
Here is the caller graph for this function:

◆ Update() [2/2]

void Analysis::Update ( )

Member Data Documentation

◆ fdose_hist [1/2]

TH1D* Analysis::fdose_hist
private

◆ fdose_hist [2/2]

G4int Analysis::fdose_hist
private

◆ fdose_map [1/2]

TH2D* Analysis::fdose_map
private

◆ fdose_map [2/2]

G4int Analysis::fdose_map
private

◆ fdose_map3d

G4int Analysis::fdose_map3d
private

◆ fdose_map_prof

G4int Analysis::fdose_map_prof
private

◆ fdose_prof

G4int Analysis::fdose_prof
private

◆ fincident_map [1/2]

TH2D* Analysis::fincident_map
private

◆ fincident_map [2/2]

G4int Analysis::fincident_map
private

◆ fincident_x_hist [1/2]

TH1D* Analysis::fincident_x_hist
private

◆ fincident_x_hist [2/2]

G4int Analysis::fincident_x_hist
private

◆ fincidentFlag

G4ThreadLocal G4int Analysis::fincidentFlag = false
staticprivate

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