Skip to content

Commit d132949

Browse files
committed
code format
1 parent 7890724 commit d132949

File tree

1 file changed

+43
-15
lines changed

1 file changed

+43
-15
lines changed

SimTransport/TotemRPProtonTransportParametrization/src/LHCOpticsApproximator.cc

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ bool LHCOpticsApproximator::Transport_m_GeV(double in_pos[3],
199199
in[3] = in_momentum[1] / nominal_beam_momentum_;
200200
in[4] = (part_mom - nominal_beam_momentum_) / nominal_beam_momentum_;
201201

202-
if (!Transport(in, out, check_apertures, true)) { return false; }
202+
if (!Transport(in, out, check_apertures, true)) {
203+
return false;
204+
}
203205

204206
out_pos[0] = out[0];
205207
out_pos[1] = out[2];
@@ -209,7 +211,7 @@ bool LHCOpticsApproximator::Transport_m_GeV(double in_pos[3],
209211
out_momentum[1] = out[3] * nominal_beam_momentum_;
210212
double part_out_total_mom = (out[4] + 1) * nominal_beam_momentum_;
211213
out_momentum[2] = std::sqrt(part_out_total_mom * part_out_total_mom - out_momentum[0] * out_momentum[0] -
212-
out_momentum[1] * out_momentum[1]);
214+
out_momentum[1] * out_momentum[1]);
213215
out_momentum[2] = TMath::Sign(out_momentum[2], in_momentum[2]);
214216

215217
return true;
@@ -231,7 +233,9 @@ bool LHCOpticsApproximator::Transport(const MadKinematicDescriptor *in,
231233
input[4] = in->ksi;
232234

233235
//transport inverts the coordinate systems
234-
if (!Transport(input, output, check_apertures, invert_beam_coord_sytems)) { return false; }
236+
if (!Transport(input, output, check_apertures, invert_beam_coord_sytems)) {
237+
return false;
238+
}
235239

236240
out->x = output[0];
237241
out->theta_x = output[1];
@@ -1033,13 +1037,17 @@ void LHCOpticsApproximator::PrintCoordinateOpticalFunctions(TMultiDimFet &parame
10331037
void LHCOpticsApproximator::GetLinearApproximation(
10341038
double atPoint[], double &Cx, double &Lx, double &vx, double &Cy, double &Ly, double &vy, double &D, double ep) {
10351039
double out[2];
1036-
if (!Transport2D(atPoint, out)) { return; }
1040+
if (!Transport2D(atPoint, out)) {
1041+
return;
1042+
}
10371043
Cx = out[0];
10381044
Cy = out[1];
10391045

10401046
for (int i = 0; i < 5; ++i) {
10411047
atPoint[i] += ep;
1042-
if (!Transport2D(atPoint, out)) { continue; }
1048+
if (!Transport2D(atPoint, out)) {
1049+
continue;
1050+
}
10431051
switch (i) {
10441052
case 0:
10451053
vx = (out[0] - Cx) / ep;
@@ -1081,18 +1089,24 @@ void LHCOpticsApproximator::GetLineariasedTransportMatrixX(double mad_init_x,
10811089

10821090
double out[5];
10831091

1084-
if (!Transport(in, out)) { return; };
1092+
if (!Transport(in, out)) {
1093+
return;
1094+
};
10851095
double x1 = out[0];
10861096
double thx1 = out[1];
10871097

10881098
in[0] = mad_init_x + d_mad_x;
1089-
if (!Transport(in, out)) { return; }
1099+
if (!Transport(in, out)) {
1100+
return;
1101+
}
10901102
double x2_dx = out[0];
10911103
double thx2_dx = out[1];
10921104

10931105
in[0] = mad_init_x;
10941106
in[1] = mad_init_thx + d_mad_thx; //?
1095-
if (!Transport(in, out)) { return; }
1107+
if (!Transport(in, out)) {
1108+
return;
1109+
}
10961110
double x2_dthx = out[0];
10971111
double thx2_dthx = out[1];
10981112

@@ -1125,18 +1139,24 @@ void LHCOpticsApproximator::GetLineariasedTransportMatrixY(double mad_init_x,
11251139

11261140
double out[5];
11271141

1128-
if (!Transport(in, out)) { return; };
1142+
if (!Transport(in, out)) {
1143+
return;
1144+
};
11291145
double y1 = out[2];
11301146
double thy1 = out[3];
11311147

11321148
in[2] = mad_init_y + d_mad_y;
1133-
if (!Transport(in, out)) { return; }
1149+
if (!Transport(in, out)) {
1150+
return;
1151+
}
11341152
double y2_dy = out[2];
11351153
double thy2_dy = out[3];
11361154

11371155
in[2] = mad_init_y;
11381156
in[3] = mad_init_thy + d_mad_thy; //?
1139-
if (!Transport(in, out)) { return; }
1157+
if (!Transport(in, out)) {
1158+
return;
1159+
}
11401160
double y2_dthy = out[2];
11411161
double thy2_dthy = out[3];
11421162

@@ -1165,11 +1185,15 @@ double LHCOpticsApproximator::GetDx(double mad_init_x,
11651185

11661186
double out[5];
11671187

1168-
if (!Transport(in, out)) { return 0.0; }
1188+
if (!Transport(in, out)) {
1189+
return 0.0;
1190+
}
11691191
double x1 = out[0];
11701192

11711193
in[4] = mad_init_xi + d_mad_xi;
1172-
if (!Transport(in, out)) { return 0.0; }
1194+
if (!Transport(in, out)) {
1195+
return 0.0;
1196+
}
11731197
double x2_dxi = out[0];
11741198
double dispersion = (x2_dxi - x1) / d_mad_xi;
11751199

@@ -1194,11 +1218,15 @@ double LHCOpticsApproximator::GetDxds(double mad_init_x,
11941218

11951219
double out[5];
11961220

1197-
if (!Transport(in, out)) { return 0.0; }
1221+
if (!Transport(in, out)) {
1222+
return 0.0;
1223+
}
11981224
double thx1 = out[1] / MADX_momentum_correction_factor;
11991225

12001226
in[4] = mad_init_xi + d_mad_xi;
1201-
if (!Transport(in, out)) { return 0.0; }
1227+
if (!Transport(in, out)) {
1228+
return 0.0;
1229+
}
12021230
double thx2_dxi = out[1] / MADX_momentum_correction_factor;
12031231
double dispersion = (thx2_dxi - thx1) / d_mad_xi;
12041232

0 commit comments

Comments
 (0)