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

#include <B3Run.hh>

Inheritance diagram for B3Run:
G4Run

Public Member Functions

 B3Run ()
 
virtual ~B3Run ()
 
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 B3Run.hh.

Constructor & Destructor Documentation

B3Run::B3Run ( )

Definition at line 43 of file B3Run.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
B3Run::~B3Run ( )
virtual

Definition at line 55 of file B3Run.cc.

56 { }

Member Function Documentation

G4int B3Run::GetNbGoodEvents ( ) const
inline

Definition at line 52 of file B3Run.hh.

Referenced by B3RunAction::EndOfRunAction().

52 { return fGoodEvents; }
G4double B3Run::GetSumDose ( ) const
inline

Definition at line 53 of file B3Run.hh.

Referenced by B3RunAction::EndOfRunAction().

53 { return fSumDose; }
void B3Run::Merge ( const G4Run aRun)
virtual

Reimplemented from G4Run.

Definition at line 119 of file B3Run.cc.

References G4Run::Merge().

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

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

G4int copyNb = (itr->first);

Reimplemented from G4Run.

Definition at line 60 of file B3Run.cc.

References G4cout, G4endl, G4SDManager::GetCollectionID(), G4HCofThisEvent::GetHC(), G4THitsMap< T >::GetMap(), G4SDManager::GetSDMpointer(), python.hepunit::keV, and G4Run::RecordEvent().

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

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