43 SiStripConfObjectTest() :
cond::payloadInspector::Histogram1D<
SiStripConfObject>(
"SiStrip Configuration Object test",
44 "SiStrip Configuration Object test", 1,0.0,1.0)
49 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
50 for (
auto const & iov: iovs) {
57 ss <<
"Summary of strips configuration object:" << std::endl;
59 SiStripConfObject::parMap::const_iterator it = payload->parameters.begin();
60 for( ; it != payload->parameters.end(); ++it ) {
61 ss <<
"parameter name = " << it->first <<
" value = " << it->second << std::endl;
76 SiStripConfObjectDisplay() :
cond::payloadInspector::PlotImage<
SiStripConfObject>(
"Display Configuration Values")
81 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
82 auto iov = iovs.front();
83 std::shared_ptr<SiStripConfObject> payload = fetchPayload( std::get<1>(iov) );
85 unsigned int run = std::get<0>(iov);
86 std::vector<float> y_line;
91 t1.SetTextSize(0.045);
96 latex.SetTextSize(0.035);
98 unsigned int configsize_ = payload->parameters.size();
99 TLine
lines[configsize_+1];
101 auto h_Config = std::unique_ptr<TH1F>(
new TH1F(
"ConfigParamter",
";;configuration value",configsize_,0.,configsize_));
102 h_Config->SetStats(
false);
104 bool isShiftAndXTalk = payload->isParameter(
"shift_IB1Deco");
107 int c_width = isShiftAndXTalk ? 2000 : 1000;
108 int c_height = isShiftAndXTalk ? 1000 : 800;
110 TCanvas
canvas(
"Configuration Summary",
"Configuration Summary",c_width,c_height);
114 if(!isShiftAndXTalk){
116 t1.DrawLatex(0.5, 0.96, Form(
"SiStrip ConfObject, IOV %i",run));
117 latex.DrawLatex(0.1,0.92,
"Parameter"); latex.DrawLatex(0.6,0.92,
"Value");
118 y_line.push_back(0.92);
119 latex.SetTextFont(42);
120 latex.SetTextColor(kBlack);
122 SiStripConfObject::parMap::const_iterator it = payload->parameters.begin();
123 unsigned int count=0;
124 for( ; it != payload->parameters.end(); ++it ) {
126 float y_loc=0.92-(0.90/configsize_)*count;
127 latex.SetTextSize(
std::min(0.035,0.95/configsize_));
128 latex.DrawLatex(0.1,y_loc,(it->first).c_str()); latex.DrawLatex(0.6,y_loc,(it->second).c_str());
129 y_line.push_back(y_loc);
133 for (
const auto &
line : y_line){
134 lines[iL] = TLine(gPad->GetUxmin(),
line,gPad->GetUxmax(),
line);
135 lines[iL].SetLineWidth(1);
136 lines[iL].SetLineStyle(9);
137 lines[iL].SetLineColor(2);
138 lines[iL].Draw(
"same");
146 canvas.SetBottomMargin(0.16);
147 canvas.SetLeftMargin(0.08);
148 canvas.SetRightMargin(0.02);
149 canvas.SetTopMargin(0.05);
152 SiStripConfObject::parMap::const_iterator it = payload->parameters.begin();
154 unsigned int count=0;
155 for( ; it != payload->parameters.end(); ++it ) {
158 h_Config->SetBinContent(count,std::stof(it->second));
159 h_Config->GetXaxis()->SetBinLabel(count,(std::regex_replace(it->first, std::regex(
"_"),
" ")).c_str());
163 h_Config->GetYaxis()->SetTitleOffset(0.8);
164 h_Config->GetXaxis()->SetLabelSize(0.03);
165 h_Config->SetMaximum(h_Config->GetMaximum()*1.20);
166 h_Config->SetFillColorAlpha(kRed,0.35);
168 h_Config->Draw(
"textsame");
170 t1.DrawLatex(0.5, 0.96, Form(
"SiStrip ConfObject, IOV %i: Payload %s",run,(std::get<1>(iov)).c_str()));
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
void makeNicePlotStyle(TH1 *hist)
void fillWithValue(float value, float weight=1)
#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