Set up code:
source /cvmfs/grid.cern.ch/emi3ui-latest/etc/profile.d/setup-ui-example.sh
export VO_CMS_SW_DIR=/cvmfs/cms.cern.ch
source $VO_CMS_SW_DIR/cmsset_default.sh
export SCRAM_ARCH=slc7_amd64_gcc700
cmsrel CMSSW_10_6_1
cd CMSSW_10_6_1/src
cmsenv
# set up cmssw git repo and check out tau reco package
git cms-init
git cms-addpkg RecoTauTag/RecoTau/
# compile
scram b -j 8
# move to testing area
cd RecoTauTag/RecoTau/test/
# get code examples
git clone https://github.com/cms-physics-object-school/LongExerciseTauReco
scp -r lxplus.cern.ch:/afs/cern.ch/work/j/jbechtel/public/CMSPOS_2019/TauRECO .
cp -rs TauRECO/*root .
Available Scripts
We advice you to always check the scripts before running them to get a feeling on what to script will actually do
Re-run the tau reconstruction on miniAOD:
cmsRun LongExerciseTauReco/customise_tau_reco_miniaod_cfg.py
First we rerun the Tau Reconstruction on the provided Samples ( a ZTT Sample and a QCD Sample). During this step, different Parameters of the Tau Reconstruction can be modified, and their impact on e.g. the efficiency of the tau reconstruction can be checked.
Ntupelize the output file:
python LongExerciseTauReco/read_taus.py --file (ZTT|QCD)
After the Tau Reconstruction is rerun, you can convert the MiniAOD file to a flat ntuple. These flat ntuples can then be used to plot and calculate various quantities.
The script will result in two nuples:
- containing one entry for each generated Tau
- containing one entry for each reconstructed Jet
Plot the efficiency curve and smearing of tau pt:
python LongExerciseTauReco/plotting.py --file (ZTT|QCD)
The plotting script is used to generate plots from the flat ntuples.
Tasks:
Perform the following tasks on the miniAOD Z->tau tau sample and the QCD sample provided:
-
Re-run the tau reconstruction on the both samples
-
Ntupelize the two output miniAOD files. Make sure to set the correct input file!
-
Calculate the overall tau reconstuction efficiency using the ZTT sample by applying the following cuts. You can add the calculation in the script
plotting.py
.- gen. tau
$p_{T} > 18$ GeV - gen. tau
$|\eta| < 2.4$
and calculating
$\frac{\text{Reconstructed taus from genuine tau}}{\text{Number genuine taus}}$ (Efficiency) - gen. tau
-
Caclulate the overall misidentification propability using the QCD sample by applying the following cuts. You can add the calculation in the script
plotting.py
.- jet
$p_{T} > 18$ GeV - jet
$|\eta| < 2.4$
and calculating
$\frac{\text{Reconstructed taus from jet}}{\text{Total jets}}$ (Misidentification probability) - jet
-
Plot the reconstruction efficiency for for genuine taus as a function of the tau
$p_{T}$ , as well as the smearing of the reconstructed tau$p_{T}$ usingplotting.py
. This is already implemented. -
Adapt
plotting.py
to additionally plot the reconstruction efficiency of jets misidentified as tau leptons for the QCD sample. -
Adapt
plotting.py
to plot the distribution of the reconstructed and true decay modes for tau leptons passing the$p_{T}$ and$\eta$ cuts of part 3 in the same plot. Use different colors and a ROOT TLegend to label the two histograms. The variable decay_mode is an integer withdecay mode = 5 * (n_charged - 1) + n_pi0
. The most common decay modes are 0 (1 charged hadron, no pi0), 1 (1 charged hadron, 1 pi0), and 10 (three charged hadrons, no pi0) -
Read out the tau-isolation discriminator
byLooseIsolationMVArun2v1DBoldDMwLT
. It can be accessed for reconstructed taus by requestingtau.tauID("name of ID")
when ntupelizing the miniAOD file. -
Repeat steps 3.-7., however now only use reconstructed tau leptons passing the isolation discriminator.
-
How did the reconstruction efficiencies and (mainly) the misidentification probability change?
-
For early finishers only: Use
LongExerciseTauReco/customise_tau_reco_miniaod_cfg.py
to rerun the tau reconstruction using custom settings, and see how it changes the quality of your tau reconstruction. You could change e.g.:- Decay modes to be considered for valid tau leptons
- dR isolation cone size
- Minimum quality requirements on tracks to be considered