README.md 6.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
# 2018 Agata/Neda/Diamant Campaign - TSelector
Global logic: each experiment will have its own git branch based on a previous experiment branch.
This is to avoid any interference between the analysis of two given experiments while allowing collaboration in the analysis of a specific experiment.
This readme explains how to install, use and modify this tool on a any computer.
An installation is provided on the agata-analysis machines.

## Installation

### Step 1: Dependencies
On the chosen machine, those two dependencies must be met:
* `root` (5.34 or above): This is a TSelector that was initially generated with root 5.34/30
* `git`: probably not a too-old version

### Step 2: Acquire the package
Create an empty directory somewhere that will be filled with this package. Let's call it "selector_dir".

Now, execute the following:

```
cd selector_dir
git clone -b YOUR_EXPERIMENT_ID https://gitlab.in2p3.fr/IPNL_GAMMA/PrepNeda-Selector.git ./
```

For experiment E699, YOUR_EXPERIMENT_ID is just E699.

You now have a fresh install, ready to be customized and run!

### What are the different files
Xavier Fabian's avatar
Xavier Fabian committed
29
.<br>
Xavier Fabian's avatar
Xavier Fabian committed
30 31 32
├── CleanProcesses.sh => Kill any pending proof subprocess. Cannot hurt after a crash or a ctrl+c style exit<br>
├── compile.sh => Compiles the program containing `main()` (PlotResults.*), not the selector itself<br>
├── InputPars => "Input parameters" folder<br>
Xavier Fabian's avatar
Xavier Fabian committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
│   ├── CutDIAMANT<br>
│   │   ├── cuts_from_commissioning => templates. The selector will actually look in `CutDIAMANT` and not this folder<br>
│   │   │   ├── ConvertCuts.C => convert `cutfile_BOARDID_run156` files to `DIAMANTPidEnergy_cut_DETECTORID.root` (expected by the selector)<br>
│   │   │   ├── cutfile_BOARDID_run156 => original diamant cuts (provided by Istvan)<br>
│   │   │   ├── DIA_histo_run_0156.root => histograms on which the original cuts were made<br>
│   │   │   ├── DIAMANTPidEnergy_cut_DETECTORID.root => up-to-date cuts (converted and adjusted with `MoveCuts.C`) used for the commissioning analysis<br>
│   │   └── MoveCuts.C => Allows to easily adjust a series of cuts contained in `DIAMANTPidEnergy_cut_DETECTORID.root` files<br>
│   ├── CutNEDA<br>
│   │   └── cuts_from_commissioning => templates. The selector will actually look in `CutNEDA` and not this folder<br>
│   │       ├── NEDACcTof_cut.root => up-to-date cut (converted and adjusted with `MoveCuts.C`) used for the commissioning analysis<br>
│   │       └── NEDAEnergyCc_cut.root => up-to-date cut (converted and adjusted with `MoveCuts.C`) used for the commissioning analysis<br>
│   ├── diamant_id_lookup.EXAMPLE => The selector will look for `diamant_id_lookup`, not `diamant_id_lookup.EXAMPLE`<br>
│   ├── neda_id_lookup.EXAMPLE => The selector will look for `neda_id_lookup`, not `neda_id_lookup.EXAMPLE`<br>
│   ├── neda_id_lookup_from_run_219<br>
│   └── neda_id_lookup_until_run_210<br>
├── Out => The resulting root file from the selector should be put here. In `PlotResults.conf`, `FileNameOut absolute/path/to/this/Out/`<br>
├── PlotResults.conf.EXAMPLE => Main configuration file. The selector will look for `PlotResults.conf`, not `PlotResults.conf.EXAMPLE`<br>
├── README.md => This readme<br>
└── src<br>
    ├── PlotResults.cxx => The main program, compiled with `compile.sh`<br>
    ├── PlotResults.h => Header of the main program<br>
    ├── PlotResultsSelector.C => The selector itself (compiled when PlotResults is executed)<br>
    └── PlotResultsSelector.h => Header of the selector<br>
Xavier Fabian's avatar
Xavier Fabian committed
56 57 58

## Quick launch

59 60
### Step 0: Reach the workspace on an agata analysis machine (go to Step 1 if you use another computer)
From the acquisition room @ GANIL, you can use one of the agata-visu machine and type `a1` or `a2` in a terminal (this should `ssh` to an agata analysis machine).
Xavier Fabian's avatar
Xavier Fabian committed
61

62
From this machine, from the home directory, `source to_Workspace.sh YOUR_EXPERIMENT_ID`.
Xavier Fabian's avatar
Xavier Fabian committed
63

64
For experiment E699, YOUR_EXPERIMENT_ID is just E699.
Xavier Fabian's avatar
Xavier Fabian committed
65

66
`cd Analysis/PlotResults/`
Xavier Fabian's avatar
Xavier Fabian committed
67

68
You are now in the selector workspace of your experiment.
Xavier Fabian's avatar
Xavier Fabian committed
69

70
### Step 1: Configure
Xavier Fabian's avatar
Xavier Fabian committed
71
```
72
cp PlotResults.conf.EXAMPLE PlotResults.conf
Xavier Fabian's avatar
Xavier Fabian committed
73
```
74
Modify `PlotResults.conf` which will be parsed by the program.
Xavier Fabian's avatar
Xavier Fabian committed
75

76 77 78 79 80
Now, we provide a few input parameters
```
cd InputPars
cp diamant_id_lookup.EXAMPLE diamant_id_lookup
cp neda_id_lookup.EXAMPLE neda_id_lookup
Xavier Fabian's avatar
Xavier Fabian committed
81

82 83 84
cd CutNEDA
cp cuts_from_commissioning/NEDACcTof_cut.root ./
cp cuts_from_commissioning/NEDAEnergyCc_cut.root ./
Xavier Fabian's avatar
Xavier Fabian committed
85

86 87 88
cd ../CutDIAMANT
cp ./cuts_from_commissioning/DIAMANTPidEnergy_cut_* ./
```
Xavier Fabian's avatar
Xavier Fabian committed
89

90
> If you want to run WITHOUT proof, you have to comment `#define USEPROOF` in both `PlotResults.h` and `PlotResultsSelector.h`.
Xavier Fabian's avatar
Xavier Fabian committed
91

92 93 94 95 96
### Step 2: Compile & Execute
Execute the following to compile the main `PlotResults` program:
```
./compile.sh
```
Xavier Fabian's avatar
Xavier Fabian committed
97

98 99 100 101
And execute the binary with no argument to have an explanation:
```
./PlotResults
```
Xavier Fabian's avatar
Xavier Fabian committed
102

103
Note that executing `PlotResults` will compile `PlotResultsSelector` as per the usual `->Process("./selector.C")` root call.
Xavier Fabian's avatar
Xavier Fabian committed
104

105 106 107
If you use proof, the output of each thread will be in files `worker-X.X.log` located in `~/.proof/path-to-selector-location/last-lite-session/`. This is where any `cout` or `printf` output goes.
When using proof, also be aware that launching too much workers might result in a memory overflow, since each worker allocate all histograms (in his dedicated space).
On agata analysis machines, 10 was ok during commissioning.
Xavier Fabian's avatar
Xavier Fabian committed
108

109 110
**In case of a crash**, since this uses proof, parallel threads may still run in background.
In order to clean everything up, use the `./Clean.sh` script.
Xavier Fabian's avatar
Xavier Fabian committed
111 112 113

## Known bugs

Xavier Fabian's avatar
Xavier Fabian committed
114
### High hit crash
115 116
Sometimes, agata data may include some random very high hits events that may cause the selector to crash because of unexpected table sizes.
In principle, this will result in an entry being skipped, but this was not tested thoroughly.
Xavier Fabian's avatar
Xavier Fabian committed
117

118 119 120 121 122 123
## Support
The following people have worked with at least a part of this selector and may be able to help:
Xavier Fabian (fabian@ipnl.in2p3.fr)
Jérémie Dudouet (jeremie.dudouet@csnsm.in2p3.fr)
Olivier Stezowski (stezow@ipnl.in2p3.fr)
Marcin Palacz (palacz@slcj.uw.edu.pl)