From 4920fbde5c2844dc28e2e553f88af013468d3670 Mon Sep 17 00:00:00 2001
From: Bertrand Martin <martindl@cern.ch>
Date: Fri, 8 Nov 2019 11:46:34 +0100
Subject: [PATCH] Towards PFlow-seeded tau reconstruction: baby steps

Hello,

This MR adds a tauRec flag to specify the jet collection that is used to seed the tau reconstruction.
The proposed implementation is via a flag, rather than a property to be set on the TauProcessorTool, which seems more error prone.
A priori there won't be a need to run LC-jet-seeded and PFlow-jet-seeded tau reconstruction in the same job, it will be either one or the other.
So a TauProcessorTool property does not seem required.

Cheers,
Bertrand
---
 Reconstruction/tauRec/python/TauRecBuilder.py    | 3 +--
 Reconstruction/tauRec/python/TauRecConfigured.py | 2 +-
 Reconstruction/tauRec/python/TauRecRunner.py     | 1 -
 Reconstruction/tauRec/python/tauRecFlags.py      | 9 ++++++++-
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/Reconstruction/tauRec/python/TauRecBuilder.py b/Reconstruction/tauRec/python/TauRecBuilder.py
index 66273909e94a..163c2cc76a7a 100644
--- a/Reconstruction/tauRec/python/TauRecBuilder.py
+++ b/Reconstruction/tauRec/python/TauRecBuilder.py
@@ -29,7 +29,6 @@ _outputKey = "TauJets"
 _outputAuxType = "xAOD::TauJetAuxContainer"
 _outputAuxKey = "TauJetsAux."
 _track_collection = "InDetTrackParticles"
-_jet_collection = "AntiKt4LCTopoJets"
 
 ################################################################################
 ## @class TauRecCoreBuilder
@@ -79,7 +78,7 @@ class TauRecCoreBuilder ( TauRecConfigured ) :
         
         tools = []
         try:
-            tools.append(taualgs.getJetSeedBuilder(_jet_collection))
+            tools.append(taualgs.getJetSeedBuilder(seed_collection_name=tauFlags.tauRecSeedJetCollection()))
 
             # run vertex finder only in case vertexing is available. This check can also be done in TauAlgorithmsHolder instead doing it here. 
             from InDetRecExample.InDetJobProperties import InDetFlags
diff --git a/Reconstruction/tauRec/python/TauRecConfigured.py b/Reconstruction/tauRec/python/TauRecConfigured.py
index 8747fd7fb314..97190f34fd38 100644
--- a/Reconstruction/tauRec/python/TauRecConfigured.py
+++ b/Reconstruction/tauRec/python/TauRecConfigured.py
@@ -37,7 +37,7 @@ class TauRecConfigured ( Configured ) :
         from AthenaCommon.AppMgr import ToolSvc
 
         self._TauProcessorAlgHandle = TauProcessorAlg ( name=self.name+'Alg',
-                                                        Key_jetInputContainer="AntiKt4LCTopoJets",
+                                                        Key_jetInputContainer=tauFlags.tauRecSeedJetCollection(),
                                                         Key_tauOutputContainer="tmp_TauJets",
                                                         Key_tauTrackOutputContainer="TauTracks",
                                                         Key_tauShotClusOutputContainer="TauShotClusters",
diff --git a/Reconstruction/tauRec/python/TauRecRunner.py b/Reconstruction/tauRec/python/TauRecRunner.py
index 665aecafed01..6de522b0b034 100644
--- a/Reconstruction/tauRec/python/TauRecRunner.py
+++ b/Reconstruction/tauRec/python/TauRecRunner.py
@@ -29,7 +29,6 @@ _outputKey = "TauJets"
 _outputAuxType = "xAOD::TauJetAuxContainer"
 _outputAuxKey = "TauJetsAux."
 _track_collection = "InDetTrackParticles"
-_jet_collection = "AntiKt4LCTopoJets"
 
 ################################################################################
 ## @class TauRecRunner
diff --git a/Reconstruction/tauRec/python/tauRecFlags.py b/Reconstruction/tauRec/python/tauRecFlags.py
index 0a5d9699939d..3202001ce541 100644
--- a/Reconstruction/tauRec/python/tauRecFlags.py
+++ b/Reconstruction/tauRec/python/tauRecFlags.py
@@ -31,6 +31,13 @@ class doTauRec(JobProperty):
     def get_Value(self):
         return self.statusOn and self.StoredValue and jobproperties.tauRecFlags.Enabled()
 
+class tauRecSeedJetCollection(JobProperty):
+    """ jet collection used to seed tau reconstruction
+    """
+    statusOn=True
+    allowedTypes=['string']
+    StoredValue="AntiKt4LCTopoJets"
+
 class tauRecToolsCVMFSPath(JobProperty):
     """ path to cvmfs file location
     """
@@ -185,7 +192,7 @@ class tauRecFlags(JobPropertyContainer):
 jobproperties.add_Container(tauRecFlags)
 
 # I want always the following flags in the Rec container  
-_list_tau=[Enabled,doTauRec,tauRecToolsCVMFSPath,TauDiscriminantCVMFSPath,tauRecMVATrackClassification,tauRecRNNTrackClassification,tauRecMVATrackClassificationConfig,tauRecRNNTrackClassificationConfig,tauRecSeedMaxEta,tauRecToolsDevToolList,tauRecToolsDevToolListProcessor,doRunTauDiscriminant,useVertexBasedConvFinder,useNewPIDBasedConvFinder,doPanTau,doPi0,pi0EtCuts,pi0MVACuts_1prong,pi0MVACuts_mprong,shotPtCut_1Photon,shotPtCut_2Photons,useOldVertexFitterAPI]
+_list_tau=[Enabled,doTauRec,tauRecSeedJetCollection,tauRecToolsCVMFSPath,TauDiscriminantCVMFSPath,tauRecMVATrackClassification,tauRecRNNTrackClassification,tauRecMVATrackClassificationConfig,tauRecRNNTrackClassificationConfig,tauRecSeedMaxEta,tauRecToolsDevToolList,tauRecToolsDevToolListProcessor,doRunTauDiscriminant,useVertexBasedConvFinder,useNewPIDBasedConvFinder,doPanTau,doPi0,pi0EtCuts,pi0MVACuts_1prong,pi0MVACuts_mprong,shotPtCut_1Photon,shotPtCut_2Photons,useOldVertexFitterAPI]
 for j in _list_tau: 
     jobproperties.tauRecFlags.add_JobProperty(j)
 del _list_tau
-- 
GitLab