File indexing completed on 2025-08-05 08:20:28
0001 #ifndef MVTX_MVTXMONDRAW_H
0002 #define MVTX_MVTXMONDRAW_H
0003
0004 #include <onlmon/OnlMonDraw.h>
0005
0006 #include <TColor.h>
0007 #include <string> // for allocator, string
0008
0009 class OnlMonDB;
0010 class TCanvas;
0011 class TGraphErrors;
0012 class TPad;
0013 class OnlMonClient;
0014 class TPaveText;
0015 class TH1;
0016 class TH2Poly;
0017
0018 class MvtxMonDraw : public OnlMonDraw
0019 {
0020 public:
0021 MvtxMonDraw(const std::string &name);
0022
0023 ~MvtxMonDraw() override {}
0024
0025 static constexpr int NFlags = 3;
0026 enum Quality
0027 {
0028 Good,
0029 Medium,
0030 Bad
0031 };
0032
0033 int Init() override;
0034 int Draw(const std::string &what = "ALL") override;
0035 int MakeHtml(const std::string &what = "ALL") override;
0036 int SavePlot(const std::string &what = "ALL", const std::string &type = "png") override;
0037
0038 int PublishHistogram(TCanvas *c, int pad, TH1 *h, const char *opt = "", int palettestyle=0);
0039 int PublishHistogram(TPad *p, TH1 *h, const char *opt = "", int palettestyle=0);
0040
0041
0042 int PublishHistogram(TPad *p, int pad, TH1 *h, const char *opt = "", int palettestyle=0);
0043 void PublishStatistics(int canvasid, OnlMonClient *cl);
0044 template <typename T>
0045 int MergeServers(T *h);
0046 void formatPaveText(TPaveText *aPT, float aTextSize, Color_t aTextColor, short aTextAlign, const char *aText);
0047 std::vector<Quality> analyseForError(TH2Poly *lane, TH2Poly *noisy, TH1 *strobes, TH1 *decErr, TH1 *decErrTime, TH1 *DMAstat);
0048 void DrawPave(std::vector<MvtxMonDraw::Quality> status, int position, const char *what = "");
0049 static void setPalDefault();
0050 static void setPalUser();
0051
0052 private:
0053 const static int NSTAVE = 48;
0054 const static int NCHIP = 9;
0055 const static int NLAYERS = 3;
0056 const int NStaves[NLAYERS] = {12, 16, 20};
0057 const int StaveBoundary[NLAYERS + 1] = {0, 12, 28, 48};
0058 std::string mLaneStatusFlag[NFlags] = {"WARNING", "ERROR", "FAULT"};
0059 static const int NFlx = 6;
0060 static constexpr int NCols = 1024;
0061 static constexpr int NRows = 512;
0062 static constexpr int NPixels = NRows * NCols;
0063 const int chipmapoffset[3] = {0, 12, 28};
0064 const int LayerBoundaryFEE[NLAYERS - 1] = {35, 83};
0065 const int LayerBoundaryChip[NLAYERS - 1] = {35*3, 83*3};
0066
0067 int MakeCanvas(const std::string &name);
0068 int DrawFirst(const std::string &what = "ALL");
0069 int DrawSecond(const std::string &what = "ALL");
0070 int DrawHitMap(const std::string &what = "ALL");
0071 int DrawGeneral(const std::string &what = "ALL");
0072 int DrawFEE(const std::string &what = "ALL");
0073 int DrawOCC(const std::string &what = "ALL");
0074 int DrawFHR(const std::string &what = "ALL");
0075 int DrawHistory(const std::string &what = "ALL");
0076 int DrawServerStats();
0077 int TimeOffsetTicks = -1;
0078 int lastStrobes[12] = {0};
0079 TCanvas *TC[7] = {nullptr};
0080 TPad *transparent[7] = {nullptr};
0081 TPad *Pad[6] = {nullptr};
0082 TGraphErrors *gr[6] = {nullptr};
0083 OnlMonDB *dbvars[NFlx] = {nullptr};
0084
0085 int maxbadchips = 2;
0086
0087 };
0088
0089 #endif