Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-10-15 08:24:59

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef FUN4ALL_FUN4ALLMEMORYHISTOGRAMS_H
0004 #define FUN4ALL_FUN4ALLMEMORYHISTOGRAMS_H
0005 
0006 #include "Fun4AllBase.h"
0007 
0008 
0009 #include <map>
0010 #include <string>
0011 #include <vector>
0012 
0013 class TH1;
0014 
0015 class Fun4AllMemoryHistograms : public Fun4AllBase
0016 {
0017  public:
0018   static Fun4AllMemoryHistograms *instance()
0019   {
0020     if (mInstance) return mInstance;
0021     mInstance = new Fun4AllMemoryHistograms();
0022     return mInstance;
0023   }
0024   ~Fun4AllMemoryHistograms() override = default;
0025   void Enable() {m_Enabled = true;}
0026   void CreateHistos();
0027   void FillHistos();
0028   void SaveHistos(const std::string &fname);
0029   void increase_TH1_channelcount();
0030   
0031  private:
0032   Fun4AllMemoryHistograms();
0033   static Fun4AllMemoryHistograms *mInstance;
0034   
0035   int m_EventCount {0};
0036   int m_NumChannels {10000};
0037   bool m_Enabled {false};
0038   bool m_HistosCreated {false};
0039 
0040   std::vector<TH1 *> m_histovector;
0041 };
0042 
0043 #endif