ECCE @ EIC Software
 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 
10 
11 #include <stdexcept>
12 
14 #include "G4Run.hh"
15 
17 
19  if (fgInstance) {
20  throw std::logic_error("Attempted to duplicate a singleton");
21  } else {
22  fgInstance = this;
23  }
24 }
25 
27  fgInstance = nullptr;
28 }
29 
31  return fgInstance;
32 }
33 
35  G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
36  // initialize event cumulative quantities
38 }
39 
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 }