Skip to content

Commit 521b69f

Browse files
author
Benedikt Volkel
committed
Update README
1 parent 0f830c2 commit 521b69f

File tree

1 file changed

+35
-17
lines changed

1 file changed

+35
-17
lines changed

README.md

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# Important note
1+
# MCStepLogger
22

3-
This repository is extracting the MCStepLogger from https://github.com/AliceO2Group/AliceO2/tree/dev/Utilities/MCStepLogger making it ready to be an O2-independent tool (which is in principle already is). Only dependencies are `ROOT` and `Boost`.
3+
This package can be used to log and analyse the single steps computed by detector simulation engines built upon the [Virtual Monte Carlo (VMC)](https://vmc-project.github.io/).
44

55
## Build and install
66

7-
`cmake` (version >= 3.11.0) is used to build this project. Please install [ROOT](https://github.com/root-project/root) (tested with version 6.12.06) and [Boost](https://www.boost.org/) (tested with version 1.59.0). After that just set the environment variables `ROOTSYS` and `BOOST_ROOT` to the root directories of the `ROOT` and `Boost` installations, respectively. Finally, do
7+
The only dependencies are `ROOT` and `Boost`.
8+
9+
`cmake` (version >= 3.11.0) is used to build this project. Please install [ROOT](https://github.com/root-project/root) and [Boost](https://www.boost.org/). For both the versions that shoult allow the built can be derived from [alidist](https://github.com/alisw/alidist). After that just set the environment variables `ROOTSYS` and `BOOST_ROOT` to the root directories of the `ROOT` and `Boost` installations, respectively. Finally, do
810
```bash
911
mkdir -p $BUILD_DIR $INSTALL_DIR; cd $BUILD_DIR
1012
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR $MCSTEPLOGGER_SOURCE_DIR
@@ -15,22 +17,38 @@ That leaves you with
1517
* headers at`$INSTALL_DIR/include`
1618
* the executable `$INSTALL_DIR/bin/mcStepAnalysis` (usage explained [below](#mcsteploganalysis))
1719

18-
Note that some of the instructions below especially apply to the usage together with the ALICE O2 software framework.
20+
**Note** that some of the instructions below especially apply to the usage together with the ALICE O2 software framework.
21+
**Note** also that the interception only works in case your application derives from or is equal to [FairMCApplication](https://github.com/FairRootGroup/FairRoot/blob/master/base/sim/FairMCApplication.h) or [AliMC](https://github.com/alisw/AliRoot/blob/master/STEER/STEER/AliMC.h).
22+
23+
### Use `aliBuild`
24+
25+
`aliBuild` can be used to setup the package. To obtain `aliBuild` and related packages, please follow https://alice-doc.github.io/alice-analysis-tutorial/building/. To build from the `master` branch, do
26+
27+
```bash
28+
aliBuild init MCStepLogger@master --defaults o2
29+
aliBuild build MCStepLogger --defaults o2
30+
```
31+
32+
After that, enter the environment with
33+
```bash
34+
alienv enter MCStepLogger/latest
35+
```
36+
and you are good to go.
1937

20-
## MCStepLogger
38+
## MCStepLogger - usage and info
2139

2240
3 libraries are built
2341

24-
1. MCStepLoggerCore
25-
2. MCStepLoggerIntercept
26-
3. MCStepLoggerAnalysis
42+
1. `libMCStepLoggerCore.so`
43+
2. `libMCStepLoggerIntercept.so`
44+
3. `libMCStepLoggerAnalysis.so`
2745

28-
The first one contains core classes like `o2::StepInfo` to be used in depending packages and the same is true for the third one which contains analysis specific code.
46+
The first one contains core functionality to be used in depending packages and the same is true for the third one which contains analysis specific code.
2947

30-
The second library `MCStepLoggerIntercept` allows for detailed debug information where stepping can be directed to standard output using the `LD_PRELOAD` env variable, which "injects" this library (which intercepts some calls) in the executable that follows in the command line.
48+
The second allows for detailed debug information where stepping can be directed to standard output using the `LD_PRELOAD` env variable, which "injects" this library (which intercepts some calls) in the executable that follows in the command line.
3149

3250
```bash
33-
LD_PRELOAD=path_to/libMCStepLoggerIntercept.so o2sim -m MCH -n 10
51+
LD_PRELOAD=path_to/libMCStepLoggerIntercept.so o2-sim-serial -m MCH -n 10
3452
```
3553

3654

@@ -53,7 +71,7 @@ Default name is `MCStepLoggerOutput.root` (and can be changed
5371
by setting the `MCSTEPLOG_OUTFILE` env variable).
5472

5573
```bash
56-
MCSTEPLOG_TTREE=1 LD_PRELOAD=path_to/libMCStepLogger.so o2sim ..
74+
MCSTEPLOG_TTREE=1 LD_PRELOAD=path_to/libMCStepLogger.so o2-sim-serial ..
5775
```
5876

5977
Finally the logger can use a map file to give names to some logical grouping of volumes. For instance to map all sensitive volumes from a given detector `DET` to a common label `DET`. That label can then be used to query information about the detector steps "as a whole" when using the `StepLoggerTree` output tree.
@@ -71,7 +89,7 @@ downroundedPCB MCH
7189
uproundedPCB MCH
7290
cave TheCavern
7391

74-
> MCSTEPLOG_VOLMAPFILE=path_to_/volmapfile.dat MCSTEPLOG_TTREE=1 LD_PRELOAD=path_to/libMCStepLogger.so o2sim ..
92+
> MCSTEPLOG_VOLMAPFILE=path_to_/volmapfile.dat MCSTEPLOG_TTREE=1 LD_PRELOAD=path_to/libMCStepLogger.so o2-sim-serial ..
7593

7694
> root -b MCStepLoggerOutput.root
7795
root[0] StepLoggerTree->Draw( "Lookups.volidtomodule.data()");
@@ -80,24 +98,24 @@ root[0] StepLoggerTree->Draw( "Lookups.volidtomodule.data()");
8098
Note also the existence of the `LD_DEBUG` variable which can be used to see in details what libraries are loaded (and much more if needed...).
8199

82100
```bash
83-
LD_DEBUG=libs o2sim
84-
LD_DEBUG=help o2sim
101+
LD_DEBUG=libs o2-sim-serial
102+
LD_DEBUG=help o2-sim-serial
85103
```
86104

87105
## Special case on macOS
88106

89107
`LD_PRELOAD` must be replaced by `DYLD_INSERT_LIBRARIES`, e.g. :
90108

91109
```bash
92-
DYLD_INSERT_LIBRARIES=/Users/laurent/alice/sw/osx_x86-64/O2/latest-clion-o2/lib/libMCStepLogger.dylib MCSTEPLOG_TTREE=1 MCSTEPLOG_OUTFILE=toto.root o2sim -m MCH -g mugen -n 1
110+
DYLD_INSERT_LIBRARIES=/Users/laurent/alice/sw/osx_x86-64/O2/latest-clion-o2/lib/libMCStepLogger.dylib MCSTEPLOG_TTREE=1 MCSTEPLOG_OUTFILE=toto.root o2-sim-serial -m MCH -g mugen -n 1
93111
```
94112

95113
`LD_DEBUG=libs` must be replaced by `DYLD_PRINT_LIBRARIES=1`
96114

97115
`LD_DEBUG=statistics` must be replaced by `DYLD_PRINT_STATISTICS=1`
98116

99117

100-
## MCStepLogAnalysis
118+
## Step analysis
101119

102120
Information collected and stored in `MCStepLoggerOutput.root` can be further investigated using the excutable `mcStepAnalysis`. This executable is independent of the simulation itself and produces therefore no overhead when running a simulation. 2 commands are so far available (`analyze`, `checkFile`) including useful help message when typing
103121
```bash

0 commit comments

Comments
 (0)