ATLAS Offline Software
Functions | Variables
python.ThinInDetClustersConfig Namespace Reference

Functions

def ThinInDetClustersCfg (flags, name="ThinInDetClustersAlg", **kwargs)
 

Variables

string __doc__
 
 flags = initConfigFlags()
 
 Files
 
 writeExtendedSi_PRDInfo
 
 writeExtendedTRT_PRDInfo
 
 thinPixelClustersOnTrack
 
 thinSCTClustersOnTrack
 
 thinTRTClustersOnTrack
 
 doWriteAOD
 
 acc = MainServicesCfg(flags)
 
 mlog = logging.getLogger("ThinInDetClustersConfigTest")
 
 nestLevel
 
 printDefaults
 

Function Documentation

◆ ThinInDetClustersCfg()

def python.ThinInDetClustersConfig.ThinInDetClustersCfg (   flags,
  name = "ThinInDetClustersAlg",
**  kwargs 
)

Definition at line 13 of file ThinInDetClustersConfig.py.

13 def ThinInDetClustersCfg(flags, name="ThinInDetClustersAlg", **kwargs):
14  mlog = logging.getLogger(name)
15  mlog.info("Starting InDetTrackParticle Cluster Thinning configuration")
16  acc = ComponentAccumulator()
17 
18  kwargs.setdefault("StreamName", "StreamAOD")
19 
20  if not flags.Detector.EnablePixel:
21  kwargs.setdefault("InDetTrackStatesPixKey", "")
22  kwargs.setdefault("InDetTrackMeasurementsPixKey", "")
23  if not flags.Detector.EnableSCT:
24  kwargs.setdefault("InDetTrackStatesSctKey", "")
25  kwargs.setdefault("InDetTrackMeasurementsSctKey", "")
26  if not flags.Detector.EnableTRT:
27  kwargs.setdefault("InDetTrackStatesTrtKey", "")
28  kwargs.setdefault("InDetTrackMeasurementsTrtKey", "")
29 
30  if not flags.Tracking.thinPixelClustersOnTrack:
31  kwargs.setdefault("ThinPixelHitsOnTrack", False)
32  if not flags.Tracking.thinSCTClustersOnTrack:
33  kwargs.setdefault("ThinSCTHitsOnTrack", False)
34  if not flags.Tracking.thinTRTClustersOnTrack:
35  kwargs.setdefault("ThinTRTHitsOnTrack", False)
36 
37  kwargs.setdefault("InDetTrackParticlesKey", "InDetTrackParticles")
38  kwargs.setdefault("SelectionString", "InDetTrackParticles.pt>10*GeV")
39 
40 
43 
44  if flags.Tracking.thinPixelClustersOnTrack and not flags.Tracking.writeExtendedSi_PRDInfo:
45  msg = "Requested to thin pixel hits on track, but flags.Tracking.writeExtendedSi_PRDInfo is set to false, so the relevant containers will not be written to the AOD. Cannot add ThinInDetClustersAlg."
46  mlog.error( msg )
47  raise RuntimeError( msg )
48 
49  if flags.Tracking.thinSCTClustersOnTrack and not flags.Tracking.writeExtendedSi_PRDInfo:
50  msg = "Requested to thin SCT hits on track, but flags.Tracking.writeExtendedSi_PRDInfo is set to false, so the relevant containers will not be written to the AOD. Cannot add ThinInDetClustersAlg."
51  mlog.error( msg )
52  raise RuntimeError( msg )
53 
54  if flags.Tracking.thinTRTClustersOnTrack and not flags.Tracking.writeExtendedTRT_PRDInfo:
55  msg = "Requested to thin TRT hits on track, but flags.Tracking.writeExtendedTRT_PRDInfo is set to false, so the relevant containers will not be written to the AOD. Cannot add ThinInDetClustersAlg."
56  mlog.error( msg )
57  raise RuntimeError( msg )
58 
59  nTrackContainers = len(flags.Tracking.thinInDetClustersTrackContainers)
60  nSelectionStrings = len(flags.Tracking.thinInDetClustersSelectionStrings)
61  nPixelMSOSContainers = len(flags.Tracking.thinInDetClustersPixelMSOSContainers)
62  nSCTMSOSContainers = len(flags.Tracking.thinInDetClustersSCTMSOSContainers)
63  nTRTMSOSContainers = len(flags.Tracking.thinInDetClustersTRTMSOSContainers)
64 
65  if not nTrackContainers == nSelectionStrings:
66  msg = f"Number of selection strings ({nSelectionStrings}) does not match number of track containers ({nTrackContainers}). Cannot add ThinInDetClustersAlg."
67  mlog.error( msg )
68  raise RuntimeError( msg )
69 
70  if flags.Tracking.thinPixelClustersOnTrack:
71  if not nTrackContainers == nPixelMSOSContainers:
72  msg = f"Number of pixel MSOS containers ({nPixelMSOSContainers}) does not match number of track containers ({nTrackContainers}). Cannot add ThinInDetClustersAlg."
73  mlog.error( msg )
74  raise RuntimeError( msg )
75 
76  if flags.Tracking.thinSCTClustersOnTrack:
77  if not nTrackContainers == nSCTMSOSContainers:
78  msg = f"Number of SCT MSOS containers ({nSCTMSOSContainers}) does not match number of track containers ({nTrackContainers}). Cannot add ThinInDetClustersAlg."
79  mlog.error( msg )
80  raise RuntimeError( msg )
81 
82  if flags.Tracking.thinTRTClustersOnTrack:
83  if not nTrackContainers == nTRTMSOSContainers:
84  msg = f"Number of TRT MSOS containers ({nTRTMSOSContainers}) does not match number of track containers ({nTrackContainers}). Cannot add ThinInDetClustersAlg."
85  mlog.error( msg )
86  raise RuntimeError( msg )
87 
88  for idx,trackContainer in enumerate(flags.Tracking.thinInDetClustersTrackContainers):
89  selectionString = flags.Tracking.thinInDetClustersSelectionStrings[idx]
90  if trackContainer not in selectionString:
91  mlog.warning(f"Track container {trackContainer} is not used in the associated selection string: {selectionString}.")
92 
93 
96 
97  for idx,trackContainer in enumerate(flags.Tracking.thinInDetClustersTrackContainers):
98  kwargs["InDetTrackParticlesKey"]= trackContainer
99  kwargs["SelectionString"] = flags.Tracking.thinInDetClustersSelectionStrings[idx]
100 
101  # TODO: Test selection strings for seeds and candidates
102  # Change selections without keyword-based argument without changing code (flags)
103 
104  # Thin hits on track from requested detector technologies
105  if flags.Tracking.thinPixelClustersOnTrack:
106  kwargs["ThinPixelHitsOnTrack"] = True
107  kwargs["InDetTrackStatesPixKey"] = flags.Tracking.thinInDetClustersPixelMSOSContainers[idx]
108  kwargs["InDetTrackMeasurementsPixKey"] = "PixelClusters"
109  if flags.Tracking.thinSCTClustersOnTrack:
110  kwargs["ThinSCTHitsOnTrack"] = True
111  kwargs["InDetTrackStatesSctKey"] = flags.Tracking.thinInDetClustersSCTMSOSContainers[idx]
112  kwargs["InDetTrackMeasurementsSctKey"] = "SCT_Clusters"
113  if flags.Tracking.thinTRTClustersOnTrack:
114  kwargs["ThinTRTHitsOnTrack"] = True
115  kwargs["InDetTrackStatesTrtKey"] = flags.Tracking.thinInDetClustersTRTMSOSContainers[idx]
116  kwargs["InDetTrackMeasurementsTrtKey"] = "TRT_DriftCircles"
117 
118  acc.addEventAlgo(CompFactory.ThinInDetClustersAlg(name+"_"+trackContainer, **kwargs))
119 
120  return acc
121 
122 

Variable Documentation

◆ __doc__

string python.ThinInDetClustersConfig.__doc__
private
Initial value:
1 = """
2  Instantiate the InDetTrackParticles Cluster Thinning
3  """

Definition at line 5 of file ThinInDetClustersConfig.py.

◆ acc

python.ThinInDetClustersConfig.acc = MainServicesCfg(flags)

Definition at line 137 of file ThinInDetClustersConfig.py.

◆ doWriteAOD

python.ThinInDetClustersConfig.doWriteAOD

Definition at line 135 of file ThinInDetClustersConfig.py.

◆ Files

python.ThinInDetClustersConfig.Files

Definition at line 129 of file ThinInDetClustersConfig.py.

◆ flags

python.ThinInDetClustersConfig.flags = initConfigFlags()

Definition at line 128 of file ThinInDetClustersConfig.py.

◆ mlog

python.ThinInDetClustersConfig.mlog = logging.getLogger("ThinInDetClustersConfigTest")

Definition at line 139 of file ThinInDetClustersConfig.py.

◆ nestLevel

python.ThinInDetClustersConfig.nestLevel

Definition at line 143 of file ThinInDetClustersConfig.py.

◆ printDefaults

python.ThinInDetClustersConfig.printDefaults

Definition at line 144 of file ThinInDetClustersConfig.py.

◆ thinPixelClustersOnTrack

python.ThinInDetClustersConfig.thinPixelClustersOnTrack

Definition at line 132 of file ThinInDetClustersConfig.py.

◆ thinSCTClustersOnTrack

python.ThinInDetClustersConfig.thinSCTClustersOnTrack

Definition at line 133 of file ThinInDetClustersConfig.py.

◆ thinTRTClustersOnTrack

python.ThinInDetClustersConfig.thinTRTClustersOnTrack

Definition at line 134 of file ThinInDetClustersConfig.py.

◆ writeExtendedSi_PRDInfo

python.ThinInDetClustersConfig.writeExtendedSi_PRDInfo

Definition at line 130 of file ThinInDetClustersConfig.py.

◆ writeExtendedTRT_PRDInfo

python.ThinInDetClustersConfig.writeExtendedTRT_PRDInfo

Definition at line 131 of file ThinInDetClustersConfig.py.

python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.ThinInDetClustersConfig.ThinInDetClustersCfg
def ThinInDetClustersCfg(flags, name="ThinInDetClustersAlg", **kwargs)
Definition: ThinInDetClustersConfig.py:13