Newer
Older
# For Developers
Developers please follow the following process to collaborate on development.
1. 'git clone' the main branch on your own PC.
2. create new branch to record your jobs.
3. after 'git add' the necessary changes, 'git commit' them with proper introduction.
4. use 'git push --set-upstream your_branch' to store your work in the remote depository.
5. when finishing the modular work, please merge the main branch to your_branch.
6. resolve the confilicts
7. push your_branch to the gitlab
8. submit merge request to the main branch in gitlab.
# Prerequisites
To build the project you need
- a C++ compiler that supports C++17,
- a Fortran compiler,
- ROOT 6,
- GSL (GNU Scientific Library),
- CMake (version 3.9 or higher),
- Geant4 (version 10.6 or higher),
- Garfield++,
- fmt,
- eigen3.
For simplicity on the server of the Institute of High Energy, we define a shell file `bluet.sh` to help users configure environment variables.
Assuming that `bluet.sh` is added to your `.bashrc`, such as
```
>>> source /wns_ana/chenhaizheng-ana/bluet-v5/bluet.sh
>>> mkdir build
>>> cd build
>>> cmake ..
>>> make -j<number of cores on your machine>
Otherwise, you need to make sure all dependencies are installed locally.
You can run the examples from everywhere, while the path of the running file is declared in `bluet.sh`, such as:
```
>>> bluet
```
When you run the program for the first time, prompts for using each functional module will be given in the terminal, and a `temp_env.xml` file will be generated to record each working directory.
The command line will output the following information:
```
DESCRIPTION
Program for MTPC Series Simulation and Analysis.
SYNOPSIS
bluet [--config <filepath>] [--rawdata <dirpath>] [--rootdata <dirpath>] [--eventdata <dirpath>]
[--simdata <dirpath>]
bluet geant4 [-t <threads>] [-n <events>] [--vis] [--subtask]
bluet garfield [--read] [--gen]
bluet raw2root [-f <name1...nameN>...] [-r <number1 number2>...] [-t <threads>] [--dir]
bluet factory [-f <name1...nameN>...] [-r <number1 number2>...] [-t <threads>] [-j <jobs>]
bluet lab [-f <name1...nameN>...] [-r <number1 number2>...] [--dir] [--cut] [--slurm]
bluet drawwave [-f <name>] [--fit] [--cut]
bluet drawevent [-f <name>] [--dec] [--cut] [--track] [--fit]
bluet drawmap [-f <name>] [--vis]
OPTIONS
change the environment:
--config <filepath> Change the path of config file.
--rawdata <dirpath> Change the path of raw data directory.
--rootdata <dirpath> Change the path of root data directory.
--eventdata <dirpath> Change the path of event data directory.
--simdata <dirpath> Change the path of sim data directory.
geant4 mode:
-t <threads> Set the numbet of multiple running threads.(default 1)
-n <events> Set the numbet of events.
--vis Start program in visual mode.
--subtask Internal use of the program.
garfield mode:
--read Set the read funciont of Garfield module.
--gen Set the generate funciont of Garfield module.
raw2root mode:
-f <name1...nameN> Please input filenames.
-r <number1 number2> Please input two number(min max) to range a set of files.
-t <threads> Set the numbet of multiple running threads.(default 1)
--dir Processes all files under the RawData directory.
--subtask Internal use of the program.
factory mode:
-f <name1...nameN> Please input filenames.
-r <number1 number2> Please input two number(min max) to range a set of files.
-t <threads> Set the numbet of multiple running threads.(default 1)
-j <jobs> One file divided to number of tasks.(default 100)
--dir Processes all files under the RootData directory.
--track Enable track.
--subtask Internal use of the program.
lab mode:
-f <name1...nameN> Please input filenames.
-r <number1 number2> Please input two number(min max) to range a set of files.
--dir Processes all files under the EventData directory.
--cut Enable cut.
drawwave mode:
-f <name> Please input filename.
--fit Enable fit.
--cut Enable cut.
drawevent mode:
-f <name> Please input filename.
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
--cut Enable cut.
--track Enable track.
--fit Enable Drawfit.
drawmap mode:
-f <name> Please input filename.
--vis Enable visual the map file.
LICENSE
China Spallation Neutron Source
```
The temporary environment variables of the program include the following five items:
- bluet_config: The path to the configuration file.
- bluet_rawdata: Experiment data storage directory.
- bluet_rootdata: Experimental data after format conversion.
- bluet_eventdata: Experimental data after data processing.
- bluet_simdata: Simulated signal data.
Temporary environment variables can be modified manually or with program-assisted modification.
```
>>> bluet --config /path/to/file
```
Ensure that all environment variables are set correctly, the configuration file is filled in correctly, and the program can select a function to run.
```
>>> bluet raw2root -f Daq.run.20231101091451.001.dat
```
In the following lines we use the geant4 example (`-t` is the selected threads, `-n` is the number of events):
```
## Support
Here are some tutotials on MTPC and BLUET on Bilibili:
- [MTPC tutorial on Bilibili.](https://www.bilibili.com/video/BV11p4y1J7Y5/?spm_id_from=333.999.0.0&vd_source=752a33a845dc197d2672a4790fc6a4cc)
- [BLUET tutorial on Bilibili.](https://www.bilibili.com/video/BV1au4y197cF/?spm_id_from=333.999.0.0)
## Authors and acknowledgment
This software is distributed under the terms of the MIT license.
## Notes for developers
See [Notes for developers](https://code.ihep.ac.cn/csns-backn-tpc/bluet-v5/-/wikis/BLUET/Notes-for-developers).