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 self.addOption ('muonContainerName', '', type=str,
23 noneAction='error',
24 info="the name of the input muon container.")
25 self.addOption ('jetPreselection', "", type=str,
26 info="the jet preselection.")
27 self.addOption ('muonPreselection', "", type=str,
28 info="the muon preselection.")
29 self.addOption ('doPtCorr', True, type=bool,
30 info=r"whether to run the b-jet $p_\mathrm{T}$ correction on top of the muon-in-jet one.")
31 self.addOption ('onlyDecorate', False, type=bool,
32 info="whether to only decorate jets with the updated 4-vector.")
33 self.addOption ('changeAngularComponents', False, type=bool,
34 info="whether to change the angular components of the jet 4-vector when applying the muon-in-jet correction."
35 " This is not recommended, as it can cause unexpected downstream issues as eta/phi is usually not systematically varied.",
36 expertMode=True)
37

Member Function Documentation

◆ instanceName()

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

Definition at line 38 of file BJetCalibAnalysisConfig.py.

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

◆ makeAlgs()

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

Definition at line 42 of file BJetCalibAnalysisConfig.py.

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

Member Data Documentation

◆ doPtCorr

python.BJetCalibAnalysisConfig.BJetCalibAnalysisConfig.doPtCorr

Definition at line 77 of file BJetCalibAnalysisConfig.py.

◆ onlyDecorate

python.BJetCalibAnalysisConfig.BJetCalibAnalysisConfig.onlyDecorate

Definition at line 81 of file BJetCalibAnalysisConfig.py.


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