Skip to content

Commit 4807f6e

Browse files
committed
Added standalone CRV data viewer / prototype artdaq DQM
1 parent b331f52 commit 4807f6e

File tree

5 files changed

+459
-0
lines changed

5 files changed

+459
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
include(BuildPlugins)
2+
3+
cet_build_plugin(CrvDQM art::module LIBRARIES REG
4+
art_root_io::TFileService_service
5+
artdaq_core_mu2e::artdaq-core-mu2e_Data
6+
otsdaq_mu2e::otsdaq-mu2e_ArtModules
7+
otsdaq::NetworkUtilities
8+
ROOT::Hist
9+
ROOT::Tree
10+
ROOT::Core
11+
ROOT::RIO
12+
ROOT::Gui
13+
ROOT::RHTTP
14+
)
15+
16+
install_headers(SUBDIRS detail)
17+
install_source(SUBDIRS detail)
18+
install_fhicl(SUBDIRS fcl)
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// ROOT styling for CRV DQM
2+
// Samuel Grant 2025
3+
4+
#ifndef CRV_DQM_STYLE_H
5+
#define CRV_DQM_STYLE_H
6+
7+
#include "TH1.h"
8+
#include "TH2.h"
9+
#include "TStyle.h"
10+
#include "TCanvas.h"
11+
#include "TPad.h"
12+
#include "TROOT.h"
13+
14+
class CrvDQMStyle {
15+
public:
16+
static void SetStyle() {
17+
18+
TStyle *style = new TStyle("CrvStyle", "CRV DQM styling");
19+
20+
// Basic canvas settings
21+
style->SetCanvasColor(kWhite);
22+
style->SetCanvasBorderMode(0);
23+
style->SetPadColor(kWhite);
24+
style->SetPadBorderMode(0);
25+
style->SetPadTopMargin(0.05);
26+
style->SetPadBottomMargin(0.13);
27+
style->SetPadLeftMargin(0.15);
28+
style->SetPadRightMargin(0.05);
29+
30+
// Font settings
31+
style->SetTextFont(42);
32+
style->SetLabelFont(42, "xyz");
33+
style->SetTitleFont(42, "xyz");
34+
35+
// Text sizes
36+
style->SetTextSize(0.045);
37+
style->SetLabelSize(0.045, "xyz");
38+
style->SetTitleSize(0.05, "xyz");
39+
40+
// Title positioning
41+
style->SetTitleOffset(1.2, "y");
42+
style->SetTitleOffset(1.0, "x");
43+
44+
// Canvas fill
45+
style->SetFillColor(kWhite);
46+
style->SetFillStyle(1001);
47+
48+
// Ticks and divisions
49+
style->SetPadTickX(1);
50+
style->SetPadTickY(1);
51+
style->SetTickLength(0.015);
52+
style->SetNdivisions(505, "xyz");
53+
54+
// Frame
55+
style->SetFrameLineWidth(1);
56+
style->SetLineWidth(1);
57+
58+
style->SetOptStat(0);
59+
60+
// Use current style - this works in 6.30
61+
gROOT->SetStyle("CrvStyle");
62+
gROOT->ForceStyle();
63+
}
64+
65+
static void FormatHist(TH1* hist, const std::string& colour = "blue") {
66+
if (!hist) return;
67+
// Basic histogram-specific formatting
68+
hist->SetStats(0);
69+
hist->SetLineWidth(2);
70+
hist->SetFillStyle(1001);
71+
hist->SetLineStyle(1);
72+
hist->GetYaxis()->SetTitleOffset(1.6);
73+
hist->GetXaxis()->SetTitleOffset(1.2);
74+
75+
// Primary colours
76+
if (colour == "blue") {
77+
hist->SetLineColor(kAzure+2);
78+
hist->SetFillColor(kAzure-9);
79+
}
80+
else if (colour == "green") {
81+
hist->SetLineColor(kGreen+2);
82+
hist->SetFillColor(kGreen-9);
83+
}
84+
else if (colour == "red") {
85+
hist->SetLineColor(kRed+2);
86+
hist->SetFillColor(kRed-9);
87+
}
88+
}
89+
};
90+
91+
#endif

0 commit comments

Comments
 (0)