3from AthenaCommon.Logging
import logging
4logging.getLogger().info(
"Importing %s",__name__)
5log = logging.getLogger(__name__)
7from ..Config.ChainConfigurationBase
import ChainConfigurationBase
8from ..CommonSequences.CaloSequences
import fastCaloSequenceGenCfg, fastCaloCalibSequenceGenCfg
9from ..CommonSequences.CaloSequences_FWD
import fastCalo_FWDSequenceGenCfg
10from ..Electron.FastElectronMenuSequences
import fastElectronSequenceGenCfg, fastElectron_LRTSequenceGenCfg
11from ..Electron.FastTrackingMenuSequences
import fastTrackingSequenceGenCfg, fastTracking_LRTSequenceGenCfg
12from ..Electron.PrecisionCaloMenuSequences
import precisionCaloSequenceGenCfg, precisionCalo_LRTSequenceGenCfg
13from ..Electron.PrecisionElectronMenuSequences
import precisionElectronSequenceGenCfg, precisionElectron_LRTSequenceGenCfg
14from ..Electron.PrecisionElectronMenuSequences_GSF
import precisionElectron_GSFSequenceGenCfg, precisionElectron_GSF_LRTSequenceGenCfg
15from TrigBphysHypo.TrigMultiTrkComboHypoConfig
import NoMuonDiElecPrecisionGSFComboHypoCfg, DiElecPrecisionGSFComboHypoCfg, TrigMultiTrkComboHypoToolFromDict
16from ..Electron.PrecisionTrackingMenuSequences
import precisionTrackingSequenceGenCfg, precisionTracking_LRTSequenceGenCfg
17from ..Electron.PrecisionTracks_GSFRefittedMenuSequences
import precisionTracks_GSFRefittedSequenceGenCfg, precisionTracks_GSFRefitted_LRTSequenceGenCfg
19from AthenaConfiguration.ComponentFactory
import CompFactory
21from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
26 name = chainDict[
'chainName']
28 HistPath =
'EgammaMassHypo/'+name)
29 monTool.defineHistogram(
'DphiOfProcessed', type=
'TH1F', path=
'EXPERT', title=
"PrecisionCalo Hypo entries per Phi;Phi", xbins=128, xmin=-3.2, xmax=3.2)
30 monTool.defineHistogram(
'MassOfProcessed', type=
'TH1F', path=
'EXPERT', title=
"Mass in accepted combinations [MeV]", xbins=75, xmin=0, xmax=150000)
31 monTool.defineHistogram(
'DphiOfAccepted', type=
'TH1F', path=
'EXPERT', title=
"PrecisionCalo Hypo entries per Phi;Phi", xbins=128, xmin=-3.2, xmax=3.2)
32 monTool.defineHistogram(
'MassOfAccepted', type=
'TH1F', path=
'EXPERT', title=
"Mass in accepted combinations [MeV]", xbins=75, xmin=0, xmax=150000)
34 tool = CompFactory.TrigEgammaTopoHypoTool(name,
37 LowerMassEgammaClusterCut = mass_range[0],
38 UpperMassEgammaClusterCut = mass_range[1],
59 ChainConfigurationBase.__init__(self,chainDict)
81 if not self.chainPart[
'IDinfo']
and not self.chainPart[
'L2IDAlg']
and not self.chainPart[
'isoInfo']
and not self.chainPart[
'addInfo']:
84 if "fwd" in self.chainPart[
'addInfo']:
85 stepNames += [
'getFastCalo_fwd']
88 if "etcut" in self.chainPart[
'addInfo']:
91 if 'calibringer' in self.chainPart[
'calibInfo']:
92 stepNames+=[
'getFastCaloCalib']
94 stepNames += [
'getFastCalo']
101 if self.chainPart[
'lrtInfo']:
102 stepNames += [
'getFastTracking_lrt']
104 stepNames += [
'getFastTracking']
112 if self.chainPart[
'lrtInfo']:
113 stepNames += [
'getFastElectron_lrt']
115 stepNames += [
'getFastElectron']
124 if not self.chainPart[
'IDinfo']
and not self.chainPart[
'isoInfo']
and not self.chainPart[
'addInfo']:
125 log.debug(
"No IDInfo, no isoInfo and no addInfo. Returning here up to fastElectron")
128 if self.chainPart[
'lrtInfo']:
129 stepNames += [
'getPrecisionCaloElectron_lrt']
131 stepNames += [
'getPrecisionCaloElectron']
135 if 'etcut' in self.chainPart[
'addInfo']
and 'idperf' not in self.chainPart[
'idperfInfo']:
136 log.debug(
"This is an etcut chain. Returning here")
144 if self.chainPart[
'lrtInfo']:
145 stepNames += [
'getPrecisionTracking_lrt']
147 stepNames += [
'getPrecisionTracking']
154 if "" in self.chainPart[
'gsfInfo']
and 'nogsf' not in self.chainPart[
'gsfInfo']:
155 if self.chainPart[
'lrtInfo']:
156 stepNames += [
'getPrecisionTrack_GSFRefitted_lrt']
158 stepNames += [
'getPrecisionTrack_GSFRefitted']
161 if 'idperf' not in self.chainPart[
'idperfInfo']:
163 stepNames += [
'getEmptyRefitStep']
168 if 'idperf' in self.chainPart[
'idperfInfo']:
169 log.debug(
"This is an idperf chain. Returning here")
179 if "nogsf" in self.chainPart[
'gsfInfo']:
180 if self.chainPart[
'lrtInfo']:
181 stepNames += [
'getPrecisionElectron_lrt']
183 stepNames += [
'getPrecisionElectron']
186 if self.chainPart[
'lrtInfo']:
187 stepNames += [
'getPrecisionGSFElectron_lrt']
189 stepNames += [
'getPrecisionGSFElectron']
191 log.debug(
"Returning chain with all steps in the sequence")
206 log.debug(
"stepNames: %s", steps)
208 log.debug(
'Adding electron trigger step %s', step)
209 is_probe_leg = self.chainPart[
'tnpInfo']==
'probe'
210 chainstep = getattr(self, step)(flags, is_probe_leg=is_probe_leg)
211 chainSteps+=[chainstep]
213 myChain = self.buildChain(chainSteps)
222 stepName =
"FastCalo_electron"
223 return self.getStep(flags, stepName,[fastCaloSequenceGenCfg], name=
'Electron', is_probe_leg=is_probe_leg)
226 stepName =
"FastCalo_electronCalib"
227 return self.getStep(flags, stepName,[fastCaloCalibSequenceGenCfg], name=
'Electron', is_probe_leg=is_probe_leg)
230 stepName =
"fast_tracking"
231 return self.getStep(flags, stepName,[ fastTrackingSequenceGenCfg],is_probe_leg=is_probe_leg)
234 stepName =
"fast_tracking_lrt"
235 return self.getStep(flags, stepName,[ fastTracking_LRTSequenceGenCfg],is_probe_leg=is_probe_leg)
238 if self.chainPart[
'idperfInfo']:
239 stepName =
"fast_electron_empty"
240 return self.getEmptyStep(stepName)
242 stepName =
"fast_electron"
243 return self.getStep(flags, stepName,[fastElectronSequenceGenCfg],is_probe_leg=is_probe_leg)
246 if self.chainPart[
'idperfInfo']:
247 stepName =
"fast_electron_lrt_empty"
248 return self.getEmptyStep(stepName)
250 stepName =
"fast_electron_lrt"
251 return self.getStep(flags, stepName,[fastElectron_LRTSequenceGenCfg],is_probe_leg=is_probe_leg)
254 if self.chainPart[
'extra'] ==
'ion':
255 stepName =
'precisionCalo_ion_electron'
256 return self.getStep(flags, stepName, [precisionCaloSequenceGenCfg], ion=
True, is_probe_leg=is_probe_leg)
258 stepName =
"precisionCalo_electron"
259 return self.getStep(flags, stepName,[precisionCaloSequenceGenCfg], is_probe_leg=is_probe_leg)
262 stepName =
"precisionCalo_electron_lrt"
263 return self.getStep(flags, stepName,[precisionCalo_LRTSequenceGenCfg],is_probe_leg=is_probe_leg)
266 if self.chainPart[
'extra'] ==
'ion':
267 stepName =
'precisionTracking_ion_electron'
268 return self.getStep(flags, stepName, [precisionTrackingSequenceGenCfg], ion=
True, is_probe_leg=is_probe_leg)
270 stepName =
"precisionTracking_electron"
271 return self.getStep(flags, stepName,[precisionTrackingSequenceGenCfg], is_probe_leg=is_probe_leg)
274 stepName =
"precisionTracking_electron_lrt"
275 return self.getStep(flags, stepName,[precisionTracking_LRTSequenceGenCfg],is_probe_leg=is_probe_leg)
278 stepName =
"PrecisionTrack_GSFRefitted_electron"
279 return self.getStep(flags, stepName,[precisionTracks_GSFRefittedSequenceGenCfg], is_probe_leg=is_probe_leg)
282 stepName =
"PrecisionTrack_GSFRefitted_electron_lrt"
283 return self.getStep(flags, stepName,[precisionTracks_GSFRefitted_LRTSequenceGenCfg], is_probe_leg=is_probe_leg)
287 isocut = self.chainPart[
'isoInfo']
288 log.debug(
' isolation cut = %s', isocut)
291 stepName =
"precision_electron_Zee"+str(isocut)
292 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectronSequenceGenCfg], comboTools=[diElectronZeeMassComboHypoToolFromDict], is_probe_leg=is_probe_leg)
294 stepName =
"precision_topoelectron_Jpsiee"+str(isocut)
295 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectronSequenceGenCfg], comboTools=[diElectronJpsieeMassComboHypoToolFromDict], is_probe_leg=is_probe_leg)
297 stepName =
"precision_electron_Heg"+str(isocut)
298 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectronSequenceGenCfg], comboTools=[diEgammaHegMassComboHypoToolFromDict], is_probe_leg=is_probe_leg)
299 elif self.chainPart[
'extra'] ==
'ion':
300 stepName =
"precision_ion_electron" + str(isocut)
301 return self.getStep(flags, stepName,[precisionElectronSequenceGenCfg], ion=
True, is_probe_leg=is_probe_leg)
303 stepName =
"precision_electron_nominal"+str(isocut)
304 return self.getStep(flags, stepName,[ precisionElectronSequenceGenCfg ], is_probe_leg=is_probe_leg)
308 isocut = self.chainPart[
'isoInfo']
309 log.debug(
' isolation cut = %s', isocut)
312 stepName =
"precision_topoelectron_Zee_GSF"+str(isocut)
313 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectron_GSFSequenceGenCfg], comboTools=[diElectronZeeMassComboHypoToolFromDict], is_probe_leg=is_probe_leg)
315 stepName =
"precision_topoelectron_Jpsiee_GSF"+str(isocut)
316 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectron_GSFSequenceGenCfg], comboTools=[diElectronJpsieeMassComboHypoToolFromDict], is_probe_leg=is_probe_leg)
317 elif "bBeeM6000" in self.
chainDict[
'topo']:
318 signatures = self.
chainDict[
'signatures']
319 if signatures.count(signatures[0]) == len(signatures):
320 stepName =
"noMuon_precision_electron_bBee_GSF"+str(isocut)
321 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectron_GSFSequenceGenCfg], comboHypoCfg=NoMuonDiElecPrecisionGSFComboHypoCfg, comboTools=[TrigMultiTrkComboHypoToolFromDict], is_probe_leg=is_probe_leg)
323 stepName =
"precision_electron_bBee_GSF"+str(isocut)
324 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectron_GSFSequenceGenCfg], comboHypoCfg=DiElecPrecisionGSFComboHypoCfg, comboTools=[TrigMultiTrkComboHypoToolFromDict], is_probe_leg=is_probe_leg)
326 stepName =
"precision_electron_GSF"+str(isocut)
327 return self.getStep(flags, stepName,[precisionElectron_GSFSequenceGenCfg], is_probe_leg=is_probe_leg)
331 isocut = self.chainPart[
'isoInfo']
332 log.debug(
' isolation cut = %s', isocut)
333 stepName =
"precision_electron_LRTGSF"+str(isocut)
334 return self.getStep(flags, stepName,[precisionElectron_GSF_LRTSequenceGenCfg], is_probe_leg=is_probe_leg)
338 isocut = self.chainPart[
'isoInfo']
339 log.debug(
' isolation cut = %s', isocut)
340 stepName =
"precision_electron_lrt"+str(isocut)
341 return self.getStep(flags, stepName,[ precisionElectron_LRTSequenceGenCfg],is_probe_leg=is_probe_leg)
344 stepName =
"FastCalo_FWD_electron"
345 return self.getStep(flags, stepName, [fastCalo_FWDSequenceGenCfg], name=
'Electron', is_probe_leg=is_probe_leg)
348 return self.getEmptyStep(
'nonGSFEmptyRefit')
getFastTracking(self, flags, is_probe_leg=False)
getFastElectron_lrt(self, flags, is_probe_leg=False)
getFastCalo(self, flags, is_probe_leg=False)
getPrecisionGSFElectron(self, flags, is_probe_leg=False)
getPrecisionTracking_lrt(self, flags, is_probe_leg=False)
getPrecisionCaloElectron(self, flags, is_probe_leg=False)
getFastCalo_fwd(self, flags, is_probe_leg=False)
getFastCaloCalib(self, flags, is_probe_leg=False)
getPrecisionElectron(self, flags, is_probe_leg=False)
assembleChainImpl(self, flags)
getPrecisionCaloElectron_lrt(self, flags, is_probe_leg=False)
getFastElectron(self, flags, is_probe_leg=False)
getPrecisionTracking(self, flags, is_probe_leg=False)
getPrecisionTrack_GSFRefitted_lrt(self, flags, is_probe_leg=False)
getPrecisionGSFElectron_lrt(self, flags, is_probe_leg=False)
getPrecisionTrack_GSFRefitted(self, flags, is_probe_leg=False)
getFastTracking_lrt(self, flags, is_probe_leg=False)
__init__(self, chainDict)
getEmptyRefitStep(self, flags, is_probe_leg=False)
getPrecisionElectron_lrt(self, flags, is_probe_leg=False)
_diElectronMassComboHypoToolFromDict(flags, chainDict, mass_range)
diEgammaHegMassComboHypoToolFromDict(flags, chainDict)
diElectronZeeMassComboHypoToolFromDict(flags, chainDict)
diElectronJpsieeMassComboHypoToolFromDict(flags, chainDict)