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

Public Member Functions

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

Public Attributes

 doPtCorr
 onlyDecorate

Detailed Description

the ConfigBlock for the b-jet calibration sequence

Definition at line 8 of file BJetCalibAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.BJetCalibAnalysisConfig.BJetCalibAnalysisConfig.__init__ ( self)

Definition at line 11 of file BJetCalibAnalysisConfig.py.

11 def __init__ (self) :
12 super (BJetCalibAnalysisConfig, self).__init__ ()
13 self.setBlockName('BJetCalib')
14 self.addDependency('FTag', required=False)
15 self.addDependency('Muons', required=True)
16 self.addDependency('MuonsWorkingPoint', required=False)
17 self.addDependency('FTagJetSF', required=False)
18 self.addDependency('JvtWorkingPointEfficiencyConfig', required=False)
19 self.addOption ('containerName', '', type=str,
20 noneAction='error',
21 info="the name of the input jet container.",
22 meta={'role':'containerRef'})
23 self.addOption ('muonContainerName', '', type=str,
24 noneAction='error',
25 info="the name of the input muon container.",
26 meta={'role':'containerRef'})
27 self.addOption ('jetPreselection', "", type=str,
28 info="the jet preselection.",
29 meta={'role':'selection'})
30 self.addOption ('muonPreselection', "", type=str,
31 info="the muon preselection.",
32 meta={'role':'selection'})
33 self.addOption ('doPtCorr', True, type=bool,
34 info=r"whether to run the b-jet $p_\mathrm{T}$ correction on top of the muon-in-jet one.")
35 self.addOption ('onlyDecorate', False, type=bool,
36 info="whether to only decorate jets with the updated 4-vector.")
37 self.addOption ('changeAngularComponents', False, type=bool,
38 info="whether to change the angular components of the jet 4-vector when applying the muon-in-jet correction."
39 " This is not recommended, as it can cause unexpected downstream issues as eta/phi is usually not systematically varied.",
40 expertMode=True)
41

Member Function Documentation

◆ instanceName()

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

Definition at line 42 of file BJetCalibAnalysisConfig.py.

42 def instanceName (self) :
43 """Return the instance name for this block"""
44 return self.containerName
45

◆ makeAlgs()

python.BJetCalibAnalysisConfig.BJetCalibAnalysisConfig.makeAlgs ( self,
config )

Definition at line 46 of file BJetCalibAnalysisConfig.py.

46 def makeAlgs(self, config):
47
48 if not self.onlyDecorate and self.changeAngularComponents and not config.noSystematics():
49 raise ValueError("BJetCalibAnalysisConfig: changeAngularComponents=True is not compatible with systematics. Please set changeAngularComponents=False or run without systematics.")
50
51 # Set up kinematic selection for which ftag selection should be used downstream
52 jetPreselection = config.getFullSelection(self.containerName, self.jetPreselection)
53 if jetPreselection:
54 alg = config.createAlgorithm('CP::AsgSelectionAlg',
55 'FtagPTEtaCutAlg')
56 alg.selectionDecoration = 'selectPtEtaFtag'
57 config.addPrivateTool('selectionTool', 'CP::AsgPtEtaSelectionTool')
58 alg.selectionTool.maxEta = 2.5
59 alg.selectionTool.minPt = 20. * Units.GeV
60 alg.particles = config.readName(self.containerName)
61 alg.preselection = config.getPreselection(self.containerName, '')
62 jetPreselection = "selectPtEtaFtag&&"+jetPreselection
63
64 alg = config.createAlgorithm('CP::BJetCalibrationAlg',
65 'BJetCalibAlg')
66 alg.muons = config.readName(self.muonContainerName)
67 alg.muonPreselection = config.getPreselection(self.muonContainerName,
68 self.muonPreselection)
69 alg.jets = config.readName(self.containerName)
70 alg.jetPreselection = jetPreselection
71 alg.jetsOut = config.copyName(self.containerName)
72
73 alg.onlyDecorate = self.onlyDecorate
74
75 config.addPrivateTool('muonInJetTool', 'MuonInJetCorrectionTool')
76 alg.muonInJetTool.changeAngularComponents = self.changeAngularComponents
77 # Adjust dR matching for large-R jets
78 if "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets" in alg.jets:
79 alg.muonInJetTool.doLargeR = True
80
81 if self.doPtCorr:
82 config.addPrivateTool('bJetTool', 'BJetCorrectionTool')
83
84 # (re-)decorate jets with the updated energy
85 if not self.onlyDecorate:
86 alg = config.createAlgorithm( 'CP::AsgEnergyDecoratorAlg', 'EnergyDecoratorBJetCalib' )
87 alg.particles = config.readName (self.containerName)

Member Data Documentation

◆ doPtCorr

python.BJetCalibAnalysisConfig.BJetCalibAnalysisConfig.doPtCorr

Definition at line 81 of file BJetCalibAnalysisConfig.py.

◆ onlyDecorate

python.BJetCalibAnalysisConfig.BJetCalibAnalysisConfig.onlyDecorate

Definition at line 85 of file BJetCalibAnalysisConfig.py.


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