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