Skip to content
Snippets Groups Projects
Forked from atlas / athena
75849 commits behind the upstream repository.
user avatar
Bertrand Martin authored
Hello,

This MR adds a new tauRec thinning algorithm that will remove all entries from tau-related containers for tau candidates below a minimum tau pt threshold.
The motivation is explained in detail in https://indico.cern.ch/event/986226/contributions/4152506/attachments/2164807/3653366/TauCP_Seeds_LRT_17Dec20.pdf (slide 10).
In R22, we will have to relax the seed jet pt cut (15 GeV) currently applied by default in the reconstruction, as it causes tau reconstruction inefficiency.
Instead, we will have to run the tau reconstruction on all seed jets, and at the end, remove tau candidates below a pt threshold (~10 GeV), in order to keep the tau disk size comparable to what it is now.

The algorithm is added to tauRec but not yet deployed in RecExCommon_topOptions, on purpose. This will be done once we converge on the pt threshold, and the seed jet pt cut will have to be dropped at the same time.

Relevant JIRA ticket: ATLASRECTS-5684

Cheers,
Bertrand
78cc4205
History
Name Last commit Last update
..
doc
python
share
src
test
CMakeLists.txt
README.md

tauRec package

This package is the python steering package for tau reconstruction and the c++ algorithms. This package has two algorithms: TauProcessorAlg (also referred to as TauBuilder in some places) and TauRunnerAlg that call tools defined in tauRecTools. This page contains a quick summary of the structure with links to the relevant code. For more details please see the tauRec r22 tWiki page.

Tau Reconstruction chain:

There are a total of 4 algorithms, which are scheduled in the following order: jetTrackAlg, TauBuilder, tauPi0ClusterMaker, and TauRecRunner. The TauBuilder and TauRunner are the main tau algorithms, each of which runs a number of tauRecTools.

  1. Reco_tf.py invokes CombinedRec_config.py which calls the tau joboptions file: tauRec_config.py.

  2. tauRec_config calls tauRec_jobOptions.py (and DiTauRec_config.py if required). tauRec_jobOptions then calls scripts to set up each of the required algorithms:

  3. TauRecCoreBuilder, defined in TauRecBuilder.py. Sets up the first two algorithms using TauRecConfigured.

  4. Pi0ClusterMaker. This is a CaloRec algorithm, which is run using its own job options Pi0ClusterMaker_jobOptions.py.

  5. TauRecRunner, defined in TauRecRunner.py. Sets the last algorithm using TauRecRunConfigured.py.

The tool definitions are defined in TauAlgorithmsHolder.py

TauRecBuilder

Only one class of this is used in r22, the TauRecCoreBuilder:

  • Creates tau candidates from jet seeds
  • Builds a tau candidate if jet seed passes minimal kinematic criteria
  • Associates a vertex
  • Associates tracks
  • Classifies tracks
  • Builds ID variables that require cells or athena geometry
  • Creates Pi0 candidates

TauRecCoreBuilder sets up the required tools. TauRecConfigured is used to configure the algorithm and add the tools to it.

TauRecRunner

This algorithm runs calculations that require input from the tools scheduled in the previous algorithms.

  • Construct pi0 clusters (part of substructure)
  • Compute common variables used in tau ID and energy scale calculations
  • Run substructure tools
  • Run PanTau
  • MVA TES
  • TauID
  • TauID score flattening
  • Evaluate and decorate BDT/RNN scores

It has a similar structure to TauRecBuilder, with its own TauRecRunConfigured, used for the algorithm settings and adding the tools.

TauAlgorithmsHolder

This module contains functions for configuring each tauRecTool. In the case where multiple instances of a tool may be used, a flexible function is created to retrieve the instance you want. For example, the TauJetBDTEvaluator is used numerous times : 1p taus, 3p taus, 3 different eta bins for Electron BDT.


def getTauJetBDTEvaluator(_n, weightsFile="", minNTracks=0, maxNTracks=10000, outputVarName="BDTJetScore", minAbsTrackEta=-1, maxAbsTrackEta=-1):
    _name = sPrefix + _n
    from tauRecTools.tauRecToolsConf import TauJetBDTEvaluator
    myTauJetBDTEvaluator = TauJetBDTEvaluator(name=_name,
                                              weightsFile=weightsFile,
                                              minNTracks=minNTracks,
                                              maxNTracks=maxNTracks,
                                              minAbsTrackEta=minAbsTrackEta,
                                              maxAbsTrackEta=maxAbsTrackEta,
                                              outputVarName=outputVarName)
    cached_instances[_name] = myTauJetBDTEvaluator
    return myTauJetBDTEvaluator

tauRecFlags

In order to determine the actual settings for tools, one needs to consult both the TauAlgorithmsHolder module or the TauRecBuilder module--in cases where the TauAlgorithmsHolder function allows for customization of the tool (see TauJetBDTEvaluator above). You may also see places in TauAlgorithmsHolder where the 'declareProperty' is set via a 'tauFlag', as defined in tauRecFlags. The reason for this extra level of abstraction is at least two fold:

  1. define a variable in one place to be used in numerous tools (e.g. cvmfs CALIBPATH folder)
  2. allow for the setting of variables on the command line: Reco_tf.py --preExec 'from tauRec.tauRecFlags import tauFlags; tauFlags.abc=d'

Being able to set variables on the command line is extremely important. In this way we can request an r-tag without making any code changes. We did this while finalizing the TauTrack Classification variables.