Skip to content

Commit 139fe41

Browse files
Nicola NicassioNicola Nicassio
authored andcommitted
adjusting formatting issue
1 parent fd5151e commit 139fe41

1 file changed

Lines changed: 66 additions & 49 deletions

File tree

Lines changed: 66 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,69 @@
1-
std::function<void(const double *, double *)> field() {
2-
return [](const double *x, double *b) {
3-
double Rc;
4-
double R1;
5-
double R2;
6-
double B1;
7-
double B2;
8-
double beamStart = 500.; //[cm]
9-
double tokGauss = 1. / 0.1; // conversion from Tesla to kGauss
10-
11-
bool isMagAbs = true;
12-
13-
// ***********************
14-
// LAYOUT 1
15-
// ***********************
16-
17-
// RADIUS
18-
Rc = 185.; //[cm]
19-
R1 = 220.; //[cm]
20-
R2 = 290.; //[cm]
21-
22-
// To set the B2
23-
B1 = 2.; //[T]
24-
B2 = -Rc * Rc * B1 / ((R2 * R2 - R1 * R1)); //[T]
25-
26-
if ((abs(x[2]) <= beamStart) && (sqrt(x[0] * x[0] + x[1] * x[1]) < Rc)) {
27-
b[0] = 0.;
28-
b[1] = 0.;
29-
b[2] = B1 * tokGauss;
30-
} else if ((abs(x[2]) <= beamStart) &&
31-
(sqrt(x[0] * x[0] + x[1] * x[1]) >= Rc &&
32-
sqrt(x[0] * x[0] + x[1] * x[1]) < R1)) {
33-
b[0] = 0.;
34-
b[1] = 0.;
35-
b[2] = 0.;
36-
} else if ((abs(x[2]) <= beamStart) &&
37-
(sqrt(x[0] * x[0] + x[1] * x[1]) >= R1 &&
38-
sqrt(x[0] * x[0] + x[1] * x[1]) < R2)) {
39-
b[0] = 0.;
40-
b[1] = 0.;
41-
if (isMagAbs) {
42-
b[2] = B2 * tokGauss;
43-
} else {
44-
b[2] = 0.;
45-
}
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file make_geometry_csv.C
13+
/// \brief Export ALICE 3 geometry boundaries in the R-z plane to a CSV file.
14+
/// \author Nicola Nicassio (nicola.nicassio@cern.ch)
15+
/// \author Rocco Liotino (rocco.liotino@cern.ch)
16+
17+
std::function<void(const double*, double*)> field()
18+
{
19+
return [](const double* x, double* b) {
20+
double Rc;
21+
double R1;
22+
double R2;
23+
double B1;
24+
double B2;
25+
double beamStart = 500.; // [cm]
26+
double tokGauss = 1. / 0.1; // conversion from Tesla to kGauss
27+
28+
bool isMagAbs = true;
29+
30+
// ***********************
31+
// LAYOUT 1
32+
// ***********************
33+
34+
// RADIUS
35+
Rc = 185.; // [cm]
36+
R1 = 220.; // [cm]
37+
R2 = 290.; // [cm]
38+
39+
// To set the B2
40+
B1 = 2.; // [T]
41+
B2 = -Rc * Rc * B1 / ((R2 * R2 - R1 * R1)); // [T]
42+
43+
if ((abs(x[2]) <= beamStart) && (sqrt(x[0] * x[0] + x[1] * x[1]) < Rc)) {
44+
b[0] = 0.;
45+
b[1] = 0.;
46+
b[2] = B1 * tokGauss;
47+
} else if ((abs(x[2]) <= beamStart) &&
48+
(sqrt(x[0] * x[0] + x[1] * x[1]) >= Rc &&
49+
sqrt(x[0] * x[0] + x[1] * x[1]) < R1)) {
50+
b[0] = 0.;
51+
b[1] = 0.;
52+
b[2] = 0.;
53+
} else if ((abs(x[2]) <= beamStart) &&
54+
(sqrt(x[0] * x[0] + x[1] * x[1]) >= R1 &&
55+
sqrt(x[0] * x[0] + x[1] * x[1]) < R2)) {
56+
b[0] = 0.;
57+
b[1] = 0.;
58+
if (isMagAbs) {
59+
b[2] = B2 * tokGauss;
4660
} else {
47-
b[0] = 0.;
48-
b[1] = 0.;
4961
b[2] = 0.;
5062
}
51-
};
52-
}
63+
} else {
64+
b[0] = 0.;
65+
b[1] = 0.;
66+
b[2] = 0.;
67+
}
68+
};
69+
}

0 commit comments

Comments
 (0)