Source code for vibe.analysis_validation_modes.clustering.pi0EnergyResolution

from typing import List

import basf2
import modularAnalysis as ma  # type: ignore
import variables.collections as vc  # type: ignore
from variables import variables as vm  # type: ignore
import variables.utils as vu  # type: ignore

from vibe.core.utils.misc import fancy_validation_mode_header
from vibe.core.validation_mode import ValidationModeBaseClass
from vibe.core.helper.histogram_tools import HistVariable, Histogram, HistComponent
from vibe.core.helper.root_helper import makeROOTCompatible

__all__ = [
    "pi0EnergyResolution",
]


[docs] @fancy_validation_mode_header class pi0EnergyResolution(ValidationModeBaseClass): name = "pi0EnergyResolution" latex_str = r"$\pi^0$ from $B\overline{B}$ events" plotting_strategies = ["resolution_fitting"]
[docs] def create_basf2_path(self, **kwargs): """ Reconstruction script for pi0s. """ main = basf2.create_path() ma.fillParticleList("gamma:selection", "", path=main) ma.matchMCTruth(list_name="gamma:selection", path=main) ma.applyCuts( "gamma:selection", "inECLAcceptance and abs(clusterTiming) < 200", path=main, ) ma.reconstructDecay( "pi0:selection -> gamma:selection gamma:selection", "", path=main, ) vm.addAlias("PDG_M", "formula(0.1349768)") ma.matchMCTruth(list_name="pi0:selection", path=main) self.variables_to_validation_ntuple( decay_str="pi0:selection", variables=vu.create_aliases_for_selected( self.base_particle_vars + self.cluster_vars + vc.mc_truth + vc.mc_kinematics + vc.mc_variables + [ "mcTheta", "clusterMCMatchWeight", "clusterTotalMCMatchWeight", "clusterBestMCMatchWeight", "mcSecPhysProc", "M", "PDG_M", ], "^pi0:selection", ["pi0"], ), path=main, ) return main
@property def base_particle_vars(self): return vc.kinematics + vc.inv_mass + vc.momentum_uncertainty + vc.pid @property def cluster_vars(self): return vc.cluster + [ "clusterE", "clusterUncorrE", "clusterThetaID", "clusterMdstIndex", "clusterCellID", "clusterSecondMoment", "clusterTrackMatch", ] @property def base_roe_vars(self): return vc.roe_multiplicities + vc.roe_kinematics + vc.extra_energy @property def analysis_validation_histograms(self) -> List[Histogram]: return [ Histogram( name="EResolution_pi0_Selection", title="Energy Resolution of pi0 (Selection)", particle_list="pi0:selection", hist_variable=HistVariable( df_label=makeROOTCompatible(variable="pi0_mcP"), label="$P_{\\mathrm{reco}}^{\\pi^0}$", unit="GeV", bins=3, scope=(0.0, 2.5), ), hist_components=[ HistComponent( label="Signal", ), ], ), ]