This project provides a C++ program that reads oscillation data, processes it, and generates histograms using the ROOT framework. It deals with data from two sources: prompt data and null prediction data. The program parses these files, processes them to map segment data to baseline values, and creates ROOT files and histograms for analysis.
- Parses oscillation data from text files with configurable columns.
- Maps segment data to baseline values using a segment map file.
- Creates ROOT files with oscillation data.
- Plots histograms of oscillation data using the ROOT framework.
To run this project, you need the following installed on your system:
- ROOT - A framework for data processing and visualization.
- A C++ compiler, such as g++.
DataPointclass: Represents a data point with fields like bin center, IBD counts, total stats error, background counts, and background stats error.SegmentMapstruct: Holds the mapping between segment and baseline values.OscillationAnalyzerclass: Handles file parsing, ROOT file creation, and histogram plotting.
- 1.1_Osc_SegmentMap.txt: Contains mapping from segment to baseline.
- 1.4_Osc_Prompt[segment].txt: Contains prompt data for different segments.
- 1.6_Osc_NullOscPred[baseline].txt: Contains null oscillation predictions for different baselines.
-
Clone the repository:
git clone https://github.com/RalAngelo/OscillationDataAnalyzer cd OscillationDataAnalyzer -
Make sure you have ROOT installed. You can check by running:
root --version
-
Compile the code:
g++ -o oscAnalyzer oscAnalyzer.cpp `root-config --cflags --glibs` -
Prepare the data files. Make sure you have the necessary datasets:
- 1.1_Osc_SegmentMap.txt
- 1.4_Osc_Prompt[segment].txt
- 1.6_Osc_NullOscPred[baseline].txt
-
Run the executable:
./oscAnalyzer
-
The program will process the files, generate ROOT files (
oscPrompt.rootandoscNull.root), and produce histograms saved as PNG images:Fig40_Reconstructed.pngFig40_1_Reconstructed.png
The code consists of the following steps:
- File Parsing: Data is parsed from text files into
DataPointobjects. - Mapping: Segment data is mapped to baseline values using a segment map.
- ROOT File Creation: The parsed data is stored in ROOT files for further analysis.
- Plotting: Histograms of the data are plotted and saved as images.
- Modify the segment and baseline range by adjusting the loops in the
processFilesmethod. - Change the appearance of the histograms by modifying the
plotHistogramsandplotHistograms2methods. - If your data format changes, adjust the
parseFilemethod to handle different column structures.
Feel free to fork the project, create issues, or submit pull requests if you have ideas for improvements or bug fixes.