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 74 of file JetAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.JetAnalysisConfig.PreJetAnalysisConfig.__init__ ( self)

Definition at line 77 of file JetAnalysisConfig.py.

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

Member Function Documentation

◆ instanceName()

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

Definition at line 98 of file JetAnalysisConfig.py.

98 def instanceName (self) :
99 """Return the instance name for this block"""
100 return self.containerName
101

◆ makeAlgs()

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

Definition at line 102 of file JetAnalysisConfig.py.

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

Member Data Documentation

◆ containerName

python.JetAnalysisConfig.PreJetAnalysisConfig.containerName

Definition at line 106 of file JetAnalysisConfig.py.

◆ jetCollection

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

Definition at line 105 of file JetAnalysisConfig.py.


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