Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
GammaKnifeController Class Reference

#include <GammaKnifeController.hh>

Public Member Functions

 GammaKnifeController (GammaKnifeDetectorConstruction *)
 
 ~GammaKnifeController ()
 
void BeamOn (G4int)
 
void ReadFile (std::string fileName)
 

Detailed Description

Definition at line 44 of file GammaKnifeController.hh.

Constructor & Destructor Documentation

GammaKnifeController::GammaKnifeController ( GammaKnifeDetectorConstruction det)

Definition at line 35 of file GammaKnifeController.cc.

35  : scoreMaps( 0 )
36 {
37  detector = det;
38 
39  messenger = new GammaKnifeMessenger( this );
40 }
GammaKnifeController::~GammaKnifeController ( )

Definition at line 42 of file GammaKnifeController.cc.

43 {
44  delete messenger;
45 }

Member Function Documentation

void GammaKnifeController::BeamOn ( G4int  n_event)

Definition at line 47 of file GammaKnifeController.cc.

References G4RunManager::BeamOn(), GAMMAKNIFE_SOURCES, and G4RunManager::GetRunManager().

Referenced by GammaKnifeMessenger::SetNewValue().

48 {
49  PrepareHitsAccumulation();
50  for (G4int i = 0; i < GAMMAKNIFE_SOURCES; i++)
51  {
52  RotateForward(i);
54 
55  if (i != (GAMMAKNIFE_SOURCES - 1))
56  StoreHits();
57 
58  RotateBack(i);
59  }
60  AccumulateAllHits();
61 }
virtual void BeamOn(G4int n_event, const char *macroFile=0, G4int n_select=-1)
int G4int
Definition: G4Types.hh:78
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
#define GAMMAKNIFE_SOURCES
void GammaKnifeController::ReadFile ( std::string  fileName)

Definition at line 158 of file GammaKnifeController.cc.

References test::c, python.hepunit::degree, and GAMMAKNIFE_SOURCES.

Referenced by main(), and GammaKnifeMessenger::SetNewValue().

159 {
160  //G4cout << "Enter ReadFile()...";
161  const int SZ = 100;
162  char buf[SZ];
163 
164  phiAngles.clear(); // If called for the second time
165  thetaAngles.clear(); // we won't have 402 positions...
166 
167  std::ifstream ifs;
168  ifs.open( fileName.c_str() );
169 
170  for (G4int i = 0; i < GAMMAKNIFE_SOURCES; i++)
171  {
172  G4double phi, theta;
173 
174  /* Skip the "Axx" at the beginning of the line */
175  for (G4int c = 0; c < 4; c++) ifs.get();
176 
177  ifs >> phi >> theta;
178  ifs.getline(buf, SZ); // Next line
179 
180  phiAngles.push_back( phi * degree );
181  thetaAngles.push_back( theta * degree );
182  }
183  ifs.close();
184  //G4cout << "... done " << G4endl;
185 }
int G4int
Definition: G4Types.hh:78
tuple degree
Definition: hepunit.py:69
#define GAMMAKNIFE_SOURCES
double G4double
Definition: G4Types.hh:76

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