67 const std::string folder (
"kazu_pedestal");
68 const unsigned int ch = 0;
69 const std::string param (
"mean");
73 const size_t npoints=100;
74 std::vector<double> xarray, yarray;
75 xarray.reserve(npoints);
76 yarray.reserve(npoints);
77 double ymax = std::numeric_limits<double>::min();
78 double ymin = std::numeric_limits<double>::max();
81 TTimeStamp start (2015,2,6,0,0,1,0,
false);
82 TTimeStamp
end (2015,2,6,1,0,1,0,
false);
83 TTimeStamp
now (start);
86 art::ServiceHandle<lariov::WebReaderService const> db_handle;
87 auto&
db = db_handle->GetWebReader<
double>();
89 int period = (int)( (
end.GetSec() - start.GetSec()) / (
double)(npoints) );
90 for(
size_t i=0; i<npoints; ++i) {
93 now.SetSec(
now.GetSec() + period );
96 auto snapshot =
db.Request(folder,
now);
99 auto ch_data = snapshot.ChData(ch);
102 if( param_index < 0 ) param_index = snapshot.Name2Index(param);
105 auto val = ch_data[ param_index ];
108 xarray.push_back(
now.GetSec() );
109 yarray.push_back( val );
112 if( val > ymax ) ymax = val;
113 if( val < ymin ) ymin = val;
119 if( !ymax && !ymin ) { ymax=1; ymin=-1; }
123 art::ServiceHandle<art::TFileService const> fs;
124 gPed = fs->make<TGraph>(npoints,&xarray[0],&yarray[0]);
125 gPed->SetName(
"gPed");
126 gPed->SetTitle(
"Pedestal Mean Value Over Time; ;Pedestal Mean");
127 gPed->GetXaxis()->SetTimeDisplay(1);
128 gPed->GetXaxis()->SetNdivisions(-503);
129 gPed->GetXaxis()->SetTimeFormat(
"%Y-%m-%d %H:%M");
130 gPed->GetXaxis()->SetTimeOffset(0,
"gmt");
131 gPed->GetXaxis()->SetRangeUser(start.GetSec(),
end.GetSec());
132 gPed->SetMarkerStyle(22);
133 gPed->SetMarkerSize(1);
134 gPed->SetMaximum(ymax);
135 gPed->SetMinimum(ymin);
137 TCanvas c(
"c",
"",600,500);
139 c.SaveAs(
"gPed.gif");
auto end(FixedBins< T, C > const &) noexcept
height to which particles are projected pnfs larsoft persistent physics cosmics Fermilab CORSIKA standard He_showers_ * db