A modular C++ analysis framework for MUonE ROOT files using FairRoot infrastructure. Developed by C Zhang.
run_FairMUanalyzer 是可以设定成改参数的,因为可以分别在run_FairMUanalyzer.sh上面跑 batch_run 就没有必要了,反正都是大规模跑,也没法改参数,不如设定好以后 make 然后 run
./run_FairMUanalyzer [input.root] [output_prefix]
./batch_run root/prefix
详情见 analyzer.Run();之前的各种 set
- ROOT (via
root-config) - FairSoft (nov22p1): [CVMFS path]
/cvmfs/fairsoft.gsi.de/centos8/fairsoft/nov22p1 - FairRoot (custom build): [set your path] e.g.
/afs/cern.ch/user/c/cez/eos/Soft/fair_install/FairRoot/install_11July25
Before building or running, source your environment:
source /afs/cern.ch/user/c/cez/eos/Soft/fair_install/FairRoot/install_11July25/bin/FairRootConfig.shFairMUanalyzer/
├── include/ # Contains FairMUanalyzer.h
├── src/ # Contains core analysis code
│ ├── FairMUanalyzer.cpp
│ ├── FairMUanalyzer_MF/TRK/OTHERS.cpp
│ └── run_FairMUanalyzer.cpp
├── batch_run.cpp # Multi-threaded runner
├── Makefile
└── README.md
Compile both single-run and batch-run modes:
make clean
make -jThis produces:
run_FairMUanalyzer: run a single ROOT filebatch_run: multi-threaded batch processor over directory
./run_FairMUanalyzer input.rootor you can set the file path inside run_FairMUanalyzer (hard coded), then just run
./run_FairMUanalyzer ./batch_run root/ 4root/is the input directory4is the number of threads
Each output is saved in:
result/<basename>/
Each processed file produces:
*_output.root: contains all histograms*_residuals_station.pdf: comparison of residuals for each station*_residuals_station_module.pdf: per-module residuals (on/off track)
These are useful for studying tracking residuals and module performance.
- You can add more
AnalyzeXXX()modules insideFairMUanalyzer_SOMETHING.cpp. .DS_Store, build artifacts, and result folders are ignored by default via.gitignore.
If compilation fails:
- Check
Makefilepaths toFairRootandFairSoft - Ensure
MUonERecoOutputAnalysis.his found underinclude/ - Ensure ROOT is properly initialized with
root-config
- ROOT (via
root-config) - MUonE reconstruction libraries:
libMUonEReconstruction.solibMUonEReconstructedEventsFilter.solibMUonEReconstructionConfiguration.so
- C++17 (
std::filesystemand threads)
Linking requires:
-lstdc++fs # for GCC < 10source /afs/cern.ch/user/c/cez/eos/Soft/fair_install/FairRoot/install_11July25/bin/FairRootConfig.shg++ -std=c++17 -O2 -Wall \
-Iinclude \
-I/cvmfs/fairsoft.gsi.de/centos8/fairsoft/nov22p1/include \
-I/afs/cern.ch/user/c/cez/eos/Soft/fair_install/FairRoot/install_11July25/include \
$(root-config --cflags) \
src/FairMUanalyzer.cpp \
src/FairMUanalyzer_Analyze.cpp \
src/run_FairMUanalyzer.cpp \
-o run_FairMUanalyzer \
$(root-config --libs) \
-L/afs/cern.ch/user/c/cez/eos/Soft/fair_install/FairRoot/install_11July25/lib64 \
-lMUonEReconstruction -lMUonEReconstructedEventsFilter -lMUonEReconstructionConfiguration \
-lstdc++fsg++ -std=c++17 -O2 -Wall -pthread \
-Iinclude \
-I/cvmfs/fairsoft.gsi.de/centos8/fairsoft/nov22p1/include \
-I/afs/cern.ch/user/c/cez/eos/Soft/fair_install/FairRoot/install_11July25/include \
$(root-config --cflags) \
src/FairMUanalyzer.cpp \
src/FairMUanalyzer_Analyze.cpp \
batch_run.cpp \
-o batch_run \
$(root-config --libs) \
-L/afs/cern.ch/user/c/cez/eos/Soft/fair_install/FairRoot/install_11July25/lib64 \
-lMUonEReconstruction -lMUonEReconstructedEventsFilter -lMUonEReconstructionConfiguration \
-lstdc++fs-std=c++17 支持 std::filesystem 和 modern C++
-I$(root-config --incdir) 引入 ROOT 头文件,例如 TFile.h, TTree.h 等
-I/cvmfs/... 引入 FairSoft 相关头文件
-I/afs/... 引入你的 MUonE 安装头文件
-lMUonEReconstruction 等 你的项目所需的 MUonE .so
-lstdc++fs GCC <10 时需要手动链接 std::filesystem
$(root-config --libs) 链接所有标准 ROOT 库make # 编译 run_FairMUanalyzer 和 batch_run 运行单个文件: ./run_FairMUanalyzer input.root result/outputname 3 多线程处理整个目录(自动建 result 子目录): ./batch_run root/ 3 4
如你升级到 GCC ≥ 10,则 std::filesystem 无需 -lstdc++fs,但 CERN 环境多为 8.x/9.x,建议始终保留以确保兼容性。
运行示例见单独文件