Import Geant4 10.1.0 source tree
This commit is contained in:
@@ -23,82 +23,45 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: B1EventAction.cc 69587 2013-05-08 14:26:03Z gcosmo $
|
||||
// $Id: B1EventAction.cc 80449 2014-04-22 08:35:50Z gcosmo $
|
||||
//
|
||||
/// \file B1EventAction.cc
|
||||
/// \brief Implementation of the B1EventAction class
|
||||
|
||||
#include "B1EventAction.hh"
|
||||
#include "B1Run.hh"
|
||||
|
||||
#include "B1RunAction.hh"
|
||||
#include "B1SteppingAction.hh"
|
||||
// use of stepping action to get and reset accumulated energy
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Event.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1EventAction* B1EventAction::fgInstance = 0;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1EventAction* B1EventAction::Instance()
|
||||
{
|
||||
// Static acces function via G4RunManager
|
||||
|
||||
return fgInstance;
|
||||
}
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1EventAction::B1EventAction()
|
||||
: G4UserEventAction(),
|
||||
fPrintModulo(100),
|
||||
fEnergySum(0.),
|
||||
fEnergy2Sum(0.)
|
||||
{
|
||||
fgInstance = this;
|
||||
}
|
||||
fEdep(0.)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1EventAction::~B1EventAction()
|
||||
{
|
||||
fgInstance = 0;
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1EventAction::BeginOfEventAction(const G4Event*)
|
||||
{
|
||||
fEdep = 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1EventAction::BeginOfEventAction(const G4Event* event)
|
||||
{
|
||||
G4int eventNb = event->GetEventID();
|
||||
if (eventNb%fPrintModulo == 0) {
|
||||
G4cout << "\n---> Begin of event: " << eventNb << G4endl;
|
||||
}
|
||||
|
||||
// Reset accounted energy in stepping action
|
||||
B1SteppingAction::Instance()->Reset();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1EventAction::EndOfEventAction(const G4Event* /*event*/)
|
||||
{
|
||||
// accumulate statistics
|
||||
G4double energy = B1SteppingAction::Instance()->GetEnergy();
|
||||
fEnergySum += energy;
|
||||
fEnergy2Sum += energy*energy;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1EventAction::Reset()
|
||||
{
|
||||
//reset cumulative quantities
|
||||
//
|
||||
fEnergySum = 0.;
|
||||
fEnergy2Sum = 0.;
|
||||
void B1EventAction::EndOfEventAction(const G4Event*)
|
||||
{
|
||||
// accumulate statistics in B1Run
|
||||
B1Run* run
|
||||
= static_cast<B1Run*>(
|
||||
G4RunManager::GetRunManager()->GetNonConstCurrentRun());
|
||||
run->AddEdep(fEdep);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user