ATLAS Offline Software
Functions | Variables
python.BTagESD Namespace Reference

Functions

def RenameInputContainerCfg (suffix)
 
def RenameHLTaggerCfg (JetCollection, Tagger, suffix)
 
def BTagHLTaggersCfg (inputFlags, JetCollection=[])
 
def RunHighLevelTaggersCfg (inputFlags, jet, tracks, Associator, taggers)
 
def str2bool (v)
 
def PrepareStandAloneBTagCfg (inputFlags)
 
def BTagRedoESDCfg (flags, jet, extraContainers=[])
 
def registerJetCollectionEL (flags, JetCollection)
 
def registerOutputBTaggingContainers (flags, JetCollection, suffix='')
 

Variables

string 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"
 
 parser
 
 default
 
 type
 
 str
 
 help
 
 int
 
 str2bool
 
 False
 
 args = parser.parse_args()
 
 cfgFlags = initConfigFlags()
 
 Files
 
 ESDFileName
 
 NumThreads
 
 ShowDataDeps
 
 ShowDataFlow
 
 ShowControlFlow
 
 NumConcurrentEvents
 
 acc = MainServicesCfg(cfgFlags)
 
 Format
 
list JetCollection = ['AntiKt4EMTopo', 'AntiKt4EMPFlow']
 
 f = open("BTag.pkl","wb")
 

Function Documentation

◆ BTagHLTaggersCfg()

def python.BTagESD.BTagHLTaggersCfg (   inputFlags,
  JetCollection = [] 
)

Definition at line 44 of file BTagESD.py.

44 def BTagHLTaggersCfg(inputFlags, JetCollection = []):
45  acc = ComponentAccumulator()
46 
47  # Nothing written out
48  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
49  acc.merge(OutputStreamCfg(cfgFlags,"ESD", ItemList=[]))
50 
51  DeprecatedHLTaggers = ['rnnip', 'DL1']
52  postTagDL2JetToTrainingMap={
53  'AntiKt4EMPFlow': [
54  #'BTagging/201903/smt/antikt4empflow/network.json',
55  'BTagging/201903/rnnip/antikt4empflow/network.json',
56  'BTagging/201903/dl1r/antikt4empflow/network.json',
57  'BTagging/201903/dl1/antikt4empflow/network.json',
58  #'BTagging/201903/dl1rmu/antikt4empflow/network.json',
59  ]
60  }
61  for jet in JetCollection:
62  if jet in postTagDL2JetToTrainingMap:
63  for tagger in DeprecatedHLTaggers:
64  acc.merge(RenameHLTaggerCfg(jet, tagger, '_old'))
65  #Track Augmenter
66  acc.merge(BTagTrackAugmenterAlgCfg(cfgFlags))
67 
68  #HighLevel taggers can not be run with time stamped containers
69  acc.merge(RunHighLevelTaggersCfg(cfgFlags, jet, 'BTagTrackToJetAssociator', postTagDL2JetToTrainingMap[jet], ""))
70 
71  return acc
72 
73 

◆ BTagRedoESDCfg()

def python.BTagESD.BTagRedoESDCfg (   flags,
  jet,
  extraContainers = [] 
)

Definition at line 110 of file BTagESD.py.

110 def BTagRedoESDCfg(flags, jet, extraContainers=[]):
112 
113  acc.merge(RenameInputContainerCfg("old"))
114 
115  #Register input ESD container in output
116  ESDItemList = registerOutputBTaggingContainers(flags, jet)
117  ESDItemList += registerJetCollectionEL(flags, jet)
118  print(ESDItemList)
119  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
120  acc.merge(OutputStreamCfg(flags,"ESD", ItemList=ESDItemList+extraContainers))
121 
122  return acc
123 

◆ PrepareStandAloneBTagCfg()

def python.BTagESD.PrepareStandAloneBTagCfg (   inputFlags)

Definition at line 94 of file BTagESD.py.

94 def PrepareStandAloneBTagCfg(inputFlags):
95  result=ComponentAccumulator()
96 
97  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
98  result.merge(PoolReadCfg(inputFlags))
99 
100  # get standard config for magnetic field - map and cache
101  from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
102  result.merge(AtlasFieldCacheCondAlgCfg( inputFlags ))
103 
104  #load folders needed for Run2 ID alignment
105  from IOVDbSvc.IOVDbSvcConfig import addFolders
106  result.merge(addFolders(inputFlags,['/TRT/Align'],'TRT_OFL'))
107 
108  return result
109 

◆ registerJetCollectionEL()

def python.BTagESD.registerJetCollectionEL (   flags,
  JetCollection 
)

Definition at line 124 of file BTagESD.py.

124 def registerJetCollectionEL(flags, JetCollection):
125  ItemList = []
126  # btaggingLink
127  ItemList.append('xAOD::JetContainer#'+JetCollection+'Jets')
128  ItemList.append('xAOD::JetAuxContainer#'+JetCollection+'JetsAux.btaggingLink')
129  return ItemList
130 

◆ registerOutputBTaggingContainers()

def python.BTagESD.registerOutputBTaggingContainers (   flags,
  JetCollection,
  suffix = '' 
)
Registers the jet collection to various containers in BTaggingFlags which govern which
containers will be parsed to the output xAOD and ESD files. This used to happen in
./share/BTagging_jobOptions.py.

input: JetCollection:       The name of the jet collection.

Definition at line 131 of file BTagESD.py.

131 def registerOutputBTaggingContainers(flags, JetCollection, suffix = ''):
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.
135 
136  input: JetCollection: The name of the jet collection."""
137  ItemList = []
138 
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#"
147 
148  author = flags.BTagging.OutputFiles.Prefix + JetCollection
149  # SecVert
150  ItemList.append(OutputFilesBaseNameSecVtx + author + OutputFilesSVname)
151  ItemList.append(OutputFilesBaseAuxNameSecVtx + author + OutputFilesSVname + 'Aux.-vxTrackAtVertex')
152  # JFSeCVert
153  ItemList.append(OutputFilesBaseNameJFSecVtx + author + OutputFilesJFVxname)
154  ItemList.append(OutputFilesBaseAuxNameJFSecVtx + author + OutputFilesJFVxname + 'Aux.')
155 
156  if suffix:
157  author += '_' + suffix
158 
159  ItemList.append(OutputFilesBaseName + author)
160  ItemList.append(OutputFilesBaseAuxName + author + 'Aux.*')
161  #ItemList.append(OutputFilesBaseAuxName + author + 'Aux.-BTagTrackToJetAssociatorBB')
162 
163  return ItemList
164 

◆ RenameHLTaggerCfg()

def python.BTagESD.RenameHLTaggerCfg (   JetCollection,
  Tagger,
  suffix 
)

Definition at line 30 of file BTagESD.py.

30 def RenameHLTaggerCfg(JetCollection, Tagger, suffix):
32  AddressRemappingSvc, ProxyProviderSvc=CompFactory.getComps("AddressRemappingSvc","ProxyProviderSvc",)
33  AddressRemappingSvc = AddressRemappingSvc("AddressRemappingSvc")
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)
39  acc.addService(ProxyProviderSvc(ProviderNames = [ "AddressRemappingSvc" ]))
40 
41  return acc
42 
43 

◆ RenameInputContainerCfg()

def python.BTagESD.RenameInputContainerCfg (   suffix)

Definition at line 12 of file BTagESD.py.

12 def RenameInputContainerCfg(suffix):
14 
15  #Delete BTagging container read from input ESD
16  AddressRemappingSvc, ProxyProviderSvc=CompFactory.getComps("AddressRemappingSvc","ProxyProviderSvc",)
17  AddressRemappingSvc = AddressRemappingSvc("AddressRemappingSvc")
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)
26  acc.addService(ProxyProviderSvc(ProviderNames = [ "AddressRemappingSvc" ]))
27 
28  return acc
29 

◆ RunHighLevelTaggersCfg()

def python.BTagESD.RunHighLevelTaggersCfg (   inputFlags,
  jet,
  tracks,
  Associator,
  taggers 
)

Definition at line 74 of file BTagESD.py.

74 def RunHighLevelTaggersCfg(inputFlags, jet, tracks, Associator, taggers):
75  result = ComponentAccumulator()
76 
77  BTagCollection = inputFlags.BTagging.OutputFiles.Prefix+JetCollection
78  result.merge(BTagJetAugmenterAlgCfg(inputFlags, JetCollection=jet, BTagCollection=BTagCollection, Associator=Associator, TrackCollection=tracks) )
79  for dl2 in taggers:
80  result.merge(FlavorTagNNCfg(inputFlags, BTagCollection, TrackCollection=tracks, NNFile=dl2) )
81 
82  return result
83 
84 

◆ str2bool()

def python.BTagESD.str2bool (   v)

Definition at line 85 of file BTagESD.py.

85 def str2bool(v):
86  if v.lower() in ('yes', 'true', 't', 'y', '1'):
87  return True
88  elif v.lower() in ('no', 'false', 'f', 'n', '0'):
89  return False
90  else:
91  raise argparse.ArgumentTypeError('Boolean value expected.')
92 
93 

Variable Documentation

◆ acc

python.BTagESD.acc = MainServicesCfg(cfgFlags)

Definition at line 192 of file BTagESD.py.

◆ args

python.BTagESD.args = parser.parse_args()

Definition at line 175 of file BTagESD.py.

◆ cfgFlags

python.BTagESD.cfgFlags = initConfigFlags()

Definition at line 178 of file BTagESD.py.

◆ default

python.BTagESD.default

Definition at line 171 of file BTagESD.py.

◆ ESDFileName

python.BTagESD.ESDFileName

Definition at line 181 of file BTagESD.py.

◆ f

python.BTagESD.f = open("BTag.pkl","wb")

Definition at line 207 of file BTagESD.py.

◆ False

python.BTagESD.False

Definition at line 173 of file BTagESD.py.

◆ Files

python.BTagESD.Files

Definition at line 179 of file BTagESD.py.

◆ Format

python.BTagESD.Format

Definition at line 193 of file BTagESD.py.

◆ help

python.BTagESD.help

Definition at line 171 of file BTagESD.py.

◆ inputESD

python.BTagESD.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"

Definition at line 167 of file BTagESD.py.

◆ int

python.BTagESD.int

Definition at line 172 of file BTagESD.py.

◆ JetCollection

list python.BTagESD.JetCollection = ['AntiKt4EMTopo', 'AntiKt4EMPFlow']

Definition at line 200 of file BTagESD.py.

◆ NumConcurrentEvents

python.BTagESD.NumConcurrentEvents

Definition at line 189 of file BTagESD.py.

◆ NumThreads

python.BTagESD.NumThreads

Definition at line 184 of file BTagESD.py.

◆ parser

python.BTagESD.parser
Initial value:
1 = argparse.ArgumentParser(prog="BTagConfig: An example configuration module for btagging reconstruction reading an ESD",
2  usage="Call with an input file, pass -n=0 to skip execution, -t 0 for serial or 1 for threaded execution.")

Definition at line 169 of file BTagESD.py.

◆ ShowControlFlow

python.BTagESD.ShowControlFlow

Definition at line 188 of file BTagESD.py.

◆ ShowDataDeps

python.BTagESD.ShowDataDeps

Definition at line 186 of file BTagESD.py.

◆ ShowDataFlow

python.BTagESD.ShowDataFlow

Definition at line 187 of file BTagESD.py.

◆ str

python.BTagESD.str

Definition at line 171 of file BTagESD.py.

◆ str2bool

python.BTagESD.str2bool

Definition at line 173 of file BTagESD.py.

◆ type

python.BTagESD.type

Definition at line 171 of file BTagESD.py.

AddressRemappingSvc
This class provides the interface to the LCG POOL persistency software.
Definition: AddressRemappingSvc.h:41
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.BTagESD.BTagRedoESDCfg
def BTagRedoESDCfg(flags, jet, extraContainers=[])
Definition: BTagESD.py:110
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
python.BTagESD.BTagHLTaggersCfg
def BTagHLTaggersCfg(inputFlags, JetCollection=[])
Definition: BTagESD.py:44
python.BTagESD.RunHighLevelTaggersCfg
def RunHighLevelTaggersCfg(inputFlags, jet, tracks, Associator, taggers)
Definition: BTagESD.py:74
python.BTagESD.registerJetCollectionEL
def registerJetCollectionEL(flags, JetCollection)
Definition: BTagESD.py:124
python.BTagTrackAugmenterAlgConfig.BTagTrackAugmenterAlgCfg
def BTagTrackAugmenterAlgCfg(flags, TrackCollection='InDetTrackParticles', PrimaryVertexCollectionName='PrimaryVertices', prefix=None)
Definition: BTagTrackAugmenterAlgConfig.py:9
ProxyProviderSvc
manages the address providers and add proxies on demand to the store
Definition: ProxyProviderSvc.h:43
python.BTagESD.PrepareStandAloneBTagCfg
def PrepareStandAloneBTagCfg(inputFlags)
Definition: BTagESD.py:94
python.BTagESD.str2bool
def str2bool(v)
Definition: BTagESD.py:85
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
python.BTagJetAugmenterAlgConfig.BTagJetAugmenterAlgCfg
def BTagJetAugmenterAlgCfg(ConfigFlags, BTagCollection, Associator, TrackCollection, doFlipTagger=False)
Definition: BTagJetAugmenterAlgConfig.py:6
python.BTagESD.registerOutputBTaggingContainers
def registerOutputBTaggingContainers(flags, JetCollection, suffix='')
Definition: BTagESD.py:131
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
python.MagFieldServicesConfig.AtlasFieldCacheCondAlgCfg
def AtlasFieldCacheCondAlgCfg(flags, **kwargs)
Definition: MagFieldServicesConfig.py:8
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.FlavorTagNNConfig.FlavorTagNNCfg
def FlavorTagNNCfg(flags, BTaggingCollection, TrackCollection, NNFile, FlipConfig="STANDARD", variableRemapping={})
Definition: FlavorTagNNConfig.py:134
python.BTagESD.RenameInputContainerCfg
def RenameInputContainerCfg(suffix)
Definition: BTagESD.py:12
python.BTagESD.RenameHLTaggerCfg
def RenameHLTaggerCfg(JetCollection, Tagger, suffix)
Definition: BTagESD.py:30