3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from BTagging.BTagTrackAugmenterAlgConfig
import BTagTrackAugmenterAlgCfg
7 from FlavorTagDiscriminants.BTagJetAugmenterAlgConfig
import (
8 BTagJetAugmenterAlgCfg)
10 from FlavorTagDiscriminants.FlavorTagNNConfig
import FlavorTagNNCfg
16 AddressRemappingSvc, ProxyProviderSvc=CompFactory.getComps(
"AddressRemappingSvc",
"ProxyProviderSvc",)
18 AddressRemappingSvc.TypeKeyRenameMaps += [
'xAOD::JetAuxContainer#AntiKt4EMTopoJets.btaggingLink->AntiKt4EMTopoJets.btaggingLink_' + suffix]
19 AddressRemappingSvc.TypeKeyRenameMaps += [
'xAOD::BTaggingContainer#BTagging_AntiKt4EMTopo->BTagging_AntiKt4EMTopo_' + suffix]
20 AddressRemappingSvc.TypeKeyRenameMaps += [
'xAOD::BTaggingAuxContainer#BTagging_AntiKt4EMTopoAux.->BTagging_AntiKt4EMTopo_' + suffix+
"Aux."]
21 AddressRemappingSvc.TypeKeyRenameMaps += [
'xAOD::VertexContainer#BTagging_AntiKt4EMTopoSecVtx->BTagging_AntiKt4EMTopoSecVtx_' + suffix]
22 AddressRemappingSvc.TypeKeyRenameMaps += [
'xAOD::VertexAuxContainer#BTagging_AntiKt4EMTopoSecVtxAux.->BTagging_AntiKt4EMTopoSecVtx_' + suffix+
"Aux."]
23 AddressRemappingSvc.TypeKeyRenameMaps += [
'xAOD::BTagVertexContainer#BTagging_AntiKt4EMTopoJFVtx->BTagging_AntiKt4EMTopoJFVtx_' + suffix]
24 AddressRemappingSvc.TypeKeyRenameMaps += [
'xAOD::BTagVertexAuxContainer#BTagging_AntiKt4EMTopoJFVtxAux.->BTagging_AntiKt4EMTopoJFVtx_' + suffix+
"Aux."]
25 acc.addService(AddressRemappingSvc)
32 AddressRemappingSvc, ProxyProviderSvc=CompFactory.getComps(
"AddressRemappingSvc",
"ProxyProviderSvc",)
34 AddressRemappingSvc.TypeKeyRenameMaps += [
'xAOD::BTaggingAuxContainer#BTagging_' + JetCollection +
'.' + Tagger +
'_pu->BTagging_' + JetCollection +
'.'+ Tagger +
'_pu' + suffix]
35 AddressRemappingSvc.TypeKeyRenameMaps += [
'xAOD::BTaggingAuxContainer#BTagging_' + JetCollection +
'.' + Tagger +
'_pc->BTagging_' + JetCollection +
'.'+ Tagger +
'_pc' + suffix]
36 AddressRemappingSvc.TypeKeyRenameMaps += [
'xAOD::BTaggingAuxContainer#BTagging_' + JetCollection +
'.' + Tagger +
'_pb->BTagging_' + JetCollection +
'.'+ Tagger +
'_pb' + suffix]
37 AddressRemappingSvc.TypeKeyRenameMaps += [
'xAOD::BTaggingAuxContainer#BTagging_' + JetCollection +
'.' + Tagger +
'_ptau->BTagging_' + JetCollection +
'.'+ Tagger +
'_ptau' + suffix]
38 acc.addService(AddressRemappingSvc)
48 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
51 DeprecatedHLTaggers = [
'rnnip',
'DL1']
52 postTagDL2JetToTrainingMap={
55 'BTagging/201903/rnnip/antikt4empflow/network.json',
56 'BTagging/201903/dl1r/antikt4empflow/network.json',
57 'BTagging/201903/dl1/antikt4empflow/network.json',
61 for jet
in JetCollection:
62 if jet
in postTagDL2JetToTrainingMap:
63 for tagger
in DeprecatedHLTaggers:
69 acc.merge(
RunHighLevelTaggersCfg(cfgFlags, jet,
'BTagTrackToJetAssociator', postTagDL2JetToTrainingMap[jet],
""))
77 BTagCollection = inputFlags.BTagging.OutputFiles.Prefix+JetCollection
78 result.merge(
BTagJetAugmenterAlgCfg(inputFlags, JetCollection=jet, BTagCollection=BTagCollection, Associator=Associator, TrackCollection=tracks) )
80 result.merge(
FlavorTagNNCfg(inputFlags, BTagCollection, TrackCollection=tracks, NNFile=dl2) )
86 if v.lower()
in (
'yes',
'true',
't',
'y',
'1'):
88 elif v.lower()
in (
'no',
'false',
'f',
'n',
'0'):
91 raise argparse.ArgumentTypeError(
'Boolean value expected.')
97 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
101 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
105 from IOVDbSvc.IOVDbSvcConfig
import addFolders
106 result.merge(
addFolders(inputFlags,[
'/TRT/Align'],
'TRT_OFL'))
119 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
120 acc.merge(
OutputStreamCfg(flags,
"ESD", ItemList=ESDItemList+extraContainers))
127 ItemList.append(
'xAOD::JetContainer#'+JetCollection+
'Jets')
128 ItemList.append(
'xAOD::JetAuxContainer#'+JetCollection+
'JetsAux.btaggingLink')
132 """Registers the jet collection to various containers in BTaggingFlags which govern which
133 containers will be parsed to the output xAOD and ESD files. This used to happen in
134 ./share/BTagging_jobOptions.py.
136 input: JetCollection: The name of the jet collection."""
139 OutputFilesSVname =
"SecVtx"
140 OutputFilesJFVxname =
"JFVtx"
141 OutputFilesBaseName =
"xAOD::BTaggingContainer#"
142 OutputFilesBaseAuxName =
"xAOD::BTaggingAuxContainer#"
143 OutputFilesBaseNameSecVtx =
"xAOD::VertexContainer#"
144 OutputFilesBaseAuxNameSecVtx =
"xAOD::VertexAuxContainer#"
145 OutputFilesBaseNameJFSecVtx =
"xAOD::BTagVertexContainer#"
146 OutputFilesBaseAuxNameJFSecVtx=
"xAOD::BTagVertexAuxContainer#"
148 author = flags.BTagging.OutputFiles.Prefix + JetCollection
150 ItemList.append(OutputFilesBaseNameSecVtx + author + OutputFilesSVname)
151 ItemList.append(OutputFilesBaseAuxNameSecVtx + author + OutputFilesSVname +
'Aux.-vxTrackAtVertex')
153 ItemList.append(OutputFilesBaseNameJFSecVtx + author + OutputFilesJFVxname)
154 ItemList.append(OutputFilesBaseAuxNameJFSecVtx + author + OutputFilesJFVxname +
'Aux.')
157 author +=
'_' + suffix
159 ItemList.append(OutputFilesBaseName + author)
160 ItemList.append(OutputFilesBaseAuxName + author +
'Aux.*')
165 if __name__==
"__main__":
167 inputESD =
"/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExRecoTest/mc21_13p6TeV/ESDFiles/mc21_13p6TeV.421450.PhPy8EG_A14_ttbar_hdamp258p75_SingleLep_fct.recon.ESD.e8445_e8447_s3822_r13565/ESD.28877240._000046.pool.root.1"
169 parser = argparse.ArgumentParser(prog=
"BTagConfig: An example configuration module for btagging reconstruction reading an ESD",
170 usage=
"Call with an input file, pass -n=0 to skip execution, -t 0 for serial or 1 for threaded execution.")
171 parser.add_argument(
"-f",
"--filesIn", default = inputESD, type=str, help=
"Comma-separated list of input files")
172 parser.add_argument(
"-t",
"--nThreads", default=1, type=int, help=
"The number of concurrent threads to run. 0 uses serial Athena.")
173 parser.add_argument(
"-l",
"--highlevel", type=str2bool, default=
False, help=
"Run only high level taggers.")
175 args = parser.parse_args()
177 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
179 cfgFlags.Input.Files= args.filesIn.split(
",")
181 cfgFlags.Output.ESDFileName=
"esdOut.pool.root"
184 cfgFlags.Concurrency.NumThreads = args.nThreads
186 cfgFlags.Scheduler.ShowDataDeps =
True
187 cfgFlags.Scheduler.ShowDataFlow =
True
188 cfgFlags.Scheduler.ShowControlFlow =
True
189 cfgFlags.Concurrency.NumConcurrentEvents = args.nThreads
191 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
193 acc.getService(
"MessageSvc").Format =
"% F%80W%S%7W%R%T %0W%M"
200 JetCollection = [
'AntiKt4EMTopo',
'AntiKt4EMPFlow']
205 acc.setAppProperty(
"EvtMax",-1)