Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
B3b::Run Class Reference
basic » B3 » B3b

Run class. More...

#include <Doxymodules_basic.h>

Inheritance diagram for B3b::Run:
G4Run

Public Member Functions

 Run ()=default
 
 ~Run () override=default
 
void RecordEvent (const G4Event *) override
 
void Merge (const G4Run *) override
 
G4int GetNbGoodEvents () const
 
G4double GetSumDose () const
 
G4StatAnalysis GetStatDose () const
 

Private Attributes

G4int fCollID_cryst = -1
 
G4int fCollID_patient = -1
 
G4int fPrintModulo = 10000
 
G4int fGoodEvents = 0
 
G4double fSumDose = 0.
 
G4StatAnalysis fStatDose
 

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 105 of file Doxymodules_basic.h.

Constructor & Destructor Documentation

◆ Run()

B3b::Run::Run ( )
default

◆ ~Run()

B3b::Run::~Run ( )
overridedefault

Member Function Documentation

◆ RecordEvent()

void B3b::Run::RecordEvent ( const G4Event event)
override

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

G4int copyNb = (itr->first);

Definition at line 45 of file Run.cc.

46{
47 if ( fCollID_cryst < 0 ) {
49 = G4SDManager::GetSDMpointer()->GetCollectionID("crystal/edep");
50 //G4cout << " fCollID_cryst: " << fCollID_cryst << G4endl;
51 }
52
53 if ( fCollID_patient < 0 ) {
55 = G4SDManager::GetSDMpointer()->GetCollectionID("patient/dose");
56 //G4cout << " fCollID_patient: " << fCollID_patient << G4endl;
57 }
58
59 G4int evtNb = event->GetEventID();
60
61 if (evtNb%fPrintModulo == 0) {
62 G4cout << G4endl << "---> end of event: " << evtNb << G4endl;
63 }
64
65 //Hits collections
66 //
67 G4HCofThisEvent* HCE = event->GetHCofThisEvent();
68 if(!HCE) return;
69
70 //Energy in crystals : identify 'good events'
71 //
72 const G4double eThreshold = 500*keV;
73 G4int nbOfFired = 0;
74
75 auto evtMap = static_cast<G4THitsMap<G4double>*>(HCE->GetHC(fCollID_cryst));
76
77 std::map<G4int,G4double*>::iterator itr;
78 for (itr = evtMap->GetMap()->begin(); itr != evtMap->GetMap()->end(); itr++) {
79 G4double edep = *(itr->second);
80 if (edep > eThreshold) nbOfFired++;
81 ///G4int copyNb = (itr->first);
82 ///G4cout << G4endl << " cryst" << copyNb << ": " << edep/keV << " keV ";
83 }
84 if (nbOfFired == 2) fGoodEvents++;
85
86 //Dose deposit in patient
87 //
88 G4double dose = 0.;
89
90 evtMap = static_cast<G4THitsMap<G4double>*>(HCE->GetHC(fCollID_patient));
91
92 for (itr = evtMap->GetMap()->begin(); itr != evtMap->GetMap()->end(); itr++) {
93 ///G4int copyNb = (itr->first);
94 dose = *(itr->second);
95 }
96 fSumDose += dose;
97 fStatDose += dose;
98
99 G4Run::RecordEvent(event);
100}
G4StatAnalysis fStatDose
Definition Run.hh:65
G4int fCollID_cryst
Definition Run.hh:60
G4int fGoodEvents
Definition Run.hh:63
G4double fSumDose
Definition Run.hh:64
G4int fPrintModulo
Definition Run.hh:62
G4int fCollID_patient
Definition Run.hh:61

◆ Merge()

void B3b::Run::Merge ( const G4Run aRun)
override

Definition at line 104 of file Run.cc.

105{
106 const Run* localRun = static_cast<const Run*>(aRun);
107 fGoodEvents += localRun->fGoodEvents;
108 fSumDose += localRun->fSumDose;
109 fStatDose += localRun->fStatDose;
110 G4Run::Merge(aRun);
111}
Run()=default

◆ GetNbGoodEvents()

G4int B3b::Run::GetNbGoodEvents ( ) const
inline

Definition at line 55 of file Run.hh.

55{ return fGoodEvents; }

◆ GetSumDose()

G4double B3b::Run::GetSumDose ( ) const
inline

Definition at line 56 of file Run.hh.

56{ return fSumDose; }

◆ GetStatDose()

G4StatAnalysis B3b::Run::GetStatDose ( ) const
inline

Definition at line 57 of file Run.hh.

57{ return fStatDose; }

Member Data Documentation

◆ fCollID_cryst

G4int B3b::Run::fCollID_cryst = -1
private

Definition at line 60 of file Run.hh.

◆ fCollID_patient

G4int B3b::Run::fCollID_patient = -1
private

Definition at line 61 of file Run.hh.

◆ fPrintModulo

G4int B3b::Run::fPrintModulo = 10000
private

Definition at line 62 of file Run.hh.

◆ fGoodEvents

G4int B3b::Run::fGoodEvents = 0
private

Definition at line 63 of file Run.hh.

◆ fSumDose

G4double B3b::Run::fSumDose = 0.
private

Definition at line 64 of file Run.hh.

◆ fStatDose

G4StatAnalysis B3b::Run::fStatDose
private

Definition at line 65 of file Run.hh.


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

Applications | User Support | Publications | Collaboration