Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:20:29

0001 #ifndef __PKTSIZEMONDRAW_H__
0002 #define __PKTSIZEMONDRAW_H__
0003 
0004 #include <onlmon/OnlMonDraw.h>
0005 #include <map>
0006 #include <set>
0007 
0008 class RunDBodbc;
0009 class PktSizeDBodbc;
0010 class TCanvas;
0011 class TGraph;
0012 class TH1;
0013 class TH2;
0014 class TMarker;
0015 class TPad;
0016 class TText;
0017 
0018 class PktSizeMonDraw : public OnlMonDraw
0019 {
0020  public:
0021   PktSizeMonDraw(const std::string &name = "PKTSIZEMON");
0022   virtual ~PktSizeMonDraw();
0023 
0024   int Init();
0025   int Draw(const std::string &what = "ALL");
0026   int MakeHtml(const std::string &what = "ALL");
0027   int SavePlot(const std::string &what = "ALL", const std::string &type = "png");
0028   int loadpreviousruns(const int nruns = 5);
0029   int AddKnownBig(const unsigned int packetid, const float maxsize);
0030   void Print(const std::string &what = "ALL") const;
0031   int CleanOldRuns(const unsigned int maxrun);
0032   int RemoveRun(const int runno);
0033 
0034  protected:
0035   int MakeCanvas(const char *name);
0036   int DrawFirst(const std::string &what = "ALL");
0037   int DrawOldFirst(const std::string &what = "ALL");
0038   int DrawHistory(const std::string &what = "ALL");
0039   int FillPacketMap(const TH1 *histo);
0040   int FillRunPacketList(std::map<unsigned int, float> &pkts, const int runnumber);
0041   int ExtractActivePackets(const std::map<unsigned int, float> &packetsize);
0042   int MakeNoisyCandidates();
0043   int IsKnownBig(const unsigned int packetid, const float size);
0044   int PlotNoisy(TGraph &gr, TMarker &tr, TText &tx, const unsigned int ipkt, const unsigned int icnt);
0045   int ReplaceRunFromDB(const int runno);
0046 
0047   TCanvas *TC[2]{};
0048   TPad *transparent[2]{};
0049   TPad *Pad[2]{};
0050   TH2* Frames[12]{};
0051   PktSizeDBodbc *db = nullptr;
0052   RunDBodbc *rd = nullptr;
0053   TMarker *tm = nullptr;
0054   int lastrun;
0055   std::map<int, std::map<unsigned int, float> > packetmap;
0056   std::map<std::string, std::pair<unsigned int, unsigned int> > granulepacketlimits;
0057   std::map<unsigned int, float> knownbig;
0058   std::set<unsigned int> activepackets;
0059   std::set<unsigned int> noisypackets;
0060   std::set<int> runlist;
0061 };
0062 
0063 #endif /*__PKTSIZEMONDRAW_H__ */