69 return std::make_tuple( payload.
GetX(), payload.
GetY() );
82 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
83 auto iov = iovs.front();
84 std::shared_ptr<BeamSpotObjects>
payload = fetchPayload( std::get<1>(iov) );
86 TCanvas
canvas(
"Beam Spot Parameters Summary",
"BeamSpot Parameters summary",1000,1000);
89 canvas.SetTopMargin(0.07);
90 canvas.SetBottomMargin(0.06);
91 canvas.SetLeftMargin(0.15);
92 canvas.SetRightMargin(0.03);
96 auto h2_BSParameters = std::unique_ptr<TH2F>(
new TH2F(
"Parameters",
"BeamSpot parameters summary",2,0.0,2.0,8,0,8.));
97 h2_BSParameters->SetStats(
false);
99 std::function<double(parameters,bool)> cutFunctor = [&
payload](
parameters my_param,
bool isError) {
103 case X :
return payload->GetX();
104 case Y :
return payload->GetY();
105 case Z :
return payload->GetZ();
106 case sigmaX :
return payload->GetBeamWidthX();
107 case sigmaY :
return payload->GetBeamWidthY();
108 case sigmaZ :
return payload->GetSigmaZ();
109 case dxdz :
return payload->Getdxdz();
110 case dydz :
return payload->Getdydz();
111 case END_OF_TYPES :
return ret;
112 default :
return ret;
116 case X :
return payload->GetXError();
117 case Y :
return payload->GetYError();
118 case Z :
return payload->GetZError();
119 case sigmaX :
return payload->GetBeamWidthXError();
120 case sigmaY :
return payload->GetBeamWidthYError();
121 case sigmaZ :
return payload->GetSigmaZError();
122 case dxdz :
return payload->GetdxdzError();
123 case dydz :
return payload->GetdydzError();
124 case END_OF_TYPES :
return ret;
125 default :
return ret;
130 h2_BSParameters->GetXaxis()->SetBinLabel(1,
"Value");
131 h2_BSParameters->GetXaxis()->SetBinLabel(2,
"Error");
136 std::string theLabel = getStringFromTypeEnum(param);
137 h2_BSParameters->GetYaxis()->SetBinLabel(yBin,theLabel.c_str());
138 h2_BSParameters->SetBinContent(1,yBin,cutFunctor(param,
false));
139 h2_BSParameters->SetBinContent(2,yBin,cutFunctor(param,
true));
143 h2_BSParameters->GetXaxis()->LabelsOption(
"h");
145 h2_BSParameters->GetYaxis()->SetLabelSize(0.05);
146 h2_BSParameters->GetXaxis()->SetLabelSize(0.05);
148 h2_BSParameters->SetMarkerSize(1.5);
149 h2_BSParameters->Draw(
"TEXT");
152 canvas.SaveAs(fileName.c_str());
160 case X :
return "X [cm]";
161 case Y :
return "Y [cm]";
162 case Z :
return "Z [cm]";
163 case sigmaX :
return "#sigma_{X} [cm]";
164 case sigmaY :
return "#sigma_{Y} [cm]";
165 case sigmaZ :
return "#sigma_{Z} [cm]";
166 case dxdz :
return "#frac{dX}{dZ} [rad]";
167 case dydz :
return "#frac{dY}{dZ} [rad]";
168 default:
return "should never be here";
double GetY() const
get Y beam position
double GetYError() const
get Y beam position Error
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
virtual Y getFromPayload(PayloadType &payload)=0
double GetX() const
get X beam position
double GetXError() const
get X beam position Error