Skip to content

Commit aeb0367

Browse files
committed
add language specification for bash commands in ReadMe
1 parent 7b4153d commit aeb0367

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,22 @@ Information about all fields in all branches is stored in Configuration object.
4242
ROOT6 is needed for installation.
4343
Follow CERN ROOT [instructions](https://root.cern/install/) to install it.
4444
Version compiled with c++17 flag is preferred, otherwise CMAKE_CXX_STANDARD flag needs to be explicitly specified (see below).
45-
45+
```bash
4646
git clone https://github.com/HeavyIonAnalysis/AnalysisTree.git
4747
cd AnalysisTree
4848
mkdir build install
4949
cd build
5050
source path-to-root-installation/bin/thisroot.sh
5151
cmake -DCMAKE_INSTALL_PREFIX=../install ../
5252
make -j install
53-
53+
```
5454
*path-to-root-installation* must be replaced with your actual location of Root install directory.
5555

5656
### List of CMake options:
5757
To apply the flag use -D{Name}={value}, for example, if you want to compile using c++11:
58-
58+
```bash
5959
cmake -DCMAKE_CXX_STANDARD=11 ../
60-
60+
```
6161
| Name | Default value | Possible values |
6262
| ------------- | ------------- | ---------- |
6363
| CMAKE_BUILD_TYPE | RELEASE | RELEASE/DEBUG |
@@ -70,16 +70,16 @@ To apply the flag use -D{Name}={value}, for example, if you want to compile usin
7070
### Setting AnalysisTree environment
7171
Whatever you are going to do with AnalysisTree - read the file, perform analysis based on information stored in it or create your own file, first of all you need to set up environment variables.
7272
It can be done in a single command:
73-
73+
```bash
7474
source path-to-analysis_tree-installation/bin/AnalysisTreeConfig.sh
75-
75+
```
7676
### Reading files from ROOT session
7777
An example of AnalysisTree ROOT file can be downloaded by this [link](https://sf.gsi.de/f/3ba5a9e3ff5248edba2c/?dl=1)
7878

7979
Open a ROOT-file
80-
80+
```bash
8181
root -l 1.analysistree.root
82-
82+
```
8383
Check its content
8484

8585
.ls
@@ -98,9 +98,9 @@ and, finally, AnalysisTree::DataHeader object named *DataHeader* containing info
9898

9999
#### Reading the configuration
100100
In order to know the structure of the tree, perform following command:
101-
101+
```c++
102102
Configuration->Print()
103-
103+
```
104104
An output will contain plenty of branches and matchings between them.
105105
Let us look at one of them:
106106

@@ -114,7 +114,7 @@ Negative ids belong to default fields of branches while positive ids and 0 - to
114114
Middle column contains string name of the field, and right column - a description of it.
115115

116116
#### Digesting the tree content
117-
117+
```c++
118118
Configuration->GetBranchConfig("SimParticles").GetType()
119119
// to know to which type (Hit, Track, Module, Particle or EventHeader belongs SimParticles branch)
120120

@@ -149,27 +149,27 @@ Middle column contains string name of the field, and right column - a descriptio
149149
// drawing a histogram with user-defined binning and ranges.
150150

151151
rTree->Draw("TMath::Log(TMath::Abs(SimParticles.channels_.GetPx()))")
152-
// drawing a distribution of derived quantites calculated by formula
153-
152+
// drawing a distribution of derived quantities calculated by formula
153+
```
154154
Moreover, for default fields which are explicitly present in Container (i.e. px is OK, but not pt, which is not stored but calculated on fly) there is a possibility to draw them using TTree::Draw syntax:
155-
155+
```c++
156156
rTree->Draw("SimParticles.px_")
157157
rTree->Draw("TMath::Log(TMath::Abs(SimParticles.px_))")
158158
rTree->Draw("TMath::Log(TMath::Abs(SimParticles.px_)) * TMath::Cos(SimParticles.py_)")
159-
159+
```
160160
Also you can open a ROOT interactive session and create an AnalysisTree::Chain:
161-
161+
```c++
162162
AnalysisTree::Chain t("1.analysistree.root", "rTree") // Chain constructor with a single file
163163
// or
164164
AnalysisTree::Chain t({"filelist.txt"}, {"rTree"}) // Chain constructor with a file list
165-
165+
```
166166
and then build any fields including user-defined and implicitly present fields (such as phi or pt):
167-
167+
```c++
168168
t.Draw("SimParticles.px")
169169
t.Draw("SimParticles.pid")
170170
t.Draw("VtxTracks.chi2")
171171
// 2D histograms, cuts, drawing options and math formulas mentioned above are also available
172-
172+
```
173173
### Reading file with a macro
174174

175175
Building of distributions in interactive mode is a good approach only if the commands are simple, and the number of events to be analized is not so big.

0 commit comments

Comments
 (0)