100 def makeAlgs (self, config) :
102 log = logging.getLogger(
'ElectronCalibrationConfig')
104 if self.forceFullSimConfig:
105 log.warning(
"You are running ElectronCalibrationConfig forcing full sim config")
106 log.warning(
" This is only intended to be used for testing purposes")
108 if config.isPhyslite() :
109 config.setSourceName (self.containerName,
"AnalysisElectrons")
111 config.setSourceName (self.containerName,
"Electrons")
114 if config.wantCopy (self.containerName) :
115 alg = config.createAlgorithm(
'CP::AsgShallowCopyAlg',
'ElectronShallowCopyAlg' + self.postfix )
116 alg.input = config.readName (self.containerName)
117 alg.output = config.copyName (self.containerName)
121 alg = config.createAlgorithm(
'CP::AsgSelectionAlg',
'ElectronEtaCutAlg' + self.postfix )
122 alg.selectionDecoration =
'selectEta' + self.postfix +
',as_bits'
123 config.addPrivateTool(
'selectionTool',
'CP::AsgPtEtaSelectionTool' )
124 alg.selectionTool.maxEta = 2.47
126 alg.selectionTool.etaGapLow = 1.37
127 alg.selectionTool.etaGapHigh = 1.52
128 alg.selectionTool.useClusterEta =
True
129 alg.particles = config.readName (self.containerName)
130 alg.preselection = config.getPreselection (self.containerName,
'')
131 config.addSelection (self.containerName,
'', alg.selectionDecoration)
134 alg = config.createAlgorithm(
'CP::AsgSelectionAlg',
'ElectronObjectQualityAlg' + self.postfix )
135 alg.selectionDecoration =
'goodOQ' + self.postfix +
',as_bits'
136 config.addPrivateTool(
'selectionTool',
'CP::EgammaIsGoodOQSelectionTool' )
137 alg.selectionTool.Mask = xAOD.EgammaParameters.BADCLUSELECTRON
138 alg.particles = config.readName (self.containerName)
139 alg.preselection = config.getPreselection (self.containerName,
'')
140 config.addSelection (self.containerName,
'', alg.selectionDecoration)
142 if not self.splitCalibrationAndSmearing :
144 alg = self.makeCalibrationAndSmearingAlg (config,
'ElectronCalibrationAndSmearingAlg')
145 if config.isPhyslite()
and not self.recalibratePhyslite :
146 alg.skipNominal =
True
165 alg = self.makeCalibrationAndSmearingAlg (config,
'ElectronBaseCalibrationAlg')
167 alg.noToolSystematics =
True
169 alg.calibrationAndSmearingTool.doSmearing =
False
172 alg = self.makeCalibrationAndSmearingAlg (config,
'ElectronCalibrationSystematicsAlg')
174 alg.calibrationAndSmearingTool.doScaleCorrection =
False
175 alg.calibrationAndSmearingTool.useMVACalibration =
False
179 alg = config.createAlgorithm(
'CP::AsgSelectionAlg',
'ElectronPtCutAlg' + self.postfix )
180 alg.selectionDecoration =
'selectPt' + self.postfix +
',as_bits'
181 config.addPrivateTool(
'selectionTool',
'CP::AsgPtEtaSelectionTool' )
182 alg.selectionTool.minPt = self.minPt
183 alg.particles = config.readName (self.containerName)
184 alg.preselection = config.getPreselection (self.containerName,
'')
185 config.addSelection (self.containerName,
'', alg.selectionDecoration,
189 if self.isolationCorrection:
190 alg = config.createAlgorithm(
'CP::EgammaIsolationCorrectionAlg',
191 'ElectronIsolationCorrectionAlg' + self.postfix )
192 config.addPrivateTool(
'isolationCorrectionTool',
193 'CP::IsolationCorrectionTool' )
194 alg.isolationCorrectionTool.IsMC = config.dataType()
is not DataType.Data
195 alg.isolationCorrectionTool.AFII_corr = (
196 0
if self.forceFullSimConfig
197 else config.dataType()
is DataType.FastSim)
198 alg.egammas = config.readName (self.containerName)
199 alg.egammasOut = config.copyName (self.containerName)
200 alg.preselection = config.getPreselection (self.containerName,
'')
203 alg = config.createAlgorithm(
'CP::AsgEnergyDecoratorAlg',
'EnergyDecorator' + self.containerName + self.postfix )
204 alg.particles = config.readName(self.containerName)
206 config.addOutputVar (self.containerName,
'pt',
'pt')
207 config.addOutputVar (self.containerName,
'eta',
'eta', noSys=
True)
208 config.addOutputVar (self.containerName,
'phi',
'phi', noSys=
True)
209 config.addOutputVar (self.containerName,
'e_%SYS%',
'e')
210 config.addOutputVar (self.containerName,
'charge',
'charge', noSys=
True)
213 if self.decorateTruth
and config.dataType()
is not DataType.Data:
214 config.addOutputVar (self.containerName,
"truthType",
"truth_type", noSys=
True)
215 config.addOutputVar (self.containerName,
"truthOrigin",
"truth_origin", noSys=
True)
217 config.addOutputVar (self.containerName,
"firstEgMotherPdgId",
"truth_firstEgMotherPdgId", noSys=
True)
218 config.addOutputVar (self.containerName,
"firstEgMotherTruthOrigin",
"truth_firstEgMotherTruthOrigin", noSys=
True)
219 config.addOutputVar (self.containerName,
"firstEgMotherTruthType",
"truth_firstEgMotherTruthType", noSys=
True)