ATLAS Offline Software
Loading...
Searching...
No Matches
python.JetAnalysisConfig.PreJetAnalysisConfig Class Reference
Inheritance diagram for python.JetAnalysisConfig.PreJetAnalysisConfig:
Collaboration diagram for python.JetAnalysisConfig.PreJetAnalysisConfig:

Public Member Functions

 __init__ (self)
 instanceName (self)
 makeAlgs (self, config)

Public Attributes

str jetCollection = 'AntiKt4EMPFlowJets' :
 containerName

Detailed Description

the ConfigBlock for the common preprocessing of jet sequences

Definition at line 79 of file JetAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.JetAnalysisConfig.PreJetAnalysisConfig.__init__ ( self)

Definition at line 82 of file JetAnalysisConfig.py.

82 def __init__ (self) :
83 super().__init__()
84 self.addOption ('containerName', '', type=str,
85 noneAction='error',
86 info="the name of the output container after calibration.",
87 meta={'role':'container'})
88 self.addOption ('jetCollection', '', type=str,
89 noneAction='error',
90 info="the jet container to run on. It is interpreted to determine "
91 "the correct config blocks to call for small- or large-R jets.")
92 self.addOption('outputTruthLabelIDs', False, type=bool,
93 info='enable or disable `HadronConeExclTruthLabelID` and `PartonTruthLabelID` decorations.')
94 self.addOption ('runOriginalObjectLink', False, type=bool,
95 info='sets up an instance of `CP::AsgOriginalObjectLinkAlg` to link systematically-varied containers to the base one.')
96 self.addOption ('runGhostMuonAssociation', None, type=bool,
97 info="whether to set up the jet-ghost-muon association algorithm "
98 "`CP::JetGhostMuonAssociationAlg`. If left empty, automatically defaults to `False` for PHYSLITE and `True` otherwise.")
99 self.addOption ('runTruthJetTagging', True, type=bool,
100 info="whether to set up the jet truth tagging algorithm "
101 "`CP::JetTruthTagAlg`.")
102

Member Function Documentation

◆ instanceName()

python.JetAnalysisConfig.PreJetAnalysisConfig.instanceName ( self)
Return the instance name for this block

Definition at line 103 of file JetAnalysisConfig.py.

103 def instanceName (self) :
104 """Return the instance name for this block"""
105 return self.containerName
106

◆ makeAlgs()

python.JetAnalysisConfig.PreJetAnalysisConfig.makeAlgs ( self,
config )

Definition at line 107 of file JetAnalysisConfig.py.

107 def makeAlgs (self, config) :
108
109
110 if config.isPhyslite() and self.jetCollection == 'AntiKt4EMPFlowJets' :
111 config.setSourceName (self.containerName, "AnalysisJets", originalName = self.jetCollection)
112 elif config.isPhyslite() and self.jetCollection == 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets' :
113 config.setSourceName (self.containerName, "AnalysisLargeRJets", originalName = self.jetCollection)
114 else :
115 config.setSourceName (self.containerName, self.jetCollection, originalName = self.jetCollection)
116
117 # Parse and store jet collection metadata for downstream blocks
118 radius, jetInput, trim, hasBTag = _parseJetCollection(self.jetCollection)
119 config.setContainerMeta(self.containerName, 'jetRadius', radius)
120 config.setContainerMeta(self.containerName, 'jetInput', jetInput)
121 config.setContainerMeta(self.containerName, 'jetTrim', trim)
122 config.setContainerMeta(self.containerName, 'hasBTag', hasBTag)
123 config.setContainerMeta(self.containerName, 'jetCollectionName',
124 _resolveJetCollectionName(self.jetCollection))
125
126 # Relink original jets in case of b-tagging calibration
127 if self.runOriginalObjectLink or hasBTag :
128 alg = config.createAlgorithm( 'CP::AsgOriginalObjectLinkAlg',
129 'JetOriginalObjectLinkAlg',
130 reentrant=True )
131 alg.baseContainerName = self.jetCollection
132 alg.particles = config.readName (self.containerName)
133 if config.wantCopy (self.containerName) :
134 alg.particlesOut = config.copyName (self.containerName)
135 alg.preselection = config.getPreselection (self.containerName, '')
136
137 # Set up the jet ghost muon association algorithm:
138 if (self.runGhostMuonAssociation is None and not config.isPhyslite()) or \
139 (self.runGhostMuonAssociation is True):
140 alg = config.createAlgorithm( 'CP::JetGhostMuonAssociationAlg',
141 'JetGhostMuonAssociationAlg' )
142 alg.jets = config.readName (self.containerName)
143 if config.isPhyslite():
144 alg.muons = "AnalysisMuons"
145 if config.wantCopy (self.containerName) :
146 alg.jetsOut = config.copyName (self.containerName)
147 taggerName = "GN2HLv01" if config.geometry() >= LHCPeriod.Run4 else "GN2v01"
148 extraInputs = [
149 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.DFCommonJets_jetClean_LooseBad"),
150 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.DFCommonJets_jetClean_TightBad"),
151 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.{taggerName}_pb"),
152 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.{taggerName}_pc"),
153 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.{taggerName}_ptau"),
154 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.{taggerName}_pu")]
155 config.setExtraInputs (extraInputs)
156
157 if self.runTruthJetTagging and config.dataType() is not DataType.Data:
158 # Decorate jets with isHS labels (required to retrieve Jvt SFs)
159 alg = config.createAlgorithm( 'CP::JetDecoratorAlg', 'JetPileupLabelAlg' )
160 config.addPrivateTool( 'decorator', 'JetPileupLabelingTool' )
161 alg.jets = config.readName (self.containerName)
162 alg.jetsOut = config.copyName (self.containerName)
163 alg.decorator.RecoJetContainer = alg.jetsOut.replace ('%SYS%', 'NOSYS')
164 alg.decorator.SuppressOutputDependence=True
165 if self.jetCollection == 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets' :
166 extraInputs = [
167 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.{decoration}")
168 for decoration in _largeRJetFTagDecorations]
169 config.setExtraInputs (extraInputs)
170
171 # Set up shallow copy if needed and not yet done
172 if config.wantCopy (self.containerName) :
173 alg = config.createAlgorithm( 'CP::AsgShallowCopyAlg', 'JetShallowCopyAlg' )
174 alg.input = config.readName (self.containerName)
175 alg.output = config.copyName (self.containerName)
176 alg.outputType = 'xAOD::JetContainer'
177 if self.jetCollection == 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets' :
178 alg.declareDecorations = _largeRJetFTagDecorations
179
180 config.addOutputVar (self.containerName, 'pt', 'pt', auxType="float")
181 config.addOutputVar (self.containerName, 'eta', 'eta', noSys=True, auxType="float")
182 config.addOutputVar (self.containerName, 'phi', 'phi', noSys=True, auxType="float")
183 config.addOutputVar (self.containerName, 'charge', 'charge', noSys=True, enabled=False)
184
185
186 if self.outputTruthLabelIDs and config.dataType() is not DataType.Data:
187 config.addOutputVar (self.containerName, 'HadronConeExclTruthLabelID', 'HadronConeExclTruthLabelID', noSys=True, auxType="int")
188 config.addOutputVar (self.containerName, 'PartonTruthLabelID', 'PartonTruthLabelID', noSys=True, auxType="int")
189
190
191

Member Data Documentation

◆ containerName

python.JetAnalysisConfig.PreJetAnalysisConfig.containerName

Definition at line 111 of file JetAnalysisConfig.py.

◆ jetCollection

python.JetAnalysisConfig.PreJetAnalysisConfig.jetCollection = 'AntiKt4EMPFlowJets' :

Definition at line 110 of file JetAnalysisConfig.py.


The documentation for this class was generated from the following file: