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
 runOriginalObjectLink

Detailed Description

the ConfigBlock for the common preprocessing of jet sequences

Definition at line 15 of file JetAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.JetAnalysisConfig.PreJetAnalysisConfig.__init__ ( self)

Definition at line 18 of file JetAnalysisConfig.py.

18 def __init__ (self) :
19 super (PreJetAnalysisConfig, self).__init__ ()
20 self.addOption ('containerName', '', type=str,
21 noneAction='error',
22 info="the name of the output container after calibration.")
23 self.addOption ('jetCollection', '', type=str,
24 noneAction='error',
25 info="the jet container to run on. It is interpreted to determine "
26 "the correct config blocks to call for small- or large-R jets.")
27 self.addOption('outputTruthLabelIDs', False, type=bool,
28 info='enable or disable `HadronConeExclTruthLabelID` and `PartonTruthLabelID` decorations.')
29 self.addOption ('runOriginalObjectLink', False, type=bool,
30 info='sets up an instance of `CP::AsgOriginalObjectLinkAlg` to link systematically-varied containers to the base one.')
31 self.addOption ('runGhostMuonAssociation', None, type=bool,
32 info="whether to set up the jet-ghost-muon association algorithm "
33 "`CP::JetGhostMuonAssociationAlg`. If left empty, automatically defaults to `False` for PHYSLITE and `True` otherwise.")
34 self.addOption ('runTruthJetTagging', None, type=bool,
35 info="whether to set up the jet truth tagging algorithm "
36 "`CP::JetTruthTagAlg`.")
37

Member Function Documentation

◆ instanceName()

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

Definition at line 38 of file JetAnalysisConfig.py.

38 def instanceName (self) :
39 """Return the instance name for this block"""
40 return self.containerName
41

◆ makeAlgs()

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

Definition at line 42 of file JetAnalysisConfig.py.

42 def makeAlgs (self, config) :
43
44
45 if config.isPhyslite() and self.jetCollection == 'AntiKt4EMPFlowJets' :
46 config.setSourceName (self.containerName, "AnalysisJets", originalName = self.jetCollection)
47 elif config.isPhyslite() and self.jetCollection == 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets' :
48 config.setSourceName (self.containerName, "AnalysisLargeRJets", originalName = self.jetCollection)
49 else :
50 config.setSourceName (self.containerName, self.jetCollection, originalName = self.jetCollection)
51
52 # Relink original jets in case of b-tagging calibration
53 if self.runOriginalObjectLink :
54 alg = config.createAlgorithm( 'CP::AsgOriginalObjectLinkAlg',
55 'JetOriginalObjectLinkAlg',
56 reentrant=True )
57 alg.baseContainerName = self.jetCollection
58 alg.particles = config.readName (self.containerName)
59 if config.wantCopy (self.containerName) :
60 alg.particlesOut = config.copyName (self.containerName)
61 alg.preselection = config.getPreselection (self.containerName, '')
62
63 # Set up the jet ghost muon association algorithm:
64 if (self.runGhostMuonAssociation is None and not config.isPhyslite()) or \
65 (self.runGhostMuonAssociation is True):
66 alg = config.createAlgorithm( 'CP::JetGhostMuonAssociationAlg',
67 'JetGhostMuonAssociationAlg' )
68 alg.jets = config.readName (self.containerName)
69 if config.isPhyslite():
70 alg.muons = "AnalysisMuons"
71 if config.wantCopy (self.containerName) :
72 alg.jetsOut = config.copyName (self.containerName)
73
74 # NB: I'm assuming that the truth tagging is done in PHYSLITE, if not this will
75 # need to change
76 if (self.runTruthJetTagging or (self.runTruthJetTagging is None)
77 ) and config.dataType() is not DataType.Data:
78 # Decorate jets with isHS labels (required to retrieve Jvt SFs)
79 alg = config.createAlgorithm( 'CP::JetDecoratorAlg', 'JetPileupLabelAlg' )
80 config.addPrivateTool( 'decorator', 'JetPileupLabelingTool' )
81 alg.jets = config.readName (self.containerName)
82 alg.jetsOut = config.copyName (self.containerName)
83 alg.decorator.RecoJetContainer = alg.jetsOut.replace ('%SYS%', 'NOSYS')
84 alg.decorator.SuppressOutputDependence=True
85
86 # Set up shallow copy if needed and not yet done
87 if config.wantCopy (self.containerName) :
88 alg = config.createAlgorithm( 'CP::AsgShallowCopyAlg', 'JetShallowCopyAlg' )
89 alg.input = config.readName (self.containerName)
90 alg.output = config.copyName (self.containerName)
91
92 config.addOutputVar (self.containerName, 'pt', 'pt')
93 config.addOutputVar (self.containerName, 'eta', 'eta', noSys=True)
94 config.addOutputVar (self.containerName, 'phi', 'phi', noSys=True)
95 config.addOutputVar (self.containerName, 'charge', 'charge', noSys=True, enabled=False)
96
97 if self.outputTruthLabelIDs and config.dataType() is not DataType.Data:
98 config.addOutputVar (self.containerName, 'HadronConeExclTruthLabelID', 'HadronConeExclTruthLabelID', noSys=True)
99 config.addOutputVar (self.containerName, 'PartonTruthLabelID', 'PartonTruthLabelID', noSys=True)
100
101
102

Member Data Documentation

◆ containerName

python.JetAnalysisConfig.PreJetAnalysisConfig.containerName

Definition at line 46 of file JetAnalysisConfig.py.

◆ jetCollection

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

Definition at line 45 of file JetAnalysisConfig.py.

◆ runOriginalObjectLink

python.JetAnalysisConfig.PreJetAnalysisConfig.runOriginalObjectLink

Definition at line 53 of file JetAnalysisConfig.py.


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