Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
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 ()
 

Static Public Member Functions

static AnalysisGetAnalysis ()
 

Detailed Description

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

Constructor & Destructor Documentation

Analysis::~Analysis ( )

Definition at line 77 of file Analysis.cc.

78 {
79  delete fincident_map;
80  delete fincident_x_hist;
81  delete fdose_map;
82  delete fdose_hist;
83 }

Member Function Documentation

void Analysis::Clear ( )

Definition at line 92 of file Analysis.cc.

93 {
94  fincident_map-> Reset();
95  fincident_x_hist-> Reset();
96  fdose_map-> Reset();
97  fdose_hist-> Reset();
98 
99  return;
100 }
void Analysis::ClearIncidentFlag ( )
inline

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

73 {
74  fincidentFlag = false;
75 }
void Analysis::FillDose ( const G4ThreeVector p,
G4double  dedx 
)

Definition at line 131 of file Analysis.cc.

References python.hepunit::cm, python.hepunit::GeV, python.hepunit::mm, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

132 {
133  const G4double Z0 = 25.*cm;
134  const G4double dxy = 10.*mm;
135 
136  if ( std::abs(p.y()) < dxy ) {
137  fdose_map-> Fill((p.z()+Z0)/cm, p.x()/cm, dedx/GeV);
138 
139  if ( std::abs(p.x()) < dxy ) {
140  fdose_hist-> Fill((p.z()+Z0)/cm, dedx/GeV);
141  }
142  }
143 }
double x() const
double z() const
double y() const
double G4double
Definition: G4Types.hh:76
void Analysis::FillIncident ( const G4ThreeVector p)

Definition at line 120 of file Analysis.cc.

References python.hepunit::cm, CLHEP::Hep3Vector::x(), and CLHEP::Hep3Vector::y().

121 {
122  if ( ! fincidentFlag ) {
123  fincident_map-> Fill(p.x()/cm, p.y()/cm);
124  fincident_x_hist-> Fill(p.x()/cm);
125 
126  fincidentFlag = true;
127  }
128 }
double x() const
double y() const
Analysis * Analysis::GetAnalysis ( )
static

Definition at line 41 of file Analysis.cc.

Referenced by VoxelSD::ProcessHits().

42 {
43  static Analysis the_analysis;
44  return &the_analysis;
45 }
void Analysis::Save ( const G4String fname)

Definition at line 103 of file Analysis.cc.

104 {
105  TFile* file = new TFile(fname.c_str(), "RECREATE", "Geant4 ROOT analysis");
106 
107  fincident_map-> Write();
108  fincident_x_hist-> Write();
109  fdose_map-> Write();
110  fdose_hist-> Write();
111 
112  file-> Close();
113 
114  delete file;
115 
116  return;
117 }
void Analysis::Update ( )

Definition at line 86 of file Analysis.cc.

87 {
88  return;
89 }

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