Geant4  10.02.p03
Em10EventAction Class Reference

#include <Em10EventAction.hh>

Inheritance diagram for Em10EventAction:
Collaboration diagram for Em10EventAction:

Public Member Functions

 Em10EventAction (Em10RunAction *Em10RA)
 
 ~Em10EventAction ()
 
void BeginOfEventAction (const G4Event *)
 
void EndOfEventAction (const G4Event *)
 
G4int GetEventno ()
 
void setEventVerbose (G4int level)
 
void CountStepsCharged ()
 
void CountStepsNeutral ()
 
void AddCharged ()
 
void AddNeutral ()
 
void AddE ()
 
void AddP ()
 
void SetTr ()
 
void SetRef ()
 
void SetDrawFlag (G4String val)
 
void SetPrintModulo (G4int val)
 
- Public Member Functions inherited from G4UserEventAction
 G4UserEventAction ()
 
virtual ~G4UserEventAction ()
 
virtual void SetEventManager (G4EventManager *value)
 

Private Attributes

G4int calorimeterCollID
 
Em10EventActionMessengereventMessenger
 
Em10RunActionrunaction
 
G4int verboselevel
 
G4double nstep
 
G4double nstepCharged
 
G4double nstepNeutral
 
G4double Nch
 
G4double Nne
 
G4double NE
 
G4double NP
 
G4double Transmitted
 
G4double Reflected
 
G4String drawFlag
 
G4int printModulo
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Definition at line 48 of file Em10EventAction.hh.

Constructor & Destructor Documentation

◆ Em10EventAction()

Em10EventAction::Em10EventAction ( Em10RunAction Em10RA)

Definition at line 56 of file Em10EventAction.cc.

◆ ~Em10EventAction()

Em10EventAction::~Em10EventAction ( )

Definition at line 65 of file Em10EventAction.cc.

66 {
67  delete eventMessenger;
68 }
Em10EventActionMessenger * eventMessenger

Member Function Documentation

◆ AddCharged()

void Em10EventAction::AddCharged ( )

Definition at line 192 of file Em10EventAction.cc.

193 {
194  Nch += 1.;
195 }
Here is the caller graph for this function:

◆ AddE()

void Em10EventAction::AddE ( )

Definition at line 206 of file Em10EventAction.cc.

207 {
208  NE += 1.;
209 }
Here is the caller graph for this function:

◆ AddNeutral()

void Em10EventAction::AddNeutral ( )

Definition at line 199 of file Em10EventAction.cc.

200 {
201  Nne += 1.;
202 }
Here is the caller graph for this function:

◆ AddP()

void Em10EventAction::AddP ( )

Definition at line 213 of file Em10EventAction.cc.

214 {
215  NP += 1.;
216 }
Here is the caller graph for this function:

◆ BeginOfEventAction()

void Em10EventAction::BeginOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 72 of file Em10EventAction.cc.

73 {
74  G4int evtNb = evt->GetEventID();
75  if (evtNb%printModulo == 0)
76  G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
77 
78  if(verboselevel>1)
79  G4cout << "<<< Event " << evtNb << " started." << G4endl;
80 
81  if (calorimeterCollID==-1)
82  {
84  calorimeterCollID = SDman->GetCollectionID("CalCollection");
85  }
86 
87  nstep = 0. ;
88  nstepCharged = 0. ;
89  nstepNeutral = 0. ;
90  Nch = 0. ;
91  Nne = 0. ;
92  NE=0.;
93  NP=0.;
94  Transmitted=0.;
95  Reflected =0.;
96 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4int GetEventID() const
Definition: G4Event.hh:151
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ CountStepsCharged()

void Em10EventAction::CountStepsCharged ( )

Definition at line 178 of file Em10EventAction.cc.

179 {
180  nstepCharged += 1. ;
181 }
Here is the caller graph for this function:

◆ CountStepsNeutral()

void Em10EventAction::CountStepsNeutral ( )

Definition at line 185 of file Em10EventAction.cc.

186 {
187  nstepNeutral += 1. ;
188 }
Here is the caller graph for this function:

◆ EndOfEventAction()

void Em10EventAction::EndOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 100 of file Em10EventAction.cc.

101 {
102  G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
103  Em10CalorHitsCollection* CHC = 0;
104  if (HCE)
106 
107  if (CHC)
108  {
109  int n_hit = CHC->entries();
110  // if(verboselevel==2)
111  // G4cout << " " << n_hit
112  // << " hits are stored in Em10CalorHitsCollection." << G4endl;
113 
114  G4double totEAbs=0, totLAbs=0;
115  for (int i=0;i<n_hit;i++)
116  { totEAbs += (*CHC)[i]->GetEdepAbs();
117  totLAbs += (*CHC)[i]->GetTrakAbs();
118  }
119  if(verboselevel==2)
120  G4cout
121  << " Absorber: total energy: " << std::setw(7) <<
122  G4BestUnit(totEAbs,"Energy")
123  << " total track length: " << std::setw(7) <<
124  G4BestUnit(totLAbs,"Length")
125  << G4endl;
126 
127  // count event, add deposits to the sum ...
128  runaction->CountEvent() ;
129  runaction->AddTrackLength(totLAbs) ;
132  if(verboselevel==2)
133  G4cout << " Ncharged=" << Nch << " , Nneutral=" << Nne << G4endl;
135  runaction->AddEP(NE,NP);
137  runaction->AddEdeps(totEAbs) ;
138  runaction->FillEn(totEAbs) ;
139 
142  }
143 
144  if(verboselevel>0)
145  G4cout << "<<< Event " << evt->GetEventID() << " ended." << G4endl;
146 
147 
148  //save rndm status
149  if (runaction->GetRndmFreq() == 2)
150  {
151  CLHEP::HepRandom::saveEngineStatus("endOfEvent.rndm");
152  G4int evtNb = evt->GetEventID();
153  if (evtNb%printModulo == 0)
154  {
155  G4cout << "\n---> End of Event: " << evtNb << G4endl;
157  }
158  }
159 }
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void FillNbOfSteps(G4double nstep)
G4int GetRndmFreq()
int G4int
Definition: G4Types.hh:78
void CountParticles(G4double, G4double)
void FillEn(G4double En)
G4GLOB_DLL std::ostream G4cout
void AddEdeps(G4double Eabs)
static void showEngineStatus()
Definition: Random.cc:204
Em10RunAction * runaction
static void saveEngineStatus(const char filename[]="Config.conf")
Definition: Random.cc:176
G4int GetEventID() const
Definition: G4Event.hh:151
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:185
void AddTrRef(G4double tr, G4double ref)
#define G4endl
Definition: G4ios.hh:61
void AddnStepsNeutral(G4double ns)
double G4double
Definition: G4Types.hh:76
void AddnStepsCharged(G4double ns)
void AddTrackLength(G4double tlabs)
void AddEP(G4double, G4double)
Here is the call graph for this function:

◆ GetEventno()

G4int Em10EventAction::GetEventno ( )

Definition at line 163 of file Em10EventAction.cc.

164 {
166  return evno ;
167 }
G4EventManager * fpEventManager
int G4int
Definition: G4Types.hh:78
G4int GetEventID() const
Definition: G4Event.hh:151
const G4Event * GetConstCurrentEvent()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDrawFlag()

void Em10EventAction::SetDrawFlag ( G4String  val)
inline

Definition at line 69 of file Em10EventAction.hh.

69 {drawFlag = val;};
Here is the caller graph for this function:

◆ setEventVerbose()

void Em10EventAction::setEventVerbose ( G4int  level)

Definition at line 171 of file Em10EventAction.cc.

172 {
173  verboselevel = level ;
174 }
Here is the caller graph for this function:

◆ SetPrintModulo()

void Em10EventAction::SetPrintModulo ( G4int  val)
inline

Definition at line 70 of file Em10EventAction.hh.

70 {printModulo = val;};
Here is the caller graph for this function:

◆ SetRef()

void Em10EventAction::SetRef ( )

Definition at line 227 of file Em10EventAction.cc.

228 {
229  Reflected = 1.;
230 }
Here is the caller graph for this function:

◆ SetTr()

void Em10EventAction::SetTr ( )

Definition at line 220 of file Em10EventAction.cc.

221 {
222  Transmitted = 1.;
223 }
Here is the caller graph for this function:

Member Data Documentation

◆ calorimeterCollID

G4int Em10EventAction::calorimeterCollID
private

Definition at line 70 of file Em10EventAction.hh.

◆ drawFlag

G4String Em10EventAction::drawFlag
private

Definition at line 82 of file Em10EventAction.hh.

◆ eventMessenger

Em10EventActionMessenger* Em10EventAction::eventMessenger
private

Definition at line 74 of file Em10EventAction.hh.

◆ Nch

G4double Em10EventAction::Nch
private

Definition at line 78 of file Em10EventAction.hh.

◆ NE

G4double Em10EventAction::NE
private

Definition at line 79 of file Em10EventAction.hh.

◆ Nne

G4double Em10EventAction::Nne
private

Definition at line 78 of file Em10EventAction.hh.

◆ NP

G4double Em10EventAction::NP
private

Definition at line 79 of file Em10EventAction.hh.

◆ nstep

G4double Em10EventAction::nstep
private

Definition at line 77 of file Em10EventAction.hh.

◆ nstepCharged

G4double Em10EventAction::nstepCharged
private

Definition at line 77 of file Em10EventAction.hh.

◆ nstepNeutral

G4double Em10EventAction::nstepNeutral
private

Definition at line 77 of file Em10EventAction.hh.

◆ printModulo

G4int Em10EventAction::printModulo
private

Definition at line 83 of file Em10EventAction.hh.

◆ Reflected

G4double Em10EventAction::Reflected
private

Definition at line 80 of file Em10EventAction.hh.

◆ runaction

Em10RunAction* Em10EventAction::runaction
private

Definition at line 75 of file Em10EventAction.hh.

◆ Transmitted

G4double Em10EventAction::Transmitted
private

Definition at line 80 of file Em10EventAction.hh.

◆ verboselevel

G4int Em10EventAction::verboselevel
private

Definition at line 76 of file Em10EventAction.hh.


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