34 #include "TPaveStats.h" 35 #include "TPaletteAxis.h" 45 RunInfoTest() :
cond::payloadInspector::Histogram1D<
RunInfo>(
"Test RunInfo",
"Test RunInfo",10,0.0,10.0)
50 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
51 auto iov = iovs.front();
55 payload->printAllValues();
66 RunInfoParameters() :
cond::payloadInspector::PlotImage<
RunInfo>(
"Display of RunInfo parameters" ){
70 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
71 auto iov = iovs.front();
72 std::shared_ptr<RunInfo> payload = fetchPayload( std::get<1>(iov) );
74 TCanvas
canvas(
"Beam Spot Parameters Summary",
"RunInfo Parameters summary",1000,1000);
77 gStyle->SetHistMinimumZero();
80 canvas.SetBottomMargin(0.06);
82 canvas.SetRightMargin(0.02);
86 auto h2_RunInfoParameters = std::unique_ptr<TH2F>(
new TH2F(
"Parameters",
"",1,0.0,1.0,11,0,11.));
87 auto h2_RunInfoState = std::unique_ptr<TH2F>(
new TH2F(
"State",
"",1,0.0,1.0,11,0,11.));
88 h2_RunInfoParameters->SetStats(
false);
89 h2_RunInfoState->SetStats(
false);
108 default :
return ret;
112 h2_RunInfoParameters->GetXaxis()->SetBinLabel(1,
"Value");
113 h2_RunInfoState->GetXaxis()->SetBinLabel(1,
"Value");
115 unsigned int yBin=11;
119 h2_RunInfoState->GetYaxis()->SetBinLabel(yBin,theLabel.c_str());
120 h2_RunInfoParameters->GetYaxis()->SetBinLabel(yBin,theLabel.c_str());
121 h2_RunInfoParameters->SetBinContent(1,yBin,cutFunctor(param));
123 if((payload->m_run)!=-1){
124 if ((payload->m_avg_current)<=-1){
126 h2_RunInfoState->SetBinContent(1,yBin,0.);
129 h2_RunInfoState->SetBinContent(1,yBin,1.);
133 h2_RunInfoState->SetBinContent(1,yBin,0.9);
139 h2_RunInfoParameters->GetXaxis()->LabelsOption(
"h");
140 h2_RunInfoParameters->GetYaxis()->SetLabelSize(0.05);
141 h2_RunInfoParameters->GetXaxis()->SetLabelSize(0.05);
142 h2_RunInfoParameters->SetMarkerSize(1.5);
144 h2_RunInfoState->GetXaxis()->LabelsOption(
"h");
145 h2_RunInfoState->GetYaxis()->SetLabelSize(0.05);
146 h2_RunInfoState->GetXaxis()->SetLabelSize(0.05);
147 h2_RunInfoState->SetMarkerSize(1.5);
150 h2_RunInfoState->Draw(
"col");
152 h2_RunInfoParameters->Draw(
"TEXTsame");
157 t1.SetTextSize(0.03);
158 t1.DrawLatex(0.1, 0.98,
"RunInfo parameters:");
159 t1.DrawLatex(0.1, 0.95,
"payload:");
163 t1.DrawLatex(0.37, 0.982,Form(
"IOV %s",std::to_string(+std::get<0>(iov)).c_str()));
164 t1.DrawLatex(0.21, 0.952,Form(
" %s",(std::get<1>(iov)).c_str()));
182 ~RunInfoCurrentHistory()
override =
default;
184 float getFromPayload(
RunInfo& payload )
override{
211 default:
return "should never be here";
216 typedef RunInfoCurrentHistory<RunInfoPI::m_start_current> RunInfoStartCurrentHistory;
217 typedef RunInfoCurrentHistory<RunInfoPI::m_stop_current> RunInfoStopCurrentHistory;
218 typedef RunInfoCurrentHistory<RunInfoPI::m_avg_current> RunInfoAverageCurrentHistory;
219 typedef RunInfoCurrentHistory<RunInfoPI::m_max_current> RunInfoMaxCurrentHistory;
220 typedef RunInfoCurrentHistory<RunInfoPI::m_min_current> RunInfoMinCurrentHistory;
221 typedef RunInfoCurrentHistory<RunInfoPI::m_BField> RunInfoBFieldHistory;
void reportSummaryMapPalette(TH2 *obj)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
std::string getStringFromTypeEnum(const parameters ¶meter)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
void setSingleIov(bool flag)
bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override
float theBField(const float current)