ATLAS Offline Software
FastTRT_DigitizationConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 from DigitizationConfig.PileUpMergeSvcConfig import PileUpMergeSvcCfg, PileUpXingFolderCfg
7 
8 # The earliest bunch crossing time for which interactions will be sent
9 # to the FastTRT Digitization code.
11  return -50
12 
13 
14 # The latest bunch crossing time for which interactions will be sent
15 # to the FastTRT Digitization code.
17  return 50
18 
19 
20 def FastTRTRangeCfg(flags, name="FastTRTRange", **kwargs):
21  #this is the time of the xing in ns
22  kwargs.setdefault('FirstXing', FastTRT_FirstXing() )
23  kwargs.setdefault('LastXing', FastTRT_LastXing() )
24  kwargs.setdefault('CacheRefreshFrequency', 1.0 ) #default 0 no dataproxy reset
25  kwargs.setdefault('ItemList', ["TRTUncompressedHitCollection#TRTUncompressedHits"] )
26  return PileUpXingFolderCfg(flags, name, **kwargs)
27 
28 
29 def BasicTRTFastDigitizationToolCfg(flags, name, **kwargs):
30  acc = ComponentAccumulator()
31  from IOVDbSvc.IOVDbSvcConfig import addFolders, addFoldersSplitOnline
32  acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/Calib/errors", "/TRT/Calib/errors"))
33  acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Calib/PID_vector", "/TRT/Calib/PID_vector"))
34  acc.merge(addFolders(flags, "TRT_OFL", "/TRT/Calib/ToT/ToTVectors"))
35  acc.merge(addFolders(flags, "TRT_OFL", "/TRT/Calib/ToT/ToTValue"))
36  if flags.Digitization.DoXingByXingPileUp:
37  kwargs.setdefault("FirstXing", FastTRT_FirstXing())
38  kwargs.setdefault("LastXing", FastTRT_LastXing())
39  from RngComps.RngCompsConfig import AthRNGSvcCfg
40  kwargs.setdefault("RndmSvc", acc.getPrimaryAndMerge(AthRNGSvcCfg(flags)).name)
41  kwargs.setdefault("RandomStreamName", "FastTRTDigitization")
42 
43  if "TRT_DriftFunctionTool" not in kwargs:
44  from InDetConfig.TRT_DriftFunctionToolConfig import (
45  TRT_DriftFunctionToolCfg)
46  kwargs.setdefault("TRT_DriftFunctionTool", acc.popToolsAndMerge(
48 
49  tool = CompFactory.TRTFastDigitizationTool(name,**kwargs)
50  acc.setPrivateTools(tool)
51  return acc
52 
53 
54 def TRTFastDigitizationToolCfg(flags, name="TRTFastDigitizationTool",**kwargs):
55  acc = ComponentAccumulator()
56  intervals = []
57  if not flags.Digitization.DoXingByXingPileUp:
58  intervals += [acc.popToolsAndMerge(FastTRTRangeCfg(flags))]
59  kwargs.setdefault("MergeSvc", acc.getPrimaryAndMerge(PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
60  kwargs.setdefault("trtDriftCircleContainer", "TRT_DriftCircles")
61  kwargs.setdefault("trtPrdMultiTruthCollection", "PRD_MultiTruthTRT")
62  kwargs.setdefault("HardScatterSplittingMode", 0)
63  acc.setPrivateTools(BasicTRTFastDigitizationToolCfg(flags, name,**kwargs))
64  return acc
65 
66 
67 def TRTFastDigitizationToolHS(flags, name="TRTFastDigitizationToolHS",**kwargs):
68  acc = ComponentAccumulator()
69  intervals = []
70  if not flags.Digitization.DoXingByXingPileUp:
71  intervals += [acc.popToolsAndMerge(FastTRTRangeCfg(flags))]
72  kwargs.setdefault("MergeSvc", acc.getPrimaryAndMerge(PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
73  kwargs.setdefault("OnlyUseContainerName", True)
74  kwargs.setdefault("trtDriftCircleContainer", "TRT_DriftCircles")
75  kwargs.setdefault("trtPrdMultiTruthCollection", "PRD_MultiTruthTRT")
76  kwargs.setdefault("HardScatterSplittingMode", 1)
77  acc.setPrivateTools(BasicTRTFastDigitizationToolCfg(flags, name,**kwargs))
78  return acc
79 
80 
81 def TRTFastDigitizationToolPU(flags, name="TRTFastDigitizationToolPU",**kwargs):
82  acc = ComponentAccumulator()
83  intervals = []
84  if not flags.Digitization.DoXingByXingPileUp:
85  intervals += [acc.popToolsAndMerge(FastTRTRangeCfg(flags))]
86  kwargs.setdefault("MergeSvc", acc.getPrimaryAndMerge(PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
87  kwargs.setdefault("trtDriftCircleContainer", "TRT_PU_DriftCircles")
88  kwargs.setdefault("trtPrdMultiTruthCollection", "PRD_MultiTruthTRT_PU")
89  kwargs.setdefault("HardScatterSplittingMode", 2)
90  acc.setPrivateTools(BasicTRTFastDigitizationToolCfg(flags, name,**kwargs))
91  return acc
92 
93 
94 def TRTFastDigitizationToolSplitNoMergePU(flags, name="TRTFastDigitizationToolSplitNoMergePU",**kwargs):
95  acc = ComponentAccumulator()
96  intervals = []
97  if not flags.Digitization.DoXingByXingPileUp:
98  intervals += [acc.popToolsAndMerge(FastTRTRangeCfg(flags))]
99  kwargs.setdefault("MergeSvc", acc.getPrimaryAndMerge(PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
100  kwargs.setdefault("trtHitCollectionName", "PileupTRTUncompressedHits")
101  kwargs.setdefault("trtDriftCircleContainer", "TRT_PU_DriftCircles")
102  kwargs.setdefault("trtPrdMultiTruthCollection", "PRD_MultiTruthTRT_PU")
103  kwargs.setdefault("HardScatterSplittingMode", 0)
104  acc.setPrivateTools(BasicTRTFastDigitizationToolCfg(flags, name,**kwargs))
105  return acc
FastTRT_DigitizationConfig.TRTFastDigitizationToolHS
def TRTFastDigitizationToolHS(flags, name="TRTFastDigitizationToolHS", **kwargs)
Definition: FastTRT_DigitizationConfig.py:67
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
FastTRT_DigitizationConfig.TRTFastDigitizationToolSplitNoMergePU
def TRTFastDigitizationToolSplitNoMergePU(flags, name="TRTFastDigitizationToolSplitNoMergePU", **kwargs)
Definition: FastTRT_DigitizationConfig.py:94
FastTRT_DigitizationConfig.FastTRTRangeCfg
def FastTRTRangeCfg(flags, name="FastTRTRange", **kwargs)
Definition: FastTRT_DigitizationConfig.py:20
FastTRT_DigitizationConfig.TRTFastDigitizationToolPU
def TRTFastDigitizationToolPU(flags, name="TRTFastDigitizationToolPU", **kwargs)
Definition: FastTRT_DigitizationConfig.py:81
FastTRT_DigitizationConfig.FastTRT_LastXing
def FastTRT_LastXing()
Definition: FastTRT_DigitizationConfig.py:16
FastTRT_DigitizationConfig.TRTFastDigitizationToolCfg
def TRTFastDigitizationToolCfg(flags, name="TRTFastDigitizationTool", **kwargs)
Definition: FastTRT_DigitizationConfig.py:54
python.TRT_DriftFunctionToolConfig.TRT_DriftFunctionToolCfg
def TRT_DriftFunctionToolCfg(flags, name="InDetTRT_DriftFunctionTool", **kwargs)
Definition: TRT_DriftFunctionToolConfig.py:6
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
python.IOVDbSvcConfig.addFoldersSplitOnline
def addFoldersSplitOnline(flags, detDb, onlineFolders, offlineFolders, className=None, extensible=False, addMCString='_OFL', splitMC=False, tag=None, forceDb=None, modifiers='')
Definition: IOVDbSvcConfig.py:153
python.PileUpMergeSvcConfig.PileUpXingFolderCfg
def PileUpXingFolderCfg(flags, name="PileUpXingFolder", **kwargs)
Definition: PileUpMergeSvcConfig.py:35
python.PileUpMergeSvcConfig.PileUpMergeSvcCfg
def PileUpMergeSvcCfg(flags, name="PileUpMergeSvc", Intervals=[], **kwargs)
Definition: PileUpMergeSvcConfig.py:10
FastTRT_DigitizationConfig.BasicTRTFastDigitizationToolCfg
def BasicTRTFastDigitizationToolCfg(flags, name, **kwargs)
Definition: FastTRT_DigitizationConfig.py:29
FastTRT_DigitizationConfig.FastTRT_FirstXing
def FastTRT_FirstXing()
Definition: FastTRT_DigitizationConfig.py:10
RngCompsConfig.AthRNGSvcCfg
def AthRNGSvcCfg(flags, name="AthRNGSvc")
Definition: RngCompsConfig.py:51