Skip to content
Snippets Groups Projects
Commit f85c65ba authored by Nikita Ivvan Pond's avatar Nikita Ivvan Pond Committed by Dan Guest
Browse files

Cleanup dump-single-btag-flow

parent f924d8ef
No related branches found
No related tags found
No related merge requests found
#!/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)
...@@ -16,6 +16,7 @@ class FlowSelector(BaseBlock): ...@@ -16,6 +16,7 @@ class FlowSelector(BaseBlock):
""" """
jet_collection: str = None jet_collection: str = None
name: str = "NeutralFlowSelectorAlg"
def __post_init__(self): def __post_init__(self):
if self.jet_collection is None: if self.jet_collection is None:
...@@ -26,7 +27,7 @@ class FlowSelector(BaseBlock): ...@@ -26,7 +27,7 @@ class FlowSelector(BaseBlock):
ca = ComponentAccumulator() ca = ComponentAccumulator()
ca.addEventAlgo( ca.addEventAlgo(
CompFactory.FlowSelectorAlg( CompFactory.FlowSelectorAlg(
name="NeutralFlowSelectorAlg", name=self.name,
Constituents=f'{self.jet_collection}.constituentLinks', Constituents=f'{self.jet_collection}.constituentLinks',
OutConstituentsNeutral=f'{self.jet_collection}.neutralConstituentLinks', OutConstituentsNeutral=f'{self.jet_collection}.neutralConstituentLinks',
OutConstituentsCharged=f'{self.jet_collection}.chargedConstituentLinks' OutConstituentsCharged=f'{self.jet_collection}.chargedConstituentLinks'
......
...@@ -18,6 +18,7 @@ class TrackFlowOverlapRemoval(BaseBlock): ...@@ -18,6 +18,7 @@ class TrackFlowOverlapRemoval(BaseBlock):
jet_collection: str = None jet_collection: str = None
track_container: str = None track_container: str = None
name: str = "nonConstituentAdder"
def __post_init__(self): def __post_init__(self):
if self.jet_collection is None: if self.jet_collection is None:
...@@ -29,7 +30,7 @@ class TrackFlowOverlapRemoval(BaseBlock): ...@@ -29,7 +30,7 @@ class TrackFlowOverlapRemoval(BaseBlock):
ca = ComponentAccumulator() ca = ComponentAccumulator()
ca.addEventAlgo( ca.addEventAlgo(
CompFactory.TrackFlowOverlapRemovalAlg( CompFactory.TrackFlowOverlapRemovalAlg(
name='nonConstituentAdder', name=self.name,
Tracks=f'{self.jet_collection}.{self.track_container}', Tracks=f'{self.jet_collection}.{self.track_container}',
Constituents=f'{self.jet_collection}.constituentLinks', Constituents=f'{self.jet_collection}.constituentLinks',
OutTracks=f'{self.jet_collection}.nonConstituentTracks' OutTracks=f'{self.jet_collection}.nonConstituentTracks'
......
...@@ -150,7 +150,7 @@ declare -A TESTS=( ...@@ -150,7 +150,7 @@ declare -A TESTS=(
[trigger-hits]=dump-trigger-emtopo [trigger-hits]=dump-trigger-emtopo
[trigger-hitz-network]=dump-trigger-emtopo [trigger-hitz-network]=dump-trigger-emtopo
[jer]=dump-jer [jer]=dump-jer
[neutral]=dump-single-btag-flow [neutral]=dump-single-btag
[retag-fatjet]=dump-retag-fatjet [retag-fatjet]=dump-retag-fatjet
[taucomp]=dump-single-btag [taucomp]=dump-single-btag
[blocks]=dump-single-btag [blocks]=dump-single-btag
......
...@@ -149,6 +149,15 @@ ...@@ -149,6 +149,15 @@
"decorate_summary": true "decorate_summary": true
} }
], ],
"ca_blocks" : [
{
"block": "FlowSelector"
},
{
"block" : "TrackFlowOverlapRemoval",
"track_container" : "TracksForBTagging"
}
],
"decorate": { "decorate": {
"jet_aug": false, "jet_aug": false,
"btag_jes": true, "btag_jes": true,
......
...@@ -141,6 +141,15 @@ ...@@ -141,6 +141,15 @@
"decorate_summary": true "decorate_summary": true
} }
], ],
"ca_blocks" : [
{
"block": "FlowSelector"
},
{
"block" : "TrackFlowOverlapRemoval",
"track_container" : "TracksForBTagging"
}
],
"decorate": { "decorate": {
"jet_aug": false, "jet_aug": false,
"btag_jes": true, "btag_jes": true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment