FCC Logo FCCAnalyses

Common analysis framework for the Future Circular Collider

back

Examples

Example analysis

To better explain the FCCAnalyses workflow let's run our example analysis. The analysis should be located at examples/FCCee/higgs/mH-recoil/mumu/.

Pre-selection

The pre-selection runs over already existing and properly registered FCCSW EDM4hep events. The dataset names with the corresponding statistics can be found here for the IDEA spring 2021 campaign. The processList is a dictionary of processes, each process having it's own dictionary of parameters. For example

'p8_ee_ZH_ecm240':{'fraction':0.2, 'chunks':2, 'output':'p8_ee_ZH_ecm240_out'}

where p8_ee_ZH_ecm240 should match an existing sample in the database, fraction is the fraction of the sample you want to run on (default is 1), chunks is the number of jobs to run (you will have the corresponding number of output files) and output in case you need to change the name of the output file (please note that then the sample will not be matched in the database for finalSel.py histograms normalisation). The other parameters are explained in the example file.

To run the pre-selection stage of the example analysis run:

fccanalysis run examples/FCCee/higgs/mH-recoil/mumu/analysis_stage1.py

This will create the output files in the ZH_mumu_recoil/stage1 subdirectory of the output director specified with parameter outDir in the file.

You also have the possibility to bypass the samples specified in the processList variable by using command line parameter --output, like so:

fccanalysis run examples/FCCee/higgs/mH-recoil/mumu/analysis_stage1.py \
       --output <myoutput.root> \
       --files-list <file.root or file1.root file2.root or file*.root>

The example analysis consists of two pre-selection stages, to run the second one slightly alter the previous command:

fccanalysis run examples/FCCee/higgs/mH-recoil/mumu/analysis_stage2.py

Pre-selection on batch (HTCondor)

It is also possible to run the pre-selection step on the batch. For that the runBatch parameter needs to be set to true. Please make sure you select a long enough batchQueue and that your computing group is properly set compGroup (as you might not have the right to use the default one group_u_FCC.local_gen as it request to be part of the FCC computing e-group fcc-experiments-comp). When running on batch, you should use the chunk parameter for each sample in your processList such that you benefit from high parallelisation.

Final selection

The final selection runs on the pre-selection files that were produced in the Pre-selection stages. In the configuration file analysis_final.py various cuts are defined to be run on and the final variables to be stored in both a TTree and histograms. This is why the variables needs extra fields like title, number of bins and range for the histogram creation. In the example analysis it can be run like this:

fccanalysis final examples/FCCee/higgs/mH-recoil/mumu/analysis_final.py

This will create 2 files per selection SAMPLENAME_SELECTIONNAME.root for the TTree and SAMPLENAME_SELECTIONNAME_histo.root for the histograms. SAMPLENAME and SELECTIONNAME correspond to the name of the sample and selection respectively in the configuration file.

Plotting

The plotting analysis file analysis_plots.py contains not only details for the rendering of the plots but also ways of combining samples for plotting. In the example analysis it can be run in the following manner:

fccanalysis plots examples/FCCee/higgs/mH-recoil/mumu/analysis_plots.py

Resulting plots will be located the outdir defined in the analysis file.

Compiling framework with CMake

In order to customize installation of the locally compiled FCCAnalyses one can compile the framework using standard CMake commands:

git clone git@github.com:<your_github_handle>/FCCAnalyses.git
cd FCCAnalyses
git remote add upstream git@github.com:HEP-FCC/FCCAnalyses.git
git fetch upstream
source setup.sh
mkdir build install
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
make install
cd ..
fccanalysis run analysis_script.py