48 : g_v_x_vs_xi(new TGraph),
49 g_L_x_vs_xi(new TGraph),
50 g_x_D_vs_xi(new TGraph),
51 g_v_y_vs_xi(new TGraph),
52 g_L_y_vs_xi(new TGraph),
53 g_y_D_vs_xi(new TGraph),
54 h_y_vs_x_disp(new TGraph) {}
57 g_v_x_vs_xi->SetTitle(
";xi;v_{x}");
58 g_v_x_vs_xi->Write(
"g_v_x_vs_xi");
60 g_L_x_vs_xi->SetTitle(
";xi;L_{x} (cm)");
61 g_L_x_vs_xi->Write(
"g_L_x_vs_xi");
63 g_x_D_vs_xi->SetTitle(
";xi;x_{D} (cm)");
64 g_x_D_vs_xi->Write(
"g_x_D_vs_xi");
66 g_v_y_vs_xi->SetTitle(
";xi;v_{y}");
67 g_v_y_vs_xi->Write(
"g_v_y_vs_xi");
69 g_L_y_vs_xi->SetTitle(
";xi;L_{y} (cm)");
70 g_L_y_vs_xi->Write(
"g_L_y_vs_xi");
72 g_y_D_vs_xi->SetTitle(
";xi;y_{D} (cm)");
73 g_y_D_vs_xi->Write(
"g_y_D_vs_xi");
75 h_y_vs_x_disp->SetTitle(
";x (cm);y (cm)");
76 h_y_vs_x_disp->Write(
"h_y_vs_x_disp");
87 ArmPlots() : g_de_x_vs_x_disp(new TGraph), g_de_y_vs_x_disp(new TGraph) {}
90 g_de_x_vs_x_disp->SetTitle(
";x_N (cm);x_F - x_N (cm)");
91 g_de_x_vs_x_disp->Write(
"g_de_x_vs_x_disp");
93 g_de_y_vs_x_disp->SetTitle(
";x_N (cm);y_F - y_N (cm)");
94 g_de_y_vs_x_disp->Write(
"g_de_y_vs_x_disp");
136 if (hOpticalFunctions->empty())
140 for (
const auto& it : *hOpticalFunctions) {
142 unsigned int rpDecId = rpId.
arm() * 100 + rpId.
station() * 10 + rpId.
rp();
148 it.second.transport(k_in_beam, k_out_beam);
150 const double vtx_ep = 1E-4;
151 const double th_ep = 1E-6;
153 for (
double xi = 0.;
xi < 0.30001;
xi += 0.001) {
156 it.second.transport(k_in_xi, k_out_xi);
160 it.second.transport(k_in_xi_vtx_x, k_out_xi_vtx_x);
164 it.second.transport(k_in_xi_th_x, k_out_xi_th_x);
168 it.second.transport(k_in_xi_vtx_y, k_out_xi_vtx_y);
172 it.second.transport(k_in_xi_th_y, k_out_xi_th_y);
174 int idx = pl.g_v_x_vs_xi->GetN();
176 pl.g_v_x_vs_xi->SetPoint(idx, xi, (k_out_xi_vtx_x.
x - k_out_xi.
x) / vtx_ep);
177 pl.g_L_x_vs_xi->SetPoint(idx, xi, (k_out_xi_th_x.
x - k_out_xi.
x) / th_ep);
178 pl.g_x_D_vs_xi->SetPoint(idx, xi, k_out_xi.
x - k_out_beam.
x);
180 pl.g_v_y_vs_xi->SetPoint(idx, xi, (k_out_xi_vtx_y.
y - k_out_xi.
y) / vtx_ep);
181 pl.g_L_y_vs_xi->SetPoint(idx, xi, (k_out_xi_th_y.
y - k_out_xi.
y) / th_ep);
182 pl.g_y_D_vs_xi->SetPoint(idx, xi, k_out_xi.
y - k_out_beam.
y);
184 pl.h_y_vs_x_disp->SetPoint(idx, k_out_xi.
x - k_out_beam.
x, k_out_xi.
y - k_out_beam.
y);
193 for (
const auto& it : *hOpticalFunctions) {
195 unsigned int rpDecId = rpId.
arm() * 100 + rpId.
station() * 10 + rpId.
rp();
197 if (rpDecId == ap.second.id_N)
199 if (rpDecId == ap.second.id_F)
203 if (!opt_N || !opt_F) {
204 edm::LogError(
"CTPPSOpticsPlotter::analyze") <<
"Cannot find optics objects for arm " << ap.first;
211 opt_N->
transport(k_in_beam, k_out_beam_N);
212 opt_F->transport(k_in_beam, k_out_beam_F);
214 for (
double xi = 0.;
xi < 0.30001;
xi += 0.001) {
219 opt_F->transport(k_in_xi, k_out_xi_F);
221 int idx = ap.second.g_de_x_vs_x_disp->GetN();
223 ap.second.g_de_x_vs_x_disp->SetPoint(
224 idx, k_out_xi_N.
x - k_out_beam_N.
x, (k_out_xi_F.
x - k_out_beam_F.
x) - (k_out_xi_N.
x - k_out_beam_N.
x));
225 ap.second.g_de_y_vs_x_disp->SetPoint(
226 idx, k_out_xi_N.
x - k_out_beam_N.
x, (k_out_xi_F.
y - k_out_beam_F.
y) - (k_out_xi_N.
y - k_out_beam_N.
y));
234 auto f_out = std::make_unique<TFile>(
outputFile_.c_str(),
"recreate");
237 gDirectory = f_out->mkdir(Form(
"%u",
p.first));
242 gDirectory = f_out->mkdir(Form(
"arm %u",
p.first));
void analyze(const edm::Event &, const edm::EventSetup &) override
std::unique_ptr< TGraph > g_L_x_vs_xi
CTPPSOpticsPlotter(const edm::ParameterSet &)
std::unique_ptr< TGraph > g_x_D_vs_xi
std::map< unsigned int, ArmPlots > arm_plots_
std::unique_ptr< TGraph > g_L_y_vs_xi
#define DEFINE_FWK_MODULE(type)
std::unique_ptr< TGraph > g_de_y_vs_x_disp
std::unique_ptr< TGraph > g_v_y_vs_xi
proton kinematics description
std::map< unsigned int, RPPlots > rp_plots_
std::unique_ptr< TGraph > g_v_x_vs_xi
std::unique_ptr< TGraph > h_y_vs_x_disp
void transport(const Kinematics &input, Kinematics &output, bool calculateAngles=false) const
transports proton according to the splines
std::unique_ptr< TGraph > g_y_D_vs_xi
Set of optical functions corresponding to one scoring plane along LHC, including splines for interpol...
Base class for CTPPS detector IDs.