PYTHIA  8.312
VinciaDiagnostics.h
1 // VinciaDiagnostics.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2024 Peter Skands, Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // Header file for the VinciaDiagnostics class.
7 
8 #ifndef Pythia8_VinciaDiagnostics_H
9 #define Pythia8_VinciaDiagnostics_H
10 
11 #include "Pythia8/UserHooks.h"
12 
13 namespace Pythia8 {
14 
15 //==========================================================================
16 
17 // Vincia diagnostics.
18 
19 class VinciaDiagnostics : public UserHooks {
20 
21  public:
22 
23  // Initialise.
24  void init() {};
25 
26  // Define and increment a counter (default is increment by 1).
27  void increment(string methodName, string variableName, double inc = 1);
28 
29  // Called when "name" starts.
30  void start(string name);
31 
32  // Called when "name" stops.
33  void stop(string name, string counter = "", double inc = 1);
34 
35  // Print diagnostics.
36  void print();
37 
38  private:
39 
40  map<string, bool> isRunning;
41  map<string, clock_t> startTime;
42  map<string, double> nStarts, nRestarts;
43  map<string, double> runTime;
44  map<string, Hist> hRunTime;
45  map<string, map<string, double> > counters;
46 
47 };
48 
49 //==========================================================================
50 
51 } // end namespace Pythia8
52 
53 #endif // Pythia8_VinciaDiagnostics_H
void print()
Print diagnostics.
Definition: VinciaDiagnostics.cc:78
void increment(string methodName, string variableName, double inc=1)
Define and increment a counter (default is increment by 1).
Definition: VinciaDiagnostics.cc:24
void stop(string name, string counter="", double inc=1)
Called when "name" stops.
Definition: VinciaDiagnostics.cc:58
Vincia diagnostics.
Definition: VinciaDiagnostics.h:19
void init()
Initialise.
Definition: VinciaDiagnostics.h:24
std::string methodName(const std::string &prettyFunction, bool withNamespace=false)
end PYTHIA_FUNCTION
Definition: PythiaStdlib.h:283
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
UserHooks is base class for user access to program execution.
Definition: UserHooks.h:32
void start(string name)
Called when "name" starts.
Definition: VinciaDiagnostics.cc:40