Skip to content

Commit 933b3e3

Browse files
authored
Alice3: add minimal documentation + Magnetic field macro (#13011)
1 parent 87d05f3 commit 933b3e3

File tree

3 files changed

+137
-1
lines changed

3 files changed

+137
-1
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# ALICE 3 full simulation
2+
3+
## Simulation
4+
### Simulation software for Run 5
5+
Current simulation approach for ALICE 3 is a specification of what it is used in the main O2 simulation package.
6+
It shares the same structure and possibly inherits all the features in place already.
7+
For all of the features that are not really Run-5 specific please refer to the official [O2 Simulation Documentation](https://aliceo2group.github.io/simulation/docs/).
8+
9+
### Rationale for the "Upgrades" codebase
10+
Run 5 code for the detectors is stored in the `Detectors/Upgrades/ALICE3` directory and its suboflder strucure mimicks the same we have in `Detectors`.
11+
For specific data formats the plan is to keep the same approach in `DataFormats/Upgrades`.
12+
13+
### Available modules
14+
Run 5 executable is called `o2-sim-run5` and accepts the same syntax as `o2-sim`.
15+
There is also the serial vertsion `o2-sim-serial-run5` that is the serial implementation.
16+
The specific modules for Run 5 are enabled by passing their their IDs to the `-m` parameter of the `o2-sim`.
17+
A list of the available DetIDs is reproted in the table below:
18+
19+
| Detector ID | Detector description |
20+
|-------------|----------------------------------|
21+
| `A3IP` | Beam pipe |
22+
| `TRK` | Barrel Tracker |
23+
| `TF3` | Time Of Flight detectors |
24+
| `FT3` | Forward endcaps |
25+
| `RCH` | Ring Imaging Cherenkov detectors |
26+
| `ECL` | Electromagnetic Calorimeter |
27+
| `MI3` | Muon Identification |
28+
| `FCT` | Forward Conversion Tracker |
29+
| `A3ABSO` | Absorber |
30+
| `A3MAG` | Magnet |
31+
32+
Names are arbitrarily chosen and are such as to be orthogonal to any Run 3+ other DetID.
33+
The detector IDs of sensitive modules are mapped to the corresponding `o2::detector::DetID` class definition for convenience, so to be consistent with output names of the hit files.
34+
35+
### Use the ALICE 3 magnetic field
36+
By definition the `o2-sim-run5` will use the Run 3 magnetic field configurations.
37+
Field description can be overridden with a custom macro with a path exported in the `ALICE3_MAGFIELD_MACRO` environment variable.
38+
The env var `ALICE3_SIM_FIELD` needs also to be set to `ON`.
39+
Example:
40+
41+
```bash
42+
export ALICE3_SIM_FIELD=ON
43+
export ALICE3_MAGFIELD_MACRO=../ALICE3Field.C
44+
```
45+
46+
An exampling macro for a custom magnetic field is stored in `Detectors/Upgrades/macros/ALICE3Field.C`.
47+
48+
### Run a simple simulation for run 5
49+
The simplest command to be run to test the simulation is working is:
50+
51+
```bash
52+
o2-sim-run5 -n 0
53+
```
54+
This will not produce any events but will spin the machinery and will produce the `o2sim_geometry.root` file with the whole geometry description.
55+
To enable a specific set of modules, e.g. the beampipe and the TOFs one can specify which modules to enable, e.g.:
56+
57+
```bash
58+
o2-sim-run5 -n 10 -m A3IP TF3
59+
```
60+
### Output of the simulation
61+
The simulation will produce a `o2sim_Hits<DetID>.root` file with a tree with the hits related to that detector.
62+
Currently, hits are produced for: `TRK`, `FT3`, and `TF3`.
63+
More detectors will be included.
64+
65+
## Reconstruction
66+
WIP
67+
68+
## Analysis
69+
WIP
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
// Author: J. E. Munoz Mendez jesus.munoz@cern.ch
13+
14+
std::function<void(const double*, double*)> field()
15+
{
16+
return [](const double* x, double* b) {
17+
double Rc;
18+
double R1;
19+
double R2;
20+
double B1;
21+
double B2;
22+
double beamStart = 500.; //[cm]
23+
double tokGauss = 1. / 0.1; // conversion from Tesla to kGauss
24+
25+
bool isMagAbs = true;
26+
27+
// ***********************
28+
// LAYOUT 1
29+
// ***********************
30+
31+
// RADIUS
32+
Rc = 185.; //[cm]
33+
R1 = 220.; //[cm]
34+
R2 = 290.; //[cm]
35+
36+
// To set the B2
37+
B1 = 2.; //[T]
38+
B2 = -Rc * Rc / ((R2 * R2 - R1 * R1) * B1); //[T]
39+
40+
if ((abs(x[2]) <= beamStart) && (sqrt(x[0] * x[0] + x[1] * x[1]) < Rc)) {
41+
b[0] = 0.;
42+
b[1] = 0.;
43+
b[2] = B1 * tokGauss;
44+
} else if ((abs(x[2]) <= beamStart) &&
45+
(sqrt(x[0] * x[0] + x[1] * x[1]) >= Rc &&
46+
sqrt(x[0] * x[0] + x[1] * x[1]) < R1)) {
47+
b[0] = 0.;
48+
b[1] = 0.;
49+
b[2] = 0.;
50+
} else if ((abs(x[2]) <= beamStart) &&
51+
(sqrt(x[0] * x[0] + x[1] * x[1]) >= R1 &&
52+
sqrt(x[0] * x[0] + x[1] * x[1]) < R2)) {
53+
b[0] = 0.;
54+
b[1] = 0.;
55+
if (isMagAbs) {
56+
b[2] = B2 * tokGauss;
57+
} else {
58+
b[2] = 0.;
59+
}
60+
} else {
61+
b[0] = 0.;
62+
b[1] = 0.;
63+
b[2] = 0.;
64+
}
65+
};
66+
}

cmake/O2RootMacroExclusionList.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ list(APPEND O2_ROOT_MACRO_EXCLUSION_LIST
6060
macro/load_all_libs.C
6161
macro/putCondition.C
6262
macro/rootlogon.C
63-
Detectors/FIT/FT0/calibration/macros/makeChannelOffsetCalibObjectInCCDB.C)
63+
Detectors/FIT/FT0/calibration/macros/makeChannelOffsetCalibObjectInCCDB.C
64+
Detectors/Upgrades/ALICE3/macros/ALICE3Field.C)
6465

6566

6667
if(NOT BUILD_SIMULATION)

0 commit comments

Comments
 (0)