21 : fShortCount(0), fLongCount(0) {
22 RegisterInputCollection(
"InputCollection",
23 "Scaler object inheriting from art::TScalerData",
26 RegisterProcessorParameter(
"ShortInterval",
"the interval time (seconds) for short time monitor",
28 RegisterProcessorParameter(
"ShortDuration",
"the time range (seconds) for short time monitor",
30 RegisterProcessorParameter(
"LongInterval",
"the interval time (seconds) for long time monitor",
32 RegisterProcessorParameter(
"LongDuration",
"the time range (seconds) for long time monitor",
35 RegisterProcessorParameter(
"Clock",
"the channel number of 10Hz clock [ch, Hz]",
39 RegisterProcessorParameter(
"Channels",
"the time range (seconds) for long time monitor",
61 gStyle->SetTimeOffset(-788918400);
62 gStyle->SetNdivisions(505);
63 gStyle->SetPadGridX(1);
64 gStyle->SetPadGridY(1);
66 Info(
"Init",
"Scaler live time chart");
67 Info(
"Init",
"NEED: analysis speed > trigger rate");
70 Info(
"Init",
"Display: channel, name, scale factor");
71 for (Size_t i = 0; i <
fChannels.size(); i++) {
72 Info(
"Init",
"Display: %s",
fChannels[i].Data());
77 SetStateError(TString::Format(
"input not found: %s",
fInputColName.Data()));
81 for (Size_t i = 0; i <
fChannels.size(); i++) {
86 SetStateError(
"Input steering yaml is wrong, need \"ch, name, factor\"");
89 TString channel_str =
fChannels[i](0, first);
90 Int_t channel = channel_str.Remove(TString::kBoth,
' ').Atoi();
93 TString name =
fChannels[i](first + 1, last - first - 1);
94 fNames.emplace_back(name.Remove(TString::kBoth,
' '));
96 TString factor_str =
fChannels[i](last + 1, len - last - 1);
97 Double_t factor = factor_str.Remove(TString::kBoth,
' ').Atof();
103 fGr_s[i] =
new TGraph();
104 fGr_s[i]->SetLineWidth(1);
105 fGr_s[i]->SetMarkerStyle(8);
106 fGr_s[i]->SetMarkerSize(0.8);
107 fGr_s[i]->SetMinimum(0.);
108 fGr_s[i]->SetMaximum(1000.);
110 fGr_l[i] =
new TGraph();
111 fGr_l[i]->SetLineWidth(1);
112 fGr_l[i]->SetMarkerStyle(8);
113 fGr_l[i]->SetMarkerSize(0.8);
114 fGr_l[i]->SetMinimum(0.);
115 fGr_l[i]->SetMaximum(1000.);
118 for (Size_t i = 0; i <
fChannels.size(); i++) {
134 main =
new TCanvas(
"canvas",
"monitor", 800, 800);
135 pad_s =
new TPad(
"short",
"short", 0.0, 0.5, 1.0, 1.0);
136 pad_l =
new TPad(
"long",
"long", 0.0, 0.0, 1.0, 0.5);
169 const TScalerData *
const scadata =
static_cast<TScalerData *
>(*fInData);
191 fGr_s[i]->GetPoint(j + 1, x, y);
192 fGr_s[i]->SetPoint(j, x, y);
200 Bool_t isfirst_obj =
true;
201 TLegend *legend =
new TLegend(0.78, 0.70, 0.95, 0.95);
202 for (Size_t i = 0; i <
fDisplayCh.size(); i++) {