97 def makeAlgs (self, config) :
99 log = logging.getLogger(
'ElectronCalibrationConfig')
101 if self.forceFullSimConfig:
102 log.warning(
"You are running ElectronCalibrationConfig forcing full sim config")
103 log.warning(
" This is only intended to be used for testing purposes")
105 if config.isPhyslite() :
106 config.setSourceName (self.containerName,
"AnalysisElectrons")
108 config.setSourceName (self.containerName,
"Electrons")
111 if config.wantCopy (self.containerName) :
112 alg = config.createAlgorithm(
'CP::AsgShallowCopyAlg',
'ElectronShallowCopyAlg' + self.postfix )
113 alg.input = config.readName (self.containerName)
114 alg.output = config.copyName (self.containerName)
118 alg = config.createAlgorithm(
'CP::AsgSelectionAlg',
'ElectronEtaCutAlg' + self.postfix )
119 alg.selectionDecoration =
'selectEta' + self.postfix +
',as_bits'
120 config.addPrivateTool(
'selectionTool',
'CP::AsgPtEtaSelectionTool' )
121 alg.selectionTool.maxEta = 2.47
123 alg.selectionTool.etaGapLow = 1.37
124 alg.selectionTool.etaGapHigh = 1.52
125 alg.selectionTool.useClusterEta =
True
126 alg.particles = config.readName (self.containerName)
127 alg.preselection = config.getPreselection (self.containerName,
'')
128 config.addSelection (self.containerName,
'', alg.selectionDecoration)
131 alg = config.createAlgorithm(
'CP::AsgSelectionAlg',
'ElectronObjectQualityAlg' + self.postfix )
132 alg.selectionDecoration =
'goodOQ' + self.postfix +
',as_bits'
133 config.addPrivateTool(
'selectionTool',
'CP::EgammaIsGoodOQSelectionTool' )
134 alg.selectionTool.Mask = xAOD.EgammaParameters.BADCLUSELECTRON
135 alg.particles = config.readName (self.containerName)
136 alg.preselection = config.getPreselection (self.containerName,
'')
137 config.addSelection (self.containerName,
'', alg.selectionDecoration)
139 if not self.splitCalibrationAndSmearing :
141 alg = self.makeCalibrationAndSmearingAlg (config,
'ElectronCalibrationAndSmearingAlg')
142 if config.isPhyslite()
and not self.recalibratePhyslite :
143 alg.skipNominal =
True
162 alg = self.makeCalibrationAndSmearingAlg (config,
'ElectronBaseCalibrationAlg')
164 alg.noToolSystematics =
True
166 alg.calibrationAndSmearingTool.doSmearing =
False
169 alg = self.makeCalibrationAndSmearingAlg (config,
'ElectronCalibrationSystematicsAlg')
171 alg.calibrationAndSmearingTool.doScaleCorrection =
False
172 alg.calibrationAndSmearingTool.useMVACalibration =
False
176 alg = config.createAlgorithm(
'CP::AsgSelectionAlg',
'ElectronPtCutAlg' + self.postfix )
177 alg.selectionDecoration =
'selectPt' + self.postfix +
',as_bits'
178 config.addPrivateTool(
'selectionTool',
'CP::AsgPtEtaSelectionTool' )
179 alg.selectionTool.minPt = self.minPt
180 alg.particles = config.readName (self.containerName)
181 alg.preselection = config.getPreselection (self.containerName,
'')
182 config.addSelection (self.containerName,
'', alg.selectionDecoration,
186 if self.isolationCorrection:
187 alg = config.createAlgorithm(
'CP::EgammaIsolationCorrectionAlg',
188 'ElectronIsolationCorrectionAlg' + self.postfix )
189 config.addPrivateTool(
'isolationCorrectionTool',
190 'CP::IsolationCorrectionTool' )
191 alg.isolationCorrectionTool.IsMC = config.dataType()
is not DataType.Data
192 alg.isolationCorrectionTool.AFII_corr = (
193 0
if self.forceFullSimConfig
194 else config.dataType()
is DataType.FastSim)
195 alg.egammas = config.readName (self.containerName)
196 alg.egammasOut = config.copyName (self.containerName)
197 alg.preselection = config.getPreselection (self.containerName,
'')
200 alg = config.createAlgorithm(
'CP::AsgEnergyDecoratorAlg',
'EnergyDecorator' + self.containerName + self.postfix )
201 alg.particles = config.readName(self.containerName)
203 config.addOutputVar (self.containerName,
'pt',
'pt')
204 config.addOutputVar (self.containerName,
'eta',
'eta', noSys=
True)
205 config.addOutputVar (self.containerName,
'phi',
'phi', noSys=
True)
206 config.addOutputVar (self.containerName,
'e_%SYS%',
'e')
207 config.addOutputVar (self.containerName,
'charge',
'charge', noSys=
True)