From 82666e892bd364a15fb509a880712b66f6052e9b Mon Sep 17 00:00:00 2001 From: Jack Harrison <jack.matthew.harrison@cern.ch> Date: Fri, 14 Jul 2023 19:56:46 +0200 Subject: [PATCH 1/9] L1Topo Late muon reading fix L1Topo Late muon reading fix --- .../TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.cxx index 3a6cea3fcbc..f0e6c07bd55 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.cxx @@ -363,7 +363,7 @@ MuonInputProvider::fillTopoInputEvent(TCS::TopoInputEvent& inputEvent) const { ATH_MSG_DEBUG( "Contains L1Topo LateMuons L1Muctpi object from StoreGate!" ); - for(const auto muonRoi : *muonROIs) { + for(const auto muonRoi : *latemuonROIs) { inputEvent.addLateMuon( MuonInputProvider::createLateMuonTOB( *muonRoi, rpcPtValues, tgcPtValues) ); } } -- GitLab From 14700d5ab1407ccc5003ba53efdc9f3c2e9a053f Mon Sep 17 00:00:00 2001 From: Scott Snyder <scott.snyder@cern.ch> Date: Fri, 14 Jul 2023 19:57:53 +0200 Subject: [PATCH 2/9] TrigT1CaloMonitoring: Protect against out-of-bounds writes. TrigT1CaloMonitoring: Protect against out-of-bounds writes. Protect CpmMonitorAlgorithm against out-of-bounds vector writes when there is an error decoding the module/cpm numbers. See ATLASRECTS-7654. --- .../src/CpmMonitorAlgorithm.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/src/CpmMonitorAlgorithm.cxx b/Trigger/TrigT1/TrigT1CaloMonitoring/src/CpmMonitorAlgorithm.cxx index 902cffb88c8..c725336deab 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/src/CpmMonitorAlgorithm.cxx +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/src/CpmMonitorAlgorithm.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "CpmMonitorAlgorithm.h" @@ -800,11 +800,14 @@ StatusCode CpmMonitorAlgorithm::fillCpmTowerVectors(SG::ReadHandle<xAOD::CPMTowe : converter.cpCrateOverlap(coord); const int cpm = (core) ? converter.cpModule(coord) : converter.cpModuleOverlap(coord); - const int loc = crate * m_modules + cpm - 1; + const unsigned int loc = crate * m_modules + cpm - 1; const int slices = (ct->emEnergyVec()).size(); const int slice = crate * m_maxSlices + slices - 1; - if (crate==999) { - ATH_MSG_DEBUG("Crate number is 999, "<< crate << " eta " << eta << " phi " << phi << + if (loc >= errorsCPM.size()) { + ATH_MSG_ERROR("Crate/module index out of range: " << loc << " >= " + << errorsCPM.size() << " crate " << crate + << " core " << core + << " eta " << eta << " phi " << phi << " cpm " << cpm << " slices " << slices << " max slices " << m_maxSlices << " m_modules " << m_modules << " slice " << slice); @@ -814,7 +817,7 @@ StatusCode CpmMonitorAlgorithm::fillCpmTowerVectors(SG::ReadHandle<xAOD::CPMTowe bool emParityError=false; bool emLinkDownError=false; uint32_t error = ct->emError(); - if (error) { + if (error && loc < errorsCPM.size()) { const LVL1::DataError emError(error); if (emError.get(LVL1::DataError::Parity)) { emParityError=true; @@ -840,7 +843,7 @@ StatusCode CpmMonitorAlgorithm::fillCpmTowerVectors(SG::ReadHandle<xAOD::CPMTowe bool hadParityError=false; bool hadLinkDownError=false; error = ct->hadError(); - if (error) { + if (error && loc < errorsCPM.size()) { const LVL1::DataError hadError(error); if (hadError.get(LVL1::DataError::Parity)) { hadParityError=true; -- GitLab From c25f88e326ced9aa5e6019c315c3122a2c21cba7 Mon Sep 17 00:00:00 2001 From: Francesco De Santis <francesco.de.santis@cern.ch> Date: Fri, 14 Jul 2023 20:03:26 +0200 Subject: [PATCH 3/9] NSWL1Simulation: Fixing truth info in output ntuple NSWL1Simulation: Fixing truth info in output ntuple --- .../TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx index 0cf391adbb6..3f3fa283645 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx @@ -137,13 +137,12 @@ namespace NSWL1 { diamond->setRoadSizeDownUV(m_diamOverlapStereoDown); } - unsigned int particles = entries.rbegin()->first.second +1, nskip=0; - for (unsigned int i=0; i<particles; i++) { double trueta = -999., truphi = -999., trutheta = -999., trupt = -999., dt = -999., tpos = -999., ppos = -999., epos = -999., tent = -999., pent = -999., eent = -999.; // We need to extract truth info, if available - std::pair<int, unsigned int> pair_event (event,i); + for (unsigned int j=0; j<Event_Info.size(); j++) { + std::pair<int, unsigned int> truth_event (event,j); if (!Event_Info.empty()) { - auto tru_it = Event_Info.find(pair_event); + auto tru_it = Event_Info.find(truth_event); if (tru_it != Event_Info.end()) { evInf_entry truth_info(tru_it->second); trutheta = truth_info.theta_ip; // truth muon at the IP @@ -170,8 +169,13 @@ namespace NSWL1 { m_trigger_trueTheEnt->push_back(tent); m_trigger_truePhiEnt->push_back(pent); } - } else ATH_MSG_DEBUG( "Extra reco particle with no truth candidate available" ); + } } + } + unsigned int particles = entries.rbegin()->first.second +1, nskip=0; + for (unsigned int i=0; i<particles; i++) { + std::pair<int, unsigned int> pair_event (event,i); + // Now let's switch to reco hits: firstly, extracting the station name we're working on... std::string station = "-"; auto event_it = entries.find(pair_event); -- GitLab From 1804f6f4c8b5884c7577dc99198663319f46516b Mon Sep 17 00:00:00 2001 From: Savanna Shaw <savanna.marie.shaw@cern.ch> Date: Fri, 14 Jul 2023 20:08:06 +0200 Subject: [PATCH 4/9] Fix ROB prefetching configuration for probe triggers Fix ROB prefetching configuration for probe triggers Setting the ROBPrefetchingInputDecisions for the probe versions of the ROB prefetching algorithms that are used in purely CA based configuration (ATR-27934). --- .../TriggerMenuMT/python/HLT/Config/MenuComponents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/MenuComponents.py index 2028ecfbe86..722a18f6cfb 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/MenuComponents.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/MenuComponents.py @@ -405,7 +405,7 @@ class MenuSequence(object): if ROBPrefetching.StepRoI in flags.Trigger.ROBPrefetchingOptions: seqChildren = Sequence.getChildren() if hasattr(Sequence,'getChildren') else Sequence.Members for child in seqChildren: - if hasProp(child,'ROBPrefetchingInputDecisions') and input_maker_output not in child.ROBPrefetchingInputDecisions and not input_maker_output.endswith('_probe'): + if hasProp(child,'ROBPrefetchingInputDecisions') and input_maker_output not in child.ROBPrefetchingInputDecisions and not IsProbe: locked = bool(child.isLocked()) if hasattr(child,'isLocked') else False if locked: child.unlock() -- GitLab From 95aebc6cbbc3bbd626e2f024255d759358e354f8 Mon Sep 17 00:00:00 2001 From: Walter Lampl <walter.lampl@cern.ch> Date: Sat, 15 Jul 2023 13:02:42 +0200 Subject: [PATCH 5/9] Bump version number to 23.0.38 --- Projects/AthDataQuality/version.txt | 2 +- Projects/AthSimulation/version.txt | 2 +- Projects/Athena/version.txt | 2 +- Projects/DetCommon/version.txt | 2 +- Projects/VP1Light/version.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Projects/AthDataQuality/version.txt b/Projects/AthDataQuality/version.txt index c6766f6c022..f57c176bb5b 100644 --- a/Projects/AthDataQuality/version.txt +++ b/Projects/AthDataQuality/version.txt @@ -1 +1 @@ -23.0.37 +23.0.38 diff --git a/Projects/AthSimulation/version.txt b/Projects/AthSimulation/version.txt index c6766f6c022..f57c176bb5b 100644 --- a/Projects/AthSimulation/version.txt +++ b/Projects/AthSimulation/version.txt @@ -1 +1 @@ -23.0.37 +23.0.38 diff --git a/Projects/Athena/version.txt b/Projects/Athena/version.txt index c6766f6c022..f57c176bb5b 100644 --- a/Projects/Athena/version.txt +++ b/Projects/Athena/version.txt @@ -1 +1 @@ -23.0.37 +23.0.38 diff --git a/Projects/DetCommon/version.txt b/Projects/DetCommon/version.txt index c6766f6c022..f57c176bb5b 100644 --- a/Projects/DetCommon/version.txt +++ b/Projects/DetCommon/version.txt @@ -1 +1 @@ -23.0.37 +23.0.38 diff --git a/Projects/VP1Light/version.txt b/Projects/VP1Light/version.txt index c6766f6c022..f57c176bb5b 100644 --- a/Projects/VP1Light/version.txt +++ b/Projects/VP1Light/version.txt @@ -1 +1 @@ -23.0.37 +23.0.38 -- GitLab From 7a3ac3f58979b44aa8c4f6b686e062006c555391 Mon Sep 17 00:00:00 2001 From: Peter Sherwood <peter.sherwood@cern.ch> Date: Sun, 16 Jul 2023 10:01:15 +0200 Subject: [PATCH 6/9] TrigJetHypo ATR-27619 - reduce the number of AlgTools. TrigJetHypo ATR-27619 - reduce the number of AlgTools. Replace the on to one matching of Condition filters - Conditions with an index array, and a Filter array. The index array is one-to-one with the Conditions, while the size of the filter array is at most the length of the filter index array. In the majority of cases, the condition filters were pass-through filters, so this approch reduces the need to configure the such filters, at the proce of more complex code. Further, the filter used before the processing the jet hypo, has been replaced by a simple copy when a PassThrough filter was requested. --- .../python/HelperConfigToolParams.py | 22 ++++- .../python/hypoConfigBuilder.py | 32 +++---- .../TrigHLTJetHypo/python/hypoToolTests.py | 95 ++++++++++--------- .../TrigHLTJetHypo/python/scenario_dijet.py | 12 ++- .../python/scenario_fbdjnoshared.py | 12 ++- .../python/scenario_fbdjshared.py | 18 ++-- .../TrigHLTJetHypo/python/scenario_ht.py | 11 ++- .../TrigHLTJetHypo/python/scenario_simple.py | 10 +- .../TrigHLTJetHypo/src/FastReducer.cxx | 16 +++- .../TrigHLTJetHypo/src/FastReducer.h | 6 +- .../src/FastReductionMatcher.cxx | 25 ++++- .../TrigHLTJetHypo/src/FastReductionMatcher.h | 6 +- .../TrigJetHypoToolConfig_fastreduction.cxx | 24 +++-- .../src/TrigJetHypoToolConfig_fastreduction.h | 9 +- 14 files changed, 193 insertions(+), 105 deletions(-) diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/HelperConfigToolParams.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/HelperConfigToolParams.py index a28501fb326..8275a01cb08 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/HelperConfigToolParams.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/HelperConfigToolParams.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration from AthenaCommon.Logging import logging from AthenaCommon.Constants import DEBUG @@ -14,12 +14,17 @@ class HelperConfigToolParams: and Conditions that will filter for the node. """ - def __init__(self, treevec=[], repcondargs=[], filterparams=[]): + def __init__(self, + treevec=[], + repcondargs=[], + filterparams=[], + filterparam_inds=[]): self.treevec = treevec self.repcondargs = repcondargs self.filterparams = filterparams + self.filterparam_inds = filterparam_inds @property def treevec(self): @@ -69,11 +74,22 @@ class HelperConfigToolParams: @filterparams.setter def filterparams(self, filterparams): self.__filterparams = filterparams + + + @property + def filterparam_inds(self): + return self.__filterparam_inds + + @filterparam_inds.setter + def filterparam_inds(self, filterparam_inds): + self.__filterparam_inds = filterparam_inds + def __str__(self): s = [self.__class__.__name__ + ':'] - to_show = ['treevec', 'leafvec', 'repcondargs', 'filterparams'] + to_show = ['treevec', 'leafvec', 'repcondargs', 'filterparams', + 'filterparam_inds'] width = max([len(a) for a in to_show]) [s.append('%s %s' % (a.ljust(width), getattr(self, a))) for a in to_show] return '\n'.join(s) diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/hypoConfigBuilder.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/hypoConfigBuilder.py index 88338494440..1d26e2fbb88 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/hypoConfigBuilder.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/hypoConfigBuilder.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration from TrigHLTJetHypo.FastReductionAlgToolFactory import toolfactory @@ -18,10 +18,6 @@ from TrigHLTJetHypo.makeConditionFilterConfigurer import ( makeConditionFilterConfigurer, ) -from TrigHLTJetHypo.makePassThroughFilterConfigurer import ( - makePassThroughFilterConfigurer, -) - from TrigHLTJetHypo.make_repeatedCondConfigurer import ( make_repeatedCond, make_repeatedCondCfgFromParams, @@ -73,8 +69,10 @@ def buildHypoHelperConfigTool(params): scenarios. It contains the information needed to build the configuration AlgTool that intialiases a hypo helper AlgTool""" - # check that each Condition has a Filter - assert len(params.repcondargs) == len(params.filterparams) + # check that each Condition has a Filter index. + # the index is -1 for no Condition filtering. + assert len(params.repcondargs) == len(params.filterparam_inds) + assert len(params.filterparam_inds) >= len(params.filterparams) # FastReducer root node repcondobjs = [make_root_repcondconfig()] @@ -82,24 +80,24 @@ def buildHypoHelperConfigTool(params): repcondobjs.append(make_repeatedCondCfgFromParams(ra)) - # filter for FastReducer root node - filtConditionMakers = [makePassThroughFilterConfigurer()] + # filter for FastReducer root node (use position 0) + filtConditionMakers = [] + filtConditionMakerInds = [-1] # no condition filtering for root - for ra in params.filterparams: - if ra.typename == 'ConditionFilter': + for ra_ind in params.filterparam_inds: + if ra_ind != -1: + ra = params.filterparams[ra_ind] filtConditionMakers.append(makeConditionFilterConfigurer(ra)) - elif ra.typename == 'PassThroughFilter': - filtConditionMakers.append(makePassThroughFilterConfigurer()) + filtConditionMakerInds.append(len(filtConditionMakers)-1) else: - raise NotImplementedError( - 'Filter type %s not implemented' % ra.typename - ) + filtConditionMakerInds.append(-1) toolclass, name = toolfactory('HelperToolConfigTool') vals = {'name': name, 'conditionMakers': repcondobjs, 'filterMakers': filtConditionMakers, + 'filterMakerInds': filtConditionMakerInds, 'treeVector': params.treevec, 'leafVector': params.leafvec, } @@ -294,7 +292,7 @@ def make_prefilter_configurers(chain_dict): # a PassThroughFilter configurer is made. if not pf_strings: - return [makePassThroughFilterConfigurer()] + return [] # route the prefilter strings to the appropriate handler prefilter_router = { diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/hypoToolTests.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/hypoToolTests.py index 1f958c38a55..c264e0015d9 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/hypoToolTests.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/hypoToolTests.py @@ -30,8 +30,8 @@ class HypoToolStructure(unittest.TestCase): ChainProp(name='HLT_j420_subresjesgscIS_ftf_L1J100', groups=SingleJetGroup), 'connections': dict(((0, [1]), - (1, [2, 10]), - (2, [3, 5, 8, 9]), + (1, [2]), + (2, [3, 5]), (3, [4]), (5, [6, 7]))), 'values': [] @@ -41,8 +41,8 @@ class HypoToolStructure(unittest.TestCase): ChainProp(name='HLT_j260f_L1J75_31ETA49', groups=SingleJetGroup), 'connections': dict(((0, [1]), - (1, [2, 10]), - (2, [3, 5, 8, 9]), + (1, [2]), + (2, [3, 5]), (3, [4]), (5, [6, 7]))), 'values': [] @@ -53,8 +53,8 @@ class HypoToolStructure(unittest.TestCase): ChainProp(name='HLT_j80_j60_L1J15', l1SeedThresholds=['FSNOSEED']*2, groups=MultiJetGroup), 'connections': dict(((0, [1]), - (1, [2, 14]), - (2, [3, 5, 8, 11,12, 13]), + (1, [2]), + (2, [3, 5, 8]), (3, [4]), (5, [6, 7]), (8, [9, 10]))), @@ -64,8 +64,8 @@ class HypoToolStructure(unittest.TestCase): { 'prop': ChainProp(name='HLT_2j80_3j60_L1J15', l1SeedThresholds=['FSNOSEED']*2, groups=MultiJetGroup), - 'connections': dict(((0, [1]), (1, [2, 14]), - (2, [3, 5, 8, 11, 12, 13]), + 'connections': dict(((0, [1]), (1, [2]), + (2, [3, 5, 8]), (3, [4]), (5, [6, 7]), (8, [9,10]))), @@ -77,12 +77,12 @@ class HypoToolStructure(unittest.TestCase): groups=SingleJetGroup), 'connections': dict(((0, [1]), - (1, [2, 12]), - (2, [3, 5, 7, 8]), + (1, [2]), + (2, [3, 5, 7]), (3, [4]), (5, [6]), - (8, [9]), - (9, [10, 11]))), + (7, [8]), + (8, [9, 10]))), 'values': [] }, @@ -93,15 +93,15 @@ class HypoToolStructure(unittest.TestCase): groups=MultiJetGroup), 'connections': dict(((0, [1]), - (1, [2, 14, 27]), - (2, [3, 5, 8, 11, 12, 13]), + (1, [2, 11]), + (2, [3, 5, 8]), (3, [4]), (5, [6, 7]), (8, [9, 10]), - (14, [15, 17, 21, 24, 25, 26]), - (15, [16]), - (17, [18, 19, 20]), - (21, [22, 23]),)), + (11, [12, 14, 18]), + (12, [13]), + (14, [15, 16, 17]), + (18, [19, 20]),)), 'values': [] }, @@ -111,8 +111,8 @@ class HypoToolStructure(unittest.TestCase): groups=MultiJetGroup), 'connections': dict(((0, [1]), - (1, [2, 10]), - (2, [3, 5, 8, 9]), + (1, [2]), + (2, [3, 5]), (3, [4]), (5, [6, 7]))), 'values': [{'nodeid': 5, @@ -124,16 +124,16 @@ class HypoToolStructure(unittest.TestCase): groups=SingleJetGroup), 'connections': dict(((0, [1]), - (1, [2, 14, 30]), - (2, [3, 5, 8, 11, 12, 13]), + (1, [2, 11]), + (2, [3, 5, 8]), (3, [4]), (5, [6, 7]), (8, [9, 10]), - (14, [15, 17, 20, 23, 26, 27, 28, 29]), - (15, [16]), + (11, [12, 14, 17, 20]), + (12, [13]), + (14, [15, 16]), (17, [18, 19]), - (20, [21, 22]), - (23, [24, 25]))), + (20, [21, 22]))), 'values': [] }, @@ -143,15 +143,15 @@ class HypoToolStructure(unittest.TestCase): groups=MultiJetGroup), 'connections': dict(((0, [1]), - (1, [2, 10, 20]), - (2, [3, 5, 8, 9]), + (1, [2, 8]), + (2, [3, 5]), (3, [4]), (5, [6, 7]), - (10, [11, 13, 15, 16]), + (8, [9, 11, 13]), + (9, [10]), (11, [12]), (13, [14]), - (16, [17,]), - (17, [18, 19]))), + (14, [15, 16]))), 'values': [] }, @@ -160,8 +160,8 @@ class HypoToolStructure(unittest.TestCase): groups=SingleJetGroup), 'connections': dict(((0, [1]), - (1, [2, 26]), - (2, [3, 5, 8, 11, 14, 17, 20, 21, 22, 23, 24, 25]), + (1, [2]), + (2, [3, 5, 8, 11, 14, 17]), (3, [4]), (5, [6, 7]), (8, [9, 10]), @@ -177,8 +177,8 @@ class HypoToolStructure(unittest.TestCase): groups=SingleJetGroup), 'connections': dict(((0, [1]), - (1, [2, 10]), - (2, [3, 5, 8, 9]), + (1, [2]), + (2, [3, 5]), (3, [4]), (5, [6, 7]))), 'values': [] @@ -190,12 +190,12 @@ class HypoToolStructure(unittest.TestCase): 'connections': dict(((0, [1]), - (1, [2, 10]), - (2, [3, 5, 8, 9]), + (1, [2, 8]), + (2, [3, 5]), (3, [4]), (5, [6, 7]), - (10, [11]), - (11, [12, 13]))), + (8, [9]), + (9, [10, 11]))), 'values': [] }, @@ -207,8 +207,8 @@ class HypoToolStructure(unittest.TestCase): 'connections': dict(((0, [1]), - (1, [2, 13]), - (2, [3, 5, 7, 10, 11, 12]), + (1, [2]), + (2, [3, 5, 7]), (3, [4]), (5, [6]), (7, [8, 9]))), @@ -237,11 +237,18 @@ class HypoToolStructure(unittest.TestCase): analyser = HypoToolAnalyser(tool) + node_table = [] + for k in sorted(analyser.node_table.keys()): + node_table.append ('%d: %s' % (k, analyser.node_table[k])) + + node_table = '\n'.join(node_table) + self.assertTrue(analyser.connections == td['connections'], - 'fail for case %s expected %s; saw %s' %( + 'fail for case %s expected %s; saw %s \n %s' %( chain_name, str(td['connections']), - str(analyser.connections))) + str(analyser.connections), + node_table)) # check selected attributes of inner (nested) tools. @@ -259,7 +266,7 @@ class HypoToolStructure(unittest.TestCase): for attrname, testval in ref_values.items(): toolval = getattr(subtool, attrname) self.assertEqual(toolval, testval, - msg='%s: node: %d expected %s saw %s' % ( + msg='%s: node: %d expected %s saw %s' % ( chain_name, nodeid, str(testval), diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_dijet.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_dijet.py index 1429e242c68..d9d9f64ba79 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_dijet.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_dijet.py @@ -1,7 +1,6 @@ # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration from TrigHLTJetHypo.RepeatedConditionParams import RepeatedConditionParams -from TrigHLTJetHypo.FilterParams import FilterParams from TrigHLTJetHypo.HelperConfigToolParams import HelperConfigToolParams from TrigHLTJetHypo.ConditionDefaults import defaults from TrigHLTJetHypo.make_treevec import make_treevec @@ -208,8 +207,8 @@ def scenario_dijet(scenario, chainPartInd): # make pass through filter params for each condition in the tree. nconds = len(repcondargs) - filterparams = [FilterParams(typename='PassThroughFilter') - for i in range(nconds)] + filterparams = [] + filterparam_inds = [-1 for i in range(nconds)] # parameters to initalise the AlgTool that initialises the helper AlgTool @@ -221,10 +220,13 @@ def scenario_dijet(scenario, chainPartInd): assert treevec == [0, 0, 1] else: assert treevec == [0, 0, 1, 1] - + + assert len(repcondargs) == len(filterparam_inds) + helper_params = HelperConfigToolParams(treevec=treevec, repcondargs=repcondargs, - filterparams=filterparams) + filterparams=filterparams, + filterparam_inds=filterparam_inds) return [helper_params] # a list is one entry per FastReduction tree diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_fbdjnoshared.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_fbdjnoshared.py index e541926691c..a0fac201f6f 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_fbdjnoshared.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_fbdjnoshared.py @@ -1,7 +1,6 @@ # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration from TrigHLTJetHypo.RepeatedConditionParams import RepeatedConditionParams -from TrigHLTJetHypo.FilterParams import FilterParams from TrigHLTJetHypo.HelperConfigToolParams import HelperConfigToolParams from TrigHLTJetHypo.ConditionDefaults import defaults from TrigHLTJetHypo.make_treevec import make_treevec @@ -134,8 +133,8 @@ def scenario_fbdjnoshared(scenario, chainPartInd): # make pass through filter params for each condition in the tree. nconds = len(repcondargs) - filterparams = [FilterParams(typename='PassThroughFilter') - for i in range(nconds)] + filterparams = [] + filterparam_inds = [-1 for i in range(nconds)] # parameters to initalise the AlgTool that initialises the helper AlgTool @@ -147,7 +146,10 @@ def scenario_fbdjnoshared(scenario, chainPartInd): helper_params = HelperConfigToolParams(treevec=treevec, repcondargs=repcondargs, - filterparams=filterparams) - + filterparams=filterparams, + filterparam_inds=filterparam_inds) + + assert len(repcondargs) == len(filterparam_inds) + return [helper_params] # a list is one entry per FastReduction tree diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_fbdjshared.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_fbdjshared.py index b18f0eb81de..1decf12134e 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_fbdjshared.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_fbdjshared.py @@ -1,7 +1,6 @@ # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration from TrigHLTJetHypo.RepeatedConditionParams import RepeatedConditionParams -from TrigHLTJetHypo.FilterParams import FilterParams from TrigHLTJetHypo.HelperConfigToolParams import HelperConfigToolParams from TrigHLTJetHypo.ConditionDefaults import defaults from TrigHLTJetHypo.make_treevec import make_treevec @@ -62,8 +61,8 @@ def scenario_fbdjshared(scenario, chainPartInd): # make pass through filter params for each condition in the tree. nconds = len(repcondargs) - filterparams = [FilterParams(typename='PassThroughFilter') - for i in range(nconds)] + filterparams = [] + filterparam_inds = [-1 for i in range(nconds)] # treevec[i] gives the tree_id of the parent of the # node with tree_id = i @@ -72,7 +71,8 @@ def scenario_fbdjshared(scenario, chainPartInd): helperparams = HelperConfigToolParams(treevec=treevec, repcondargs=repcondargs, - filterparams=filterparams) + filterparams=filterparams, + filterparam_inds=filterparam_inds) helperparamslist = [helperparams] #############################################33 @@ -125,8 +125,8 @@ def scenario_fbdjshared(scenario, chainPartInd): # make pass through filter params for each condition in the tree. nconds = len(repcondargs) - filterparams = [FilterParams(typename='PassThroughFilter') - for i in range(nconds)] + filterparams = [] + filterparam_inds = [-1 for i in range(nconds)] # parameters to initalise the AlgTool that initialises the helper AlgTool @@ -137,8 +137,12 @@ def scenario_fbdjshared(scenario, chainPartInd): helperparams = HelperConfigToolParams(treevec=treevec, repcondargs=repcondargs, - filterparams=filterparams) + filterparams=filterparams, + filterparam_inds=filterparam_inds) # a list is one entry per FastReduction tree + + assert len(repcondargs) == len(filterparam_inds) + helperparamslist.append(helperparams) return helperparamslist diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_ht.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_ht.py index 5f8a428e635..e253feaaab5 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_ht.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_ht.py @@ -100,8 +100,11 @@ def scenario_ht(scenario, chainPartInd): condargs=condargs)] filterparams = [FilterParams(typename='ConditionFilter', args=repfiltargs)] + filterparam_inds = [0] + else: - filterparams = [FilterParams(typename='PassThroughFilter')] + filterparams = [] + filterparam_inds = [-1] # no condition filter # parameters to initalise the AlgTool that initialises the helper AlgTool @@ -110,9 +113,13 @@ def scenario_ht(scenario, chainPartInd): treevec = make_treevec(repcondargs) assert treevec == [0, 0] + assert len(repcondargs) == len(filterparam_inds) + + helper_params = HelperConfigToolParams(treevec=treevec, repcondargs=repcondargs, - filterparams=filterparams) + filterparams=filterparams, + filterparam_inds=filterparam_inds) return [helper_params] # a list with one entry per FastReduction tree diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_simple.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_simple.py index ccb5df695a8..42473068314 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_simple.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/scenario_simple.py @@ -1,7 +1,6 @@ # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration from TrigHLTJetHypo.RepeatedConditionParams import RepeatedConditionParams -from TrigHLTJetHypo.FilterParams import FilterParams from TrigHLTJetHypo.HelperConfigToolParams import HelperConfigToolParams from TrigHLTJetHypo.ConditionDefaults import defaults from TrigHLTJetHypo.make_treevec import make_treevec @@ -170,6 +169,7 @@ def scenario_simple(chain_parts): repcondargs = [] filterparams = [] + filterparam_inds = [] ncp = 0 @@ -191,8 +191,8 @@ def scenario_simple(chain_parts): multiplicity = int(cp['multiplicity']) chainPartInd = cp['chainPartIndex'] - # make an empty filter condition for the FR condition - filterparams.append(FilterParams(typename='PassThroughFilter')) + # no condition filtering + filterparam_inds.append(-1) # no Condition filter clique = None try: @@ -215,8 +215,10 @@ def scenario_simple(chain_parts): treevec = make_treevec(repcondargs) assert treevec == [0 for i in range(len(chain_parts) + 1)] + assert len(repcondargs) == len(filterparam_inds) helper_params = HelperConfigToolParams(treevec=treevec, repcondargs=repcondargs, - filterparams=filterparams) + filterparams=filterparams, + filterparam_inds=filterparam_inds) return [helper_params] # a list is one entry per FastReduction tree diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx index 670f92a2740..dd4dc2f9ae9 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "./FastReducer.h" @@ -41,10 +41,12 @@ struct IndexVecComp{ FastReducer::FastReducer(const HypoJetVector& jv, const ConditionPtrs& conditions, const ConditionFilters& filters, + const ConditionFilterInds& filterInds, const Tree& tree, xAODJetCollector& jetCollector, const Collector& collector): - m_conditions(conditions), m_conditionFilters(filters), m_tree(tree) { + m_conditions(conditions), m_conditionFilters(filters), + m_conditionFilterInds(filterInds), m_tree(tree) { // create an empty vector of indices of satisfying jet groups // for each Condition. @@ -181,9 +183,13 @@ bool FastReducer::findInitialJetGroups(const HypoJetVector& jv, for(const auto& leaf: leaves){ - auto& filter = m_conditionFilters[leaf]; - auto filtered_jets = filter->filter(jv, collector); - + auto filtered_jets = jv; + auto& filter_ind = m_conditionFilterInds[leaf]; + if (filter_ind != -1) { + const auto& filter = m_conditionFilters[filter_ind]; + filtered_jets = filter->filter(filtered_jets, collector); + } + auto iters = std::make_pair(filtered_jets.begin(), filtered_jets.end()); diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h index 043322009f0..510b56d56eb 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_FASTREDUCER_H @@ -30,12 +30,15 @@ using JetGroupInd2ElemInds = std::map<int, std::vector<std::size_t>>; using ConditionFilters = std::vector<std::unique_ptr<IHypoJetVectorFilter>>; +using ConditionFilterInds = std::vector<int>; + class FastReducer { public: FastReducer(const HypoJetVector& jv, const ConditionPtrs& conditionObjects, const ConditionFilters& conditionFilters, + const ConditionFilterInds& conditionFilterInds, const Tree& conditionsTree, xAODJetCollector& jetCollector, const Collector& collector); @@ -59,6 +62,7 @@ class FastReducer { // conditionFilters owned by the matcher const ConditionFilters& m_conditionFilters; + ConditionFilterInds m_conditionFilterInds; /** tree structure for Conditions objects. The conditions tree gives relations among conditions (eg parent-child diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx index 2cb5b2642e1..9c1d17dfd2d 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "./FastReductionMatcher.h" @@ -12,9 +12,11 @@ FastReductionMatcher::FastReductionMatcher(ConditionPtrs& conditions, ConditionFilters& filters, + const ConditionFilterInds& filterInds, const Tree& tree): m_conditions(std::move(conditions)), m_conditionFilters(std::move(filters)), + m_conditionFilterInds(filterInds), m_tree(tree){ if (m_conditions[0]->capacity() != 0 or @@ -37,9 +39,12 @@ FastReductionMatcher::FastReductionMatcher(ConditionPtrs& conditions, m_minNjets = std::max(1, minNjets); - if (filters.size() != conditions.size()) { + if (filterInds.size() != m_conditions.size()) { m_validState = false; - m_msg = "Conditions and ConditionFilters sequence sizes differ"; + std::stringstream ss; + ss << "ConditionFilterInds and Conditions sequence sizes differ: "; + ss << filterInds.size() << " " << m_conditions.size(); + m_msg = ss.str(); } } @@ -78,6 +83,7 @@ FastReductionMatcher::match(const HypoJetVector& jv, FastReducer reducer(jv, m_conditions, m_conditionFilters, + m_conditionFilterInds, m_tree, jetCollector, collector); @@ -101,6 +107,19 @@ std::string FastReductionMatcher::toString() const { ss << sc <<": "<< c->toString() + '\n'; } + + ss << "FastReductionMatcher ConditionFilter indices [" + << m_conditionFilterInds.size() << "]: \n"; + + + count = 0; + for(const auto& c : m_conditionFilterInds){ + auto sc = std::to_string(count++); + sc.insert(sc.begin(), 3-sc.length(), ' '); + ss << sc <<": "<< c << '\n'; + } + + ss << "FastReductionMatcher ConditionFilters [" << m_conditionFilters.size() << "]: \n"; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h index 1fc2c926d58..74174f6a12f 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_FASTREDUCTIONMATCHER_H @@ -18,11 +18,14 @@ class ITrigJetHypoInfoCollector; using ConditionFilters = std::vector<std::unique_ptr<IHypoJetVectorFilter>>; +using ConditionFilterInds = std::vector<int>; + class FastReductionMatcher: public IJetsMatcher { public: FastReductionMatcher(ConditionPtrs&, ConditionFilters&, + const ConditionFilterInds&, const Tree&); @@ -53,6 +56,7 @@ class FastReductionMatcher: public IJetsMatcher { ConditionPtrs m_conditions; ConditionFilters m_conditionFilters; + ConditionFilterInds m_conditionFilterInds; /** tree structure for Conditions objects. The conditions tree gives relations among conditions (eg parent-child diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx index bd12fcf5385..d3af15d7acd 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ @@ -43,6 +43,16 @@ StatusCode TrigJetHypoToolConfig_fastreduction::initialize() { " require at least 2" ); return StatusCode::FAILURE; } + + if(m_filterMakerInds.size() != m_conditionMakers.size()){ + // need an index for each condition + ATH_MSG_ERROR("No. of conditions " + + std::to_string( m_conditionMakers.size()) + + " no. of filter inds " + + std::to_string( m_filterMakerInds.size()) + + " must be equal" ); + return StatusCode::FAILURE; + } return StatusCode::SUCCESS; } @@ -111,18 +121,18 @@ TrigJetHypoToolConfig_fastreduction::requiresNJets() const { std::unique_ptr<IJetsMatcher> TrigJetHypoToolConfig_fastreduction::getMatcher () const { - auto repeatedConds = getRepeatedConditions(); + auto matcher = std::unique_ptr<IJetsMatcher>(nullptr); - if(repeatedConds.empty()){ - return std::unique_ptr<IJetsMatcher>(nullptr); - } - - auto matcher = std::unique_ptr<IJetsMatcher>(); + auto repeatedConds = getRepeatedConditions(); + + if(repeatedConds.empty()){return matcher;} auto conditions = std::move(repeatedConds); auto filters = getFilters(); + auto fpm = new FastReductionMatcher(conditions, filters, + m_filterMakerInds, Tree(m_treeVec)); matcher.reset(fpm); return matcher; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h index 5b3d944d8bd..cb081dd11dc 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGJETHYPOTOOLCONFIG_FASTREDUCTION_H @@ -51,6 +51,13 @@ public extends<AthAlgTool, ITrigJetHypoToolNoGrouperConfig> { this, "filterMakers", {}, "AlgTools that construct Condition filters" }; + + // indirection to allow non-specification of PassThrough filters. + // as requested in ATR-27619 + Gaudi::Property<std::vector<int>> m_filterMakerInds{ + this, "filterMakerInds", {}, "Indicies into m_filterMakers" + }; + Gaudi::Property<std::vector<std::size_t>> m_treeVec{ this, "treeVector", {}, "integer sequence representation of jet hypo tree"}; -- GitLab From 1b47039b8d311aa93c4708f09700ee091ea57f35 Mon Sep 17 00:00:00 2001 From: Jiri Masik <jiri.masik@cern.ch> Date: Sun, 16 Jul 2023 15:38:29 +0200 Subject: [PATCH 7/9] cleanup of unused config after !64260 gets merged cleanup of unused config after !64260 gets merged --- .../python/InDetPriVxFinderToolConfig.py | 7 +- .../python/InDetTrackSelectionToolConfig.py | 38 ++-- .../python/SiDetElementsRoadToolConfig.py | 14 ++ .../python/SiSpacePointsSeedToolConfig.py | 40 ++++ .../InDetRecExample/python/TrackingCommon.py | 19 -- .../python/ConfiguredNewTrackingTrigCuts.py | 6 - .../python/ConfiguredVertexingTrigCuts.py | 17 -- .../python/InDetTrigConfigRecLoadTools.py | 144 -------------- .../InDetTrigConfigRecLoadToolsCosmics.py | 53 ----- .../python/InDetTrigConfigRecLoadToolsPost.py | 68 ------- .../python/InDetTrigTrackingCuts.py | 11 -- .../InDetTrigRecExample/python/README.md | 4 - .../python/TrigInDetConfiguredVtxCuts.py | 178 ----------------- .../TrigInDetConfig/python/ConfigSettings.py | 8 - .../python/ConfigSettingsBase.py | 12 +- .../TrigInDetConfig/python/EFIDTracking.py | 4 +- .../TrigInDetConfig/python/InDetTrigCommon.py | 183 +----------------- .../python/InDetTrigFastTracking.py | 10 +- .../TrigInDetConfig/python/TrigInDetConfig.py | 12 -- .../python/TrigTrackingPassFlags.py | 17 +- .../share/effpreinclude.py | 3 - .../TriggerJobOpts/share/runHLT_standalone.py | 4 - .../BeamspotChainConfiguration.py | 2 +- .../python/HLT/Electron/generateElectron.py | 6 +- .../python/HLT/Muon/generateMuon.py | 14 +- 25 files changed, 113 insertions(+), 761 deletions(-) delete mode 100644 InnerDetector/InDetExample/InDetTrigRecExample/python/ConfiguredVertexingTrigCuts.py delete mode 100644 InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsCosmics.py delete mode 100644 InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsPost.py delete mode 100644 InnerDetector/InDetExample/InDetTrigRecExample/python/TrigInDetConfiguredVtxCuts.py diff --git a/InnerDetector/InDetConfig/python/InDetPriVxFinderToolConfig.py b/InnerDetector/InDetConfig/python/InDetPriVxFinderToolConfig.py index 9ccbdd257ce..1851d7649dd 100644 --- a/InnerDetector/InDetConfig/python/InDetPriVxFinderToolConfig.py +++ b/InnerDetector/InDetConfig/python/InDetPriVxFinderToolConfig.py @@ -169,14 +169,11 @@ def TrigGaussIterativeFindingCfg(flags, kwargs.setdefault("TrackSelector", acc.popToolsAndMerge( TrigVtxInDetTrackSelectionCfg(flags))) - from InDetTrigRecExample.TrigInDetConfiguredVtxCuts import ( - ConfiguredTrigVtxCuts) - vtx_cuts = ConfiguredTrigVtxCuts() kwargs.setdefault("useBeamConstraint", True) kwargs.setdefault("maximumChi2cutForSeeding", 29) kwargs.setdefault("createSplitVertices", False) - kwargs.setdefault("doMaxTracksCut", vtx_cuts.doMaxTracksCut()) - kwargs.setdefault("MaxTracks", vtx_cuts.MaxTracks()) + kwargs.setdefault("doMaxTracksCut", True) + kwargs.setdefault("MaxTracks", 3000) acc.setPrivateTools(acc.popToolsAndMerge( GaussIterativeFindingCfg(flags, name+flags.Tracking.ActiveConfig.input_name, **kwargs))) diff --git a/InnerDetector/InDetConfig/python/InDetTrackSelectionToolConfig.py b/InnerDetector/InDetConfig/python/InDetTrackSelectionToolConfig.py index 5ee12098128..9c620a52cbd 100644 --- a/InnerDetector/InDetConfig/python/InDetTrackSelectionToolConfig.py +++ b/InnerDetector/InDetConfig/python/InDetTrackSelectionToolConfig.py @@ -114,29 +114,25 @@ def VtxInDetTrackSelectionCfg(flags, name="VertexInDetTrackSelectionTool", **kwa def TrigVtxInDetTrackSelectionCfg(flags, name="InDetTrigDetailedTrackSelectionTool", **kwargs): - from InDetTrigRecExample.TrigInDetConfiguredVtxCuts import ConfiguredTrigVtxCuts - cuts = ConfiguredTrigVtxCuts() - cuts.printInfo() acc = ComponentAccumulator() - - kwargs.setdefault("CutLevel", cuts.TrackCutLevel()) - kwargs.setdefault("minPt", cuts.minPT()) - kwargs.setdefault("maxD0", cuts.IPd0Max()) - kwargs.setdefault("maxZ0", cuts.z0Max()) - kwargs.setdefault("maxZ0SinTheta", cuts.IPz0Max()) - kwargs.setdefault("maxSigmaD0", cuts.sigIPd0Max()) - kwargs.setdefault("maxSigmaZ0SinTheta", cuts.sigIPz0Max()) - kwargs.setdefault("maxChiSqperNdf", cuts.fitChi2OnNdfMax()) - kwargs.setdefault("maxAbsEta", cuts.etaMax()) - kwargs.setdefault("minNInnermostLayerHits", cuts.nHitInnermostLayer()) - kwargs.setdefault("minNPixelHits", cuts.nHitPix()) - kwargs.setdefault("maxNPixelHoles", cuts.nHolesPix()) - kwargs.setdefault("minNSctHits", cuts.nHitSct()) - kwargs.setdefault("minNTrtHits", cuts.nHitTrt()) - kwargs.setdefault("minNSiHits", flags.Tracking.ActiveConfig.minNSiHits_vtx \ - if flags.Tracking.ActiveConfig.minNSiHits_vtx is not None \ - else cuts.nHitSi()) + import AthenaCommon.SystemOfUnits as Units + + kwargs.setdefault("CutLevel", "NoCut") #fill flags rather than hardcode here + kwargs.setdefault("minPt", 1.*Units.GeV) + kwargs.setdefault("maxD0", 4.*Units.mm) + kwargs.setdefault("maxZ0", 1000.*Units.mm) + kwargs.setdefault("maxZ0SinTheta",1000.*Units.mm) + kwargs.setdefault("maxSigmaD0", 5.) + kwargs.setdefault("maxSigmaZ0SinTheta", 10.) + kwargs.setdefault("maxChiSqperNdf", 3.5) + kwargs.setdefault("maxAbsEta", 2.4) + kwargs.setdefault("minNInnermostLayerHits", 0) + kwargs.setdefault("minNPixelHits", 1) + kwargs.setdefault("maxNPixelHoles", 1) + kwargs.setdefault("minNSctHits", 4) + kwargs.setdefault("minNTrtHits", 0) + kwargs.setdefault("minNSiHits", flags.Tracking.ActiveConfig.minNSiHits_vtx) # N.B. Legacy config used to set extrapolator + trackSummary tools but since UseTrkTrackTools is not set to True, they're not used in the InDetTrackSelectionTool acc.setPrivateTools(CompFactory.InDet.InDetTrackSelectionTool( diff --git a/InnerDetector/InDetConfig/python/SiDetElementsRoadToolConfig.py b/InnerDetector/InDetConfig/python/SiDetElementsRoadToolConfig.py index 98d48ba4dbf..8af8a9e7577 100644 --- a/InnerDetector/InDetConfig/python/SiDetElementsRoadToolConfig.py +++ b/InnerDetector/InDetConfig/python/SiDetElementsRoadToolConfig.py @@ -35,6 +35,20 @@ def SiDetElementsRoadMaker_xkCfg(flags, name="InDetSiRoadMaker", **kwargs) : name+flags.Tracking.ActiveConfig.extension, **kwargs)) return acc +def TrigSiDetElementsRoadMaker_xkCfg(flags, name="InDetTrigSiRoadMaker", **kwargs) : + acc = ComponentAccumulator() + + if 'PropagatorTool' not in kwargs: + from TrkConfig.TrkExRungeKuttaPropagatorConfig import RungeKuttaPropagatorCfg + InDetPatternPropagator = acc.popToolsAndMerge(RungeKuttaPropagatorCfg(flags, + name="InDetTrigPatternPropagator")) + acc.addPublicTool(InDetPatternPropagator) + kwargs.setdefault("PropagatorTool", InDetPatternPropagator) + + acc.setPrivateTools(acc.popToolsAndMerge(SiDetElementsRoadMaker_xkCfg(flags, name, **kwargs))) + return acc + + def SiDetElementsRoadMaker_xk_TRT_Cfg(flags, name = 'InDetTRT_SeededSiRoad', **kwargs): # # Silicon det elements road maker tool diff --git a/InnerDetector/InDetConfig/python/SiSpacePointsSeedToolConfig.py b/InnerDetector/InDetConfig/python/SiSpacePointsSeedToolConfig.py index d9b40503a24..b5a5ad561fb 100644 --- a/InnerDetector/InDetConfig/python/SiSpacePointsSeedToolConfig.py +++ b/InnerDetector/InDetConfig/python/SiSpacePointsSeedToolConfig.py @@ -157,6 +157,46 @@ def SiSpacePointsSeedMakerCfg(flags, **kwargs): return SiSpacePointsSeedMaker_ATLxkCfg(flags, **kwargs) +def TrigSiSpacePointsSeedMakerCfg(flags, **kwargs): + + # Properties valid for all of the classes + kwargs.setdefault("pTmin", flags.Tracking.ActiveConfig.minPT) + kwargs.setdefault("radMax", flags.Tracking.ActiveConfig.radMax) + kwargs.setdefault("etaMax", flags.Tracking.ActiveConfig.maxEta) + kwargs.setdefault("usePixel", flags.Tracking.ActiveConfig.usePixelSeeding) + kwargs.setdefault("SpacePointsPixelName", 'PixelTrigSpacePoints') + kwargs.setdefault("useSCT", flags.Tracking.ActiveConfig.useSCTSeeding) + kwargs.setdefault("SpacePointsSCTName", 'SCT_TrigSpacePoints') + kwargs.setdefault("useOverlapSpCollection", + flags.Tracking.ActiveConfig.useSCTSeeding) + kwargs.setdefault("SpacePointsOverlapName", 'OverlapSpacePoints') + + if flags.Tracking.ActiveConfig.usePrdAssociationTool: + # not all classes have that property !!! + kwargs.setdefault("PRDtoTrackMap", 'TrigPRDtoTrackMap') #2023fix + flags.Tracking.ActiveConfig.extension)) + + # + # --- Space points seeds maker, use different ones for cosmics and collisions + # + if flags.Tracking.ActiveConfig.input_name=="cosmics": + return SiSpacePointsSeedMaker_CosmicCfg(flags, **kwargs) + # elif flags.Reco.EnableHI: #2023fix - in principle minBias and HI should use specific versions too + # return SiSpacePointsSeedMaker_HeavyIonCfg(flags, **kwargs) + # elif flags.Tracking.ActiveConfig.isLowPt: + # return SiSpacePointsSeedMaker_LowMomentumCfg(flags, **kwargs) + else: + from InDetRecExample.TrackingCommon import setDefaults + kwargs = setDefaults( kwargs, + maxdImpact = flags.Tracking.ActiveConfig.maxRPhiImpact, + maxZ = flags.Tracking.ActiveConfig.maxZImpact, + minZ =-flags.Tracking.ActiveConfig.maxZImpact, + ) + + return SiSpacePointsSeedMaker_ATLxkCfg(flags, + name = 'TrigSiSpacePointsSeedMaker_'+flags.Tracking.ActiveConfig.input_name, + **kwargs) + + def ITkSiSpacePointsSeedMakerCfg(flags, name="ITkSpSeedsMaker", **kwargs): acc = ComponentAccumulator() diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py index baaca9b57c8..f37d5854ec7 100644 --- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py @@ -678,12 +678,6 @@ def getInDetPRDtoTrackMapToolGangedPixels(name='PRDtoTrackMapToolGangedPixels',* return InDet__InDetPRDtoTrackMapToolGangedPixels( name=the_name, **kwargs) -def getInDetTrigPRDtoTrackMapToolGangedPixels(name='InDetTrigPRDtoTrackMapToolGangedPixels',**kwargs) : - return getInDetPRDtoTrackMapToolGangedPixels(name, - **setDefaults(kwargs, - PixelClusterAmbiguitiesMapName = "TrigPixelClusterAmbiguitiesMap", - addTRToutliers = False)) - def getInDetTrackPRD_Association(name='InDetTrackPRD_Association', **kwargs) : the_name,prefix,suffix=makeNameGetPreAndSuffix(name,kwargs) @@ -724,13 +718,6 @@ def getInDetPrdAssociationTool(name='InDetPrdAssociationTool',**kwargs) : from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels return InDet__InDetPRD_AssociationToolGangedPixels(name=the_name, **kwargs) -def getInDetTrigPrdAssociationTool(name='InDetTrigPrdAssociationTool_setup',**kwargs) : - return getInDetPrdAssociationTool(name, - **setDefaults(kwargs, - PixelClusterAmbiguitiesMapName = "TrigPixelClusterAmbiguitiesMap", - addTRToutliers = False)) - - def getInDetPrdAssociationTool_setup(name='InDetPrdAssociationTool_setup',**kwargs) : ''' Provide an instance for all clients which set the tool explicitely @@ -1278,12 +1265,6 @@ def getInDetTrackSummaryTool(name='InDetTrackSummaryTool',**kwargs) : def getInDetTrackSummaryToolNoHoleSearch(name='InDetTrackSummaryToolNoHoleSearch',**kwargs) : return getInDetTrackSummaryTool(name, **setDefaults(kwargs, doHolesInDet = False)) -def getInDetTrigTrackSummaryTool(name='InDetTrackSummaryTool',**kwargs) : - return getInDetTrackSummaryTool(name,**setDefaults(kwargs, - namePrefix = "InDetTrig", - isHLT = True)) - - @makePublicTool def getInDetTRT_ExtensionToolCosmics(name='InDetTRT_ExtensionToolCosmics',**kwargs) : the_name = makeName( name, kwargs) diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/ConfiguredNewTrackingTrigCuts.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/ConfiguredNewTrackingTrigCuts.py index 5a3b1fb1463..73ff34e2898 100644 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/ConfiguredNewTrackingTrigCuts.py +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/ConfiguredNewTrackingTrigCuts.py @@ -20,10 +20,4 @@ class ConfiguredNewTrackingTrigCuts(InDetTrigTrackingCuts): if 'EFIDTrackingCuts' not in globals(): EFIDTrackingCuts = ConfiguredNewTrackingTrigCuts("Offline") - EFIDTrackingCutsCosmics = ConfiguredNewTrackingTrigCuts("Cosmics") - EFIDTrackingCutsBeamGas = ConfiguredNewTrackingTrigCuts("BeamGas") - EFIDTrackingCutsLowPt = ConfiguredNewTrackingTrigCuts("LowPt") - EFIDTrackingCutsTRT = ConfiguredNewTrackingTrigCuts("TRT") - EFIDTrackingCutsHeavyIon = ConfiguredNewTrackingTrigCuts("HeavyIon") - EFIDTrackingCutLRT = ConfiguredNewTrackingTrigCuts("LRT") L2IDTrackingCuts = EFIDTrackingCuts diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/ConfiguredVertexingTrigCuts.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/ConfiguredVertexingTrigCuts.py deleted file mode 100644 index 7331b4efe0d..00000000000 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/ConfiguredVertexingTrigCuts.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -""" Derive from the offline class and override InDetFlags -""" - -__author__ = "J. Masik" -__version__= "$Revision$" -__doc__ = "ConfiguredVertexingTrigCuts" - -from InDetRecExample.ConfiguredVertexingCuts import ConfiguredVertexingCuts - -class ConfiguredVertexingTrigCuts(ConfiguredVertexingCuts): - def __set_indetflags(self): - from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags - self.__indetflags = InDetTrigFlags - -EFIDVertexingCuts = ConfiguredVertexingTrigCuts("PileUp") diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py index 86209cb4ff5..c8d14e5a769 100755 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py @@ -38,119 +38,6 @@ TrigSCTLorentzAngleTool = getPrivateTool("SCTLorentzAngleTool") # if InDetTrigFlags.loadRotCreator(): - #4 clusterOnTrack Tools - # - from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__SCT_ClusterOnTrackTool - SCT_ClusterOnTrackTool = InDet__SCT_ClusterOnTrackTool ("SCT_ClusterOnTrackTool", - CorrectionStrategy = 0, # do correct position bias - ErrorStrategy = 2, # do use phi dependent errors - LorentzAngleTool = TrigSCTLorentzAngleTool) - - ToolSvc += SCT_ClusterOnTrackTool - if (InDetTrigFlags.doPrintConfigurables()): - print (SCT_ClusterOnTrackTool) - - # tool to always make conservative pixel cluster errors - from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__PixelClusterOnTrackTool - - if InDetTrigFlags.doPixelClusterSplitting(): - from TrkNeuralNetworkUtils.TrkNeuralNetworkUtilsConf import Trk__NeuralNetworkToHistoTool - NeuralNetworkToHistoTool=Trk__NeuralNetworkToHistoTool(name = "NeuralNetworkToHistoTool") - - ToolSvc += NeuralNetworkToHistoTool - if (InDetTrigFlags.doPrintConfigurables()): - print (NeuralNetworkToHistoTool) - - from SiClusterizationTool.SiClusterizationToolConf import InDet__NnClusterizationFactory - from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags - do_runI = geoFlags.Run() not in ["RUN2", "RUN3"] - from InDetRecExample.TrackingCommon import createAndAddCondAlg,getPixelClusterNnCondAlg,getPixelClusterNnWithTrackCondAlg - createAndAddCondAlg( getPixelClusterNnCondAlg, 'PixelClusterNnCondAlg', GetInputsInfo = do_runI) - createAndAddCondAlg( getPixelClusterNnWithTrackCondAlg,'PixelClusterNnWithTrackCondAlg', GetInputsInfo = do_runI) - if do_runI : - TrigNnClusterizationFactory = InDet__NnClusterizationFactory( name = "TrigNnClusterizationFactory", - PixelLorentzAngleTool = TrigPixelLorentzAngleTool, - doRunI = True, - useToT = False, - useRecenteringNNWithoutTracks = True, - useRecenteringNNWithTracks = False, - correctLorShiftBarrelWithoutTracks = 0, - correctLorShiftBarrelWithTracks = 0.030, - NnCollectionReadKey = 'PixelClusterNN', - NnCollectionWithTrackReadKey = 'PixelClusterNNWithTrack') - else: - TrigNnClusterizationFactory = InDet__NnClusterizationFactory( name = "TrigNnClusterizationFactory", - PixelLorentzAngleTool = TrigPixelLorentzAngleTool, - useToT = InDetTrigFlags.doNNToTCalibration(), - NnCollectionReadKey = 'PixelClusterNN', - NnCollectionWithTrackReadKey = 'PixelClusterNNWithTrack') - - ToolSvc += TrigNnClusterizationFactory - - else: - TrigNnClusterizationFactory = None - - if (InDetTrigFlags.doPrintConfigurables()): - print (TrigNnClusterizationFactory) - - InDetTrigPixelClusterOnTrackTool = InDet__PixelClusterOnTrackTool("InDetTrigPixelClusterOnTrackTool", - ErrorStrategy = 2, - LorentzAngleTool = TrigPixelLorentzAngleTool, - NnClusterizationFactory= TrigNnClusterizationFactory, - ) - - ToolSvc += InDetTrigPixelClusterOnTrackTool - - if (InDetTrigFlags.doPrintConfigurables()): - print (InDetTrigPixelClusterOnTrackTool) - - # tool to always make conservative sct cluster errors - from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__SCT_ClusterOnTrackTool - InDetTrigBroadSCT_ClusterOnTrackTool = InDet__SCT_ClusterOnTrackTool ("InDetTrigBroadSCT_ClusterOnTrackTool", - CorrectionStrategy = 0, # do correct position bias - ErrorStrategy = 0, # do use broad errors - LorentzAngleTool = TrigSCTLorentzAngleTool) - ToolSvc += InDetTrigBroadSCT_ClusterOnTrackTool - if (InDetTrigFlags.doPrintConfigurables()): - print (InDetTrigBroadSCT_ClusterOnTrackTool) - - #-- - InDetTrigBroadPixelClusterOnTrackTool = InDet__PixelClusterOnTrackTool("InDetTrigBroadPixelClusterOnTrackTool", - ErrorStrategy = 0, - LorentzAngleTool = TrigPixelLorentzAngleTool, - NnClusterizationFactory= TrigNnClusterizationFactory - ) - ToolSvc += InDetTrigBroadPixelClusterOnTrackTool - if (InDetTrigFlags.doPrintConfigurables()): - print (InDetTrigBroadPixelClusterOnTrackTool) - - # load RIO_OnTrackCreator for Inner Detector - # - - from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackCreator - InDetTrigRotCreator = Trk__RIO_OnTrackCreator(name = 'InDetTrigRotCreator', - ToolPixelCluster= InDetTrigPixelClusterOnTrackTool, - ToolSCT_Cluster = SCT_ClusterOnTrackTool, - Mode = 'indet') - ToolSvc += InDetTrigRotCreator - - if InDetTrigFlags.useBroadClusterErrors(): - InDetTrigRotCreator.ToolPixelCluster = InDetTrigBroadPixelClusterOnTrackTool - InDetTrigRotCreator.ToolSCT_Cluster = InDetTrigBroadSCT_ClusterOnTrackTool - - if (InDetTrigFlags.doPrintConfigurables()): - print (InDetTrigRotCreator) - - #-- - from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackCreator - InDetTrigBroadInDetRotCreator = \ - Trk__RIO_OnTrackCreator(name = 'InDetTrigBroadInDetRotCreator', - ToolPixelCluster= InDetTrigBroadPixelClusterOnTrackTool, - ToolSCT_Cluster = InDetTrigBroadSCT_ClusterOnTrackTool, - Mode = 'indet') - ToolSvc += InDetTrigBroadInDetRotCreator - if (InDetTrigFlags.doPrintConfigurables()): - print (InDetTrigBroadInDetRotCreator) # load error scaling #TODO - instanceName? @@ -164,27 +51,12 @@ if InDetTrigFlags.loadRotCreator(): # if InDetTrigFlags.loadExtrapolator(): - from TrkConfig.AtlasExtrapolatorToolsConfig import AtlasNavigatorCfg,AtlasMaterialEffectsUpdatorCfg - InDetTrigNavigator = CAtoLegacyPublicToolWrapper(AtlasNavigatorCfg, - name="InDetTrigNavigator") - - # Setup the MaterialEffectsUpdator - InDetTrigMaterialUpdator = CAtoLegacyPublicToolWrapper(AtlasMaterialEffectsUpdatorCfg, - name ="InDetTrigMaterialEffectsUpdator") - from TrkConfig.TrkExRungeKuttaPropagatorConfig import InDetPropagatorCfg InDetTrigPropagator = CAtoLegacyPublicToolWrapper(InDetPropagatorCfg, name = "InDetTrigPropagator") from TrkConfig.AtlasExtrapolatorConfig import InDetExtrapolatorCfg InDetTrigExtrapolator = CAtoLegacyPublicToolWrapper(InDetExtrapolatorCfg, name="InDetTrigExtrapolator") -# -# ----------- control loading of fitters -# - -from TrkConfig.TrkGlobalChi2FitterConfig import InDetTrigGlobalChi2FitterCfg,InDetTrigGlobalChi2FitterCosmicsCfg -InDetTrigTrackFitter = CAtoLegacyPublicToolWrapper(InDetTrigGlobalChi2FitterCfg) -InDetTrigTrackFitterCosmics = CAtoLegacyPublicToolWrapper(InDetTrigGlobalChi2FitterCosmicsCfg) InDetTrigPixelConditionsSummaryTool = PixelConditionsSetup.summaryTool @@ -281,10 +153,6 @@ if InDetTrigFlags.loadSummaryTool(): # FIXME: need to force an override for the online DB until this folder has been added to the latest tag conddb.addOverride("/TRT/Onl/Calib/PID_NN", "TRTCalibPID_NN_v2") - # Calibration DB Tool - from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbTool - InDetTRTCalDbTool = TRT_CalDbTool(name = "TRT_CalDbTool") - # # ----------- control loading of tools which are needed by new tracking and backtracking @@ -312,21 +180,9 @@ if InDetTrigFlags.doNewTracking() or InDetTrigFlags.doBackTracking() or InDetTri # # TRT segment minimum number of drift circles tool # -from InDetConfig.InDetTrackSelectorToolConfig import (InDetTrigTRTDriftCircleCutToolCfg) -InDetTrigTRTDriftCircleCut = CAtoLegacyPublicToolWrapper(InDetTrigTRTDriftCircleCutToolCfg) - from InDetConfig.InDetAmbiTrackSelectionToolConfig import InDetTrigAmbiTrackSelectionToolCfg InDetTrigAmbiTrackSelectionTool = CAtoLegacyPublicToolWrapper(InDetTrigAmbiTrackSelectionToolCfg) -# --- set Data/MC flag -isMC = False -if globalflags.DataSource == "geant4" : - isMC = True - -# Calibration DB Service -from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbTool -InDetTRTCalDbTool = TRT_CalDbTool(name = "TRT_CalDbTool") - diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsCosmics.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsCosmics.py deleted file mode 100644 index c93feb2e8a2..00000000000 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsCosmics.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration - -from __future__ import print_function - -""" InDetTrigConfigRecLoadToolsCosmics - various tools for cosmicsN slice -""" - -__author__ = "J. Masik" -__version__= "$Revision: 1.2 $" -__doc__ = "InDetTrigConfigRecLoadToolsCosmics" - - -from AthenaCommon.AppMgr import ToolSvc -from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags -from AthenaCommon.Logging import logging -log = logging.getLogger("InDetTrigConfigRecLoadToolsCosmics.py") - -from InDetTrigRecExample.ConfiguredNewTrackingTrigCuts import EFIDTrackingCutsCosmics - -from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetCosmicScoringTool -InDetTrigScoringToolCosmics_SiPattern = \ - InDet__InDetCosmicScoringTool(name = 'InDetTrigCosmicScoringTool_SiPattern') - -InDetTrigScoringToolCosmics_SiPattern.nWeightedClustersMin = EFIDTrackingCutsCosmics.nWeightedClustersMin() -InDetTrigScoringToolCosmics_SiPattern.minTRTHits = 0 -ToolSvc += InDetTrigScoringToolCosmics_SiPattern - -if (InDetTrigFlags.doPrintConfigurables()): - print ( InDetTrigScoringToolCosmics_SiPattern) - - -from InDetAmbiTrackSelectionTool.InDetAmbiTrackSelectionToolConf import InDet__InDetAmbiTrackSelectionTool -from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTRTDriftCircleCut -import InDetRecExample.TrackingCommon as TrackingCommon - -InDetTrigAmbiTrackSelectionToolCosmicsN = InDet__InDetAmbiTrackSelectionTool \ - (name = 'InDetTrigAmbiTrackSelectionToolCosmicsN', - minHits = 0, - minNotShared = 3, - maxShared = 0, - minTRTHits = 0, # used for Si only tracking !!! - Cosmics=True, - maxTracksPerSharedPRD = 10, - UseParameterization = False, - DriftCircleCutTool = InDetTrigTRTDriftCircleCut, - AssociationTool = TrackingCommon.getInDetTrigPRDtoTrackMapToolGangedPixels()) - -ToolSvc += InDetTrigAmbiTrackSelectionToolCosmicsN - - - - diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsPost.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsPost.py deleted file mode 100644 index ea4963f06d6..00000000000 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsPost.py +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - -from __future__ import print_function - -""" InDetTrigConfigRecLoadToolsPost - various tools for postprocessing -""" - -__author__ = "J. Masik" -__version__= "$Revision: 1.2 $" -__doc__ = "InDetTrigConfigRecLoadToolsPost" - - -# common things -from AthenaCommon.AppMgr import ToolSvc -from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags - -from InDetTrigRecExample.InDetTrigCommonTools import CAtoLegacyPublicToolWrapper - -from TrkConfig.TrkTrackSummaryToolConfig import InDetTrigTrackSummaryToolCfg -InDetTrigTrackSummaryTool = CAtoLegacyPublicToolWrapper(InDetTrigTrackSummaryToolCfg) - - -# Shared hit computation in the TrackParticleCreatorTool is disabled for consistency with the previous 2022 config -# This can be enabled with -# DoSharedSiHits = InDetTrigFlags.doSharedHits(), -# AssociationMapName = "TrigInDetPRDtoTrackMap" - -from TrkConfig.TrkParticleCreatorConfig import InDetTrigParticleCreatorToolCfg,InDetTrigParticleCreatorToolTRTPidCfg -InDetTrigParticleCreatorTool = CAtoLegacyPublicToolWrapper(InDetTrigParticleCreatorToolCfg) -InDetTrigParticleCreatorToolTRTPid = CAtoLegacyPublicToolWrapper(InDetTrigParticleCreatorToolTRTPidCfg) - - -InDetTrigTRT_ElectronPidTool = None -from AthenaCommon.DetFlags import DetFlags -if DetFlags.haveRIO.TRT_on() : - from TrigInDetConfig.InDetTrigCollectionKeys import TrigTRTKeys - from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTRTCalDbTool - - from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTRTStrawStatusSummaryTool - from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2,InDet__TRT_LocalOccupancy,TRT_ToT_dEdx - InDetTrigTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(name ="InDetTrig_TRT_LocalOccupancy", - isTrigger = True, - TRT_DriftCircleCollection = TrigTRTKeys.DriftCircles, - TRTCalDbTool = InDetTRTCalDbTool) - ToolSvc += InDetTrigTRT_LocalOccupancy - - InDetTrigTRT_ToT_dEdx = TRT_ToT_dEdx(name = "InDetTrig_TRT_ToT_dEdx", - AssociationTool = ToolSvc.InDetTrigPrdAssociationTool, - TRTStrawSummaryTool = InDetTrigTRTStrawStatusSummaryTool, - TRT_LocalOccupancyTool = InDetTrigTRT_LocalOccupancy) - ToolSvc += InDetTrigTRT_ToT_dEdx - - InDetTrigTRT_ElectronPidTool = InDet__TRT_ElectronPidToolRun2(name = "InDetTrigTRT_ElectronPidTool", - TRT_LocalOccupancyTool = InDetTrigTRT_LocalOccupancy, - TRTStrawSummaryTool= InDetTrigTRTStrawStatusSummaryTool, - TRT_ToT_dEdx_Tool = InDetTrigTRT_ToT_dEdx, - MinimumTrackPtForNNPid = 2000., # default 2 GeV - CalculateNNPid = InDetTrigFlags.doTRTPIDNN() ) - - ToolSvc += InDetTrigTRT_ElectronPidTool - if (InDetTrigFlags.doPrintConfigurables()): - print ( InDetTrigTRT_ElectronPidTool) - - - - - diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigTrackingCuts.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigTrackingCuts.py index 41354d8c717..69cc39650f3 100755 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigTrackingCuts.py +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigTrackingCuts.py @@ -112,18 +112,15 @@ class InDetTrigTrackingCuts : # --- settings for segment finder self.__TRTSegFinderPtBins = 70 - self.__maxSegTRTShared = 0.3 self.__excludeUsedTRToutliers = False # --- TRT only - self.__minTRTonlyMinPt = 0.5 * Units.GeV self.__minTRTonly = 15 self.__maxTRTonlyShared = 0.3 # --- TRT standalone has harder cuts if mode == "TRT": - self.__minTRTonlyMinPt = 0.5 * Units.GeV self.__minTRTonly = 15 self.__maxTRTonlyShared = 0.3 self.__useTRTonlyParamCuts = False @@ -552,9 +549,6 @@ class InDetTrigTrackingCuts : def maxTRTonlyShared( self ) : return self.__maxTRTonlyShared - def minTRTonlyMinPt( self ) : - return self.__minTRTonlyMinPt - def RoadWidth( self ) : return self.__roadWidth @@ -612,10 +606,6 @@ class InDetTrigTrackingCuts : def doZBoundary( self ) : return self.__doZBoundary - - def setRegSelZmax( self, val): - self.__RegSelZmax = val - def printInfo( self ) : print ('****** Inner Detector Trigger Track Reconstruction Cuts *********************************') print ('*') @@ -681,6 +671,5 @@ class InDetTrigTrackingCuts : print ('* --------------') print ('* min TRT only hits : ', self.__minTRTonly) print ('* max TRT shared fraction : ', self.__maxTRTonlyShared) - print ('* min TRT only min pt : ', self.__minTRTonlyMinPt, ' MeV') print ('*') print ('************************************************************************************') diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/README.md b/InnerDetector/InDetExample/InDetTrigRecExample/python/README.md index eead89389e5..fe7d84256d8 100644 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/README.md +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/README.md @@ -8,8 +8,6 @@ * Configured sets of tracking cuts for the modes: Offline, Cosmics, BeamGas, LowPt, TRT, HeavyIon, LRT * [InDetTrigTrackingCuts](InDetTrigTrackingCuts.py) * Cuts applied in tracking algorithms and tools for each mode. Also depends on the cutLevel set in InDetTrigFlags. -* [ConfiguredVertexingTrigCuts](ConfiguredVertexingTrigCuts.py) - * Trigger version of InDetRecExample.ConfiguredVertexingCuts ## Creation & configuration of tools used by ID tracking: * [InDetTrigConfigRecLoadTools](InDetTrigConfigRecLoadTools.py) * Creates and configures tracking tools @@ -21,8 +19,6 @@ * configures lowPt versions of tracking tools * [InDetTrigConfigRecLoadToolsBeamGas](InDetTrigConfigRecLoadToolsBeamGas.py) * **removed** configures BeamGas versions of tracking tools -* [InDetTrigConfigRecLoadToolsCosmics](InDetTrigConfigRecLoadToolsCosmics.py) - * configures Cosmics versions of tracking tools ## Create & configure ID Conditions * [InDetTrigConditionsAccess](InDetTrigConditionsAccess.py) * uses InDetTrigConfigConditions to configure & create conditions tools, services & algorithms diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/TrigInDetConfiguredVtxCuts.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/TrigInDetConfiguredVtxCuts.py deleted file mode 100644 index 1b3fbe25210..00000000000 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/TrigInDetConfiguredVtxCuts.py +++ /dev/null @@ -1,178 +0,0 @@ -# -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# - -from __future__ import print_function - -import AthenaCommon.SystemOfUnits as Units - - - -class ConfiguredTrigVtxCuts(): -# """docstring for ConfiguredTrigVtxCuts""" - def __init__(self, mode = ""): - self.__mode = mode - - # Cut level for the track selection tool. - self.__TrackCutLevel = "NoCut" - - # this is cutLevel = 1 - self.__minPT = 1000. * Units.MeV - self.__IPd0Max = 4. # = 4. for useBeamConstraint()==true, = 10. for useBeamConstraint()==false - self.__IPz0Max = 1000. - self.__z0Max = 1000. - self.__sigIPd0Max = 5. - self.__sigIPz0Max = 10. - self.__d0significanceMax = -1. - self.__z0significanceMax = -1. - self.__etaMax = 2.4 - - #cluster and track quality cuts - self.__useTrackSummaryInfo = True - self.__nHitInnermostLayer = 0 - self.__nHitPix = 1 - self.__nHolesPix = 1 - self.__nHitSct = 4 - self.__nHitSi = 10 - self.__nHitTrt = 0 - self.__nHitTrtHighEFractionMax = 1 - self.__nHitTrtHighEFractionWithOutliersMax = 1 - self.__useSharedHitInfo = False - self.__useTrackQualityInfo = False - self.__fitChi2OnNdfMax = 3.5 - self.__TrtMaxEtaAcceptance = 1.9 - - #cuts ONLY relevant to InDetPriVxFinder + Full or Fast or similar - self.__chi2CutMethod = 2 - self.__enableMultipleVertices = True - - self.__doMaxTracksCut = True - self.__MaxTracks = 3000 #Not applied anyway if above false - -# self.__indetflags = InDetFlags #TODO: implement or find InDetJobProperties - - def mode( self ) : - return self.__mode - - def TrackCutLevel( self ) : - return self.__TrackCutLevel - - def minPT( self ) : - return self.__minPT - - def IPd0Max( self ) : - return self.__IPd0Max - - def IPz0Max( self ) : - return self.__IPz0Max - - def z0Max( self ) : - return self.__z0Max - - def sigIPd0Max( self ) : - return self.__sigIPd0Max - - def sigIPz0Max( self ) : - return self.__sigIPz0Max - - def d0significanceMax( self ) : - return self.__d0significanceMax - - def z0significanceMax( self ) : - return self.__z0significanceMax - - def etaMax( self ) : - return self.__etaMax - - def useTrackSummaryInfo( self ) : - return self.__useTrackSummaryInfo - - def nHitInnermostLayer( self ) : - return self.__nHitInnermostLayer - - def nHitPix( self ): - return self.__nHitPix - - def nHitSct( self ): - return self.__nHitSct - - def nHitSi( self ): - return self.__nHitSi - - def nHitTrt( self ): - return self.__nHitTrt - - def nHitTrtHighEFractionMax(self): - return self.__nHitTrtHighEFractionMax - - def nHitTrtHighEFractionWithOutliersMax(self): - return self.__nHitTrtHighEFractionWithOutliersMax - - def useSharedHitInfo(self): - return self.__useSharedHitInfo - - def useTrackQualityInfo(self): - return self.__useTrackQualityInfo - - def fitChi2OnNdfMax(self): - return self.__fitChi2OnNdfMax - - def TrtMaxEtaAcceptance(self): - return self.__TrtMaxEtaAcceptance - - def MaxChi2PerTrack(self): - return self.__maxChi2PerTrack - - def nHolesPix(self): - return self.__nHolesPix - - def chi2CutMethod(self): - return self.__chi2CutMethod - - def enableMultipleVertices(self): - return self.__enableMultipleVertices - - def doMaxTracksCut(self): - return self.__doMaxTracksCut - - def MaxTracks(self): - return self.__MaxTracks - - def printInfo( self ) : - print('****** Inner Detector Primary Vertex Reconstruction Cuts ****************************') - print('*') - print('* mode is : ' + self.__mode) - #print('* cut level for primary vertexing is : ' + self.__indetflags.priVtxCutLevel()) - print('*') - print('* Track Cut Level : ' + self.__TrackCutLevel) - print('*') - print('* min pT : ' + str(self.__minPT) + ' MeV') - print('* Max IP d0 : ' + str(self.__IPd0Max)) - print('* Max IP Z0 : ' + str(self.__IPz0Max)) - print('* Max z0 : ' + str(self.__z0Max)) - print('* Max Sig IP d0 : ' + str(self.__sigIPd0Max)) - print('* Max Sig IP z0 : ' + str(self.__sigIPz0Max)) - print('* Max Sig d0 : ' + str(self.__d0significanceMax)) - print('* Max Sig z0 : ' + str(self.__z0significanceMax)) - print('* Max eta : ' + str(self.__etaMax)) - -#cluster and track quality cuts - print('* Use TrackSummary : ' + str(self.__useTrackSummaryInfo)) - print('* Min N Innermost Layer Hits : ' + str(self.__nHitInnermostLayer)) - print('* Min N Pix Hit : ' + str(self.__nHitPix)) - print('* Max N Pix Holes : ' + str(self.__nHolesPix)) - print('* Min N SCT Hits : ' + str(self.__nHitSct)) - print('* Min N Si Hits : ' + str(self.__nHitSi)) - print('* Min N TRT Hits : ' + str(self.__nHitTrt)) - print('* Min N high threshold hits TRT : ' + str(self.__nHitTrtHighEFractionMax)) - print('* Min N high threshold hits TRT (incl. outliers) : ' + str(self.__nHitTrtHighEFractionWithOutliersMax)) - print('* Use shared hit info : ' + str(self.__useSharedHitInfo)) - print('* Use Track Quality info : ' + str(self.__useTrackQualityInfo)) - print('* Chi2/ndf of the fit : ' + str(self.__fitChi2OnNdfMax)) - print('* TRT Max eta : ' + str(self.__TrtMaxEtaAcceptance)) - print('*') - print('* Chi2 cut method : ' + str(self.__chi2CutMethod )) - print('* Enable Multiple Vertices : ' + str(self.__enableMultipleVertices) ) - print('*') - print('***********************************************************************************') - diff --git a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py index 623f6116213..279996e8c2b 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py @@ -497,7 +497,6 @@ class ConfigSettings_DVtxLRT( _ConfigSettingsBase ): ConfigSettingsInstances = { "electron" : ConfigSettings_electron(), - "Electron" : ConfigSettings_electron(), "photon" : ConfigSettings_electron(), "muon" : ConfigSettings_muon(), @@ -507,12 +506,6 @@ ConfigSettingsInstances = { "muonFS" : ConfigSettings_muon(), "muonLate" : ConfigSettings_muon(), - "Muon" : ConfigSettings_muon(), - "MuonIso" : ConfigSettings_muonIso(), - "MuonCore" : ConfigSettings_muon(), - "MuonFS" : ConfigSettings_muon(), - "MuonLate" : ConfigSettings_muon(), - "tau" : ConfigSettings_tau(), "tauTau" : ConfigSettings_tau(), "tauCore" : ConfigSettings_tauCore(), @@ -520,7 +513,6 @@ ConfigSettingsInstances = { "tauIsoBDT" : ConfigSettings_tauIsoBDT(), "bjet" : ConfigSettings_bjet(), - "Bjet" : ConfigSettings_bjet(), "jet" : ConfigSettings_fullScan(), # "jet" : ConfigSettings_bjet(), diff --git a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py index 59aa6296035..48b475bef9f 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettingsBase.py @@ -53,7 +53,7 @@ class _ConfigSettingsBase() : self._actsVertex = False self._addSingleTrackVertices = False self._TracksMaxZinterval = 1 #mm - self._minNSiHits_vtx = None + self._minNSiHits_vtx = 10 #from vtxCuts self._vertex_jet = None self._adaptiveVertex_jet = False self._actsVertex_jet = False @@ -112,16 +112,6 @@ class _ConfigSettingsBase() : def trkTracks_IDTrig(self): return 'HLT_IDTrkTrack_{}_IDTrig'.format( self._suffix ) - def tracks_EFID(self): - if self._doRecord: - return recordable('HLT_IDTrack_{}_EFID'.format( self._suffix )) - else: - return 'HLT_IDTrack_{}_EFID'.format( self._suffix ) - - def trkTracks_EFID(self): - return 'HLT_IDTrkTrack_{}_EFID'.format( self._suffix ) - - @property def name(self): return self._name diff --git a/Trigger/TrigTools/TrigInDetConfig/python/EFIDTracking.py b/Trigger/TrigTools/TrigInDetConfig/python/EFIDTracking.py index 45025dfd240..6652fcae8b3 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/EFIDTracking.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/EFIDTracking.py @@ -171,7 +171,7 @@ def makeInDetPatternRecognition( inflags, config, verifier = 'IDTrigViewDataVeri config = config, inputTracks = config.trkTracks_IDTrig(), verifier = None, - summaryTool = summaryTool ) + ) viewAlgs += precisionAlgs @@ -180,7 +180,7 @@ def makeInDetPatternRecognition( inflags, config, verifier = 'IDTrigViewDataVeri return viewAlgs, dataVerifier -def ambiguitySolverForIDPatternRecognition( flags, config, summaryTool, inputTracks,verifier=None ): +def ambiguitySolverForIDPatternRecognition( flags, config, inputTracks,verifier=None ): ptAlgs = [] #List containing all the precision tracking algorithms hence every new added alg has to be appended to the list #----------------------------------------------------------------------------- diff --git a/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigCommon.py b/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigCommon.py index 505ae3f1197..8507749a6d5 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigCommon.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigCommon.py @@ -10,18 +10,9 @@ from InDetRecExample.TrackingCommon import makePublicTool, setDefaults from AthenaCommon.Logging import logging log = logging.getLogger("InDetTrigCommon") - +from InDetTrigRecExample.InDetTrigCommonTools import CAtoLegacyPublicToolWrapper #-------------------------------------------------------------------------- -# Track Ambiguity Solver algs/tools - - -#------------------------------- -#TODO: - -#Make loader for extrapolator - -#------------------------------- def _prefix(): #Too long? Do we need this to separate from InDet? @@ -38,93 +29,9 @@ def _suffix(signature=None): def add_prefix( core, suffix=None ): return '{}{}{}'.format( _prefix(), core, _suffix(suffix) ) - -def trigPropagator_getter(): - from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigPropagator - return InDetTrigPropagator - -#-------------------------------------------------------------------------------------- - -def trackMonitoringTool_builder(flags, suffix): - #First load the generic monitoring tool with set of histograms for Particle Cnv - from TrigInDetMonitoringTools.TrigInDetTrackingMonitoring import TrigInDetTrackCnvMonitoring - genericMonTool = TrigInDetTrackCnvMonitoring(flags, name = 'GenericMonitoring_{}'.format(suffix)) - - - - #Now pass this tool to the Track Monitoring tool - from TrigInDetMonitoringTools.TrigInDetMonitoringToolsConf import TrigInDetTrackMonitoringTool - return TrigInDetTrackMonitoringTool( name = 'xAODParticleCreatorAlg_{}'.format(suffix), - MonitoringTool = genericMonTool) - - - -#Returns suffix of tracking type from a given alg name -def getTrackingSuffix( name ): - if 'IDTrig' in name: - return '_IDTrig' - elif 'FTF' in name: - return '_FTF' - elif 'EFID' in name: - return '_EFID' - else: - return '' - - -#-------------------------------------------------------------------------- -# Track Ambiguity algs/tools -def associationTool_getter(): - #TODO double check this! - from InDetRecExample.TrackingCommon import getInDetTrigPRDtoTrackMapToolGangedPixels - return getInDetTrigPRDtoTrackMapToolGangedPixels() - #------------------------------------------------------------------------------------------------- # Alg/Tools for offline pattern recognition tracking -@makePublicTool -def siSpacePointsSeedMakerTool_builder(name, config, trackingCuts, usePrdAssociationTool, trackSummaryTool ): - from InDetRecExample.InDetKeys import InDetKeys - from .InDetTrigCollectionKeys import TrigPixelKeys, TrigSCTKeys - - kwargs = {} - kwargs = setDefaults( kwargs, - pTmin = trackingCuts.minPT(), - usePixel = trackingCuts.usePixel(), - SpacePointsPixelName = TrigPixelKeys.SpacePoints, - useSCT = trackingCuts.useSCT(), #Note: this is false for dissappearing tracks in offline - SpacePointsSCTName = TrigSCTKeys.SpacePoints, - useOverlapSpCollection = trackingCuts.useSCT(), #Note: this is false for dissappearing tracks in offline - SpacePointsOverlapName = InDetKeys.OverlapSpacePoints(), #FIXME: Switch to trigger flags? ATR-22756 - radMax = trackingCuts.radMax(), - etaMax = trackingCuts.maxEta()) - - #FIXME: revisit HI ATR-22756 - #Change/add tracking parameters based on the different tracking mode - #if config.name == 'HI': - # kwargs = setDefaults( kwargs, - # maxdImpactPPS = trackingCuts.maxdImpactPPSSeeds(), - # maxdImpactSSS = trackingCuts.maxdImpactSSSSeeds()) - - if usePrdAssociationTool: - kwargs = setDefaults( kwargs, - PRDtoTrackMap = TrigPixelKeys.PRDtoTrackMap) - - if config.name == 'cosmics': - from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_Cosmic as SiSpacePointsSeedMaker - #FIXME: revisit HI ATR-22756 - #elif config.name == 'HI': - # from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_HeavyIon as SiSpacePointsSeedMaker - else: - kwargs = setDefaults( kwargs, - maxdImpact = trackingCuts.maxPrimaryImpact(), - maxZ = trackingCuts.maxZImpact(), - minZ = -trackingCuts.maxZImpact() ) - from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_ATLxk as SiSpacePointsSeedMaker - - return SiSpacePointsSeedMaker ( name = name, - **kwargs) - - @makePublicTool def zVertexMakerTool_builder(name, trackingCuts, seedMakerTool ): @@ -149,63 +56,10 @@ def zVertexMakerTool_builder(name, trackingCuts, seedMakerTool ): return InDet__SiZvertexMaker_xk(name = name, **kwargs) -@makePublicTool -def siDetectorElementRoadMakerTool_builder( name, trackingCuts ): - from InDetRecExample.InDetKeys import InDetKeys - - from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadMaker_xk - return InDet__SiDetElementsRoadMaker_xk(name = name, - PropagatorTool = trigPropagator_getter(), - usePixel = trackingCuts.usePixel(), - PixManagerLocation = InDetKeys.PixelManager(), #FIXME: revisit ATR-22756 - useSCT = trackingCuts.useSCT(), - SCTManagerLocation = InDetKeys.SCT_Manager(), #FIXME: revisit ATR-22756 - RoadWidth = trackingCuts.RoadWidth()) - - @makePublicTool -def siCombinatorialTrackFinderTool_builder( name, trackingCuts ): - from .InDetTrigCollectionKeys import TrigPixelKeys, TrigSCTKeys - from AthenaCommon.DetFlags import DetFlags - import InDetRecExample.TrackingCommon as TrackingCommon - - #FIXME: quick hack to try running ID, remove later, ATR-22756 - DetFlags.ID_setOn() - - #Are we happy with these settings? - from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigSCTConditionsSummaryTool, InDetTrigPatternUpdator, InDetTrigBoundaryCheckTool - # @TODO ensure that PRD association map is used if usePrdAssociationTool is set ATR-22756 - - kwargs = {} - #Prepare default parameter settings for the tool - kwargs = setDefaults( kwargs, - PropagatorTool = trigPropagator_getter(), - UpdatorTool = InDetTrigPatternUpdator, - SctSummaryTool = InDetTrigSCTConditionsSummaryTool, #Any reason for this to be turned off? None, - RIOonTrackTool = TrackingCommon.getInDetRotCreatorDigital(), - usePixel = DetFlags.haveRIO.pixel_on(), - useSCT = DetFlags.haveRIO.SCT_on(), - PixelClusterContainer = TrigPixelKeys.Clusters, - SCT_ClusterContainer = TrigSCTKeys.Clusters) - - - #Add SCT condition summary if specified - #FIXME: Use TriggerFlags instead? ATR-22756 - #if (DetFlags.haveRIO.SCT_on()): - # kwargs = setDefaults( kwargs, - # SctSummaryTool = InDetTrigSCTConditionsSummaryTool ) - - from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiCombinatorialTrackFinder_xk - return InDet__SiCombinatorialTrackFinder_xk(name = name, - BoundaryCheckTool = InDetTrigBoundaryCheckTool, - **kwargs) - - -@makePublicTool -def siTrackMakerTool_builder( name, config, siDetElementsRoadMakerTool, trackFinderTool, trackingCuts, usePrdAssociationTool ): +def siTrackMakerTool_builder( name, config, trackFinderTool, trackingCuts, usePrdAssociationTool ): from InDetRecExample.InDetJobProperties import InDetFlags - from InDetRecExample.InDetKeys import InDetKeys if config.name == 'cosmics': trackPatternRecoInfo = 'SiSpacePointsSeedMaker_Cosmic' @@ -216,7 +70,9 @@ def siTrackMakerTool_builder( name, config, siDetElementsRoadMakerTool, trackFin kwargs = {} - + from InDetConfig.SiDetElementsRoadToolConfig import TrigSiDetElementsRoadMaker_xkCfg + siDetElementsRoadMakerTool = CAtoLegacyPublicToolWrapper(TrigSiDetElementsRoadMaker_xkCfg) + #FIXME: #Check compatibility of cosmic cuts from offline version with online run2 #https://gitlab.cern.ch/atlas/athena/-/blob/21.2/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecNewTracking.py#L167-172 @@ -251,16 +107,6 @@ def siTrackMakerTool_builder( name, config, siDetElementsRoadMakerTool, trackFin UseAssociationTool = usePrdAssociationTool) - if InDetFlags.doStoreTrackSeeds(): - from SeedToTrackConversionTool.SeedToTrackConversionToolConf import InDet__SeedToTrackConversionTool - InDet_SeedToTrackConversion = InDet__SeedToTrackConversionTool(name = "InDet_SeedToTrackConversion"+trackingCuts.extension(), - OutputName = InDetKeys.SiSPSeedSegments()+trackingCuts.extension()) - kwargs = setDefaults( kwargs, - SeedToTrackConversion = InDet_SeedToTrackConversion, - SeedSegmentsWrite = True ) - - - from SiTrackMakerTool_xk.SiTrackMakerTool_xkConf import InDet__SiTrackMaker_xk return InDet__SiTrackMaker_xk(name = name, **kwargs) @@ -281,11 +127,9 @@ def siSPSeededTrackFinder_builder( name, config, outputTracks, trackingCuts, use #Load subtools of the TrackFinder - siSpacePointsSeedMakerTool = siSpacePointsSeedMakerTool_builder(name = add_prefix( 'siSPSeedMaker', nameSuffix), - config = config, - trackingCuts = trackingCuts, - usePrdAssociationTool = usePrdAssociationTool, - trackSummaryTool = trackSummaryTool ) + from InDetConfig.SiSpacePointsSeedToolConfig import TrigSiSpacePointsSeedMakerCfg + siSpacePointsSeedMakerTool = CAtoLegacyPublicToolWrapper(TrigSiSpacePointsSeedMakerCfg) + # --- Z-coordinates primary vertices finder (only for collisions) zVertexMakerTool = None @@ -293,19 +137,12 @@ def siSPSeededTrackFinder_builder( name, config, outputTracks, trackingCuts, use if InDetFlags.useZvertexTool(): zVertexMakerTool = zVertexMakerTool_builder(name, trackingCuts, siSpacePointsSeedMakerTool ) - # --- SCT and Pixel detector elements road builder - #FIXME: use cosmic version of RMaker as for Run2? - #https://gitlab.cern.ch/atlas/athena/-/blob/21.2/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecNewTracking.py#L167 - siDetectorElementRoadMaker = siDetectorElementRoadMakerTool_builder( name = add_prefix( 'SiDetectorElementRoadMaker', nameSuffix), - trackingCuts = trackingCuts ) - # --- Local track finding using sdCaloSeededSSSpace point seed - siCombinatorialTrackFinderTool = siCombinatorialTrackFinderTool_builder( name = add_prefix( 'SiCombinatorialTrackFinder', nameSuffix), - trackingCuts = trackingCuts) + from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiCombinatorialTrackFinder_xk_Trig_Cfg + siCombinatorialTrackFinderTool = CAtoLegacyPublicToolWrapper(SiCombinatorialTrackFinder_xk_Trig_Cfg, name=name+'_Tool') siTrackMakerTool = siTrackMakerTool_builder( name = add_prefix( 'siTrackMaker', nameSuffix), config = config, - siDetElementsRoadMakerTool = siDetectorElementRoadMaker, trackFinderTool = siCombinatorialTrackFinderTool, trackingCuts = trackingCuts, usePrdAssociationTool = usePrdAssociationTool) diff --git a/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigFastTracking.py b/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigFastTracking.py index d5dbbbef9a3..7383da51529 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigFastTracking.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigFastTracking.py @@ -89,10 +89,8 @@ def makeInDetTrigFastTracking( inflags, config = None, rois = 'EMViewRoIs', doFT viewAlgs.extend(theFTF) - from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags - - if (InDetTrigFlags.doTruth()): - + if (flags.Tracking.ActiveConfig.doTruth): + from InDetTruthAlgs.InDetTruthAlgsConf import InDet__PRD_MultiTruthMaker InDetTrigPRD_MultiTruthMakerSi = InDet__PRD_MultiTruthMaker (name = 'InDetTrigPRD_MultiTruthMakerSi', PixelClusterContainerName = 'PixelTrigClusters', @@ -114,8 +112,8 @@ def makeInDetTrigFastTracking( inflags, config = None, rois = 'EMViewRoIs', doFT SpacePointsPixelName = "PixelTrigSpacePoints" , SpacePointsSCTName = "SCT_TrigSpacePoints" , SpacePointsOverlapName = "OverlapSpacePoints", - PixelClustesContainer = 'PixelTrigClusters', - SCT_ClustesContainer = 'SCT_TrigClusters', + PixelClusterContainer = 'PixelTrigClusters', + SCT_ClusterContainer = 'SCT_TrigClusters', MomentumCut = 1.5 * Units.GeV, RapidityCut = 2.7 , RadiusMin = 0.0 , diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py index edc539c7445..8c675d5cae7 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py @@ -41,18 +41,6 @@ def InDetIDCCacheCreatorCfg(flags): acc.addEventAlgo( InDetCacheCreatorTrig ) return acc -def trtCondCfg(flags): - acc = ComponentAccumulator() - from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline, addFolders - #TODO switch to use config from TRT_ConditionsConfig - if flags.Common.isOnline: - acc.merge(addFolders(flags, "/TRT/Onl/ROD/Compress","TRT_ONL", className='CondAttrListCollection')) - acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Calib/RT","/TRT/Calib/RT",className="TRTCond::RtRelationMultChanContainer")) - acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Calib/T0","/TRT/Calib/T0",className="TRTCond::StrawT0MultChanContainer")) - acc.merge(addFoldersSplitOnline (flags, "TRT","/TRT/Onl/Calib/errors","/TRT/Calib/errors",className="TRTCond::RtRelationMultChanContainer")) - - return acc - def _trackConverterCfg(flags, signature, inputTracksKey, outputTrackParticleKey): acc = ComponentAccumulator() diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py index 296f05dfa63..5f973edd939 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py @@ -72,7 +72,14 @@ def signatureSpecificSettingOfFlags(flags,mode): flags.nWeightedClustersMin= 8 flags.minTRTonTrk = 20 flags.seedFilterLevel = 3 - + + elif flags.input_name=="minBias": + flags.minPT = 0.1*Units.GeV + flags.maxPrimaryImpact = 10.*Units.mm + flags.maxRPhiImpact = 10.*Units.mm + flags.maxZImpact = 150.*Units.mm + flags.roadWidth = 20 + def collToRecordable(flags,name): ret = name signature = flags.input_name @@ -105,7 +112,7 @@ def signatureSpecificSettingOfFlags(flags,mode): flags.addFlag("refitROT", True) flags.addFlag("trtExtensionType", "xf") flags.addFlag("doBremRecovery", False) #setTrue for electron once validated - + flags.addFlag("doTruth", False) def createTrigTrackingPassFlags(mode="InDet"): def __flagsFromConfigSettings(settings, mode): @@ -160,9 +167,9 @@ class FlagsCopiedTest(unittest.TestCase): from AthenaConfiguration.AllConfigFlags import initConfigFlags flags = initConfigFlags() flags.Trigger.doID - flags.Trigger.InDetTracking.Muon - flags.Trigger.InDetTracking.Electron.minPT = 2.0 * Units.GeV - self.newflags = flags.cloneAndReplace('Tracking.ActiveConfig', 'Trigger.InDetTracking.Electron') + flags.Trigger.InDetTracking.muon + flags.Trigger.InDetTracking.electron.minPT = 2.0 * Units.GeV + self.newflags = flags.cloneAndReplace('Tracking.ActiveConfig', 'Trigger.InDetTracking.electron') self.newflags.dump(".*InDet") diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/effpreinclude.py b/Trigger/TrigValidation/TrigInDetValidation/share/effpreinclude.py index bda1c6d0221..4fbfc1d4483 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/share/effpreinclude.py +++ b/Trigger/TrigValidation/TrigInDetValidation/share/effpreinclude.py @@ -7,9 +7,6 @@ log.info( "preinclude: effpreinclude.py" ) from TrigInDetConfig.ConfigSettingsBase import _ConfigSettingsBase -# potential future check - leave here -# from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags ; InDetTrigFlags.cutLevel.set_Value_and_Lock(15) - from TrigInDetConfig.ConfigSettings import getInDetTrigConfig from AthenaCommon.SystemOfUnits import GeV diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py index 2cd8bc7da73..7bcdb05287a 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py @@ -353,10 +353,6 @@ include ("RecExCond/AllDet_detDescr.py") if flags.Trigger.doID: include("InDetTrigRecExample/InDetTrigRec_jobOptions.py") - from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags - InDetTrigFlags.doPrintConfigurables = log.getEffectiveLevel() <= logging.DEBUG - from InDetRecExample.InDetJobProperties import InDetFlags - InDetFlags.doPrintConfigurables = log.getEffectiveLevel() <= logging.DEBUG include("InDetRecExample/InDetRecConditionsAccess.py") diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CalibCosmicMon/BeamspotChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CalibCosmicMon/BeamspotChainConfiguration.py index 29242cb2b95..4e9b4793830 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CalibCosmicMon/BeamspotChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CalibCosmicMon/BeamspotChainConfiguration.py @@ -23,7 +23,7 @@ def trkFS_trkfast_Cfg( flags ): return allTE_trkfast( flags, signature="FS" ) def allTE_trkfast_Cfg( flags ): - return allTE_trkfast( flags, signature="BeamSpot" ) + return allTE_trkfast( flags, signature="beamSpot" ) def allTE_trkfast( flags, signature="FS" ): inputMakerAlg = EventViewCreatorAlgorithm("IM_beamspot_"+signature) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/generateElectron.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/generateElectron.py index 8dc7104bf1d..7429dd00704 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/generateElectron.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Electron/generateElectron.py @@ -40,7 +40,7 @@ def _ftfSeq(flags): # # # fast ID (need to be customised because require secialised configuration of the views maker - i.e. parent has to be linked) fastInDetReco = InViewRecoCA('FastElectron', RequireParentView = True) from TrigInDetConfig.TrigInDetConfig import trigInDetFastTrackingCfg - idTracking = trigInDetFastTrackingCfg(flags, roisKey=fastInDetReco.inputMaker().InViewRoIs, signatureName='Electron') + idTracking = trigInDetFastTrackingCfg(flags, roisKey=fastInDetReco.inputMaker().InViewRoIs, signatureName='electron') fastInDetReco.mergeReco(idTracking) fastInDetReco.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(name='VDVElectronFastCalo', DataObjects=[('xAOD::TrigEMClusterContainer', 'StoreGateSvc+HLT_FastCaloEMClusters')]) ) @@ -98,14 +98,14 @@ def _precisionTrackingSeq(flags,chainDict): name='ElectronPrecisionTracking' selAcc=SelectionCA('ElectronPrecisionTracking') - roisKey = flags.Trigger.InDetTracking.Electron.roi + roisKey = flags.Trigger.InDetTracking.electron.roi precisionInDetReco = InViewRecoCA(name, RoITool=CompFactory.ViewCreatorPreviousROITool(), # view maker args RequireParentView=True, InViewRoIs=roisKey) from TrigInDetConfig.TrigInDetConfig import trigInDetPrecisionTrackingCfg - idTracking = trigInDetPrecisionTrackingCfg(flags, rois= roisKey, signatureName='Electron') + idTracking = trigInDetPrecisionTrackingCfg(flags, rois= roisKey, signatureName='electron') precisionInDetReco.mergeReco(idTracking) selAcc.mergeReco(precisionInDetReco) hypoAlg = CompFactory.TrigStreamerHypoAlg('ElectronprecisionTrackingHypo') diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Muon/generateMuon.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Muon/generateMuon.py index fd27f32e6b7..4710afd2374 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Muon/generateMuon.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Muon/generateMuon.py @@ -47,10 +47,10 @@ def EFMuonCBViewDataVerifierCfg(flags, name): else: if flags.Detector.GeometryITk: EFMuonCBViewDataVerifier.DataObjects += [( 'MuonCandidateCollection' , 'StoreGateSvc+MuonCandidates' ), - ( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+'+flags.Trigger.ITkTracking.Muon.tracks_FTF )] + ( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+'+flags.Tracking.ActiveConfig.tracks_FTF )] else: EFMuonCBViewDataVerifier.DataObjects += [( 'MuonCandidateCollection' , 'StoreGateSvc+MuonCandidates' ), - ( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+'+flags.Trigger.InDetTracking.Muon.tracks_FTF ), + ( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+'+flags.Tracking.ActiveConfig.tracks_FTF ), ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_FlaggedCondData' ) ] @@ -130,7 +130,7 @@ def _muCombStepSeq(flags, is_probe_leg=False): recoL2CB.mergeReco( MuCombViewDataVerifier() ) #ID tracking - recoL2CB.mergeReco(trigInDetFastTrackingCfg( flags, roisKey=recoL2CB.inputMaker().InViewRoIs, signatureName="Muon" )) + recoL2CB.mergeReco(trigInDetFastTrackingCfg( flags, roisKey=recoL2CB.inputMaker().InViewRoIs, signatureName="muon" )) selAccL2CB.mergeReco(recoL2CB) @@ -185,8 +185,8 @@ def _muEFCBStepSeq(flags, name='RoI', is_probe_leg=False): ViewNodeName = viewName+"InView") recoCB = InViewRecoCA("EFMuCBReco_"+name, viewMaker=viewMakerAlg, isProbe=is_probe_leg) #ID tracking - recoCB.mergeReco(trigInDetFastTrackingCfg( flags, roisKey=recoCB.inputMaker().InViewRoIs, signatureName="MuonFS" )) - trackName = flags.Trigger.InDetTracking.MuonFS.tracks_FTF + recoCB.mergeReco(trigInDetFastTrackingCfg( flags, roisKey=recoCB.inputMaker().InViewRoIs, signatureName="muonFS" )) + trackName = flags.Trigger.InDetTracking.muonFS.tracks_FTF else: recoCB = InViewRecoCA(viewName, isProbe=is_probe_leg) recoCB.inputMaker().RequireParentView = True @@ -276,9 +276,9 @@ def _muEFIsoStepSeq(flags): ViewNodeName = viewName+"InView") recoIso = InViewRecoCA("EFMuIsoReco", viewMaker=viewMakerAlg) #ID tracking - recoIso.mergeReco(trigInDetFastTrackingCfg( flags, roisKey=recoIso.inputMaker().InViewRoIs, signatureName="MuonIso" )) + recoIso.mergeReco(trigInDetFastTrackingCfg( flags, roisKey=recoIso.inputMaker().InViewRoIs, signatureName="muonIso" )) recoIso.mergeReco(MuIsoViewDataVerifierCfg()) - recoIso.mergeReco(TrigMuonEFTrackIsolationAlgCfg(flags, IdTrackParticles=flags.Trigger.InDetTracking.MuonIso.tracks_FTF, + recoIso.mergeReco(TrigMuonEFTrackIsolationAlgCfg(flags, IdTrackParticles=flags.Trigger.InDetTracking.muonIso.tracks_FTF, MuonEFContainer="InViewIsoMuons", ptcone02Name="InViewIsoMuons.ptcone02", ptcone03Name="InViewIsoMuons.ptcone03")) -- GitLab From fd6eb3522f96f474a02fe52654f2443cd9a2dc93 Mon Sep 17 00:00:00 2001 From: Krzysztof Ciesla <krzysztof.marcin.ciesla@cern.ch> Date: Sun, 16 Jul 2023 15:44:48 +0200 Subject: [PATCH 8/9] ATR-27695: Add SpacePoints counts without ToT requirement ATR-27695: Add SpacePoints counts without ToT requirement --- .../python/TrigMinBiasMonitoring.py | 3 +- .../TrigMinBias/src/SPCountHypoTool.cxx | 116 ++++++++-------- .../TrigMinBias/src/SPCountHypoTool.h | 29 ++-- .../TrigMinBias/src/TrigCountSpacePoints.cxx | 124 ++++++++---------- .../TrigMinBias/src/TrigCountSpacePoints.h | 23 ++-- .../python/HLT/Menu/SignatureDicts.py | 5 +- .../HLT/MinBias/MinBiasMenuSequences.py | 24 ++-- 7 files changed, 152 insertions(+), 172 deletions(-) diff --git a/Trigger/TrigAlgorithms/TrigMinBias/python/TrigMinBiasMonitoring.py b/Trigger/TrigAlgorithms/TrigMinBias/python/TrigMinBiasMonitoring.py index fc1ad44cb7c..c8682996d4f 100644 --- a/Trigger/TrigAlgorithms/TrigMinBias/python/TrigMinBiasMonitoring.py +++ b/Trigger/TrigAlgorithms/TrigMinBias/python/TrigMinBiasMonitoring.py @@ -9,6 +9,7 @@ def SpCountMonitoring(flags): monTool.defineHistogram('pixCL_2', path='EXPERT', type='TH1I', title='pixCL_2',xbins=100, xmin=0, xmax=6000) monTool.defineHistogram('pixCLmin3', path='EXPERT', type='TH1I', title='pixCLmin3',xbins=100, xmin=0, xmax=6000) monTool.defineHistogram('pixCL', path='EXPERT', type='TH1I', title='pixCL', xbins = 500, xmin=0, xmax=6000) + monTool.defineHistogram('pixCLnoToT', path='EXPERT', type='TH1I', title='pixCLnoToT', xbins = 500, xmin=0, xmax=6000) monTool.defineHistogram('pixCLBarrel', path='EXPERT', type='TH1I', title='pixClBarrel', xbins = 500, xmin=0, xmax=6000) monTool.defineHistogram('pixCLEndcapA', path='EXPERT', type='TH1I', title='pixClEndcapA', xbins = 500, xmin=0, xmax=3000) monTool.defineHistogram('pixCLEndcapC', path='EXPERT', type='TH1I', title='pixClEndcapC', xbins = 500, xmin=0, xmax=3000) @@ -40,7 +41,7 @@ def MbtsHypoToolMonitoring(flags): from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool monTool = GenericMonitoringTool(flags, 'MonTool') monTool.defineHistogram('Counts', path='EXPERT', title=f'MBTS counts per channel;{__MBTSXTitle};counts', type='TH1F', xbins=32, xmin=-0.5, xmax=31.5) - + return monTool def TrackCountMonitoring(flags, hypoAlg): diff --git a/Trigger/TrigAlgorithms/TrigMinBias/src/SPCountHypoTool.cxx b/Trigger/TrigAlgorithms/TrigMinBias/src/SPCountHypoTool.cxx index 07b73bf099a..594b3fe9de2 100644 --- a/Trigger/TrigAlgorithms/TrigMinBias/src/SPCountHypoTool.cxx +++ b/Trigger/TrigAlgorithms/TrigMinBias/src/SPCountHypoTool.cxx @@ -1,79 +1,75 @@ - /* -Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ -#include "TrigCompositeUtils/HLTIdentifier.h" -#include "AthenaMonitoringKernel/Monitored.h" - #include "SPCountHypoTool.h" +#include "AthenaMonitoringKernel/Monitored.h" +#include "TrigCompositeUtils/HLTIdentifier.h" + using namespace TrigCompositeUtils; SPCountHypoTool::SPCountHypoTool(const std::string &type, const std::string &name, const IInterface *parent) - : AthCheckedComponent<AthAlgTool>(type, name, parent), - m_decisionId(HLT::Identifier::fromToolName(name)) {} + : AthCheckedComponent<AthAlgTool>(type, name, parent), m_decisionId(HLT::Identifier::fromToolName(name)) {} -StatusCode SPCountHypoTool::initialize() -{ - return StatusCode::SUCCESS; +StatusCode SPCountHypoTool::initialize() { + return StatusCode::SUCCESS; } -bool SPCountHypoTool::applyCut(const Gaudi::Property<int> &threshold, const xAOD::TrigComposite *composit, const std::string_view name) const -{ - if (threshold == -1) - return m_logicAnd; //If the logic is And, it should return true and otherwise it should return false. - const std::string detailName = (name != "" ? std::string(name) : threshold.name() ); +bool SPCountHypoTool::applyCut(const Gaudi::Property<int> &threshold, const xAOD::TrigComposite *composit, const std::string_view name) const { + if (threshold == -1) { + return m_logicAnd; // If the logic is And, it should return true and otherwise it should return false. + } + const std::string detailName = (name != "" ? std::string(name) : threshold.name()); - ATH_MSG_DEBUG("count for = " << threshold.name() << "=" << (composit->getDetail<int>(detailName) > threshold)); - return (composit->getDetail<int>(detailName) > threshold); + ATH_MSG_DEBUG("count for = " << threshold.name() << "=" << (composit->getDetail<int>(detailName) > threshold)); + return (composit->getDetail<int>(detailName) > threshold); } -bool SPCountHypoTool::applyInverseCut(const Gaudi::Property<int> &threshold, const xAOD::TrigComposite *composit, const std::string_view name) const -{ - if (threshold == -1) - return m_logicAnd; //If the logic is And, it should return true and otherwise it should return false. - const std::string detailName = (name != "" ? std::string(name) : threshold.name() ); +bool SPCountHypoTool::applyInverseCut(const Gaudi::Property<int> &threshold, const xAOD::TrigComposite *composit, const std::string_view name) const { + if (threshold == -1) { + return m_logicAnd; // If the logic is And, it should return true and otherwise it should return false. + } + const std::string detailName = (name != "" ? std::string(name) : threshold.name()); - ATH_MSG_DEBUG("count for = " << threshold.name() << "=" << (composit->getDetail<int>(detailName) < threshold)); - return (composit->getDetail<int>(detailName) < threshold); // here is the difference + ATH_MSG_DEBUG("count for = " << threshold.name() << "=" << (composit->getDetail<int>(detailName) < threshold)); + return (composit->getDetail<int>(detailName) < threshold); // here is the difference } +StatusCode SPCountHypoTool::decide(SPCountsInfo &spinfo) const { + if (spinfo.previousDecisionIDs.count(m_decisionId.numeric()) == 0) { + ATH_MSG_DEBUG("Already rejected"); + return StatusCode::SUCCESS; + } + + // clang-format off + std::vector<bool> decisionCuts({ + applyCut(m_pixCL, spinfo.counts), + applyInverseCut(m_pixCLMax, spinfo.counts, "pixCL"), + applyCut(m_pixCLnoToT, spinfo.counts), + applyCut(m_pixCL_1, spinfo.counts), + applyCut(m_pixCL_2, spinfo.counts), + applyCut(m_pixCLmin3, spinfo.counts), + applyCut(m_pixCLBarrel, spinfo.counts), + applyCut(m_pixCLEndcapA, spinfo.counts), + applyCut(m_pixCLEndcapC, spinfo.counts), + applyCut(m_sctSP, spinfo.counts), + applyInverseCut(m_sctSPMax, spinfo.counts, "sctSP"), + applyCut(m_sctSPBarrel, spinfo.counts), + applyCut(m_sctSPEndcapA, spinfo.counts), + applyCut(m_sctSPEndcapC, spinfo.counts)} + ); + // clang-format on -StatusCode SPCountHypoTool::decide(SPCountsInfo &spinfo) const -{ - if (spinfo.previousDecisionIDs.count(m_decisionId.numeric()) == 0) - { - ATH_MSG_DEBUG("Already rejected"); - return StatusCode::SUCCESS; - } - std::vector<bool> decisionCuts({applyCut(m_pixCL, spinfo.counts), - applyInverseCut(m_pixCLMax, spinfo.counts, "pixCL"), - applyCut(m_pixCL_1, spinfo.counts), - applyCut(m_pixCL_2, spinfo.counts), - applyCut(m_pixCLmin3, spinfo.counts), - applyCut(m_pixCLBarrel, spinfo.counts), - applyCut(m_pixCLEndcapA, spinfo.counts), - applyCut(m_pixCLEndcapC, spinfo.counts), - applyCut(m_sctSP, spinfo.counts), - applyInverseCut(m_sctSPMax, spinfo.counts, "sctSP"), - applyCut(m_sctSPBarrel, spinfo.counts), - applyCut(m_sctSPEndcapA, spinfo.counts), - applyCut(m_sctSPEndcapC, spinfo.counts)}); + if (m_logicAnd && !std::all_of(decisionCuts.begin(), decisionCuts.end(), [](bool k) { return k; })) { + ATH_MSG_DEBUG("REGTEST " << name() << " rejected"); + return StatusCode::SUCCESS; + } else if (m_logicAnd == false && !std::any_of(decisionCuts.begin(), decisionCuts.end(), [](bool k) { return k; })) { + ATH_MSG_DEBUG("REGTEST " << name() << " rejected"); + return StatusCode::SUCCESS; + } else { + addDecisionID(m_decisionId.numeric(), spinfo.decision); + ATH_MSG_DEBUG("REGTEST " << name() << " accepted"); + } - if (m_logicAnd && !std::all_of(decisionCuts.begin(), decisionCuts.end(), [](bool k) { return k; })) - { - ATH_MSG_DEBUG("REGTEST " << name() << " rejected"); - return StatusCode::SUCCESS; - } - else if (m_logicAnd == false && !std::any_of(decisionCuts.begin(), decisionCuts.end(), [](bool k) { return k; })) - { - ATH_MSG_DEBUG("REGTEST " << name() << " rejected"); - return StatusCode::SUCCESS; - } - else - { - addDecisionID(m_decisionId.numeric(), spinfo.decision); - ATH_MSG_DEBUG("REGTEST " << name() << " accepted"); - } - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } diff --git a/Trigger/TrigAlgorithms/TrigMinBias/src/SPCountHypoTool.h b/Trigger/TrigAlgorithms/TrigMinBias/src/SPCountHypoTool.h index 13e3a50d132..454d6e2cdb2 100644 --- a/Trigger/TrigAlgorithms/TrigMinBias/src/SPCountHypoTool.h +++ b/Trigger/TrigAlgorithms/TrigMinBias/src/SPCountHypoTool.h @@ -1,26 +1,22 @@ /* -Copyright! (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGMINBIAS_SPCOUNTHYPOTOOL_H #define TRIGMINBIAS_SPCOUNTHYPOTOOL_H -#include "Gaudi/Property.h" #include "AthenaBaseComps/AthAlgTool.h" #include "AthenaBaseComps/AthCheckedComponent.h" +#include "Gaudi/Property.h" #include "TrigCompositeUtils/HLTIdentifier.h" #include "TrigCompositeUtils/TrigCompositeUtils.h" -class SPCountHypoTool : virtual public AthCheckedComponent<::AthAlgTool> -{ -public: - SPCountHypoTool(const std::string &type, - const std::string &name, - const IInterface *parent); +class SPCountHypoTool : virtual public AthCheckedComponent<::AthAlgTool> { + public: + SPCountHypoTool(const std::string &type, const std::string &name, const IInterface *parent); virtual StatusCode initialize() override; - struct SPCountsInfo - { + struct SPCountsInfo { TrigCompositeUtils::Decision *decision; const xAOD::TrigComposite *counts; const TrigCompositeUtils::DecisionIDContainer previousDecisionIDs; @@ -28,14 +24,15 @@ public: StatusCode decide(SPCountsInfo &decisions) const; -private: - bool applyCut(const Gaudi::Property<int> &threshold, const xAOD::TrigComposite *composit, const std::string_view name="" ) const; - bool applyInverseCut(const Gaudi::Property<int> &threshold, const xAOD::TrigComposite *composit, const std::string_view name="" ) const; + private: + bool applyCut(const Gaudi::Property<int> &threshold, const xAOD::TrigComposite *composit, const std::string_view name = "") const; + bool applyInverseCut(const Gaudi::Property<int> &threshold, const xAOD::TrigComposite *composit, const std::string_view name = "") const; HLT::Identifier m_decisionId; - Gaudi::Property<int> m_pixCL{this, "pixCL", -1, "Require Clusters (of any size) Count > threshold (-1 disabled) in whole pixel"}; - Gaudi::Property<int> m_pixCLMax{this, "pixCLMax", -1, "Require Clusters (of any size) Count < threshold (-1 disabled) in whole pixel"}; + Gaudi::Property<int> m_pixCL{this, "pixCL", -1, "Require Clusters (of any size) Count > threshold (-1 disabled) in whole pixel"}; + Gaudi::Property<int> m_pixCLMax{this, "pixCLMax", -1, "Require Clusters (of any size) Count < threshold (-1 disabled) in whole pixel"}; + Gaudi::Property<int> m_pixCLnoToT{this, "pixCLnoToT", -1, "Require Clusters (of any size, without ToT cut) Count > threshold (-1 disabled) in whole pixel"}; Gaudi::Property<int> m_pixCL_1{this, "pixCL_1", -1, "Require Clusters Count made of clusters of size 1 > threshold (-1 disabled) in whole pixel"}; Gaudi::Property<int> m_pixCL_2{this, "pixCL_2", -1, "Require Clusters Count made of clusters of size 2 > threshold (-1 disabled) in whole pixel"}; Gaudi::Property<int> m_pixCLmin3{this, "pixCLmin3", -1, "Accept eventss with minimum 3 SP Count > threshold (-1 disabled) in pixel"}; @@ -50,4 +47,4 @@ private: Gaudi::Property<bool> m_logicAnd{this, "TriggerTypeAnd", true, "And/Or Logic"}; }; -#endif //> !TRIGMINBIAS_SPCOUNTHYPOTOOL_H +#endif //> !TRIGMINBIAS_SPCOUNTHYPOTOOL_H diff --git a/Trigger/TrigAlgorithms/TrigMinBias/src/TrigCountSpacePoints.cxx b/Trigger/TrigAlgorithms/TrigMinBias/src/TrigCountSpacePoints.cxx index a072a20ab4a..f3a6405edd2 100644 --- a/Trigger/TrigAlgorithms/TrigMinBias/src/TrigCountSpacePoints.cxx +++ b/Trigger/TrigAlgorithms/TrigMinBias/src/TrigCountSpacePoints.cxx @@ -1,36 +1,35 @@ /* -Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "TrigCountSpacePoints.h" + #include "InDetPrepRawData/PixelCluster.h" -TrigCountSpacePoints::TrigCountSpacePoints(const std::string &name, ISvcLocator *pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator) -{ -} +TrigCountSpacePoints::TrigCountSpacePoints(const std::string &name, ISvcLocator *pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator) {} -StatusCode TrigCountSpacePoints::initialize() -{ +StatusCode TrigCountSpacePoints::initialize() { ATH_CHECK(m_pixelSpKey.initialize()); ATH_CHECK(m_pixelHelperKey.initialize()); ATH_CHECK(m_sctSpKey.initialize()); ATH_CHECK(m_sctHelperKey.initialize()); ATH_CHECK(m_spacePointsKey.initialize()); ATH_CHECK(m_spacePointsAuxKey.initialize()); - if (!m_monTool.empty()) + if (!m_monTool.empty()) { ATH_CHECK(m_monTool.retrieve()); + } return StatusCode::SUCCESS; } -StatusCode TrigCountSpacePoints::execute(const EventContext &context) const -{ +StatusCode TrigCountSpacePoints::execute(const EventContext &context) const { - //For Pixel info decoding + // For Pixel info decoding SG::ReadHandle<PixelID> pixelHelper(m_pixelHelperKey, context); - //Here monitor + // Here monitor int pixCLBeforeCuts{}; int pixCL{}; + int pixCLnoToT{}; int pixCL_1{}; int pixCL_2{}; int pixCLmin3{}; @@ -39,71 +38,63 @@ StatusCode TrigCountSpacePoints::execute(const EventContext &context) const int pixCLEndcapC{}; int pixModulesOverThreshold{}; - SG::ReadHandle<SpacePointContainer> pixelSP(m_pixelSpKey, context); ATH_MSG_DEBUG("Successfully retrieved pixel SP container of size " << pixelSP->size()); - for (const auto pixSPointColl : *pixelSP) - { - if (pixSPointColl == nullptr) + for (const auto pixSPointColl : *pixelSP) { + if (pixSPointColl == nullptr) { continue; + } const Identifier pixid = (pixSPointColl)->identify(); - if (m_doOnlyBLayer == true && pixelHelper->layer_disk(pixid) != 0) + if (m_doOnlyBLayer == true && pixelHelper->layer_disk(pixid) != 0) { continue; + } const int bec = pixelHelper->barrel_ec(pixid); - int nPixSP{}, nPixCL_1{}, nPixCL_2{}, nPixCLmin3{}; - for (const auto pSP : *pixSPointColl) - { + int nPixSP{}, nPixCL_1{}, nPixCL_2{}, nPixCLmin3{}, nPixCLnoToT{}; + for (const auto pSP : *pixSPointColl) { pixCLBeforeCuts++; - const InDet::PixelCluster* pixClust = static_cast<const InDet::PixelCluster *>(pSP->clusterList().first); + const InDet::PixelCluster *pixClust = static_cast<const InDet::PixelCluster *>(pSP->clusterList().first); const int pixClSize = (pixClust->rdoList()).size(); const int pixclToT = pixClust->totalToT(); - if (pixclToT > m_pixelClusToTCut) - { + ++nPixCLnoToT; + if (pixclToT > m_pixelClusToTCut) { ++nPixSP; - if (pixClSize == 1) + if (pixClSize == 1) { ++nPixCL_1; - if (pixClSize == 2) + } + if (pixClSize == 2) { ++nPixCL_2; - if (pixClSize >= 3) + } + if (pixClSize >= 3) { ++nPixCLmin3; + } } } // total - if (nPixSP > m_pixModuleThreshold) - { - ATH_MSG_DEBUG(" This pixel module : " << pixid << " produced " << nPixSP << - " pix spacepoints. Ignoring these spacepoints as the maximum allowed spacepoints per module is " - << m_pixModuleThreshold); - pixModulesOverThreshold++; - } - else - { + if (nPixSP > m_pixModuleThreshold) { + ATH_MSG_DEBUG(" This pixel module : " << pixid << " produced " << nPixSP << " pix spacepoints. Ignoring these spacepoints as the maximum allowed spacepoints per module is " << m_pixModuleThreshold); + pixModulesOverThreshold++; + } else { pixCL += nPixSP; + pixCLnoToT += nPixCLnoToT; pixCL_1 += nPixCL_1; pixCL_2 += nPixCL_2; pixCLmin3 += nPixCLmin3; - if (bec == 0 ) - { + if (bec == 0) { pixCLBarrel += nPixSP; ATH_MSG_VERBOSE(" Formed " << nPixSP << " PIX spacepoints in PIX Barrel after ToT cut."); - } - else if (bec == 2) - { + } else if (bec == 2) { pixCLEndcapA += nPixSP; ATH_MSG_VERBOSE(" Formed " << nPixSP << " PIX spacepoints in PIX ECA after ToT cut."); - } - else if (bec == -2) - { + } else if (bec == -2) { pixCLEndcapC += nPixSP; ATH_MSG_VERBOSE(" Formed " << nPixSP << " PIX spacepoints in PIX ECC after ToT cut."); } - } } @@ -111,7 +102,8 @@ StatusCode TrigCountSpacePoints::execute(const EventContext &context) const ATH_MSG_DEBUG("REGTEST : " << pixCL_1 << " have cl size == 1 in total."); ATH_MSG_DEBUG("REGTEST : " << pixCL_2 << " have cl size == 2 in total."); ATH_MSG_DEBUG("REGTEST : " << pixCLmin3 << " have cl size >= 3 in total."); - ATH_MSG_DEBUG("REGTEST : Formed " << pixCL << " pixel spacepoints after ToT cut in total."); + ATH_MSG_DEBUG("REGTEST : Formed " << pixCLnoToT << " pixel spacepoints without ToT cut in total."); + ATH_MSG_DEBUG("REGTEST : Formed " << pixCL << " pixel spacepoints after ToT cut in total."); ATH_MSG_DEBUG("REGTEST : Formed " << pixCLBarrel << " SP in pixel barrel in total."); ATH_MSG_DEBUG("REGTEST : Formed " << pixCLEndcapA << " SP in pixel ECA in total."); ATH_MSG_DEBUG("REGTEST : Formed " << pixCLEndcapC << " SP in pixel ECC in total."); @@ -122,7 +114,7 @@ StatusCode TrigCountSpacePoints::execute(const EventContext &context) const SG::ReadHandle<SCT_ID> SctHelper(m_sctHelperKey, context); ATH_MSG_DEBUG("Successfully retrieved SCT SP container of size " << SctSP->size()); - //Here monitor define + // Here monitor define int nSctSP{}; int sctSPBarrel{}; int sctSPEndcapA{}; @@ -130,10 +122,10 @@ StatusCode TrigCountSpacePoints::execute(const EventContext &context) const int sctSP{}; int sctModulesOverThreshold{}; - for (const auto SctSPointColl : *SctSP) - { - if (SctSPointColl == nullptr) + for (const auto SctSPointColl : *SctSP) { + if (SctSPointColl == nullptr) { continue; + } nSctSP = (SctSPointColl)->size(); const Identifier Sctid = (SctSPointColl)->identify(); @@ -143,28 +135,19 @@ StatusCode TrigCountSpacePoints::execute(const EventContext &context) const << " with sctid module " << Sctid); // barrel // total - if (nSctSP < m_sctModuleLowerThreshold && nSctSP > m_sctModuleHigherThreshold) - { - //this is noise - ATH_MSG_DEBUG(" This SCT module : " << Sctid << " produced " << nSctSP - << " SCT spacepoints. Ignoring these spacepoints as the number of allowed spacepoints per module is between" - << m_sctModuleLowerThreshold << " and " << m_sctModuleHigherThreshold); - sctModulesOverThreshold++; - } - else - { // Accept the spacepoints - if (bec == 0) - { - sctSPBarrel +=nSctSP; + if (nSctSP < m_sctModuleLowerThreshold && nSctSP > m_sctModuleHigherThreshold) { + // this is noise + ATH_MSG_DEBUG(" This SCT module : " << Sctid << " produced " << nSctSP << " SCT spacepoints. Ignoring these spacepoints as the number of allowed spacepoints per module is between" + << m_sctModuleLowerThreshold << " and " << m_sctModuleHigherThreshold); + sctModulesOverThreshold++; + } else { // Accept the spacepoints + if (bec == 0) { + sctSPBarrel += nSctSP; ATH_MSG_VERBOSE(" Formed " << nSctSP << " SCT barrel spacepoints ."); - } - else if (bec == 2) - { // endcap, side A + } else if (bec == 2) { // endcap, side A sctSPEndcapA += nSctSP; ATH_MSG_VERBOSE(" Formed " << nSctSP << " SCT ECA spacepoints."); - } - else if (bec == -2) - { // endcap, side C + } else if (bec == -2) { // endcap, side C sctSPEndcapC += nSctSP; ATH_MSG_VERBOSE(" Formed " << nSctSP << " SCT ECC spacepoints."); } @@ -178,7 +161,6 @@ StatusCode TrigCountSpacePoints::execute(const EventContext &context) const ATH_MSG_DEBUG("REGTEST : Formed " << sctSPBarrel << " sct Barr spacepoints in total."); ATH_MSG_DEBUG("REGTEST : Formed " << sctSPEndcapA << " sct ECA spacepoints in total."); - // Recording Data SG::WriteHandle<xAOD::TrigCompositeContainer> spacePointHandle(m_spacePointsKey, context); @@ -191,12 +173,13 @@ StatusCode TrigCountSpacePoints::execute(const EventContext &context) const std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> monitoredVariables; -#define SAVE_AND_MONITOR(__VARNAME) \ - spCounts->setDetail(#__VARNAME, __VARNAME); \ +#define SAVE_AND_MONITOR(__VARNAME) \ + spCounts->setDetail(#__VARNAME, __VARNAME); \ auto mon_##__VARNAME = Monitored::Scalar(#__VARNAME, __VARNAME); \ monitoredVariables.emplace_back(mon_##__VARNAME); SAVE_AND_MONITOR(pixCL); + SAVE_AND_MONITOR(pixCLnoToT); SAVE_AND_MONITOR(pixCL_1); SAVE_AND_MONITOR(pixCL_2); SAVE_AND_MONITOR(pixCLmin3); @@ -217,7 +200,6 @@ StatusCode TrigCountSpacePoints::execute(const EventContext &context) const monitoredVariables.emplace_back(mon_sctModulesOverThreshold); Monitored::Group(m_monTool, monitoredVariables); - ATH_CHECK(spacePointHandle.record(std::move(spacePoints), std::move(spacePointsAux))); return StatusCode::SUCCESS; diff --git a/Trigger/TrigAlgorithms/TrigMinBias/src/TrigCountSpacePoints.h b/Trigger/TrigAlgorithms/TrigMinBias/src/TrigCountSpacePoints.h index 8c370e33eb8..bc033eb39a4 100644 --- a/Trigger/TrigAlgorithms/TrigMinBias/src/TrigCountSpacePoints.h +++ b/Trigger/TrigAlgorithms/TrigMinBias/src/TrigCountSpacePoints.h @@ -1,34 +1,33 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGMINBIAS_TRIGCOUNTSPACEPOINTS_H #define TRIGMINBIAS_TRIGCOUNTSPACEPOINTS_H +#include <string> + #include "AthenaBaseComps/AthReentrantAlgorithm.h" -#include "TrkSpacePoint/SpacePointContainer.h" +#include "AthenaMonitoringKernel/Monitored.h" #include "InDetIdentifier/PixelID.h" #include "InDetIdentifier/SCT_ID.h" -#include "xAODTrigger/TrigCompositeContainer.h" +#include "TrkSpacePoint/SpacePointContainer.h" #include "xAODTrigger/TrigCompositeAuxContainer.h" -#include "AthenaMonitoringKernel/Monitored.h" - -#include <string> +#include "xAODTrigger/TrigCompositeContainer.h" -class TrigCountSpacePoints : public AthReentrantAlgorithm -{ -public: +class TrigCountSpacePoints : public AthReentrantAlgorithm { + public: TrigCountSpacePoints(const std::string &name, ISvcLocator *pSvcLocator); virtual StatusCode initialize() override; virtual StatusCode execute(const EventContext &context) const override; -private: + private: Gaudi::Property<bool> m_doOnlyBLayer{this, "doOnlyBLayer", false, " "}; Gaudi::Property<int> m_pixModuleThreshold{this, "pixModuleThreshold", 100, "Dont take modules with SP Count higher than this threshold in Pixel Det."}; Gaudi::Property<int> m_sctModuleHigherThreshold{this, "sctModuleHigherThreshold", 2000000, "Dont take modules with SP Count higher than this threshold in SCT"}; Gaudi::Property<int> m_sctModuleLowerThreshold{this, "sctModuleLowerThreshold", 0, "Dont take modules with SP Count lowerer than this threshold in SCT"}; - //The need for these flags have to be reviewed + // The need for these flags have to be reviewed /*Gaudi::Property<bool> m_sct_barrel_a_side{this, "sct_barrel_a_side",true, "SCT Barrel side A"}; Gaudi::Property<bool> m_sct_barrel_c_side{this, "sct_barrel_c_side",true, "SCT Barrel side C"}; @@ -50,4 +49,4 @@ private: ToolHandle<GenericMonitoringTool> m_monTool{this, "MonTool", "", "Monitoring tool"}; }; -#endif // TRIGMINBIAS_TRIGCOUNTSPACEPOINTS_H +#endif // TRIGMINBIAS_TRIGCOUNTSPACEPOINTS_H diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Menu/SignatureDicts.py index dcbf1822ad8..8112472ee11 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Menu/SignatureDicts.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Menu/SignatureDicts.py @@ -756,8 +756,9 @@ MinBiasChainParts = { 'sp1000', 'sp1100', 'sp1200', 'sp1300', 'sp1400', 'sp1500', 'sp1600', 'sp1700', 'sp1800', 'sp2000', 'sp2100', 'sp2200', 'sp2300', 'sp2400', 'sp2500', 'sp2700', 'sp2800', 'sp2900', 'sp3000', 'sp3100', 'sp3500', 'sp4100', 'sp4500', 'sp4800', 'sp5000', 'sp5200', - 'vpix15','vpix30', - 'pix100', 'pix200', 'pix500', 'pix1000'], + 'vpix15', 'vpix30', + 'pix100', 'pix200', 'pix500', 'pix1000', + 'nototpix70', 'nototpix100', 'nototpix200', 'nototpix500'], 'pileupInfo' : ['pusup0', 'pusup7', 'pusup10', 'pusup15', 'pusup20', 'pusup30', 'pusup40','pusup50','pusup60', 'pusup70', 'pusup80', 'pusup90', 'pusup100', 'pusup110', 'pusup120', 'pusup130', 'pusup150', 'pusup180', 'pusup190', 'pusup200', 'pusup220', 'pusup240', 'pusup250', 'pusup260', 'pusup270', 'pusup280', 'pusup290', 'pusup300'], 'hypoTrkInfo' : ['trk3','trk5','trk10','trk15', 'trk20', 'trk25', 'trk30', 'trk35', 'trk40', 'trk45', 'trk50', 'trk55', 'trk60', 'trk65', 'trk70', 'trk75', 'trk80', 'trk90', diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/MinBias/MinBiasMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/MinBias/MinBiasMenuSequences.py index 5de0ee3834a..581bd53862f 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/MinBias/MinBiasMenuSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/MinBias/MinBiasMenuSequences.py @@ -36,8 +36,12 @@ def SPCountHypoToolGen(chainDict): hypo.pixCL = -1 # Remove any cut on mininum number of Pixel and SCT SpacePoints hypo.sctSP = -1 hypo.pixCLMax = int(chainDict["chainParts"][0]["hypoSPInfo"].strip("vpix")) - return hypo + if "nototpix" in chainDict["chainName"]: + hypo.pixCL = -1 # Remove any cut on mininum number of Pixel and SCT SpacePoints + hypo.sctSP = -1 + hypo.pixCLnoToT = int(chainDict["chainParts"][0]["hypoSPInfo"].strip("nototpix")) + return hypo def TrackCountHypoToolGen(chainDict): @@ -80,7 +84,7 @@ def MbtsHypoToolGen(flags, chainDict): hypo.MbtsCounters=1 return hypo - + def TrigZVertexHypoToolGen(chainDict): hypo = CompFactory.TrigZVertexHypoTool(chainDict["chainName"]) @@ -91,14 +95,14 @@ def TrigZVertexHypoToolGen(chainDict): return hypo -@AccumulatorCache +@AccumulatorCache def MinBiasSPSel(flags): reco = InViewRecoCA("SPCountingReco") minBiasFlags = flags.cloneAndReplace("Tracking.ActiveConfig","Trigger.InDetTracking.minBias") from TrigInDetConfig.InDetTrigSequence import InDetTrigSequence - seq = InDetTrigSequence(minBiasFlags, + seq = InDetTrigSequence(minBiasFlags, minBiasFlags.Tracking.ActiveConfig.input_name, # this is already in the flags, maybe we would nto need to pass it in the future? rois = str(reco.inputMaker().InViewRoIs), inView = str(reco.inputMaker().Views)) @@ -128,13 +132,13 @@ def MinBiasSPSequenceCfg(flags): def MinBiasZVertexFinderSequenceCfg(flags): recoAcc = InViewRecoCA(name="ZVertFinderReco", InViewRoIs="InputRoI", RequireParentView=True) vdv = CompFactory.AthViews.ViewDataVerifier( "VDVZFinderInputs", - DataObjects = [( 'SpacePointContainer' , 'StoreGateSvc+PixelTrigSpacePoints'), + DataObjects = [( 'SpacePointContainer' , 'StoreGateSvc+PixelTrigSpacePoints'), ( 'PixelID' , 'DetectorStore+PixelID' ) ]) recoAcc.addRecoAlgo(vdv) from IDScanZFinder.ZFinderAlgConfig import MinBiasZFinderCfg recoAcc.mergeReco( MinBiasZFinderCfg(flags) ) - selAcc = SelectionCA("ZVertexFinderSel") + selAcc = SelectionCA("ZVertexFinderSel") selAcc.mergeReco(recoAcc) selAcc.addHypoAlgo( CompFactory.TrigZVertexHypoAlg("TrigZVertexHypoAlg", ZVertexKey=recordable("HLT_vtx_z"))) return MenuSequenceCA(flags, selAcc, HypoToolGen = TrigZVertexHypoToolGen) @@ -179,16 +183,16 @@ def MinBiasMbtsSequenceCfg(flags): from TrigMinBias.MbtsConfig import MbtsFexCfg, MbtsSGInputCfg fex = MbtsFexCfg(flags, MbtsBitsKey = recordable("HLT_MbtsBitsContainer")) recoAcc.mergeReco(fex) - selAcc = SelectionCA("MbtsSel") + selAcc = SelectionCA("MbtsSel") hypo = CompFactory.MbtsHypoAlg("MbtsHypoAlg", MbtsBitsKey = fex.getPrimary().MbtsBitsKey) selAcc.mergeReco(recoAcc) selAcc.addHypoAlgo(hypo) return MenuSequenceCA(flags, selAcc, - HypoToolGen = MbtsHypoToolGen, + HypoToolGen = MbtsHypoToolGen, globalRecoCA = MbtsSGInputCfg(flags)) - + if __name__ == "__main__": from AthenaConfiguration.AllConfigFlags import initConfigFlags @@ -198,7 +202,7 @@ if __name__ == "__main__": zf.ca.printConfig(withDetails=True) from ..Config.MenuComponents import menuSequenceCAToGlobalWrapper zfms = menuSequenceCAToGlobalWrapper(MinBiasZVertexFinderSequenceCfg, flags) - + mb = MinBiasMbtsSequenceCfg(flags) mb.ca.printConfig() -- GitLab From 84d2ff36414b864d7bde9fd8a1452182ec9ee19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Ma=C5=A1=C3=ADk?= <Jiri.Masik@manchester.ac.uk> Date: Sat, 15 Jul 2023 18:42:28 +0200 Subject: [PATCH 9/9] replace InDetTrigCommon _builder methods by CA Cfgs --- .../python/SiSPSeededTrackFinderConfig.py | 48 +++++ .../TrigInDetConfig/python/EFIDTracking.py | 74 +------- .../TrigInDetConfig/python/InDetTrigCommon.py | 177 ------------------ .../python/TrigTrackingPassFlags.py | 5 + 4 files changed, 61 insertions(+), 243 deletions(-) delete mode 100644 Trigger/TrigTools/TrigInDetConfig/python/InDetTrigCommon.py diff --git a/InnerDetector/InDetConfig/python/SiSPSeededTrackFinderConfig.py b/InnerDetector/InDetConfig/python/SiSPSeededTrackFinderConfig.py index 4a27279372b..e0b269fba35 100644 --- a/InnerDetector/InDetConfig/python/SiSPSeededTrackFinderConfig.py +++ b/InnerDetector/InDetConfig/python/SiSPSeededTrackFinderConfig.py @@ -60,7 +60,55 @@ def SiSPSeededTrackFinderCfg(flags, name="InDetSiSpTrackFinder", **kwargs): name+flags.Tracking.ActiveConfig.extension, **kwargs)) return acc +def TrigSiSPSeededTrackFinderCfg(flags, name="InDetTrigSiSpTrackFinder", **kwargs): + acc = ComponentAccumulator() + + if "TracksLocation" not in kwargs: + kwargs.setdefault("TracksLocation", flags.Tracking.ActiveConfig.trkTracks_IDTrig) + + kwargs.setdefault("SpacePointsSCTName","SCT_TrigSpacePoints") + kwargs.setdefault("SpacePointsPixelName","PixelTrigSpacePoints") + + if "TrackTool" not in kwargs: + from InDetConfig.SiTrackMakerConfig import TrigSiTrackMaker_xkCfg + kwargs.setdefault("TrackTool", acc.popToolsAndMerge( + TrigSiTrackMaker_xkCfg(flags))) + + #for the time being no need of InDetTrigPropagator + # acc.popToolsAndMerge(InDetPropagatorCfg(flags, name="InDetTrigPropagator")) + + if "TrackSummaryTool" not in kwargs: + from TrkConfig.TrkTrackSummaryToolConfig import ( + InDetTrigFastTrackSummaryToolCfg) + kwargs.setdefault("TrackSummaryTool", acc.popToolsAndMerge( + InDetTrigFastTrackSummaryToolCfg(flags))) + + if "SeedsTool" not in kwargs: + from InDetConfig.SiSpacePointsSeedToolConfig import ( + TrigSiSpacePointsSeedMakerCfg) + kwargs.setdefault("SeedsTool", acc.popToolsAndMerge( + TrigSiSpacePointsSeedMakerCfg(flags))) + # Heavy-ion config (TODO the steering for the trigger) + kwargs.setdefault("useMBTSTimeDiff", flags.Reco.EnableHI) + kwargs.setdefault("useZvertexTool", False) + kwargs.setdefault("useZBoundFinding", + flags.Tracking.ActiveConfig.doZBoundary) + if flags.Reco.EnableHI: + # Heavy Ion optimization from Igor + kwargs.setdefault("FreeClustersCut", 2) + ### End of trigger-specific HI steering (TODO) + + if flags.Tracking.ActiveConfig.usePrdAssociationTool: + # not all classes have that property !!! + kwargs.setdefault("PRDtoTrackMap", ( + 'InDetPRDtoTrackMap' + flags.Tracking.ActiveConfig.input_name)) + else: + kwargs.setdefault("PRDtoTrackMap", "") + + acc.merge(SiSPSeededTrackFinderCfg(flags, name, **kwargs)) + return acc + def ITkSiSPSeededTrackFinderCfg(flags, name="ITkSiSpTrackFinder", **kwargs): acc = ComponentAccumulator() diff --git a/Trigger/TrigTools/TrigInDetConfig/python/EFIDTracking.py b/Trigger/TrigTools/TrigInDetConfig/python/EFIDTracking.py index 6652fcae8b3..6f75e8286ad 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/EFIDTracking.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/EFIDTracking.py @@ -10,7 +10,6 @@ include("InDetTrigRecExample/InDetTrigRec_jobOptions.py") # this is needed to ge from AthenaCommon.Logging import logging log = logging.getLogger("EFIDTracking") -from InDetTrigRecExample.InDetTrigCommonTools import CAtoLegacyPublicToolWrapper from TriggerMenuMT.HLT.Config.MenuComponents import algorithmCAToGlobalWrapper #Create a view verifier for necessary data collections @@ -87,17 +86,6 @@ def makeInDetPatternRecognition( inflags, config, verifier = 'IDTrigViewDataVeri dataVerifier = get_idtrig_view_verifier(verifier+config.input_name) viewAlgs.append( dataVerifier ) - #FIXME: eventually adapt the cuts in the configsetting ATR-22755 - mode_name = remapToOffline( config.name ) - if config.name == "cosmics" or config.name == "minBias": - from InDetTrigRecExample.InDetTrigTrackingCuts import InDetTrigTrackingCuts - trackingCuts = InDetTrigTrackingCuts( mode_name ) - #MinBias cuts need to be revisited: ATR-23077 - else: - from InDetRecExample.ConfiguredNewTrackingCuts import ConfiguredNewTrackingCuts - trackingCuts = ConfiguredNewTrackingCuts( mode_name ) - #trackingCuts.printInfo() - from TrigInDetConfig.utils import getFlagsForActiveConfig flags = getFlagsForActiveConfig(inflags, config.input_name, log) @@ -106,61 +94,15 @@ def makeInDetPatternRecognition( inflags, config, verifier = 'IDTrigViewDataVeri InDetTrigCA.InDetTrigConfigFlags = flags - from TrkConfig.TrkTrackSummaryToolConfig import InDetTrigTrackSummaryToolCfg - summaryTool = CAtoLegacyPublicToolWrapper(InDetTrigTrackSummaryToolCfg) + from InDetConfig.SiSPSeededTrackFinderConfig import TrigSiSPSeededTrackFinderCfg + siSPSeededTrackFinder = algorithmCAToGlobalWrapper( + TrigSiSPSeededTrackFinderCfg, + flags, + name = 'EFsiSPSeededTrackFinder'+flags.Tracking.ActiveConfig.input_name, + ) - # --- decide if use the association tool - usePrdAssociationTool = False - #FIXME: Do we need this switch? If so, make the same decision as offline (based on the tracking cuts)? ATR-22755 - #Are all of these needed? - #if (len(InputCollections) > 0) and (trackingCuts.mode() == "LowPt" or trackingCuts.mode() == "VeryLowPt" or trackingCuts.mode() == "LargeD0" or trackingCuts.mode() == "LowPtLargeD0" or trackingCuts.mode() == "BeamGas" or trackingCuts.mode() == "ForwardTracks" or trackingCuts.mode() == "ForwardSLHCTracks" or trackingCuts.mode() == "Disappearing" or trackingCuts.mode() == "VeryForwardSLHCTracks" or trackingCuts.mode() == "SLHCConversionFinding"): - #usePrdAssociationTool = True - if usePrdAssociationTool: - from .InDetTrigCommon import prdAssociation_builder - InputCollections = None #Dummy atm - prdAssociation = prdAssociation_builder( InputCollections ) - viewAlgs.append( prdAssociation ) - - - - # FIXME Use trigger flags instead of indetflags ATR-22756 - # What are the instances when we don't need this? - # if InDetFlags.doSiSPSeededTrackFinder(): - - doSiSPSeededTrackFinder = True - - if doSiSPSeededTrackFinder: - - #FIXME: do we need this covered by detflag condition? ATR-22756 - #from AthenaCommon.DetFlags import DetFlags - # --- Loading Pixel, SCT conditions - if True: #DetFlags.haveRIO.pixel_on(): - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") - if not hasattr(condSeq, "InDetSiDetElementBoundaryLinksPixelCondAlg"): - from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiDetElementBoundaryLinksCondAlg_xk - condSeq += InDet__SiDetElementBoundaryLinksCondAlg_xk(name = "InDetSiDetElementBoundaryLinksPixelCondAlg", - ReadKey = "PixelDetectorElementCollection", - WriteKey = "PixelDetElementBoundaryLinks_xk",) - - - if not hasattr(condSeq, "InDetSiDetElementBoundaryLinksSCTCondAlg"): - from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiDetElementBoundaryLinksCondAlg_xk - condSeq += InDet__SiDetElementBoundaryLinksCondAlg_xk(name = "InDetSiDetElementBoundaryLinksSCTCondAlg", - ReadKey = "SCT_DetectorElementCollection", - WriteKey = "SCT_DetElementBoundaryLinks_xk") - #------------------------------------------------------- - - from .InDetTrigCommon import siSPSeededTrackFinder_builder, add_prefix - siSPSeededTrackFinder = siSPSeededTrackFinder_builder( name = add_prefix( 'siSPSeededTrackFinder', config.input_name ), - config = config, - outputTracks = config.trkTracks_IDTrig(), - trackingCuts = trackingCuts, - usePrdAssociationTool = usePrdAssociationTool, - nameSuffix = config.input_name, - trackSummaryTool = summaryTool ) - - viewAlgs.append( siSPSeededTrackFinder ) + + viewAlgs.extend( siSPSeededTrackFinder ) #----------------------------------------------------------------------------- # Precision algorithms diff --git a/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigCommon.py b/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigCommon.py deleted file mode 100644 index 8507749a6d5..00000000000 --- a/Trigger/TrigTools/TrigInDetConfig/python/InDetTrigCommon.py +++ /dev/null @@ -1,177 +0,0 @@ -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration -# -# Contains algs/tools used by Inner Detector Trigger - -#Global keys/names for collections -#from .InDetTrigCollectionKeys import TrigTRTKeys, TrigPixelKeys - -from InDetRecExample.TrackingCommon import makePublicTool, setDefaults - -from AthenaCommon.Logging import logging -log = logging.getLogger("InDetTrigCommon") - -from InDetTrigRecExample.InDetTrigCommonTools import CAtoLegacyPublicToolWrapper - -#-------------------------------------------------------------------------- - -def _prefix(): - #Too long? Do we need this to separate from InDet? - return 'InDetTrigMT_' - -def _suffix(signature=None): - return '_%s'%signature - -#Retrieve full name of the algorithm/tool which consist of -#1] Predefined PREFIX describing the scope where this tool is being used (Inner Detector Trigger) -#2] CORE name containing the actual name of the tool -#3] SUFFIX which is derived from signature name: _electron, _muonLate, _FS etc - -def add_prefix( core, suffix=None ): - return '{}{}{}'.format( _prefix(), core, _suffix(suffix) ) - -#------------------------------------------------------------------------------------------------- -# Alg/Tools for offline pattern recognition tracking - - -@makePublicTool -def zVertexMakerTool_builder(name, trackingCuts, seedMakerTool ): - from InDetRecExample.InDetJobProperties import InDetFlags - - kwargs = {} - - #Prepare default parameter settings for the tool - kwargs = setDefaults( kwargs, - Zmax = trackingCuts.maxZImpact(), - Zmin = -trackingCuts.maxZImpact(), - minRatio = 0.17, - SeedMakerTool = seedMakerTool ) - - - if InDetFlags.doHeavyIon(): - kwargs = setDefaults( kwargs, - HistSize = 2000, - minContent = 30) - - from SiZvertexTool_xk.SiZvertexTool_xkConf import InDet__SiZvertexMaker_xk - return InDet__SiZvertexMaker_xk(name = name, - **kwargs) - - -@makePublicTool -def siTrackMakerTool_builder( name, config, trackFinderTool, trackingCuts, usePrdAssociationTool ): - from InDetRecExample.InDetJobProperties import InDetFlags - - if config.name == 'cosmics': - trackPatternRecoInfo = 'SiSpacePointsSeedMaker_Cosmic' - else: - trackPatternRecoInfo = 'SiSPSeededFinder' - - useBremMode = trackingCuts.mode() == "Offline" - - kwargs = {} - - from InDetConfig.SiDetElementsRoadToolConfig import TrigSiDetElementsRoadMaker_xkCfg - siDetElementsRoadMakerTool = CAtoLegacyPublicToolWrapper(TrigSiDetElementsRoadMaker_xkCfg) - - #FIXME: - #Check compatibility of cosmic cuts from offline version with online run2 - #https://gitlab.cern.ch/atlas/athena/-/blob/21.2/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecNewTracking.py#L167-172 - #Prepare default parameter settings for the tool - kwargs = setDefaults( kwargs, - useSCT = trackingCuts.useSCT(), - usePixel = trackingCuts.usePixel(), - RoadTool = siDetElementsRoadMakerTool, - CombinatorialTrackFinder = trackFinderTool, - pTmin = trackingCuts.minPT(), - pTminBrem = trackingCuts.minPTBrem(), - pTminSSS = InDetFlags.pT_SSScut(), #FIXME: revisit ATR-22756 - nClustersMin = trackingCuts.minClusters(), - nHolesMax = trackingCuts.nHolesMax(), - nHolesGapMax = trackingCuts.nHolesGapMax(), - SeedsFilterLevel = trackingCuts.seedFilterLevel(), - Xi2max = trackingCuts.Xi2max(), - Xi2maxNoAdd = trackingCuts.Xi2maxNoAdd(), - nWeightedClustersMin = trackingCuts.nWeightedClustersMin(), - CosmicTrack = (config.name == 'cosmics'), - Xi2maxMultiTracks = trackingCuts.Xi2max(), # was 3. - useSSSseedsFilter = InDetFlags.doSSSfilter(), #FIXME: revisit ATR-22756 - doMultiTracksProd = True, - useBremModel = InDetFlags.doBremRecovery() and useBremMode, #FIXME: revisit ATR-22756 - doCaloSeededBrem = InDetFlags.doCaloSeededBrem(), #FIXME: revisit ATR-22756 - doHadCaloSeedSSS = InDetFlags.doHadCaloSeededSSS(), #FIXME: revisit ATR-22756 - phiWidth = trackingCuts.phiWidthBrem(), - etaWidth = trackingCuts.etaWidthBrem(), - EMROIPhiRZContainer = "InDetCaloClusterROIPhiRZ0GeV", - HadROIPhiRZContainer = "InDetHadCaloClusterROIPhiRZ", #FIXME: revisit ATR-22756 - TrackPatternRecoInfo = trackPatternRecoInfo, - UseAssociationTool = usePrdAssociationTool) - - - from SiTrackMakerTool_xk.SiTrackMakerTool_xkConf import InDet__SiTrackMaker_xk - return InDet__SiTrackMaker_xk(name = name, - **kwargs) - - - -def siSPSeededTrackFinder_builder( name, config, outputTracks, trackingCuts, usePrdAssociationTool, nameSuffix, trackSummaryTool ): - - #FIXME: ATR-22756, ATR-22755 - # 1] Currently some flags are copy paste from offline configuration, might need to switch those to trigger flags - # 2] trackingCuts are adapted from offline version as well, ideally we would want to have these from ConfigSettings.py in the end - # 3] This code requires proper validation (currently ongoing using minBias and cosmic signatures) - - - from .InDetTrigCollectionKeys import TrigPixelKeys, TrigSCTKeys - from InDetRecExample.InDetJobProperties import InDetFlags - - - - #Load subtools of the TrackFinder - from InDetConfig.SiSpacePointsSeedToolConfig import TrigSiSpacePointsSeedMakerCfg - siSpacePointsSeedMakerTool = CAtoLegacyPublicToolWrapper(TrigSiSpacePointsSeedMakerCfg) - - - # --- Z-coordinates primary vertices finder (only for collisions) - zVertexMakerTool = None - #FIXME:Switch to trig flags? ATR-22756 - if InDetFlags.useZvertexTool(): - zVertexMakerTool = zVertexMakerTool_builder(name, trackingCuts, siSpacePointsSeedMakerTool ) - - - from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiCombinatorialTrackFinder_xk_Trig_Cfg - siCombinatorialTrackFinderTool = CAtoLegacyPublicToolWrapper(SiCombinatorialTrackFinder_xk_Trig_Cfg, name=name+'_Tool') - - siTrackMakerTool = siTrackMakerTool_builder( name = add_prefix( 'siTrackMaker', nameSuffix), - config = config, - trackFinderTool = siCombinatorialTrackFinderTool, - trackingCuts = trackingCuts, - usePrdAssociationTool = usePrdAssociationTool) - - #----------------------------------------------------- - # Configure parameters - - kwargs = {} - #Prepare default parameter settings for the tool - kwargs = setDefaults( kwargs, - TrackTool = siTrackMakerTool, - PRDtoTrackMap = TrigPixelKeys.PRDtoTrackMap if usePrdAssociationTool else '', #TODO: if prd is enabled this needs to be tested, ATR-22756 - SpacePointsPixelName= TrigPixelKeys.SpacePoints, - SpacePointsSCTName = TrigSCTKeys.SpacePoints, - TrackSummaryTool = trackSummaryTool, - TracksLocation = outputTracks, - SeedsTool = siSpacePointsSeedMakerTool, - ZvertexTool = zVertexMakerTool, - useZvertexTool = InDetFlags.useZvertexTool(), #FIXME: revisit ATR-22756 - useNewStrategy = InDetFlags.useNewSiSPSeededTF(), #FIXME: revisit ATR-22756 - useMBTSTimeDiff = InDetFlags.useMBTSTimeDiff(), #FIXME: revisit ATR-22756 - useZBoundFinding = trackingCuts.doZBoundary()) - - # FIXME: revisit HI option ATR-22756 - # if InDetFlags.doHeavyIon(): - # kwargs = setDefaults( kwargs, FreeClustersCut = 2) #Heavy Ion optimization from Igor - - from SiSPSeededTrackFinder.SiSPSeededTrackFinderConf import InDet__SiSPSeededTrackFinder - - return InDet__SiSPSeededTrackFinder( name=name, **kwargs ) - - diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py index 5f973edd939..7baeb77df5a 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py @@ -72,13 +72,18 @@ def signatureSpecificSettingOfFlags(flags,mode): flags.nWeightedClustersMin= 8 flags.minTRTonTrk = 20 flags.seedFilterLevel = 3 + flags.usePrdAssociationTool = False #for backward compatibility #2023fix? elif flags.input_name=="minBias": flags.minPT = 0.1*Units.GeV + flags.nClustersMin = 5 + flags.seedFilterLevel = 2 flags.maxPrimaryImpact = 10.*Units.mm flags.maxRPhiImpact = 10.*Units.mm flags.maxZImpact = 150.*Units.mm flags.roadWidth = 20 + flags.usePrdAssociationTool = False #for backward compatibility #2023fix? + def collToRecordable(flags,name): ret = name -- GitLab