ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
MMRunAction.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file MMRunAction.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#include "
ACTFW/Plugins/Geant4/MMRunAction.hpp
"
10
11
#include <stdexcept>
12
13
#include "
ACTFW/Plugins/Geant4/MMEventAction.hpp
"
14
#include "
G4Run.hh
"
15
16
FW::Geant4::MMRunAction
*
FW::Geant4::MMRunAction::fgInstance
=
nullptr
;
17
18
FW::Geant4::MMRunAction::MMRunAction
() :
G4UserRunAction
() {
19
if
(
fgInstance
) {
20
throw
std::logic_error(
"Attempted to duplicate a singleton"
);
21
}
else
{
22
fgInstance
=
this
;
23
}
24
}
25
26
FW::Geant4::MMRunAction::~MMRunAction
() {
27
fgInstance =
nullptr
;
28
}
29
30
FW::Geant4::MMRunAction
*
FW::Geant4::MMRunAction::Instance
() {
31
return
fgInstance;
32
}
33
34
void
FW::Geant4::MMRunAction::BeginOfRunAction
(
const
G4Run
* aRun) {
35
G4cout
<<
"### Run "
<< aRun->
GetRunID
() <<
" start."
<<
G4endl
;
36
// initialize event cumulative quantities
37
MMEventAction::Instance
()->
Reset
();
38
}
39
40
void
FW::Geant4::MMRunAction::EndOfRunAction
(
const
G4Run
* aRun) {
41
G4int
nofEvents = aRun->
GetNumberOfEvent
();
42
if
(nofEvents == 0)
43
return
;
44
45
// Print
46
G4cout
<<
"\n--------------------End of Run------------------------------\n"
47
<<
"\n------------------------------------------------------------\n"
48
<<
G4endl
;
49
}
acts
blob
master
Examples
Algorithms
Geant4
src
MMRunAction.cpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:23
using
1.8.2 with
ECCE GitHub integration