30 case sigmaX :
return "sigmaX";
31 case sigmaY :
return "sigmaY";
32 case sigmaZ :
return "sigmaZ";
33 case dxdz :
return "dx/dz";
34 case dydz :
return "dy/dz";
35 default:
return "should never be here";
90 auto ret = std::make_pair<double,double>(-9999.,-9999.);
93 case X :
return std::make_pair<double,double>(payload.
GetX(), payload.
GetXError());
94 case Y :
return std::make_pair<double,double>(payload.
GetY(), payload.
GetYError());
95 case Z :
return std::make_pair<double,double>(payload.
GetZ(), payload.
GetZError());
101 case END_OF_TYPES :
return ret;
102 default :
return ret;
107 typedef BeamSpot_history<X> BeamSpot_HistoryX;
108 typedef BeamSpot_history<Y> BeamSpot_HistoryY;
109 typedef BeamSpot_history<Z> BeamSpot_HistoryZ;
110 typedef BeamSpot_history<sigmaX> BeamSpot_HistorySigmaX;
111 typedef BeamSpot_history<sigmaY> BeamSpot_HistorySigmaY;
112 typedef BeamSpot_history<sigmaZ> BeamSpot_HistorySigmaZ;
113 typedef BeamSpot_history<dxdz> BeamSpot_HistorydXdZ;
114 typedef BeamSpot_history<dydz> BeamSpot_HistorydYdZ;
127 auto ret = std::make_pair<double,double>(-9999.,-9999.);
130 case X :
return std::make_pair<double,double>(payload.
GetX(), payload.
GetXError());
131 case Y :
return std::make_pair<double,double>(payload.
GetY(), payload.
GetYError());
132 case Z :
return std::make_pair<double,double>(payload.
GetZ(), payload.
GetZError());
138 case END_OF_TYPES :
return ret;
139 default :
return ret;
144 typedef BeamSpot_runhistory<X> BeamSpot_RunHistoryX;
145 typedef BeamSpot_runhistory<Y> BeamSpot_RunHistoryY;
146 typedef BeamSpot_runhistory<Z> BeamSpot_RunHistoryZ;
147 typedef BeamSpot_runhistory<sigmaX> BeamSpot_RunHistorySigmaX;
148 typedef BeamSpot_runhistory<sigmaY> BeamSpot_RunHistorySigmaY;
149 typedef BeamSpot_runhistory<sigmaZ> BeamSpot_RunHistorySigmaZ;
150 typedef BeamSpot_runhistory<dxdz> BeamSpot_RunHistorydXdZ;
151 typedef BeamSpot_runhistory<dydz> BeamSpot_RunHistorydYdZ;
164 auto ret = std::make_pair<double,double>(-9999.,-9999.);
167 case X :
return std::make_pair<double,double>(payload.
GetX(), payload.
GetXError());
168 case Y :
return std::make_pair<double,double>(payload.
GetY(), payload.
GetYError());
169 case Z :
return std::make_pair<double,double>(payload.
GetZ(), payload.
GetZError());
175 case END_OF_TYPES :
return ret;
176 default :
return ret;
181 typedef BeamSpot_timehistory<X> BeamSpot_TimeHistoryX;
182 typedef BeamSpot_timehistory<Y> BeamSpot_TimeHistoryY;
183 typedef BeamSpot_timehistory<Z> BeamSpot_TimeHistoryZ;
184 typedef BeamSpot_timehistory<sigmaX> BeamSpot_TimeHistorySigmaX;
185 typedef BeamSpot_timehistory<sigmaY> BeamSpot_TimeHistorySigmaY;
186 typedef BeamSpot_timehistory<sigmaZ> BeamSpot_TimeHistorySigmaZ;
187 typedef BeamSpot_timehistory<dxdz> BeamSpot_TimeHistorydXdZ;
188 typedef BeamSpot_timehistory<dydz> BeamSpot_TimeHistorydYdZ;
200 return std::make_tuple( payload.
GetX(), payload.
GetY() );
210 setSingleIov(
true );
213 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
214 auto iov = iovs.front();
215 std::shared_ptr<BeamSpotObjects>
payload = fetchPayload( std::get<1>(iov) );
217 TCanvas
canvas(
"Beam Spot Parameters Summary",
"BeamSpot Parameters summary",1000,1000);
220 canvas.SetTopMargin(0.07);
221 canvas.SetBottomMargin(0.06);
222 canvas.SetLeftMargin(0.15);
223 canvas.SetRightMargin(0.03);
227 auto h2_BSParameters = std::unique_ptr<TH2F>(
new TH2F(
"Parameters",
"BeamSpot parameters summary",2,0.0,2.0,8,0,8.));
228 h2_BSParameters->SetStats(
false);
230 std::function<double(parameters,bool)> cutFunctor = [&
payload](
parameters my_param,
bool isError) {
234 case X :
return payload->GetX();
235 case Y :
return payload->GetY();
236 case Z :
return payload->GetZ();
237 case sigmaX :
return payload->GetBeamWidthX();
238 case sigmaY :
return payload->GetBeamWidthY();
239 case sigmaZ :
return payload->GetSigmaZ();
240 case dxdz :
return payload->Getdxdz();
241 case dydz :
return payload->Getdydz();
242 case END_OF_TYPES :
return ret;
243 default :
return ret;
247 case X :
return payload->GetXError();
248 case Y :
return payload->GetYError();
249 case Z :
return payload->GetZError();
250 case sigmaX :
return payload->GetBeamWidthXError();
251 case sigmaY :
return payload->GetBeamWidthYError();
252 case sigmaZ :
return payload->GetSigmaZError();
253 case dxdz :
return payload->GetdxdzError();
254 case dydz :
return payload->GetdydzError();
255 case END_OF_TYPES :
return ret;
256 default :
return ret;
261 h2_BSParameters->GetXaxis()->SetBinLabel(1,
"Value");
262 h2_BSParameters->GetXaxis()->SetBinLabel(2,
"Error");
268 h2_BSParameters->GetYaxis()->SetBinLabel(yBin,theLabel.c_str());
269 h2_BSParameters->SetBinContent(1,yBin,cutFunctor(param,
false));
270 h2_BSParameters->SetBinContent(2,yBin,cutFunctor(param,
true));
274 h2_BSParameters->GetXaxis()->LabelsOption(
"h");
276 h2_BSParameters->GetYaxis()->SetLabelSize(0.05);
277 h2_BSParameters->GetXaxis()->SetLabelSize(0.05);
279 h2_BSParameters->SetMarkerSize(1.5);
280 h2_BSParameters->Draw(
"TEXT");
283 canvas.SaveAs(fileName.c_str());
291 case X :
return "X [cm]";
292 case Y :
return "Y [cm]";
293 case Z :
return "Z [cm]";
294 case sigmaX :
return "#sigma_{X} [cm]";
295 case sigmaY :
return "#sigma_{Y} [cm]";
296 case sigmaZ :
return "#sigma_{Z} [cm]";
297 case dxdz :
return "#frac{dX}{dZ} [rad]";
298 case dydz :
return "#frac{dY}{dZ} [rad]";
299 default:
return "should never be here";
double Getdydz() const
get dydz slope, crossing angle in YZ
double GetY() const
get Y beam position
double GetSigmaZ() const
get sigma Z, RMS bunch length
double GetBeamWidthX() const
get average transverse beam width
double GetYError() const
get Y beam position Error
double GetBeamWidthYError() const
get average transverse beam width error X = Y
double GetBeamWidthY() const
get average transverse beam width
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
double GetdydzError() const
get dydz slope, crossing angle in YZ Error
double GetZ() const
get Z beam position
std::string getStringFromTypeEnum(const parameters ¶meter)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
double Getdxdz() const
get dxdz slope, crossing angle in XZ
double GetdxdzError() const
get dxdz slope, crossing angle in XZ Error
double GetBeamWidthXError() const
get average transverse beam width error ASSUME the same for X and Y
virtual Y getFromPayload(PayloadType &payload)=0
double GetSigmaZError() const
get sigma Z, RMS bunch length Error
double GetX() const
get X beam position
double GetXError() const
get X beam position Error
double GetZError() const
get Z beam position Error