ATLAS Offline Software
Loading...
Searching...
No Matches
python.PhysCommonThinningConfig Namespace Reference

Functions

 PhysCommonThinningCfg (flags, StreamName="StreamDAOD_PHYS", **kwargs)

Function Documentation

◆ PhysCommonThinningCfg()

python.PhysCommonThinningConfig.PhysCommonThinningCfg ( flags,
StreamName = "StreamDAOD_PHYS",
** kwargs )
Configure the common augmentation

Definition at line 9 of file PhysCommonThinningConfig.py.

9def PhysCommonThinningCfg(flags, StreamName = "StreamDAOD_PHYS", **kwargs):
10 """Configure the common augmentation"""
11 acc = ComponentAccumulator()
12
13 # Thinning tools...
14 from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningPHYSCfg, MuonTrackParticleThinningCfg, DiTauTrackParticleThinningCfg
15 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg
16 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import CaloClusterThinningCfg
17 from DerivationFrameworkTau.TauCommonConfig import TauThinningCfg
18
19 # Inner detector group recommendations for indet tracks in analysis
20 # https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations
21 if "TrackParticleThinningToolName" in kwargs:
22 acc.merge(TrackParticleThinningPHYSCfg(
23 flags,
24 name = kwargs['TrackParticleThinningToolName'],
25 StreamName = StreamName,
26 Z0SGEntryName = "DFCommonInDetTrackZ0AtPV",
27 InDetTrackParticlesKey = "InDetTrackParticles"))
28
29 # Include inner detector tracks associated with muons
30 if "MuonTPThinningToolName" in kwargs:
31 acc.merge(MuonTrackParticleThinningCfg(
32 flags,
33 name = kwargs['MuonTPThinningToolName'],
34 StreamName = StreamName,
35 MuonKey = "Muons",
36 InDetTrackParticlesKey = "InDetTrackParticles"))
37
38 # Tau-related containers: taus, tau tracks and associated ID tracks, neutral PFOs, secondary vertices
39 if "TauJetThinningToolName" in kwargs:
40 if "PHYSLITE" in StreamName:
41 tau_thinning_expression = f"TauJets.pt >= {flags.Tau.MinPtLITE} && (TauJets.nTracks == 1 || TauJets.nTracks == 3) && abs(TauJets.charge) == 1"
42 else:
43 tau_thinning_expression = f"TauJets.pt >= {flags.Tau.MinPtDAOD} && TauJets.nTracks <= {flags.Tau.MaxTracksDAOD}"
44
45 acc.merge(TauThinningCfg(flags,
46 name = kwargs['TauJetThinningToolName'],
47 StreamName = StreamName,
48 Taus = "TauJets",
49 TauTracks = "TauTracks",
50 TrackParticles = "InDetTrackParticles",
51 TauNeutralPFOs = "TauNeutralParticleFlowObjects",
52 TauSecondaryVertices = "TauSecondaryVertices",
53 SelectionString = tau_thinning_expression))
54
55 if "TauJets_MuonRMThinningToolName" in kwargs:
56 tau_murm_thinning_expression = tau_thinning_expression.replace('TauJets', 'TauJets_MuonRM')
57 acc.merge(TauThinningCfg(flags,
58 name = kwargs['TauJets_MuonRMThinningToolName'],
59 StreamName = StreamName,
60 Taus = "TauJets_MuonRM",
61 TauTracks = "TauTracks_MuonRM",
62 TrackParticles = "InDetTrackParticles",
63 TauNeutralPFOs = "TauNeutralParticleFlowObjects_MuonRM",
64 TauSecondaryVertices = "TauSecondaryVertices_MuonRM",
65 SelectionString = tau_murm_thinning_expression))
66
67 if "TauJets_EleRMThinningToolName" in kwargs:
68 tau_erm_thinning_expression = tau_thinning_expression.replace('TauJets', 'TauJets_EleRM')
69 acc.merge(TauThinningCfg(flags,
70 name = kwargs['TauJets_EleRMThinningToolName'],
71 StreamName = StreamName,
72 Taus = "TauJets_EleRM",
73 TauTracks = "TauTracks_EleRM",
74 TrackParticles = "InDetTrackParticles",
75 TauNeutralPFOs = "TauNeutralParticleFlowObjects_EleRM",
76 TauSecondaryVertices = "TauSecondaryVertices_EleRM",
77 SelectionString = tau_erm_thinning_expression))
78
79 # di-tau thinning
80 if "DiTauThinningToolName" in kwargs:
81 acc.merge(GenericObjectThinningCfg(
82 flags,
83 name = kwargs['DiTauThinningToolName'],
84 StreamName = StreamName,
85 ContainerName = "DiTauJets",
86 SelectionString = "DiTauJets.nSubjets > 1 && abs(DiTauJets.charge) < 3"))
87
88 # ID tracks associated with high-pt di-tau
89 if "DiTauTPThinningToolName" in kwargs:
90 acc.merge(DiTauTrackParticleThinningCfg(
91 flags,
92 name = kwargs['DiTauTPThinningToolName'],
93 StreamName = StreamName,
94 DiTauKey = "DiTauJets",
95 InDetTrackParticlesKey = "InDetTrackParticles",
96 SelectionString = "DiTauJets.nSubjets > 1 && abs(DiTauJets.charge) < 3"))
97
98
99 if "DiTauLowPtThinningToolName" in kwargs:
100 acc.merge(GenericObjectThinningCfg(
101 flags,
102 name = kwargs['DiTauLowPtThinningToolName'],
103 StreamName = StreamName,
104 ContainerName = "DiTauJetsLowPt",
105 SelectionString = "DiTauJetsLowPt.nSubjets > 1 && (DiTauJetsLowPt.charge == 0 || abs(DiTauJetsLowPt.charge) == 2)"))
106
107 # ID tracks associated with low-pt ditau
108 if "DiTauLowPtTPThinningToolName" in kwargs:
109 acc.merge(DiTauTrackParticleThinningCfg(
110 flags,
111 name = kwargs['DiTauLowPtTPThinningToolName'],
112 StreamName = StreamName,
113 DiTauKey = "DiTauJetsLowPt",
114 InDetTrackParticlesKey = "InDetTrackParticles",
115 SelectionString = "DiTauJetsLowPt.nSubjets > 1 && (DiTauJetsLowPt.charge == 0 || abs(DiTauJetsLowPt.charge) == 2)"))
116
117 # keep calo clusters around electrons
118 if "ElectronCaloClusterThinningToolName" in kwargs:
119 acc.merge(CaloClusterThinningCfg(
120 flags,
121 name = kwargs['ElectronCaloClusterThinningToolName'],
122 StreamName = StreamName,
123 SGKey = "AnalysisElectrons",
124 CaloClCollectionSGKey = "egammaClusters",
125 ConeSize = -1.0))
126
127 # keep calo clusters around photons
128 if "PhotonCaloClusterThinningToolName" in kwargs:
129 acc.merge(CaloClusterThinningCfg(
130 flags,
131 name = kwargs['PhotonCaloClusterThinningToolName'],
132 StreamName = StreamName,
133 SGKey = "AnalysisPhotons",
134 CaloClCollectionSGKey = "egammaClusters",
135 ConeSize=-1.0))
136
137 # GSF tracks associated to electrons
138 if "ElectronGSFTPThinningToolName" in kwargs:
139 ElectronGSFTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
140 name = kwargs['ElectronGSFTPThinningToolName'],
141 StreamName = StreamName,
142 SGKey = "AnalysisElectrons",
143 GSFTrackParticlesKey = "GSFTrackParticles",
144 InDetTrackParticlesKey = "",
145 BestMatchOnly = True)
146 acc.addPublicTool(ElectronGSFTPThinningTool)
147
148 # GSF tracks associated to photons
149 if "PhotonGSFTPThinningToolName" in kwargs:
150 PhotonGSFTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
151 name = kwargs['PhotonGSFTPThinningToolName'],
152 StreamName = StreamName,
153 SGKey = "AnalysisPhotons",
154 GSFTrackParticlesKey = "GSFTrackParticles",
155 GSFConversionVerticesKey = "GSFConversionVertices",
156 InDetTrackParticlesKey = "",
157 BestMatchOnly = True,
158 BestVtxMatchOnly = True)
159 acc.addPublicTool(PhotonGSFTPThinningTool)
160
161 return acc
162