Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:33

0001 // VinciaDiagnostics.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2024 Peter Skands, Torbjorn Sjostrand.
0003 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
0004 // Please respect the MCnet Guidelines, see GUIDELINES for details.
0005 
0006 // Header file for the VinciaDiagnostics class.
0007 
0008 #ifndef Pythia8_VinciaDiagnostics_H
0009 #define Pythia8_VinciaDiagnostics_H
0010 
0011 #include "Pythia8/UserHooks.h"
0012 
0013 namespace Pythia8 {
0014 
0015 //==========================================================================
0016 
0017 // Vincia diagnostics.
0018 
0019 class VinciaDiagnostics : public UserHooks {
0020 
0021  public:
0022 
0023   // Initialise.
0024   void init() {};
0025 
0026   // Define and increment a counter (default is increment by 1).
0027   void increment(string methodName, string variableName, double inc = 1);
0028 
0029   // Called when "name" starts.
0030   void start(string name);
0031 
0032   // Called when "name" stops.
0033   void stop(string name, string counter = "", double inc = 1);
0034 
0035   // Print diagnostics.
0036   void print();
0037 
0038  private:
0039 
0040   map<string, bool> isRunning;
0041   map<string, clock_t> startTime;
0042   map<string, double> nStarts, nRestarts;
0043   map<string, double> runTime;
0044   map<string, Hist> hRunTime;
0045   map<string, map<string, double> > counters;
0046 
0047 };
0048 
0049 //==========================================================================
0050 
0051 } // end namespace Pythia8
0052 
0053 #endif // Pythia8_VinciaDiagnostics_H