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

#include <B3bRun.hh>

Inheritance diagram for B3bRun:
Collaboration diagram for B3bRun:

Public Member Functions

 B3bRun ()
 
virtual ~B3bRun ()
 
virtual void RecordEvent (const G4Event *)
 
virtual void Merge (const G4Run *)
 
G4int GetNbGoodEvents () const
 
G4double GetSumDose () const
 
- Public Member Functions inherited from G4Run
 G4Run ()
 
virtual ~G4Run ()
 
G4int GetRunID () const
 
G4int GetNumberOfEvent () const
 
G4int GetNumberOfEventToBeProcessed () const
 
const G4HCtableGetHCtable () const
 
const G4DCtableGetDCtable () const
 
const G4StringGetRandomNumberStatus () const
 
void SetRunID (G4int id)
 
void SetNumberOfEventToBeProcessed (G4int n_ev)
 
void SetHCtable (G4HCtable *HCtbl)
 
void SetDCtable (G4DCtable *DCtbl)
 
void SetRandomNumberStatus (G4String &st)
 
void StoreEvent (G4Event *evt)
 
const std::vector< const
G4Event * > * 
GetEventVector () const
 

Additional Inherited Members

- Protected Attributes inherited from G4Run
G4int runID
 
G4int numberOfEvent
 
G4int numberOfEventToBeProcessed
 
G4HCtableHCtable
 
G4DCtableDCtable
 
G4String randomNumberStatus
 
std::vector< const G4Event * > * eventVector
 

Detailed Description

Run class

In RecordEvent() there is collected information event per event from Hits Collections, and accumulated statistic for the run

Definition at line 42 of file B3bRun.hh.

Constructor & Destructor Documentation

B3bRun::B3bRun ( )

Definition at line 43 of file B3bRun.cc.

44  : G4Run(),
45  fCollID_cryst(-1),
46  fCollID_patient(-1),
47  fPrintModulo(10000),
48  fGoodEvents(0),
49  fSumDose(0.)
50 { }
G4Run()
Definition: G4Run.cc:34
B3bRun::~B3bRun ( )
virtual

Definition at line 54 of file B3bRun.cc.

55 { }

Member Function Documentation

G4int B3bRun::GetNbGoodEvents ( ) const
inline

Definition at line 52 of file B3bRun.hh.

52 { return fGoodEvents; }

Here is the caller graph for this function:

G4double B3bRun::GetSumDose ( ) const
inline

Definition at line 53 of file B3bRun.hh.

53 { return fSumDose; }

Here is the caller graph for this function:

void B3bRun::Merge ( const G4Run aRun)
virtual

Reimplemented from G4Run.

Definition at line 118 of file B3bRun.cc.

119 {
120  const B3bRun* localRun = static_cast<const B3bRun*>(aRun);
121  fGoodEvents += localRun->fGoodEvents;
122  fSumDose += localRun->fSumDose;
123 
124  G4Run::Merge(aRun);
125 }
virtual void Merge(const G4Run *)
Definition: G4Run.cc:54
Definition: B3bRun.hh:42

Here is the call graph for this function:

void B3bRun::RecordEvent ( const G4Event event)
virtual

G4int copyNb = (itr->first); G4cout << G4endl << " cryst" << copyNb << ": " << edep/keV << " keV ";

G4int copyNb = (itr->first);

Reimplemented from G4Run.

Definition at line 59 of file B3bRun.cc.

60 {
61  if ( fCollID_cryst < 0 ) {
62  fCollID_cryst
63  = G4SDManager::GetSDMpointer()->GetCollectionID("crystal/edep");
64  //G4cout << " fCollID_cryst: " << fCollID_cryst << G4endl;
65  }
66 
67  if ( fCollID_patient < 0 ) {
68  fCollID_patient
69  = G4SDManager::GetSDMpointer()->GetCollectionID("patient/dose");
70  //G4cout << " fCollID_patient: " << fCollID_patient << G4endl;
71  }
72 
73  G4int evtNb = event->GetEventID();
74 
75  if (evtNb%fPrintModulo == 0) {
76  G4cout << G4endl << "---> end of event: " << evtNb << G4endl;
77  }
78 
79  //Hits collections
80  //
81  G4HCofThisEvent* HCE = event->GetHCofThisEvent();
82  if(!HCE) return;
83 
84  //Energy in crystals : identify 'good events'
85  //
86  const G4double eThreshold = 500*keV;
87  G4int nbOfFired = 0;
88 
89  G4THitsMap<G4double>* evtMap =
90  static_cast<G4THitsMap<G4double>*>(HCE->GetHC(fCollID_cryst));
91 
92  std::map<G4int,G4double*>::iterator itr;
93  for (itr = evtMap->GetMap()->begin(); itr != evtMap->GetMap()->end(); itr++) {
94  G4double edep = *(itr->second);
95  if (edep > eThreshold) nbOfFired++;
98  }
99  if (nbOfFired == 2) fGoodEvents++;
100 
101  //Dose deposit in patient
102  //
103  G4double dose = 0.;
104 
105  evtMap = static_cast<G4THitsMap<G4double>*>(HCE->GetHC(fCollID_patient));
106 
107  for (itr = evtMap->GetMap()->begin(); itr != evtMap->GetMap()->end(); itr++) {
109  dose = *(itr->second);
110  }
111  fSumDose += dose;
112 
113  G4Run::RecordEvent(event);
114 }
G4VHitsCollection * GetHC(G4int i)
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
virtual void RecordEvent(const G4Event *)
Definition: G4Run.cc:51
std::map< G4int, T * > * GetMap() const
Definition: G4THitsMap.hh:99
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static constexpr double keV
Definition: G4SIunits.hh:216

Here is the call graph for this function:


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