Skip to content

zaborowska/FCC_calo_analysis_cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FCC_calo_analysis

Analysis tools for calorimetry:

  • hits/cells/cluster read from EDM in c++
  • setup and results of analysis (drawing etc.) handled from python

Initialization

Dependencies:

  • ROOT
  • PODIO
  • fcc-edm taken from the FCC software stack:
source init.sh

Build

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=../install ..
make -j 8 install
cd ..

Run analysis

Common: configuration

To see the help message:

python scripts/calo_init.py --help

The required argument is the input file name and the energy (vector):

python scripts/calo_init.py <INPUT_FILE_NAME>.root [energy]

User may also specify any of the optional arguments.

In particular, if user wants to analyse multiple files:

python scripts/calo_init.py <INPUT_FILE_NAME_CONTAINING_?_CHARACTER>.root ENERGY -r [LIST_OF_SUBSTITUTIONS]

where -r indicates that a regex should be used, substituting the ? character in the input (or output) file name with the elements of the list of substitutions.

For instance,

python scripts/calo_init.py 'output_10GeV_?.root' 10 -r firstPart secondPart

results in:

Input file: output_10GeV_firstPart.root
Input file: output_10GeV_secondPart.root
Energy of initial particle: [10] GeV

If instead of of a list, "energy" is used after "-r" option, the '?' character gets substituted with the energy of the particles.

For instance,

python scripts/calo_init.py 'output_?GeV.root' 10 50 100 -r energy

results in:

Input file: output_10GeV.root
Input file: output_50GeV.root
Input file: output_100GeV.root
Energy of initial particle: [10, 50, 100] GeV

Example: SimpleAnalysis

Required arguments:

  • input file name
  • energy
  • sampling factor
python scripts/test_macro_simple.py <INPUT_FILE_NAME>.root ENERGY SF

Shower profiles: ShowerProfiles

Required arguments:

  • input file name
  • energy
  • sampling factor

Analysis is done for one file.

python scripts/test_macro_profiles.py <INPUT_FILE_NAME>.root ENERGY SF

Cells: CellAnalysis

Required arguments:

  • input file name
  • energy
  • sf

Analysis is done for one file.

python scripts/test_macro_cells.py <INPUT_FILE_NAME>.root ENERGY SF

Reconstructed event preview: ReconstructionExample

Preview of the reconstructed cluster. The first plot contains all towers, the second the centre of the cluster and the third one all the cells associated to the cluster. Additionally the windows used in the reconstrucion are drawn.

Required arguments:

  • input file name
  • energy

Analysis is done for all the files (all energies), but for one event from each (default: first event).

python scripts/plot_recoExample.py <INPUT_FILE_NAME>.root ENERGY

Input file name and the energy are required.

List of additional options:

   -r REGEX [REGEX ...], --regex REGEX [REGEX ...]
                        String to insert in place of '?' character in file
                        names ("energy" inserts the values of energies)
  -o OUTPUT, --output OUTPUT
                        Output file name
  -v, --verbose         Verbose
    --clusterColl CLUSTERCOLL
                        Name of the clusters collection
                        (fcc::CaloClusterCollection)
  --positionColl POSITIONCOLL
                        Name of the positioned cells collection
                        (fcc::PositionedCaloHitCollection)
  --windowSeed WINDOWSEED WINDOWSEED
                        Size of the window used for seeding [eta,phi]
  --windowPos WINDOWPOS WINDOWPOS
                        Size of the window used for berycentre coalculation
                        [eta,phi]
  --windowDupl WINDOWDUPL WINDOWDUPL
                        Size of the window used for duplicate removal
                        [eta,phi]
  --dEta DETA DETA      Size of the tower in eta
  --maxEta MAXETA       Maximum eta
  --dPhi DPHI           Size of the tower in phi
  --numPhi NUMPHI       Number of the towers in phi
  --zoom ZOOM ZOOM      How many bins around centre should be visible
  --event EVENT         Number of an event to draw

Reconstruction monitor: SingleParticleRecoMonitors

Monitor plots of the reconstruction procedure. The plots are created based on the clusters and generated particles (for single particle events only).

python scripts/plot_recoMonitor.py <INPUT_FILE_NAME>.root ENERGY <INPUT_FILE_WITH_MC_INFORMATION>.root

The plots are saved to root file and as a png. The first row includes the energy distribution, energy distribution as a function of phi, number of reconstructed clusters and the number of reconstructed clusters as a function of phi. The second row contains information about any reconstructed duplicates (difference of energy, eta, phi and R=sqrt(eta^2+phi^2) with respect to the most energetic cluster). The last row contains comparison to the MC particle: difference in eta distribution, difference in eta as a function of eta, difference in phi distribution and difference in phi as a function of phi.

Reconstruction monitor with upstream energy correction

python scripts/plot_recoMonitor.py root://eospublic.cern.ch//eos/fcc/users/n/novaj/combCaloForBerlin/output_combCalo_reconstructionSW_e50GeV_part1.root 50 root://eospublic.cern.ch//eos/fcc/users/n/novaj/combCaloForBerlin/output_combCalo_e50GeV_part1_v3.root --clusterColl EcalClusters --correctionParams 0.1369 0.004587 0.1692 0.6769 --cellColl ECalCellsForSW --bitfield system:4,cryo:1,type:3,subtype:3,cell:6,eta:9,phi:10

List of additional options:

  -r REGEX [REGEX ...], --regex REGEX [REGEX ...]
                        String to insert in place of '?' character in file
                        names ("energy" inserts the values of energies)
  -o OUTPUT, --output OUTPUT
                        Output file name
  -v, --verbose         Verbose
  --particleColl PARTICLECOLL
                        Name of the MC particle collection
                        (fcc::MCParticleCollection)
  --clusterColl CLUSTERCOLL
                        Name of the clusters collection
                        (fcc::CaloClusterCollection)
  --dEta DETA DETA      Size of the tower in eta
  --maxEta MAXETA       Maximum eta
  --dPhi DPHI           Size of the tower in phi
  --numPhi NUMPHI       Number of the towers in phi

Energy resolution

Input files: ROOT files with energy distribution saved with name "energy". Each ROOT file should contain distribution for one energy. Such input files may be obtained e.g. by plot_recoMonitor.py macro. Energy distributions are fitted twice with Gaussian, and the energy resolution plot is fitted with p0+p1/sqrt(E) function.

python scripts/plot_enResolution.py energy?GeV.root 20 50 100 200 500 1000 -r energy

How to create own analysis

  1. Create Class deriving from BaseAnalysis or BaseTwoFileAnalysis. Include:
  • histograms (push back to m_histograms)
  • processEvent method
  • finishLoop method
  1. Add class to include/LinkDef.h and CMakeLists.txt so it can be accessed from ROOT.
  2. Create analysis script:
  • add command line arguments
  • retrieve histograms after analysis is done

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 54.4%
  • Python 38.2%
  • CMake 6.8%
  • Other 0.6%