diff --git a/FTagDumper/bin/dump-single-btag-flow b/FTagDumper/bin/dump-single-btag-flow deleted file mode 100755 index fce2a841d450b2c0f8e75a3c23aa1f77a6658b30..0000000000000000000000000000000000000000 --- a/FTagDumper/bin/dump-single-btag-flow +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python3 - -""" - -This script is similar to dump-single-btag, adds TrackFlowOverlapRemovalAlg -Necessary to dump the flow constiturnts and not duplicate the charged ones that are listed in tracks - -""" - -import sys -from FTagDumper import dumper - -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -from AthenaConfiguration.ComponentFactory import CompFactory - - -def orCfg(name, jets, tracks='BTagTrackToJetAssociator'): - ca = ComponentAccumulator() - ca.addEventAlgo( - CompFactory.TrackFlowOverlapRemovalAlg( - name=name, - Tracks=f'{jets}.{tracks}', - Constituents=f'{jets}.constituentLinks', - OutTracks=f'{jets}.nonConstituentTracks' - ) - ) - ca.addEventAlgo( - CompFactory.FlowSelectorAlg( - name="NeutralFlowSelectorAlg", - Constituents=f'{jets}.constituentLinks', - OutConstituentsNeutral=f'{jets}.neutralConstituentLinks', - OutConstituentsCharged=f'{jets}.chargedConstituentLinks' - ) - ) - return ca - - -def run(): - - args = dumper.base_parser(__doc__).parse_args() - - flags = dumper.update_flags(args) - flags.lock() - - ca = dumper.getMainConfig(flags) - - ca.merge(orCfg('nonConstituentAdder', 'AntiKt4EMPFlowJets', 'TracksForBTagging')) - - ca.merge(dumper.getDumperConfig(args)) - return ca.run() - - -if __name__ == '__main__': - code = run() - sys.exit(0 if code.isSuccess() else 1) - diff --git a/FTagDumper/python/blocks/FlowSelector.py b/FTagDumper/python/blocks/FlowSelector.py index 6af187f48abfb38fcece01553b940b89de0ce0e2..f9576dd939e30e0e545de56fd5e4f34877db67cc 100644 --- a/FTagDumper/python/blocks/FlowSelector.py +++ b/FTagDumper/python/blocks/FlowSelector.py @@ -16,6 +16,7 @@ class FlowSelector(BaseBlock): """ jet_collection: str = None + name: str = "NeutralFlowSelectorAlg" def __post_init__(self): if self.jet_collection is None: @@ -26,7 +27,7 @@ class FlowSelector(BaseBlock): ca = ComponentAccumulator() ca.addEventAlgo( CompFactory.FlowSelectorAlg( - name="NeutralFlowSelectorAlg", + name=self.name, Constituents=f'{self.jet_collection}.constituentLinks', OutConstituentsNeutral=f'{self.jet_collection}.neutralConstituentLinks', OutConstituentsCharged=f'{self.jet_collection}.chargedConstituentLinks' diff --git a/FTagDumper/python/blocks/TrackFlowOverlapRemoval.py b/FTagDumper/python/blocks/TrackFlowOverlapRemoval.py index 5e0325b470f3e076f8f4e471a9576f7e8cbddbe0..85ae0adf2baf8a98570225a0b722cbb32095e181 100644 --- a/FTagDumper/python/blocks/TrackFlowOverlapRemoval.py +++ b/FTagDumper/python/blocks/TrackFlowOverlapRemoval.py @@ -18,6 +18,7 @@ class TrackFlowOverlapRemoval(BaseBlock): jet_collection: str = None track_container: str = None + name: str = "nonConstituentAdder" def __post_init__(self): if self.jet_collection is None: @@ -29,7 +30,7 @@ class TrackFlowOverlapRemoval(BaseBlock): ca = ComponentAccumulator() ca.addEventAlgo( CompFactory.TrackFlowOverlapRemovalAlg( - name='nonConstituentAdder', + name=self.name, Tracks=f'{self.jet_collection}.{self.track_container}', Constituents=f'{self.jet_collection}.constituentLinks', OutTracks=f'{self.jet_collection}.nonConstituentTracks' diff --git a/FTagDumper/test/test-dumper b/FTagDumper/test/test-dumper index 00dfe3fd3c7ebffb9001849b0f8bf69d3eebf853..1bb77f1a4962244a59033f2a7aaba860d4970f0f 100755 --- a/FTagDumper/test/test-dumper +++ b/FTagDumper/test/test-dumper @@ -150,7 +150,7 @@ declare -A TESTS=( [trigger-hits]=dump-trigger-emtopo [trigger-hitz-network]=dump-trigger-emtopo [jer]=dump-jer - [neutral]=dump-single-btag-flow + [neutral]=dump-single-btag [retag-fatjet]=dump-retag-fatjet [taucomp]=dump-single-btag [blocks]=dump-single-btag diff --git a/configs/EMPFlow_all_flows.json b/configs/EMPFlow_all_flows.json index 8916928df6ddca12f2788f585e42902ee2cd1dd4..5d24a96b6e9ad239927916e0a9dae261143fe829 100644 --- a/configs/EMPFlow_all_flows.json +++ b/configs/EMPFlow_all_flows.json @@ -149,6 +149,15 @@ "decorate_summary": true } ], + "ca_blocks" : [ + { + "block": "FlowSelector" + }, + { + "block" : "TrackFlowOverlapRemoval", + "track_container" : "TracksForBTagging" + } + ], "decorate": { "jet_aug": false, "btag_jes": true, diff --git a/configs/EMPFlow_all_flows_spot.json b/configs/EMPFlow_all_flows_spot.json index f768383f439cf4e3f0de0eed7cec2a50461d4938..205c0d3358971dc743de249966816150eb28e413 100644 --- a/configs/EMPFlow_all_flows_spot.json +++ b/configs/EMPFlow_all_flows_spot.json @@ -141,6 +141,15 @@ "decorate_summary": true } ], + "ca_blocks" : [ + { + "block": "FlowSelector" + }, + { + "block" : "TrackFlowOverlapRemoval", + "track_container" : "TracksForBTagging" + } + ], "decorate": { "jet_aug": false, "btag_jes": true,