ATLAS Offline Software
Functions | Variables
python.NavConverterConfig Namespace Reference

Functions

def NavConverterCfg (flags, chainsList=[], runTheChecker=False)
 

Variables

 log
 
 flags
 
 Files
 
 doEDMVersionConversion
 
 acc
 
 withDetails
 
 True
 
 summariseProps
 

Function Documentation

◆ NavConverterCfg()

def python.NavConverterConfig.NavConverterCfg (   flags,
  chainsList = [],
  runTheChecker = False 
)
Configures Run 1/2 to Run 3 navigation conversion algorithm for all triggers

Definition at line 12 of file NavConverterConfig.py.

12 def NavConverterCfg(flags, chainsList = [], runTheChecker = False):
13  """Configures Run 1/2 to Run 3 navigation conversion algorithm for all triggers"""
14  if len(chainsList) == 0:
15  log.info("Chains list is empty, the conversion will happen for all chains, but no validation will be performed")
16  log.info("The later is enabled when an explicit chain list is provided")
17 
18  acc = ComponentAccumulator()
19 
20  if flags.Trigger.EDMVersion >= 3:
21  return acc
22 
23  if not flags.Trigger.doEDMVersionConversion:
24  return acc
25 
26  from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg, getRun3NavigationContainerFromInput
27  tdt = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
28 
29  r2ToR3OutputName = getRun3NavigationContainerFromInput(flags)
30 
31  cnvAlg = CompFactory.Run2ToRun3TrigNavConverterV2("TrigRun2ToRun3NavConverter") #, OutputLevel = 2)
32  cnvAlg.TrigDecisionTool = tdt
33  cnvAlg.TrigNavReadKey = ""
34  cnvAlg.TrigConfigSvc = tdt.TrigConfigSvc
35  cnvAlg.OutputNavKey = r2ToR3OutputName
36  from OutputStreamAthenaPool.OutputStreamConfig import addToAOD, addToESD
37  collections = [f"xAOD::TrigCompositeContainer#{r2ToR3OutputName}", f"xAOD::TrigCompositeAuxContainer#{r2ToR3OutputName}Aux."]
38  acc.merge(addToAOD(flags, collections))
39  acc.merge(addToESD(flags, collections))
40 
41  cnvAlg.Rois = ["initialRoI","forID","forID1","forID2","forMS","forSA","forTB","forMT","forCB"]
42 
43  from TrigEDMConfig.TriggerEDM import getTriggerEDMList
44  edm = getTriggerEDMList(flags, "AODCONV")
45 
46  def cleanKey(type, name):
47  return name.replace("HLT_", "", 1).replace(type.replace("::", "__"), "", 1).replace("_", "", 1)
48  types = []
49  for type, keys in edm.items():
50 
51  for key in keys:
52  types.append(type+"#"+cleanKey(type, key))
53 
54  log.info("Assuming these collections are relevant for trigger: %s", " ".join(types))
55  cnvAlg.Collections = types
56  cnvAlg.Chains = chainsList
57  cnvAlg.doCompression = True # set True for compression
58  acc.addEventAlgo(cnvAlg)
59 
60  if runTheChecker:
61  checker = CompFactory.Trig.NavigationTesterAlg(FailOnDifference = False, TrigDecisionTool = tdt) #, OutputLevel = 2)
62  checker.RetrievalToolRun2Nav = CompFactory.Trig.IParticleRetrievalTool()
63 
64  # in conversion job Run2 TDT is setup as default, we need to setup an alternative to access Run 3 format
65  run3tdt = CompFactory.Trig.TrigDecisionTool("Run3TrigDecisionTool",
66  HLTSummary = r2ToR3OutputName,
67  NavigationFormat = 'TrigComposite',
68  AcceptMultipleInstance=True,
69  TrigConfigSvc = tdt.TrigConfigSvc) #, OutputLevel = 2)
70  acc.addPublicTool(run3tdt)
71  checker.RetrievalToolRun3Nav = CompFactory.Trig.R3IParticleRetrievalTool(TrigDecisionTool = run3tdt) #, OutputLevel = 2)
72  checker.Chains = chainsList
73  checker.TrigDecisionToolRun3 = run3tdt
74  checker.TrigDecisionToolRun2 = tdt
75 
76  acc.addEventAlgo(checker)
77 
78  return acc
79 
80 

Variable Documentation

◆ acc

python.NavConverterConfig.acc

Definition at line 90 of file NavConverterConfig.py.

◆ doEDMVersionConversion

python.NavConverterConfig.doEDMVersionConversion

Definition at line 87 of file NavConverterConfig.py.

◆ Files

python.NavConverterConfig.Files

Definition at line 86 of file NavConverterConfig.py.

◆ flags

python.NavConverterConfig.flags

Definition at line 85 of file NavConverterConfig.py.

◆ log

python.NavConverterConfig.log

Definition at line 9 of file NavConverterConfig.py.

◆ summariseProps

python.NavConverterConfig.summariseProps

Definition at line 91 of file NavConverterConfig.py.

◆ True

python.NavConverterConfig.True

Definition at line 91 of file NavConverterConfig.py.

◆ withDetails

python.NavConverterConfig.withDetails

Definition at line 91 of file NavConverterConfig.py.

replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TriggerEDM.getTriggerEDMList
def getTriggerEDMList(flags, key, runVersion=-1)
Definition: TriggerEDM.py:149
python.TrigDecisionToolConfig.getRun3NavigationContainerFromInput
def getRun3NavigationContainerFromInput(flags)
Definition: TrigDecisionToolConfig.py:63
python.OutputStreamConfig.addToESD
def addToESD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:127
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.TriggerInterface.TrigDecisionToolCfg
def TrigDecisionToolCfg(flags)
Definition: TriggerInterface.py:14
python.OutputStreamConfig.addToAOD
def addToAOD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:142
python.NavConverterConfig.NavConverterCfg
def NavConverterCfg(flags, chainsList=[], runTheChecker=False)
Definition: NavConverterConfig.py:12