Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PktSizeMonDraw.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PktSizeMonDraw.h
1 #ifndef __PKTSIZEMONDRAW_H__
2 #define __PKTSIZEMONDRAW_H__
3 
4 #include <onlmon/OnlMonDraw.h>
5 #include <map>
6 #include <set>
7 
8 class RunDBodbc;
9 class PktSizeDBodbc;
10 class TCanvas;
11 class TGraph;
12 class TH1;
13 class TH2;
14 class TMarker;
15 class TPad;
16 class TText;
17 
18 class PktSizeMonDraw : public OnlMonDraw
19 {
20  public:
21  PktSizeMonDraw(const std::string &name = "PKTSIZEMON");
22  virtual ~PktSizeMonDraw();
23 
24  int Init();
25  int Draw(const std::string &what = "ALL");
26  int MakeHtml(const std::string &what = "ALL");
27  int SavePlot(const std::string &what = "ALL", const std::string &type = "png");
28  int loadpreviousruns(const int nruns = 5);
29  int AddKnownBig(const unsigned int packetid, const float maxsize);
30  void Print(const std::string &what = "ALL") const;
31  int CleanOldRuns(const unsigned int maxrun);
32  int RemoveRun(const int runno);
33 
34  protected:
35  int MakeCanvas(const char *name);
36  int DrawFirst(const std::string &what = "ALL");
37  int DrawOldFirst(const std::string &what = "ALL");
38  int DrawHistory(const std::string &what = "ALL");
39  int FillPacketMap(const TH1 *histo);
40  int FillRunPacketList(std::map<unsigned int, float> &pkts, const int runnumber);
41  int ExtractActivePackets(const std::map<unsigned int, float> &packetsize);
42  int MakeNoisyCandidates();
43  int IsKnownBig(const unsigned int packetid, const float size);
44  int PlotNoisy(TGraph &gr, TMarker &tr, TText &tx, const unsigned int ipkt, const unsigned int icnt);
45  int ReplaceRunFromDB(const int runno);
46 
47  TCanvas *TC[2]{};
48  TPad *transparent[2]{};
49  TPad *Pad[2]{};
50  TH2* Frames[12]{};
51  PktSizeDBodbc *db = nullptr;
52  RunDBodbc *rd = nullptr;
53  TMarker *tm = nullptr;
54  int lastrun;
55  std::map<int, std::map<unsigned int, float> > packetmap;
56  std::map<std::string, std::pair<unsigned int, unsigned int> > granulepacketlimits;
57  std::map<unsigned int, float> knownbig;
58  std::set<unsigned int> activepackets;
59  std::set<unsigned int> noisypackets;
60  std::set<int> runlist;
61 };
62 
63 #endif /*__PKTSIZEMONDRAW_H__ */