3 from AthenaCommon.Logging
import logging
4 logging.getLogger().
info(
"Importing %s",__name__)
5 log = logging.getLogger(__name__)
7 from ..Config.ChainConfigurationBase
import ChainConfigurationBase
8 from ..CommonSequences.CaloSequences
import fastCaloSequenceGenCfg
9 from ..CommonSequences.CaloSequences_FWD
import fastCalo_FWDSequenceGenCfg
10 from ..Electron.FastElectronMenuSequences
import fastElectronSequenceGenCfg, fastElectron_LRTSequenceGenCfg
11 from ..Electron.FastTrackingMenuSequences
import fastTrackingSequenceGenCfg, fastTracking_LRTSequenceGenCfg
12 from ..Electron.PrecisionCaloMenuSequences
import precisionCaloSequenceGenCfg, precisionCalo_LRTSequenceGenCfg
13 from ..Electron.PrecisionElectronMenuSequences
import precisionElectronSequenceGenCfg, precisionElectron_LRTSequenceGenCfg
14 from ..Electron.PrecisionElectronMenuSequences_GSF
import precisionElectron_GSFSequenceGenCfg, precisionElectron_GSF_LRTSequenceGenCfg
15 from TrigBphysHypo.TrigMultiTrkComboHypoConfig
import NoMuonDiElecPrecisionGSFComboHypoCfg, DiElecPrecisionGSFComboHypoCfg, TrigMultiTrkComboHypoToolFromDict
16 from ..Electron.PrecisionTrackingMenuSequences
import precisionTrackingSequenceGenCfg, precisionTracking_LRTSequenceGenCfg
17 from ..Electron.PrecisionTracks_GSFRefittedMenuSequences
import precisionTracks_GSFRefittedSequenceGenCfg, precisionTracks_GSFRefitted_LRTSequenceGenCfg
19 from AthenaConfiguration.ComponentFactory
import CompFactory
21 from 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 stepNames += [
'getFastCalo']
98 if self.chainPart[
'lrtInfo']:
99 stepNames += [
'getFastTracking_lrt']
101 stepNames += [
'getFastTracking']
109 if self.chainPart[
'lrtInfo']:
110 stepNames += [
'getFastElectron_lrt']
112 stepNames += [
'getFastElectron']
121 if not self.chainPart[
'IDinfo']
and not self.chainPart[
'isoInfo']
and not self.chainPart[
'addInfo']:
122 log.debug(
"No IDInfo, no isoInfo and no addInfo. Returning here up to fastElectron")
125 if self.chainPart[
'lrtInfo']:
126 stepNames += [
'getPrecisionCaloElectron_lrt']
128 stepNames += [
'getPrecisionCaloElectron']
132 if 'etcut' in self.chainPart[
'addInfo']
and 'idperf' not in self.chainPart[
'idperfInfo']:
133 log.debug(
"This is an etcut chain. Returning here")
141 if self.chainPart[
'lrtInfo']:
142 stepNames += [
'getPrecisionTracking_lrt']
144 stepNames += [
'getPrecisionTracking']
151 if "" in self.chainPart[
'gsfInfo']
and 'nogsf' not in self.chainPart[
'gsfInfo']:
152 if self.chainPart[
'lrtInfo']:
153 stepNames += [
'getPrecisionTrack_GSFRefitted_lrt']
155 stepNames += [
'getPrecisionTrack_GSFRefitted']
158 if 'idperf' not in self.chainPart[
'idperfInfo']:
160 stepNames += [
'getEmptyRefitStep']
165 if 'idperf' in self.chainPart[
'idperfInfo']:
166 log.debug(
"This is an idperf chain. Returning here")
176 if "nogsf" in self.chainPart[
'gsfInfo']:
177 if self.chainPart[
'lrtInfo']:
178 stepNames += [
'getPrecisionElectron_lrt']
180 stepNames += [
'getPrecisionElectron']
183 if self.chainPart[
'lrtInfo']:
184 stepNames += [
'getPrecisionGSFElectron_lrt']
186 stepNames += [
'getPrecisionGSFElectron']
188 log.debug(
"Returning chain with all steps in the sequence")
196 log.debug(
"Assembling chain for %s", self.chainName)
203 log.debug(
"stepNames: %s", steps)
205 log.debug(
'Adding electron trigger step %s', step)
206 is_probe_leg = self.chainPart[
'tnpInfo']==
'probe'
207 chainstep = getattr(self, step)(flags, is_probe_leg=is_probe_leg)
208 chainSteps+=[chainstep]
210 myChain = self.buildChain(chainSteps)
219 stepName =
"FastCalo_electron"
220 return self.getStep(flags, stepName,[fastCaloSequenceGenCfg], name=
'Electron', is_probe_leg=is_probe_leg)
223 stepName =
"fast_tracking"
224 return self.getStep(flags, stepName,[ fastTrackingSequenceGenCfg],is_probe_leg=is_probe_leg)
227 stepName =
"fast_tracking_lrt"
228 return self.getStep(flags, stepName,[ fastTracking_LRTSequenceGenCfg],is_probe_leg=is_probe_leg)
231 if self.chainPart[
'idperfInfo']:
232 stepName =
"fast_electron_empty"
233 return self.getEmptyStep(3,stepName)
235 stepName =
"fast_electron"
236 return self.getStep(flags, stepName,[fastElectronSequenceGenCfg],is_probe_leg=is_probe_leg)
239 if self.chainPart[
'idperfInfo']:
240 stepName =
"fast_electron_lrt_empty"
241 return self.getEmptyStep(3,stepName)
243 stepName =
"fast_electron_lrt"
244 return self.getStep(flags, stepName,[fastElectron_LRTSequenceGenCfg],is_probe_leg=is_probe_leg)
247 if self.chainPart[
'extra'] ==
'ion':
248 stepName =
'precisionCalo_ion_electron'
249 return self.getStep(flags, stepName, [precisionCaloSequenceGenCfg], ion=
True, is_probe_leg=is_probe_leg)
251 stepName =
"precisionCalo_electron"
252 return self.getStep(flags, stepName,[precisionCaloSequenceGenCfg], is_probe_leg=is_probe_leg)
255 stepName =
"precisionCalo_electron_lrt"
256 return self.getStep(flags, stepName,[precisionCalo_LRTSequenceGenCfg],is_probe_leg=is_probe_leg)
259 if self.chainPart[
'extra'] ==
'ion':
260 stepName =
'precisionTracking_ion_electron'
261 return self.getStep(flags, stepName, [precisionTrackingSequenceGenCfg], ion=
True, is_probe_leg=is_probe_leg)
263 stepName =
"precisionTracking_electron"
264 return self.getStep(flags, stepName,[precisionTrackingSequenceGenCfg], is_probe_leg=is_probe_leg)
267 stepName =
"precisionTracking_electron_lrt"
268 return self.getStep(flags, stepName,[precisionTracking_LRTSequenceGenCfg],is_probe_leg=is_probe_leg)
271 stepName =
"PrecisionTrack_GSFRefitted_electron"
272 return self.getStep(flags, stepName,[precisionTracks_GSFRefittedSequenceGenCfg], is_probe_leg=is_probe_leg)
275 stepName =
"PrecisionTrack_GSFRefitted_electron_lrt"
276 return self.getStep(flags, stepName,[precisionTracks_GSFRefitted_LRTSequenceGenCfg], is_probe_leg=is_probe_leg)
280 isocut = self.chainPart[
'isoInfo']
281 log.debug(
' isolation cut = %s', isocut)
284 stepName =
"precision_electron_Zee"+
str(isocut)
285 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectronSequenceGenCfg], comboTools=[diElectronZeeMassComboHypoToolFromDict], is_probe_leg=is_probe_leg)
287 stepName =
"precision_topoelectron_Jpsiee"+
str(isocut)
288 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectronSequenceGenCfg], comboTools=[diElectronJpsieeMassComboHypoToolFromDict], is_probe_leg=is_probe_leg)
290 stepName =
"precision_electron_Heg"+
str(isocut)
291 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectronSequenceGenCfg], comboTools=[diEgammaHegMassComboHypoToolFromDict], is_probe_leg=is_probe_leg)
292 elif self.chainPart[
'extra'] ==
'ion':
293 stepName =
"precision_ion_electron" +
str(isocut)
294 return self.getStep(flags, stepName,[precisionElectronSequenceGenCfg], ion=
True, is_probe_leg=is_probe_leg)
296 stepName =
"precision_electron_nominal"+
str(isocut)
297 return self.getStep(flags, stepName,[ precisionElectronSequenceGenCfg ], is_probe_leg=is_probe_leg)
301 isocut = self.chainPart[
'isoInfo']
302 log.debug(
' isolation cut = %s', isocut)
305 stepName =
"precision_topoelectron_Zee_GSF"+
str(isocut)
306 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectron_GSFSequenceGenCfg], comboTools=[diElectronZeeMassComboHypoToolFromDict], is_probe_leg=is_probe_leg)
308 stepName =
"precision_topoelectron_Jpsiee_GSF"+
str(isocut)
309 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectron_GSFSequenceGenCfg], comboTools=[diElectronJpsieeMassComboHypoToolFromDict], is_probe_leg=is_probe_leg)
310 elif "bBeeM6000" in self.
chainDict[
'topo']:
311 signatures = self.
chainDict[
'signatures']
312 if signatures.count(signatures[0]) == len(signatures):
313 stepName =
"noMuon_precision_electron_bBee_GSF"+
str(isocut)
314 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectron_GSFSequenceGenCfg], comboHypoCfg=NoMuonDiElecPrecisionGSFComboHypoCfg, comboTools=[TrigMultiTrkComboHypoToolFromDict], is_probe_leg=is_probe_leg)
316 stepName =
"precision_electron_bBee_GSF"+
str(isocut)
317 return self.getStep(flags, stepName,sequenceCfgArray=[precisionElectron_GSFSequenceGenCfg], comboHypoCfg=DiElecPrecisionGSFComboHypoCfg, comboTools=[TrigMultiTrkComboHypoToolFromDict], is_probe_leg=is_probe_leg)
319 stepName =
"precision_electron_GSF"+
str(isocut)
320 return self.getStep(flags, stepName,[precisionElectron_GSFSequenceGenCfg], is_probe_leg=is_probe_leg)
324 isocut = self.chainPart[
'isoInfo']
325 log.debug(
' isolation cut = %s', isocut)
326 stepName =
"precision_electron_LRTGSF"+
str(isocut)
327 return self.getStep(flags, stepName,[precisionElectron_GSF_LRTSequenceGenCfg], is_probe_leg=is_probe_leg)
331 isocut = self.chainPart[
'isoInfo']
332 log.debug(
' isolation cut = %s', isocut)
333 stepName =
"precision_electron_lrt"+
str(isocut)
334 return self.getStep(flags, stepName,[ precisionElectron_LRTSequenceGenCfg],is_probe_leg=is_probe_leg)
337 stepName =
"FastCalo_FWD_electron"
338 return self.getStep(flags, stepName, [fastCalo_FWDSequenceGenCfg], name=
'Electron', is_probe_leg=is_probe_leg)
341 return self.getEmptyStep(6,
'nonGSFEmptyRefit')