diff --git a/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py b/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py index 2bbde0df3d29d700743405ed1c8769474bfe83e3..0d80f0e9ddbc3f5132e09a37b0cbe64071a8d35a 100644 --- a/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py +++ b/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py @@ -177,9 +177,7 @@ def generateEmuEvents(): ########################################################################### def generateChainsManually(): - from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep - from DecisionHandling.TestUtils import makeChain - + from DecisionHandling.TestUtils import makeChain, makeChainStep doMuon = True doElectron = True @@ -203,21 +201,21 @@ def generateChainsManually(): #step4 mu41 = muMenuSequence(step="4",reconame="v1", hyponame="v1") - step_mu11 = ChainStep("Step1_mu11", [mu11]) - step_mu21 = ChainStep("Step2_mu21", [mu21] ) - step_mu22 = ChainStep("Step2_mu22", [mu22] ) - step_mu31 = ChainStep("Step3_mu31", [mu31] ) - step_mu32 = ChainStep("Step3_mu32", [mu32] ) - step_mu41 = ChainStep("Step4_mu41", [mu41] ) + step_mu11 = makeChainStep("Step1_mu11", [mu11] ) + step_mu21 = makeChainStep("Step2_mu21", [mu21] ) + step_mu22 = makeChainStep("Step2_mu22", [mu22] ) + step_mu31 = makeChainStep("Step3_mu31", [mu31] ) + step_mu32 = makeChainStep("Step3_mu32", [mu32] ) + step_mu41 = makeChainStep("Step4_mu41", [mu41] ) - step_empy= ChainStep("Step2_mu1empty", multiplicity=[]) + step_empy= makeChainStep("Step2_mu1empty", multiplicity=[]) MuChains = [ - makeChain(name='HLT_TestChain8_muv1step_L1MU6', L1Thresholds=["MU6"], ChainSteps=[step_mu11]), + makeChain(name='HLT_TestChain8_muv1step_L1MU6', L1Thresholds=["MU6"], ChainSteps=[step_mu11]), makeChain(name='HLT_TestChain8_muv1_L1MU10', L1Thresholds=["MU10"], ChainSteps=[step_mu11 , step_mu21 , step_mu31, step_mu41] ), makeChain(name='HLT_TestChain20_muv1_L1MU10', L1Thresholds=["MU10"], ChainSteps=[step_mu11 , step_mu21 , step_mu31, step_mu41] ), makeChain(name='HLT_TestChain10_muv2_L1MU10', L1Thresholds=["MU10"], ChainSteps=[step_mu11 , step_mu22 , step_mu31] ), - makeChain(name='HLT_TestChain6_muEmpty2_L1MU6', L1Thresholds=["MU6"], ChainSteps=[step_mu11 , step_empy , step_mu32, step_mu41] ), + makeChain(name='HLT_TestChain6_muEmpty2_L1MU6', L1Thresholds=["MU6"], ChainSteps=[step_mu11 , step_empy , step_mu32, step_mu41] ), ] @@ -238,11 +236,11 @@ def generateChainsManually(): gamm11 = gamMenuSequence("1", reconame="v1", hyponame="v1") ElChains = [ - makeChain(name='HLT_TestChain5_ev1_L1EM3', L1Thresholds=["EM3"], ChainSteps=[ ChainStep("Step1_em11", [el11]), ChainStep("Step2_em21", [el21]), ChainStep("Step3_em31", [el31])] ), - makeChain(name='HLT_TestChain8_ev1_L1EM5', L1Thresholds=["EM5"], ChainSteps=[ ChainStep("Step1_em11", [el11]), ChainStep("Step2_em21", [el21]), ChainStep("Step3_em31", [el31]) ] ), - makeChain(name='HLT_TestChain5_ev2_L1EM7', L1Thresholds=["EM7"], ChainSteps=[ ChainStep("Step1_em11", [el11]), ChainStep("Step2_em22", [el22]) ] ), - makeChain(name='HLT_TestChain5_ev3_L1EM7', L1Thresholds=["EM7"], ChainSteps=[ ChainStep("Step1_em11", [el11]), ChainStep("Step2_em23", [el23]) ] ), - makeChain(name='HLT_TestChain5_gv1_L1EM7', L1Thresholds=["EM7"], ChainSteps=[ ChainStep("Step1_gam11", [gamm11]) ] ) + makeChain(name='HLT_TestChain5_ev1_L1EM3', L1Thresholds=["EM3"], ChainSteps=[ makeChainStep("Step1_em11", [el11]), makeChainStep("Step2_em21", [el21]), makeChainStep("Step3_em31", [el31])] ), + makeChain(name='HLT_TestChain8_ev1_L1EM5', L1Thresholds=["EM5"], ChainSteps=[ makeChainStep("Step1_em11", [el11]), makeChainStep("Step2_em21", [el21]), makeChainStep("Step3_em31", [el31]) ] ), + makeChain(name='HLT_TestChain5_ev2_L1EM7', L1Thresholds=["EM7"], ChainSteps=[ makeChainStep("Step1_em11", [el11]), makeChainStep("Step2_em22", [el22]) ] ), + makeChain(name='HLT_TestChain5_ev3_L1EM7', L1Thresholds=["EM7"], ChainSteps=[ makeChainStep("Step1_em11", [el11]), makeChainStep("Step2_em23", [el23]) ] ), + makeChain(name='HLT_TestChain5_gv1_L1EM7', L1Thresholds=["EM7"], ChainSteps=[ makeChainStep("Step1_gam11", [gamm11]) ] ) ] HLTChains += ElChains @@ -283,52 +281,52 @@ def generateChainsManually(): CombChains =[ # This is an example of a chain running in "serial" makeChain(name='HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5', L1Thresholds=["MU6","EM5"], ChainSteps=[ - ChainStep("Step1_mu_em_serial", [mu11, emptySeq1], multiplicity=[1,1]), - ChainStep("Step2_mu_em_serial", [emptySeq2, el21], multiplicity=[1,1]), - ChainStep("Step3_mu_em_serial", multiplicity=[]), - ChainStep("Step4_mu_em_serial", [mu41, el41], multiplicity=[1,1])] ), + makeChainStep("Step1_mu_em_serial", [mu11, emptySeq1], multiplicity=[1,1]), + makeChainStep("Step2_mu_em_serial", [emptySeq2, el21], multiplicity=[1,1]), + makeChainStep("Step3_mu_em_serial", multiplicity=[]), + makeChainStep("Step4_mu_em_serial", [mu41, el41], multiplicity=[1,1])] ), makeChain(name='HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5', L1Thresholds=["MU6","EM5"], ChainSteps=[ - ChainStep("Step1_mu2_em", [mu12, el11], multiplicity=[1,1]), - ChainStep("Step2_mu_em", [mu21, el21], multiplicity=[1,1])] ), + makeChainStep("Step1_mu2_em", [mu12, el11], multiplicity=[1,1]), + makeChainStep("Step2_mu_em", [mu21, el21], multiplicity=[1,1])] ), makeChain(name='HLT_TestChain5_ev1_TestChain8_ev1_L12EM3', L1Thresholds=["EM3","EM3"], ChainSteps=[ #norun - ChainStep("Step1_2emAs", [el11, el11], multiplicity=[1,1]), - ChainStep("Step2_2emAs", [el21, el21], multiplicity=[1,1]) ]), + makeChainStep("Step1_2emAs", [el11, el11], multiplicity=[1,1]), + makeChainStep("Step2_2emAs", [el21, el21], multiplicity=[1,1]) ]), makeChain(name='HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6', L1Thresholds=["EM3","EM5","MU6"], ChainSteps=[ - ChainStep("Step1_2em_2mu", [el11,el11,mu11], multiplicity=[1,1,2]), - ChainStep("Step2_2em_2mu", [el21,el21,mu21], multiplicity=[1,1,2]) ]), + makeChainStep("Step1_2em_2mu", [el11,el11,mu11], multiplicity=[1,1,2]), + makeChainStep("Step2_2em_2mu", [el21,el21,mu21], multiplicity=[1,1,2]) ]), makeChain(name='HLT_2TestChain6_muv1_L12MU6', L1Thresholds=["MU6"], ChainSteps=[ - ChainStep("Step1_2mu", [mu11], multiplicity=[2]), - ChainStep("Step2_2mu", [mu21], multiplicity=[2]) ]), + makeChainStep("Step1_2mu", [mu11], multiplicity=[2]), + makeChainStep("Step2_2mu", [mu21], multiplicity=[2]) ]), makeChain(name='HLT_3TestChain6_muv1_L12MU6', L1Thresholds=["MU6"], ChainSteps=[ - ChainStep("Step1_2mu", [mu11], multiplicity=[3]), - ChainStep("Step2_2mu", [mu21], multiplicity=[3]) ]), + makeChainStep("Step1_2mu", [mu11], multiplicity=[3]), + makeChainStep("Step2_2mu", [mu21], multiplicity=[3]) ]), makeChain(name='HLT_TestChain6_muv1_TestChain10_muv1_L12MU6', L1Thresholds=["MU6", "MU6"], ChainSteps=[ - ChainStep("Step1_2muAs", [mu11,mu11], multiplicity=[1,1]), - ChainStep("Step2_2muAs", [mu21,mu21], multiplicity=[1,1]) ]), + makeChainStep("Step1_2muAs", [mu11,mu11], multiplicity=[1,1]), + makeChainStep("Step2_2muAs", [mu21,mu21], multiplicity=[1,1]) ]), makeChain(name='HLT_2TestChain6_muEmpty1_L12MU6', L1Thresholds=["MU6"], ChainSteps=[ - ChainStep("Step1_2mu_empty", multiplicity=[]),#[2] - ChainStep("Step2_2mu", [mu21], multiplicity=[2]) ]), + makeChainStep("Step1_2mu_empty", multiplicity=[]),#[2] + makeChainStep("Step2_2mu", [mu21], multiplicity=[2]) ]), makeChain(name='HLT_TestChain6_muv1_TestChain5_ev1dr_L12MU6', L1Thresholds=["MU6","EM5"], ChainSteps=[ - ChainStep("Step1_mu_em", [mu11, el11], multiplicity=[1,1], comboToolConfs=[dimuDrComboHypoTool]), - ChainStep("Step2_mu_em", [mu21, el21], multiplicity=[1,1], comboToolConfs=[dimuDrComboHypoTool])] ), + makeChainStep("Step1_mu_em", [mu11, el11], multiplicity=[1,1], comboToolConfs=[dimuDrComboHypoTool]), + makeChainStep("Step2_mu_em", [mu21, el21], multiplicity=[1,1], comboToolConfs=[dimuDrComboHypoTool])] ), makeChain(name='HLT_2TestChain4_muv1dr_L12MU6', L1Thresholds=["MU6"], ChainSteps=[ - ChainStep("Step1_2mu", [mu11], multiplicity=[2], comboToolConfs=[dimuDrComboHypoTool]), - ChainStep("Step2_2mu22", [mu22], multiplicity=[2]) ] ), + makeChainStep("Step1_2mu", [mu11], multiplicity=[2], comboToolConfs=[dimuDrComboHypoTool]), + makeChainStep("Step2_2mu22", [mu22], multiplicity=[2]) ] ), # FSNOSEED not implemented in emulation # L1Thresholds=["MU6", "MU6"], makeChain(name='HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6', L1Thresholds=["MU6", "MU6"], ChainSteps=[ - ChainStep("Step1_2muAs_empty", multiplicity=[]), - ChainStep("Step2_2muAs", [mu21, mu21], multiplicity=[1,1]) ]) + makeChainStep("Step1_2muAs_empty", multiplicity=[]), + makeChainStep("Step2_2muAs", [mu21, mu21], multiplicity=[1,1]) ]) ] diff --git a/Trigger/TrigSteer/DecisionHandling/python/TestUtils.py b/Trigger/TrigSteer/DecisionHandling/python/TestUtils.py index 2ae87b96f41ca1f63b71536a632095a0070d807f..5d2773af6f44308906516b61f93c92d8163f034f 100644 --- a/Trigger/TrigSteer/DecisionHandling/python/TestUtils.py +++ b/Trigger/TrigSteer/DecisionHandling/python/TestUtils.py @@ -69,8 +69,16 @@ class L1EmulationTest(L1Decoder): self.L1DecoderSummaryKey = "L1DecoderSummary" - - +from DecisionHandling.DecisionHandlingConfig import ComboHypoCfg +class makeChainStep(object): + """ Used to store the step info, regardless of the chainDict""" + def __init__(self, name, seq=[], multiplicity=[1], comboHypoCfg=ComboHypoCfg, comboToolConfs=[]): + self.name=name + self.seq=seq + self.mult=multiplicity + self.comboToolConfs=comboToolConfs + self.comboHypoCfg=comboHypoCfg + chainsCounter = 0 @@ -83,6 +91,7 @@ def makeChain( name, L1Thresholds, ChainSteps, Streams="physics:Main", Groups=[" prop = ChainProp( name=name, l1SeedThresholds=L1Thresholds, groups=Groups ) from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT + from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import dictFromChainName chainDict = dictFromChainName( prop ) @@ -93,8 +102,17 @@ def makeChain( name, L1Thresholds, ChainSteps, Streams="physics:Main", Groups=[" #set default chain prescale chainDict['prescale'] = 1 + from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDictInLegs + + listOfChainDicts = splitChainDictInLegs(chainDict) + + # create the ChainSteps, with the chaindict + StepConfig = [] + for step in ChainSteps: + StepConfig+=[ChainStep(step.name, step.seq, multiplicity=step.mult, chainDicts=listOfChainDicts, comboHypoCfg=step.comboHypoCfg, comboToolConfs=step.comboToolConfs)] + from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain - chainConfig = Chain( name=name, L1Thresholds=L1Thresholds, ChainSteps=ChainSteps ) + chainConfig = Chain( name=name, L1Thresholds=L1Thresholds, ChainSteps=StepConfig ) TriggerConfigHLT.registerChain( chainDict, chainConfig ) diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref index 8619c66e12dc19068914523aabd54d7f1e9e88b5..e24c0745848058c4d5cf8789cc3dd542d3d6afac 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref @@ -557,8 +557,8 @@ TrigSignatureMoniMT INFO HLT_j80_L1J15 #24408723 TrigSignatureMoniMT INFO -- #2440872308 Events 20 20 0 0 0 0 0 0 0 0 0 13 - - - 13 TrigSignatureMoniMT INFO -- #2440872308 Features 0 0 0 0 0 0 0 0 0 23 - - - TrigSignatureMoniMT INFO HLT_j80_j60_L1J15 #582699527 -TrigSignatureMoniMT INFO -- #582699527 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #582699527 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO -- #582699527 Events 20 20 0 0 0 0 0 0 0 0 0 8 - - - 8 +TrigSignatureMoniMT INFO -- #582699527 Features 0 0 0 0 0 0 0 0 0 24 - - - TrigSignatureMoniMT INFO HLT_j85_L1J20 #510475538 TrigSignatureMoniMT INFO -- #510475538 Events 19 19 0 0 0 0 0 0 0 0 0 13 - - - 13 TrigSignatureMoniMT INFO -- #510475538 Features 0 0 0 0 0 0 0 0 0 21 - - - @@ -686,8 +686,8 @@ TrigSignatureMoniMT INFO HLT_mu6_ivarmedium_L1MU TrigSignatureMoniMT INFO -- #1012713062 Events 10 10 0 0 0 0 10 10 10 9 6 - - - - 6 TrigSignatureMoniMT INFO -- #1012713062 Features 0 0 0 0 13 12 13 12 6 - - - - TrigSignatureMoniMT INFO HLT_mu6_j45_nojcalib_L1J20 #2114129685 -TrigSignatureMoniMT INFO -- #2114129685 Events 19 19 0 0 0 0 0 0 0 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #2114129685 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO -- #2114129685 Events 19 19 0 0 0 0 9 9 9 8 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #2114129685 Features 0 0 0 0 11 10 11 10 0 0 - - - TrigSignatureMoniMT INFO HLT_mu6_msonly_L1MU6 #3895421032 TrigSignatureMoniMT INFO -- #3895421032 Events 10 10 0 0 0 0 10 0 10 - - - - - - 10 TrigSignatureMoniMT INFO -- #3895421032 Features 0 0 0 0 13 0 13 - - - - - - @@ -698,8 +698,8 @@ TrigSignatureMoniMT INFO HLT_mu6_mu6noL1_L1MU6 # TrigSignatureMoniMT INFO -- #451489897 Events 10 10 0 0 0 0 10 10 10 9 0 0 0 4 3 3 TrigSignatureMoniMT INFO -- #451489897 Features 0 0 0 0 13 12 13 12 0 0 0 6 5 TrigSignatureMoniMT INFO HLT_mu6_xe30_mht_L1XE10 #3192713675 -TrigSignatureMoniMT INFO -- #3192713675 Events 19 19 0 0 0 0 0 0 0 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #3192713675 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO -- #3192713675 Events 19 19 0 0 0 0 9 9 9 8 0 8 - - - 8 +TrigSignatureMoniMT INFO -- #3192713675 Features 0 0 0 0 12 11 12 11 0 10 - - - TrigSignatureMoniMT INFO HLT_mu80_L1MU20 #387900377 TrigSignatureMoniMT INFO -- #387900377 Events 8 8 0 0 0 0 8 5 1 0 - - - - - 0 TrigSignatureMoniMT INFO -- #387900377 Features 0 0 0 0 10 6 1 0 - - - - - @@ -923,11 +923,11 @@ TrigSignatureMoniMT INFO HLT_tau0_perf_ptonly_L1 TrigSignatureMoniMT INFO -- #2342716369 Events 0 0 0 0 0 0 0 0 - - - - - - - 0 TrigSignatureMoniMT INFO -- #2342716369 Features 0 0 0 0 0 0 - - - - - - - TrigSignatureMoniMT INFO HLT_tau0_perf_ptonly_L1TAU12 #372992233 -TrigSignatureMoniMT INFO -- #372992233 Events 18 18 18 18 0 0 0 0 - - - - - - - 0 -TrigSignatureMoniMT INFO -- #372992233 Features 42 27 0 0 0 0 - - - - - - - +TrigSignatureMoniMT INFO -- #372992233 Events 18 18 18 18 0 0 18 18 - - - - - - - 18 +TrigSignatureMoniMT INFO -- #372992233 Features 42 27 0 0 27 27 - - - - - - - TrigSignatureMoniMT INFO HLT_tau0_perf_ptonly_L1TAU60 #1376650121 -TrigSignatureMoniMT INFO -- #1376650121 Events 5 5 5 3 0 0 0 0 - - - - - - - 0 -TrigSignatureMoniMT INFO -- #1376650121 Features 6 3 0 0 0 0 - - - - - - - +TrigSignatureMoniMT INFO -- #1376650121 Events 5 5 5 3 0 0 3 3 - - - - - - - 3 +TrigSignatureMoniMT INFO -- #1376650121 Features 6 3 0 0 3 3 - - - - - - - TrigSignatureMoniMT INFO HLT_tau160_idperf_track_L1TAU100 #714660857 TrigSignatureMoniMT INFO -- #714660857 Events 0 0 0 0 0 0 0 0 - - - - - - - 0 TrigSignatureMoniMT INFO -- #714660857 Features 0 0 0 0 0 0 - - - - - - - diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref index 2456e35d582832d2d8662f74633b571bbfe4a1d5..901b687c7d98a85e211e07f7136dd38fb2c25787 100644 --- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref +++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref @@ -698,8 +698,8 @@ TrigSignatureMoniMT INFO HLT_mu6_mu6noL1_L1MU6 # TrigSignatureMoniMT INFO -- #451489897 Events 20 20 0 0 0 0 1 1 0 0 0 0 0 0 0 0 TrigSignatureMoniMT INFO -- #451489897 Features 0 0 0 0 1 1 0 0 0 0 0 0 0 TrigSignatureMoniMT INFO HLT_mu6_xe30_mht_L1XE10 #3192713675 -TrigSignatureMoniMT INFO -- #3192713675 Events 20 20 0 0 0 0 0 0 0 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #3192713675 Features 0 0 0 0 0 0 0 0 0 0 - - - +TrigSignatureMoniMT INFO -- #3192713675 Events 20 20 0 0 0 0 1 1 0 0 0 0 - - - 0 +TrigSignatureMoniMT INFO -- #3192713675 Features 0 0 0 0 1 1 0 0 0 0 - - - TrigSignatureMoniMT INFO HLT_mu80_L1MU20 #387900377 TrigSignatureMoniMT INFO -- #387900377 Events 20 20 0 0 0 0 1 1 0 0 - - - - - 0 TrigSignatureMoniMT INFO -- #387900377 Features 0 0 0 0 1 1 0 0 - - - - - @@ -923,8 +923,8 @@ TrigSignatureMoniMT INFO HLT_tau0_perf_ptonly_L1 TrigSignatureMoniMT INFO -- #2342716369 Events 20 20 0 0 0 0 0 0 - - - - - - - 0 TrigSignatureMoniMT INFO -- #2342716369 Features 0 0 0 0 0 0 - - - - - - - TrigSignatureMoniMT INFO HLT_tau0_perf_ptonly_L1TAU12 #372992233 -TrigSignatureMoniMT INFO -- #372992233 Events 20 20 4 4 0 0 0 0 - - - - - - - 0 -TrigSignatureMoniMT INFO -- #372992233 Features 5 5 0 0 0 0 - - - - - - - +TrigSignatureMoniMT INFO -- #372992233 Events 20 20 4 4 0 0 4 4 - - - - - - - 4 +TrigSignatureMoniMT INFO -- #372992233 Features 5 5 0 0 4 4 - - - - - - - TrigSignatureMoniMT INFO HLT_tau0_perf_ptonly_L1TAU60 #1376650121 TrigSignatureMoniMT INFO -- #1376650121 Events 20 20 0 0 0 0 0 0 - - - - - - - 0 TrigSignatureMoniMT INFO -- #1376650121 Features 0 0 0 0 0 0 - - - - - - - diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py index a41eca3160cc8a1cc0603c196f806adff47a8743..41fce5817ef833cce87552861c5a0d3095423e5e 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py @@ -84,25 +84,30 @@ class BeamspotChainConfiguration(ChainConfigurationBase): def assembleChain(self): chainSteps = [] log.debug("Assembling chain for " + self.chainName) - # -------------------- - # define here the names of the steps and obtain the chainStep configuration - # -------------------- - stepDictionary = { - "allTE_trkfast":[self.getAllTEStep()], - #"activeTE_trkfast":[self.activeTE_trkfast()], - "trkFS_trkfast":[self.getTrkFSStep()], - } + stepDictionary = self.getStepDictionary() + #key = self.chainPart['EFrecoAlg'] key = self.chainPart['addInfo'][0] + "_" + self.chainPart['l2IDAlg'][0]#TODO: hardcoded index steps=stepDictionary[key] for step in steps: - chainSteps+=[step] + chainstep = getattr(self, step)() + chainSteps+=[chainstep] myChain = self.buildChain(chainSteps) return myChain - + def getStepDictionary(self): + # -------------------- + # define here the names of the steps and obtain the chainStep configuration + # -------------------- + stepDictionary = { + "allTE_trkfast":['getAllTEStep'], + #"activeTE_trkfast":[self.activeTE_trkfast()], + "trkFS_trkfast":['getTrkFSStep'] + } + return stepDictionary + # -------------------- # Configuration of costmonitor (costmonitor ?? but isn't this is the actua chain configuration ??) # -------------------- diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/EnhancedBiasChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/EnhancedBiasChainConfiguration.py index b2e020da2dc5287e14638e31702bb0fd32942a59..53fa0c40e0a6ad840025941f2c35ddd3aec4b0a1 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/EnhancedBiasChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/EnhancedBiasChainConfiguration.py @@ -3,7 +3,7 @@ from TrigHypoCommonTools.TrigHypoCommonToolsConf import L1InfoHypo, L1InfoHypoTool from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase -from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep, MenuSequence, RecoFragmentsPool +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool from DecisionHandling.DecisionHandlingConf import InputMakerForRoI, ViewCreatorInitialROITool from AthenaCommon.CFElements import seqAND @@ -84,22 +84,12 @@ def enhancedBiasAthSequence(ConfigFlags): return (enhancedBiasAthSequence, inputMakerAlg, enhancedBiasSequence) -class EnhancedBiasChainConfiguration(ChainConfigurationBase): - def __init__(self, chainDict): - ChainConfigurationBase.__init__(self, chainDict) - - - def assembleChain(self): - chainSteps = [] - log.debug("Assembling chain for " + self.chainName) - - ebSeq = self.enhancedBiasMenuSequence() - chainSteps.append( ChainStep(name='Step1_EnhancedBias', Sequences=[ebSeq]) ) - return self.buildChain(chainSteps) +def enahncedBiasSequence_Cfg(flags): + return enhancedBiasMenuSequence() - def enhancedBiasMenuSequence(self): +def enhancedBiasMenuSequence(): # InputMaker and sequence (_, inputMakerAlg, enhancedBiasSequence) = RecoFragmentsPool.retrieve(enhancedBiasAthSequence, None) @@ -123,3 +113,17 @@ class EnhancedBiasChainConfiguration(ChainConfigurationBase): Maker = inputMakerAlg, Hypo = hypoAlg, HypoToolGen = EnhancedBiasHypoToolGen ) + + +class EnhancedBiasChainConfiguration(ChainConfigurationBase): + def __init__(self, chainDict): + ChainConfigurationBase.__init__(self, chainDict) + + + def assembleChain(self): + chainSteps = [] + log.debug("Assembling chain for " + self.chainName) + + chainSteps.append( self.getStep(1,"EnhancedBias", [enahncedBiasSequence_Cfg]) ) + + return self.buildChain(chainSteps) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py index 404aa8e7ec49b8ffb111832e18a402195593ae27..97f82f80bc9c3ce9b4076ca13b085f2182eea23b 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py @@ -5,7 +5,7 @@ logging.getLogger().info("Importing %s",__name__) log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.MonitorChainConfiguration") from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase -from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep, MenuSequence +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence from DecisionHandling.DecisionHandlingConf import InputMakerForRoI, ViewCreatorInitialROITool from AthenaCommon.CFElements import seqAND from TrigGenericAlgs.TrigGenericAlgsConfig import TimeBurnerCfg, TimeBurnerHypoToolGen @@ -15,6 +15,24 @@ from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable # fragments generating configuration will be functions in New JO, # so let's make them functions already now #---------------------------------------------------------------- +def TimeBurnerSequenceCfg(flags): + # Input maker - required by the framework, but inputs don't matter for TimeBurner + inputMaker = InputMakerForRoI("IM_TimeBurner") + inputMaker.RoITool = ViewCreatorInitialROITool() + inputMaker.RoIs="TimeBurnerInputRoIs" + inputMakerSeq = seqAND("TimeBurnerSequence", [inputMaker]) + + # TimeBurner alg works as a reject-all hypo + hypoAlg = conf2toConfigurable(TimeBurnerCfg()) + hypoAlg.SleepTimeMillisec = 200 + + return MenuSequence( + Sequence = inputMakerSeq, + Maker = inputMaker, + Hypo = hypoAlg, + HypoToolGen = TimeBurnerHypoToolGen) + + #---------------------------------------------------------------- # Class to configure chain @@ -45,21 +63,5 @@ class MonitorChainConfiguration(ChainConfigurationBase): # -------------------- # TimeBurner configuration # -------------------- - def getTimeBurnerStep(self): - # Input maker - required by the framework, but inputs don't matter for TimeBurner - inputMaker = InputMakerForRoI("IM_TimeBurner") - inputMaker.RoITool = ViewCreatorInitialROITool() - inputMaker.RoIs="TimeBurnerInputRoIs" - inputMakerSeq = seqAND("TimeBurnerSequence", [inputMaker]) - - # TimeBurner alg works as a reject-all hypo - hypoAlg = conf2toConfigurable(TimeBurnerCfg()) - hypoAlg.SleepTimeMillisec = 200 - - seq = MenuSequence( - Sequence = inputMakerSeq, - Maker = inputMaker, - Hypo = hypoAlg, - HypoToolGen = TimeBurnerHypoToolGen) - - return ChainStep(name='Step1_TimeBurner', Sequences=[seq]) + def getTimeBurnerStep(self): + return self.getStep(1,'TimeBurner',[TimeBurnerSequenceCfg]) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py index a64911614ac7f27304f3f7b71e4eb2b8e8973d8f..c9223001f7be982ae0a86ca46108f56ac9299855 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequenceSetup.py @@ -14,7 +14,7 @@ from AthenaCommon.Logging import logging log = logging.getLogger('EventBuildingSequenceSetup') -def addEventBuildingSequence(chain, eventBuildType): +def addEventBuildingSequence(chain, eventBuildType, chainDict): ''' Add an extra ChainStep to a Chain object with a PEBInfoWriter sequence configured for the eventBuildType ''' @@ -36,7 +36,7 @@ def addEventBuildingSequence(chain, eventBuildType): HypoToolGen = pebInfoWriterToolGenerator) step_name = 'Step{:d}_PEBInfoWriter_{:s}'.format(len(chain.steps)+1, eventBuildType) - step = ChainStep(name=step_name, Sequences=[seq]) + step = ChainStep(name=step_name, Sequences=[seq], chainDicts=[chainDict]) chain.steps.append(step) @@ -163,4 +163,4 @@ def alignEventBuildingSteps(all_chains): if pebStepPosition < maxPebStepPosition[ebt]: numStepsNeeded = maxPebStepPosition[ebt] - pebStepPosition log.debug('Aligning PEB step for chain %s by adding %d empty steps', chainDict['chainName'], numStepsNeeded) - chainConfig.insertEmptySteps(chainDict,'EmptyPEBAlign', numStepsNeeded, pebStepPosition-1) + chainConfig.insertEmptySteps('EmptyPEBAlign', numStepsNeeded, pebStepPosition-1) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py index 553fbbb9de38512dbbdf12b145a75a9c8620c9e3..213ae8b8304f12b10a05acab4b536a08245438f9 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py @@ -44,8 +44,9 @@ def generateChains( flags, chainDict ): CA = accCalo) accCalo.printConfig() - + # this cannot work for asymmetric combined chains....FP fastCaloStep = ChainStep(name=firstStepName, Sequences=[fastCaloSequence], chainDicts=[chainDict], multiplicity=getChainMultFromDict(chainDict)) + secondStepName = 'ElectronFTF' diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py index eadbcb44b6f8147790f5877dd795f0f59c6655ad..8f92069262badb3f004d8fc5ffb218adced909b0 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py @@ -86,7 +86,7 @@ def splitInterSignatureChainDict(chainDict): return listOfSplitChainDicts -# maybe obsolete? + def splitChainDict(chainDict): listOfChainDicts = [] for chainPart in chainDict['chainParts']: @@ -95,10 +95,22 @@ def splitChainDict(chainDict): listOfChainDicts += [newChainDict] return listOfChainDicts +def splitChainDictInLegs(chainDict): + from TrigCompositeUtils.TrigCompositeUtils import legName + if len(chainDict['chainParts']) ==1: + return [chainDict] + chainName= chainDict['chainName'] + listOfChainDicts = [] + for count, chainDictPart in enumerate(chainDict['chainParts']): + onePartChainDict = deepcopy( chainDict ) + onePartChainDict['chainParts'] = [ chainDictPart ] + onePartChainDict['chainName'] = legName(chainName, count) + listOfChainDicts += [onePartChainDict] + return listOfChainDicts -def splitChainInDict(chainName): +def splitChainInLegs(chainName): from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT from TrigCompositeUtils.TrigCompositeUtils import legName chainDict = TriggerConfigHLT.getChainDictFromChainName(chainName) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py index be17ad84a14a497e88861554c66f4ab1b08026b2..7d7fb33e73146e4a94122044ae06512763390913 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py @@ -140,7 +140,7 @@ def serial_zip(allSteps, chainName): if emptyStep is None: seqName = getEmptySeqName(step.name, chain_index, step_index+1) emptySeq = RecoFragmentsPool.retrieve(getEmptyMenuSequence, flags=None, name=seqName) - stepList[step_index2] = ChainStep( seqName, Sequences=[emptySeq], chainDicts=step.chainDicts) + stepList[step_index2] = ChainStep( seqName, Sequences=[emptySeq], chainDicts=step.stepDicts) newsteps.append(stepList) log.debug('After serial_zip') @@ -219,7 +219,7 @@ def makeCombinedStep(steps, stepNumber, chainDefList): stepSeq.append(emptySeq) stepMult.append(1) # we need a chain dict here, use the one corresponding to this leg of the chain - stepDicts.append(deepcopy(chainDefList[chain_index].steps[-1].chainDicts[-1])) + stepDicts.append(deepcopy(chainDefList[chain_index].steps[-1].stepDicts[-1])) else: # Standard step, append it to the combined step log.debug(" step %s, multiplicity = %s", step.name, str(step.multiplicity)) @@ -242,7 +242,7 @@ def makeCombinedStep(steps, stepNumber, chainDefList): stepMult.append(sum(step.multiplicity)) comboHypoTools.extend(step.comboToolConfs) # update the chain dict list for the combined step with the chain dict from this step - stepDicts += deepcopy(step.chainDicts) + stepDicts += deepcopy(step.stepDicts) # the step naming for combined chains needs to be revisted!! diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py index 0b03fa560f1eed361c666d2825532ae775b5d55e..057d6f7eef225344288f6875251663b97bbdf2ca 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py @@ -148,6 +148,7 @@ def getChainMultFromDict(chainDict): Look for all multiplicities stored in chains """ allMultis = [] + for cpart in chainDict['chainParts']: if cpart['multiplicity'] != '': allMultis.append( int(cpart['multiplicity'])) @@ -230,6 +231,7 @@ def analyseChainName(chainName, L1thresholds, L1item): 'trigType': sigToken, 'extra': ''} mdicts.append( groupdict ) + log.debug("chain parts: %s", cparts) for cpart in cparts: @@ -252,13 +254,13 @@ def analyseChainName(chainName, L1thresholds, L1item): if theMultiChainIndex not in multichainindex: multichainindex.append(theMultiChainIndex) - log.debug("HLTChainName: %s", hltChainName) - log.debug("HLTChainNameShort: %s", hltChainNameShort) - log.debug("cpart: %s", cpart) - log.debug("groupdict: %s", groupdict) - log.debug("multichainindex: %s", multichainindex) + log.debug("HLTChainName: %s", hltChainName) + log.debug("HLTChainNameShort: %s", hltChainNameShort) + log.debug("cpart: %s", cpart) + log.debug("groupdict: %s", groupdict) + log.debug("multichainindex: %s", multichainindex) - sName = getSignatureNameFromToken(cpart) + sName = getSignatureNameFromToken(cpart) groupdict['signature'] = sName groupdict['alignmentGroup'] = getAlignmentGroupFromPattern(sName, groupdict['extra']) @@ -501,7 +503,7 @@ def dictFromChainName(chainInfo): mergingOffset = chainInfo.mergingOffset mergingOrder = chainInfo.mergingOrder topoStartFrom = chainInfo.topoStartFrom - + else: assert True, "Format of chainInfo passed to genChainDict not known" diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py index f60279990189dfce42b2952e8bdb11ceb9b74a9e..e67017394db74b71353750ba8319288a414aba0f 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py @@ -460,7 +460,7 @@ class GenerateMenuMT(object): eventBuildType = mainChainDict['eventBuildType'] if eventBuildType: log.debug('Configuring event building sequence %s for chain %s', eventBuildType, mainChainDict['chainName']) - EventBuildingSequenceSetup.addEventBuildingSequence(theChainConfig, eventBuildType) + EventBuildingSequenceSetup.addEventBuildingSequence(theChainConfig, eventBuildType, mainChainDict) log.debug('ChainConfigs %s ', theChainConfig) return theChainConfig,lengthOfChainConfigs diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py index 8cb1cb454e15cb34937d47a02aa9895b36a8e518..ec70259e6dde23460acb921ae7180c127533f1fd 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py @@ -377,10 +377,11 @@ def createDataFlow(chains, allDicts): log.debug("\n Configuring chain %s with %d steps: \n - %s ", chain.name,len(chain.steps),'\n - '.join(map(str, [{step.name:step.multiplicity} for step in chain.steps]))) lastCFseq = None + lastDecisions = [] for nstep, chainStep in enumerate( chain.steps ): log.debug("\n************* Start connecting step %d %s for chain %s", nstep+1, chainStep.name, chain.name) - filterInput = chain.L1decisions if nstep == 0 else lastCFseq.decisions + filterInput = chain.L1decisions if nstep == 0 else lastDecisions log.debug("Seeds added; having in the filter now: %s", filterInput) @@ -392,8 +393,9 @@ def createDataFlow(chains, allDicts): sequenceFilter= None filterName = CFNaming.filterName(chainStep.name) filterOutput =[ CFNaming.filterOutName(filterName, inputName) for inputName in filterInput ] - log.debug("Filter outputps: %s", filterOutput) +# log.debug("Filter outputps: %s", filterOutput) +# note: can use (foundFilter, foundCFSeq) = findCFSequences(filterName, CFseqList[nstep]) log.debug("Found %d CF sequences with filter name %s", foundFilter, filterName) # add error if more than one @@ -402,23 +404,28 @@ def createDataFlow(chains, allDicts): CFseq = CFSequence( ChainStep=chainStep, FilterAlg=sequenceFilter) CFseq.connect(filterOutput) CFseqList[nstep].append(CFseq) + lastDecisions=CFseq.decisions lastCFseq=CFseq else: if len(foundCFSeq) > 1: log.error("Found more than one seuqences containig this filter %s", filterName) lastCFseq=foundCFSeq[0] sequenceFilter=lastCFseq.filter - lastCFseq.connect(filterOutput) + #lastCFseq.connect(filterOutput) [ sequenceFilter.addInput(inputName) for inputName in filterInput ] [ sequenceFilter.addOutput(outputName) for outputName in filterOutput ] - + lastCFseq.connect(filterOutput) + if chainStep.isEmpty: + lastDecisions=filterOutput + else: + lastDecisions=lastCFseq.decisions # add chains to the filter: - chainLegs = chain.getChainLegs() + chainLegs = chainStep.getChainLegs() for leg in chainLegs: sequenceFilter.addChain(leg) log.debug("Adding chain %s to %s", leg, sequenceFilter.Alg.name()) - log.debug("Now Filter has chains: %s", sequenceFilter.getChains()) +# log.debug("Now Filter has chains: %s", sequenceFilter.getChains()) if chainStep.isCombo: if chainStep.combo is not None: @@ -427,7 +434,7 @@ def createDataFlow(chains, allDicts): if len(chain.steps) == nstep+1: log.debug("Adding finalDecisions for chain %s at step %d:", chain.name, nstep+1) - for dec in lastCFseq.decisions: + for dec in lastDecisions: finalDecisions[nstep].append(dec) log.debug(dec) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py index 7e2c2389efc8c8dfc386cab8cd3f4743a90455b4..2e2d2bd671a390eb29e6e4dcf9fcfd7ec8339eba 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py @@ -4,7 +4,7 @@ from AthenaCommon.CFElements import findAllAlgorithms, parOR, seqAND, isSequence from AthenaCommon.Logging import logging from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory -from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainInDict +from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainInLegs from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import (isComboHypoAlg, isFilterAlg, isHypoAlg, @@ -380,8 +380,8 @@ def generateDecisionTree(chains): hypoAlg.HypoTools.append( step.sequences[sequenceCounter]._hypoToolConf.confAndCreate( chainDict ) ) pass - chainDictLegs = splitChainInDict( chain.name ) - # possible cases: A) number of seqeunces == number of chain parts, e5_mu10 or just e3 type of chain + chainDictLegs = splitChainInLegs( chain.name ) + # possible cases: A) number of seqeunces == number of chain parts, e5_mu10 or just e3 type of chain # ([0, 1], [0, 1]) is the set of indices indices = zip( range( len( step.sequences ) ), range( len( chainDictLegs ) ) )# case A # B) number of sequences == 1 && number of chain parts > 1 for single signature assymetric combined chains e5_e3 type chain @@ -408,6 +408,7 @@ def generateDecisionTree(chains): for comboToolConf in step.comboToolConfs: comboHypoAlg.ComboHypoTools.append( comboToolConf.confAndCreate( TriggerConfigHLT.getChainDictFromChainName( chain.name ) ) ) + for chain in chains: log.info( "CF algorithms for chain {}".format(chain.name)) for stepCounter, step in enumerate( chain.steps, 1 ): diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFDot.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFDot.py index 4b26e7a96473f90d660f5bee971a6cf489dd24a7..2838ac1a876a5269941d0219d877fbffd84c4ffa 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFDot.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFDot.py @@ -139,7 +139,9 @@ def all_DataFlow_to_dot(name, step_list): file.write(' }\n') file.write(findConnections(cfseq_algs)) file.write('\n') - + +# print ("Step connections: ") +# print (step_connections) file.write(findConnections(step_connections)) nstep+=1 @@ -208,7 +210,7 @@ def findConnections(alg_list): if len(dataIntersection) > 0: for line in dataIntersection: lineconnect+=addConnection(compName(nodeA.Alg), compName(nodeB.Alg), line) -# print "Data connections between %s and %s: %s"%(nodeA.Alg.getName(), nodeB.Alg.getName(), line) +# print ("Data connections between ", compName(nodeA.Alg)," and ",compName(nodeB.Alg) ,": ", line) return lineconnect diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py index 974b487c5df17f95abf8a3a1861408e7b16e7f1d..c3503455125a5bac748dce4e4cd420730b8f0243 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py @@ -95,6 +95,7 @@ def __generateJSON( chainDicts, chainConfigs, HLTAllSteps, menuName, fileName ): # Find L1 Threshold information for current chain l1Thresholds = [] + [ l1Thresholds.append(p['L1threshold']) for p in chain['chainParts'] ] # Now have all information to write the chain to the menu dictionary diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_emu_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_emu_v1.py index ff1bf431be0d9fca50faa4faba99600170e95b2d..76de91628711dbf65ed6846589f2c1bfc8eb136d 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_emu_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_emu_v1.py @@ -43,15 +43,15 @@ def setupMenu(): ChainProp(name='HLT_TestChain5_gv1_L1EM7', stream=['Main'], groups=['RATE:Test','BW:Other'] ), # combined - ChainProp(name='HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5', stream=['Main'], groups=['RATE:Test','BW:Other'], mergingStrategy = 'parallel' ), - ChainProp(name='HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5', stream=['Main'], groups=['RATE:Test','BW:Other'], mergingStrategy = 'parallel' ), + ChainProp(name='HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5', stream=['Main'], groups=['RATE:Test','BW:Other'], mergingStrategy = 'parallel'), + ChainProp(name='HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5', stream=['Main'], groups=['RATE:Test','BW:Other'], mergingStrategy = 'parallel'), ChainProp(name='HLT_TestChain5_ev1_TestChain8_ev1_L12EM3', stream=['Main'], groups=['RATE:Test','BW:Other'], mergingStrategy = 'parallel'), # ChainProp(name='HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6', stream=['Main'], groups=['RATE:Test','BW:Other'] ), ChainProp(name='HLT_2TestChain6_muv1_L12MU6', stream=['Main'], groups=['RATE:Test','BW:Other'] ), ChainProp(name='HLT_3TestChain6_muv1_L12MU6', stream=['Main'], groups=['RATE:Test','BW:Other'] ), - ChainProp(name='HLT_TestChain6_muv1_TestChain10_muv1_L12MU6', stream=['Main'], groups=['RATE:Test','BW:Other'], mergingStrategy = 'parallel' ), - ChainProp(name='HLT_2TestChain6_muEmpty1_L12MU6', stream=['Main'], groups=['RATE:Test','BW:Other'], mergingStrategy = 'parallel'), #may differ from manual - ChainProp(name='HLT_TestChain6_muv1_TestChain5_ev1dr_L1MU6_EM5', stream=['Main'], groups=['RATE:Test','BW:Other'], mergingStrategy = 'parallel' ), + ChainProp(name='HLT_TestChain6_muv1_TestChain10_muv1_L12MU6', stream=['Main'], groups=['RATE:Test','BW:Other'], mergingStrategy = 'parallel' ), + ChainProp(name='HLT_2TestChain6_muEmpty1_L12MU6', stream=['Main'], groups=['RATE:Test','BW:Other']), #may differ from manual + ChainProp(name='HLT_TestChain6_muv1_TestChain5_ev1dr_L1MU6_EM5', stream=['Main'], groups=['RATE:Test','BW:Other'], mergingStrategy = 'parallel'), ChainProp(name='HLT_2TestChain4_muv1dr_L12MU6', stream=['Main'], groups=['RATE:Test','BW:Other'] ), # FSNOSEED not implemented in emulation diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py index 0a7a417ca28766c2c0236b7cb09d5f18ba3bc273..1e95b4e6f7087133c734d574701bb0ba72279945 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py @@ -52,7 +52,8 @@ def setupMenu(flags): flags.Trigger.menu.electron = [ ChainProp(name='HLT_e3_etcut_L1EM3', groups=SingleElectronGroup), ChainProp(name='HLT_2e3_etcut_L12EM3', groups=MultiElectronGroup), - ChainProp(name='HLT_e5_etcut_e3_etcut_L12EM3', groups=MultiElectronGroup), +# this chain does not work yet + # ChainProp(name='HLT_e5_etcut_e3_etcut_L12EM3', groups=MultiElectronGroup), ChainProp(name='HLT_e5_etcut_L1EM3', groups=SingleElectronGroup), ChainProp(name='HLT_e7_etcut_L1EM7', groups=SingleElectronGroup) ] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py index 7ec9ed562c2443cdfac1903a93f97c90249aabdc..4ec9960baa200040c759335b03260a11aeff39fd 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py @@ -193,7 +193,7 @@ class MenuAlignment(): aligngroups_set.reverse() for align_grp_to_align in aligngroups_set: - chainConfig.insertEmptySteps(chainDict,'Empty'+align_grp_to_align+'Align',self.length_of_configs[align_grp_to_align],0) + chainConfig.insertEmptySteps('Empty'+align_grp_to_align+'Align',self.length_of_configs[align_grp_to_align],0) log.debug("Finished with retrieving chain configuration for chain %s", chainDict['chainName']) chainConfig.numberAllSteps() @@ -233,7 +233,7 @@ class MenuAlignment(): if length_firstgrp < max_length_firstgrp: #too short! need to add padding steps between two alignment groups... needed_steps = max_length_firstgrp - length_firstgrp - chainConfig.insertEmptySteps(chainDict,'Empty'+self.sets_to_align[alignment_grps[0]][0]+'Align',needed_steps,length_firstgrp) + chainConfig.insertEmptySteps('Empty'+self.sets_to_align[alignment_grps[0]][0]+'Align',needed_steps,length_firstgrp) elif length_firstgrp > max_length_firstgrp: log.error("%s first signature length %d is greater than the max calculated, %d",chainDict.name,length_firstgrp, max_length_firstgrp) @@ -279,11 +279,11 @@ class MenuAlignment(): #too short! gotta add padding steps between two alignmentGroups... needed_steps = max_length_grp - length_in_chain start_step = n_steps_before_grp + length_in_chain - chainConfig.insertEmptySteps(chainDict,'Empty'+align_grp+'Align',needed_steps,start_step) + chainConfig.insertEmptySteps('Empty'+align_grp+'Align',needed_steps,start_step) else: # this sig isn't in the chain, but we still will need empty steps for it # always add them to the start, because we're running in reverse order - chainConfig.insertEmptySteps(chainDict,'Empty'+align_grp+'Align',self.length_of_configs[align_grp],n_steps_before_grp) + chainConfig.insertEmptySteps('Empty'+align_grp+'Align',self.length_of_configs[align_grp],n_steps_before_grp) else: log.error("Should never reach this point. alignmentGroups: %s, sets_to_align: %s",alignment_grps,self.sets_to_align) raise Exception("MenuAlignment.multi_align() needs checking, this should never happen.") diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py index a03c5f1820fec691f667ea407ef5aef7a004a304..f21f12636640ad92e714ccb80070a4d5b16974ce 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py @@ -176,8 +176,6 @@ class HypoAlgNode(AlgNode): log.error("Hypo " + self.name +" has already %s as configured output: you may want to duplicate the Hypo!" + outputs[0]) - - def addHypoTool (self, hypoToolConf): log.debug(" Adding HypoTool %s to %s", hypoToolConf.chainDict['chainName'], compName(self.Alg)) if hypoToolConf.chainDict['chainName'] not in self.tools: @@ -274,14 +272,16 @@ class ComboMaker(AlgNode): def createComboHypoTools(self, chainDict, comboToolConfs): - """Created the ComboHypoTools""" - if not len(comboToolConfs): - return - confs = [ HypoToolConf( tool ) for tool in comboToolConfs ] - log.debug("ComboMaker.createComboHypoTools for chain %s, Alg %s with %d tools", chainDict["chainName"],self.Alg.getName(), len(comboToolConfs)) - for conf in confs: - tools = self.Alg.ComboHypoTools - self.Alg.ComboHypoTools = tools + [ conf.confAndCreate( chainDict ) ] + """Created the ComboHypoTools""" + if not len(comboToolConfs): + return + confs = [ HypoToolConf( tool ) for tool in comboToolConfs ] + log.debug("ComboMaker.createComboHypoTools for chain %s, Alg %s with %d tools", chainDict["chainName"],self.Alg.getName(), len(comboToolConfs)) + for conf in confs: + tools = self.Alg.ComboHypoTools + self.Alg.ComboHypoTools = tools + [ conf.confAndCreate( chainDict ) ] + + ######################################################### @@ -531,6 +531,7 @@ class Chain(object): self.alignmentGroups = alignmentGroups self.vseeds=L1Thresholds + from L1Decoder.L1DecoderConfig import mapThresholdToL1DecisionCollection # L1decisions are used to set the seed type (EM, MU,JET), removing the actual threshold # in practice it is the L1Decoder Decision output @@ -558,7 +559,7 @@ class Chain(object): step.name = 'Step%d_'%(stepID+1)+step_name return - def insertEmptySteps(self, chainDict, empty_step_name, n_new_steps, start_position): + def insertEmptySteps(self, empty_step_name, n_new_steps, start_position): #start position indexed from 0. if start position is 3 and length is 2, it works like: # [old1,old2,old3,old4,old5,old6] ==> [old1,old2,old3,empty1,empty2,old4,old5,old6] import re @@ -575,24 +576,29 @@ class Chain(object): next_step_name = '' prev_step_name = '' + # copy the same dictionary as the last step, which else? + prev_chain_dict = [] if start_position == 0: next_step_name = chain_steps_post_split[0].name if re.search('^Step[0-9]_',next_step_name): next_step_name = next_step_name[6:] prev_step_name = 'empty_'+str(len(self.L1decisions))+'L1in' + prev_chain_dict = chain_steps_post_split[0].stepDicts else: if len(chain_steps_post_split) == 0: log.error("Adding empty steps to the end of a chain - why would you do this?") else: prev_step_name = chain_steps_pre_split[-1].name next_step_name = chain_steps_post_split[0].name + prev_chain_dict = chain_steps_pre_split[-1].stepDicts + steps_to_add = [] for stepID in range(1,n_new_steps+1): new_step_name = prev_step_name+'_'+empty_step_name+'%d_'%stepID+next_step_name log.debug("Configuring empty step " + new_step_name) - steps_to_add += [ChainStep(new_step_name, [], [], [chainDict], comboHypoCfg=ComboHypoCfg)] + steps_to_add += [ChainStep(new_step_name, [], [], chainDicts=prev_chain_dict, comboHypoCfg=ComboHypoCfg)] self.steps = chain_steps_pre_split + steps_to_add + chain_steps_post_split @@ -628,58 +634,21 @@ class Chain(object): seq.setSeed( seed ) log.debug( "setSeedsToSequences: Chain %s adding seed %s to sequence in step %s", self.name, seed, step.name ) - def getChainLegs(self): - """ This is extrapolating the chain legs from the chain dictionary""" - from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainInDict - listOfChainDictsLegs = splitChainInDict(self.name) - legs = [part['chainName'] for part in listOfChainDictsLegs] - return legs - - + def createHypoTools(self): """ This is extrapolating the hypotool configuration from the chain name""" - log.debug("createHypoTools for chain %s", self.name) - from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainInDict - - # this spliting is only needed for chains which don't yet attach - # the dictionaries to the chain steps. It should be removed - # later once that migration is done. - listOfChainDictsLegs = splitChainInDict(self.name) + log.debug("createHypoTools for chain %s", self.name) + for step in self.steps: - log.debug("createHypoTools for Step %s", step.name) if len(step.sequences) == 0: continue - - if sum(step.multiplicity) >1 and not step.isCombo: - log.error("This should be an error, because step mult > 1 (%d), but step is not combo", sum(step.multiplicity)) - - if len(step.chainDicts) > 0: - # new way to configure hypo tools, works if the chain dictionaries have been attached to the steps - log.debug('%s in new hypo tool creation method, step mult= %d, isCombo=%d', self.name, sum(step.multiplicity), step.isCombo) - log.debug("N(seq)=%d, N(chainDicts)=%d", len(step.sequences), len(step.chainDicts)) - - assert len(step.sequences)==len(step.chainDicts), "createHypoTools only makes sense if number of sequences == number of chain dicts" - for seq, onePartChainDict in zip(step.sequences, step.chainDicts): - log.debug(' seq: %s, onePartChainDict:', seq.name) - log.debug(' ' + str(onePartChainDict)) - seq.createHypoTools( onePartChainDict ) - - else: - # legacy way, to be removed once all signatures pass the chainDicts to the steps - step_mult = [str(m) for m in step.multiplicity] - log.debug('%s in old hypo tool creation method', self.name) - menu_mult = [ part['chainParts'][0]['multiplicity'] for part in listOfChainDictsLegs ] - if step_mult != menu_mult: - # Probably this shouldn't happen, but it currently does - log.warning("Got multiplicty %s from chain parts, but have %s multiplicity in this step. This is expected only for jet chains, but it has happened for %s, using the first chain dict", menu_mult, step.multiplicity, self.name) - firstChainDict = listOfChainDictsLegs[0] - firstChainDict['chainName']= self.name # rename the chaindict to remove the leg name - for seq in step.sequences: - seq.createHypoTools( firstChainDict ) - else: - # add one hypotool per sequence and chain part - for seq, onePartChainDict in zip(step.sequences, listOfChainDictsLegs): - seq.createHypoTools( onePartChainDict ) + log.debug("createHypoTools for Step %s", step.name) + log.debug('%s in new hypo tool creation method, step mult= %d, isCombo=%d', self.name, sum(step.multiplicity), step.isCombo) + log.debug("N(seq)=%d, N(chainDicts)=%d", len(step.sequences), len(step.stepDicts)) + for seq, onePartChainDict in zip(step.sequences, step.stepDicts): + log.debug(' seq: %s, onePartChainDict:', seq.name) + log.debug(' ' + str(onePartChainDict)) + seq.createHypoTools( onePartChainDict ) step.createComboHypoTools(self.name) @@ -773,6 +742,7 @@ class StepComponent(object): self.multiplicity=multiplicity self.empty=empty +# next: can we remove multiplicity array, if it can be retrieved from the ChainDict? class ChainStep(object): """Class to describe one step of a chain; if multiplicity is greater than 1, the step is combo/combined. Set one multiplicity value per sequence""" def __init__(self, name, Sequences=[], multiplicity=[1], chainDicts=[], comboHypoCfg=ComboHypoCfg, comboToolConfs=[]): @@ -780,24 +750,27 @@ class ChainStep(object): # include cases of emtpy steps with multiplicity = [] or multiplicity=[0,0,0///] if sum(multiplicity)==0: multiplicity=[] - - # This check is commented out (temporarily before can be removed completely) to support signatures wiht one sequence and multiplicty > 1, e.g. HLT_2e3 - # In such case there is only one sequence, however the multiplicty is == 2 - # sanity check on inputs - #if len(Sequences) != len(multiplicity): - # raise RuntimeError("Tried to configure a ChainStep %s with %i Sequences and %i multiplicities. These lists must have the same size" % (name, len(Sequences), len(multiplicity)) ) + else: + # sanity check on inputs, excluding empty steps + if len(Sequences) != len(multiplicity): + raise RuntimeError("Tried to configure a ChainStep %s with %i Sequences and %i multiplicities. These lists must have the same size" % (name, len(Sequences), len(multiplicity)) ) + + if len(Sequences) != len(chainDicts): + raise RuntimeError("Tried to configure a ChainStep %s with %i Sequences and %i dictionaries. These lists must have the same size" % (name, len(Sequences), len(chainDicts)) ) self.name = name self.sequences=Sequences self.multiplicity = multiplicity self.comboHypoCfg=comboHypoCfg self.comboToolConfs=comboToolConfs + self.stepDicts = chainDicts # one dict per leg self.isCombo=sum(multiplicity)>1 + self.isEmpty=sum(multiplicity)==0 self.combo=None - self.chainDicts = chainDicts if self.isCombo: self.makeCombo() - + + def addComboHypoTools(self, tools): self.comboToolConfs.append(tools) @@ -812,6 +785,11 @@ class ChainStep(object): from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT chainDict = TriggerConfigHLT.getChainDictFromChainName(chainName) self.combo.createComboHypoTools(chainDict, self.comboToolConfs) + + def getChainLegs(self): + """ This is extrapolating the chain legs from the step dictionaries""" + legs = [part['chainName'] for part in self.stepDicts] + return legs def getChainNames(self): if not self.isCombo: @@ -821,20 +799,17 @@ class ChainStep(object): def __repr__(self): if len(self.sequences) == 0: - return "--- ChainStep %s ---\n is Empty, ChainDict = %s "%(self.name, ' '.join(map(str, [dic['chainName'] for dic in self.chainDicts])) ) - if not self.isCombo: - return "--- ChainStep %s ---\n , multiplicity = %d ChainDict = %s \n + MenuSequences = %s "%(self.name, sum(self.multiplicity), ' '.join(map(str, [dic['chainName'] for dic in self.chainDicts])), ' '.join(map(str, [seq.name for seq in self.sequences]) )) - else: - if self.combo: - calg = self.combo.Alg.name() - else: - calg = 'NONE' - return "--- ChainStep %s ---\n + isCombo, multiplicity = %d ChainDict = %s \n + MenuSequences = %s \n + ComboHypo = %s, ComboHypoTools = %s" %\ - (self.name, sum(self.multiplicity), - ' '.join(map(str, [dic['chainName'] for dic in self.chainDicts])), - ' '.join(map(str, [seq.name for seq in self.sequences]) ), - calg, + return "--- ChainStep %s ---\n is Empty, ChainDict = %s "%(self.name, ' '.join(map(str, [dic['chainName'] for dic in self.stepDicts])) ) + + repr_string= "--- ChainStep %s ---\n , multiplicity = %s ChainDict = %s \n + MenuSequences = %s "%\ + (self.name, ' '.join(map(str,[mult for mult in self.multiplicity])), + ' '.join(map(str, [dic['chainName'] for dic in self.stepDicts])), + ' '.join(map(str, [seq.name for seq in self.sequences]) )) + if self.isCombo: + repr_string += "\n+ ComboHypo = %s, ComboHypoTools = %s" %\ + (self.combo.Alg.name(), ' '.join(map(str, [tool.__name__ for tool in self.comboToolConfs]))) + return repr_string def createComboAlg(dummyFlags, name, multiplicity, comboHypoCfg): diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py index f1ca0df55f1b844173d307f46e479f31c08b4f70..1214b696d22898e61c114707bddad089ae1e1e9a 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py @@ -6,143 +6,35 @@ log = logging.getLogger( __name__ ) from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase -from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence -from AthenaCommon.CFElements import parOR -from AthenaCommon.CFElements import seqAND -from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep -from TrigInDetConfig.InDetSetup import makeInDetAlgs -from TrigEDMConfig.TriggerEDMRun3 import recordable -from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm -from DecisionHandling.DecisionHandlingConf import ViewCreatorInitialROITool -from AthenaCommon.GlobalFlags import globalflags -from TrigInDetConfig.ConfigSettings import getInDetTrigConfig +from TriggerMenuMT.HLTMenuConfig.MinBias.MinBiasMenuSequences import MinBiasSPSequence, MinBiasTrkSequence + #---------------------------------------------------------------- # fragments generating configuration will be functions in New JO, # so let's make them functions already now #---------------------------------------------------------------- +def MinBiasSPSequenceCfg(flags): + return MinBiasSPSequence() + +def MinBiasTrkSequenceCfg(flags): + return MinBiasTrkSequence() + + class MinBiasChainConfig(ChainConfigurationBase): def __init__(self, chainDict): ChainConfigurationBase.__init__(self,chainDict) - # ---------------------- - # Assemble the chain depending on information from chainName - # ---------------------- + # ---------------------- + # Assemble the chain depending on information from chainName + # ---------------------- def assembleChain(self): log.debug("Assembling chain for " + self.chainName) SpStep = self.getMinBiasSpStep() TrkStep = self.getMinBiasTrkStep() - return self.buildChain([SpStep,TrkStep]) + def getMinBiasSpStep(self): - """ Use the reco-dict to construct a single MinBias step """ - def generateSPCountHypo(chainDict): - hypo = SPCountHypoTool(chainDict["chainName"]) - if "hmt" in chainDict["chainName"]: - hypo.totNumSctSP = int( chainDict["chainParts"][0]["hypoL2Info"].strip("sp") ) - if "mb_sptrk" in chainDict["chainName"]: - hypo.totNumPixSP = 2 - hypo.totNumSctSP = 3 - # will set here thresholds - return hypo - SpList = [] - from TrigT2MinBias.TrigT2MinBiasConf import TrigCountSpacePointsMT, SPCountHypoAlgMT, SPCountHypoTool - - - SPInputMakerAlg = EventViewCreatorAlgorithm("IM_SPEventViewCreator") - SPInputMakerAlg.ViewFallThrough = True - SPInputMakerAlg.RoITool = ViewCreatorInitialROITool() - SPInputMakerAlg.InViewRoIs = "InputRoI" - SPInputMakerAlg.Views = "SPView" - - IDTrigConfig = getInDetTrigConfig( 'minBias' ) - idAlgs, verifier = makeInDetAlgs( config = IDTrigConfig, rois=SPInputMakerAlg.InViewRoIs, viewVerifier='SPViewDataVerifier' ) - verifier.DataObjects += [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+InputRoI' ), - ( 'SCT_ID' , 'DetectorStore+SCT_ID' ), - ( 'PixelID' , 'DetectorStore+PixelID' ), - ( 'TagInfo' , 'DetectorStore+ProcessingTags' )] - - # Make sure required objects are still available at whole-event level - from AthenaCommon.AlgSequence import AlgSequence - topSequence = AlgSequence() - topSequence.SGInputLoader.Load += [( 'SCT_ID' , 'DetectorStore+SCT_ID' ), - ( 'PixelID' , 'DetectorStore+PixelID' ), - ( 'TagInfo' , 'DetectorStore+ProcessingTags' )] - - SpList = idAlgs[:-2] - - SpCount=TrigCountSpacePointsMT() - SpCount.SpacePointsKey=recordable("HLT_SpacePointCounts") - - from TrigT2MinBias.TrigT2MinBiasMonitoringMT import SpCountMonitoring - SpCount.MonTool = SpCountMonitoring() - - SPrecoSeq = parOR("SPrecoSeq", SpList + [ SpCount ]) - SPSequence = seqAND("SPSequence", [SPInputMakerAlg, SPrecoSeq]) - SPInputMakerAlg.ViewNodeName = SPrecoSeq.name() - - - SpCountHypo =SPCountHypoAlgMT() - SpCountHypo.SpacePointsKey=recordable("HLT_SpacePointCounts") - - Step1_SPCount = ChainStep( "Step1_SPCount", [MenuSequence( Sequence = SPSequence, - Maker = SPInputMakerAlg, - Hypo = SpCountHypo, - HypoToolGen = generateSPCountHypo )] ) - - return Step1_SPCount + return self.getStep(1,'SPCount',[MinBiasSPSequenceCfg]) def getMinBiasTrkStep(self): - """ Use the reco-dict to construct a single MinBias step """ - def generateTrackCountHypo(chainDict): - hypo = TrackCountHypoTool(chainDict["chainName"]) - if "hmt" in chainDict["chainName"]: - hypo.required_ntrks = int( chainDict["chainParts"][0]["hypoEFInfo"].strip("trk") ) - if "mb_sptrk" in chainDict["chainName"]: - hypo.min_pt = 0.2 - hypo.max_z0 = 401 - - # will set here cuts - return hypo - from TrigMinBias.TrigMinBiasConf import TrackCountHypoAlgMT, TrackCountHypoTool - - TrkInputMakerAlg = EventViewCreatorAlgorithm("IM_TrkEventViewCreator") - TrkInputMakerAlg.ViewFallThrough = True - TrkInputMakerAlg.RoITool = ViewCreatorInitialROITool() - TrkInputMakerAlg.InViewRoIs = "InputRoI" # contract with the consumer - TrkInputMakerAlg.Views = "TrkView" - TrkInputMakerAlg.RequireParentView = True - TrkInputMakerAlg.ViewNodeName = "TrkCountHypoAlgMTNode" - - # prepare algorithms to run in views, first, inform scheduler that input data is available in parent view (has to be done by hand) - IDTrigConfig = getInDetTrigConfig( 'minBias' ) - idAlgs, verifier = makeInDetAlgs( config = IDTrigConfig, rois=TrkInputMakerAlg.InViewRoIs, viewVerifier='TrkrecoSeqDataVerifier') - verifier.DataObjects += [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+InputRoI' ), - ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_FlaggedCondData_TRIG' ), - ( 'InDet::SCT_ClusterContainer' , 'StoreGateSvc+SCT_TrigClusters' ), - ( 'SpacePointContainer' , 'StoreGateSvc+SCT_TrigSpacePoints' ), - ( 'InDet::PixelClusterContainer' , 'StoreGateSvc+PixelTrigClusters' ), - ( 'SpacePointContainer' , 'StoreGateSvc+PixelTrigSpacePoints' )] - - if globalflags.InputFormat.is_bytestream(): - verifier.DataObjects += [( 'IDCInDetBSErrContainer' , 'StoreGateSvc+PixelByteStreamErrs' ), - ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_ByteStreamErrs' )] - - - TrkList = idAlgs[-2:] # FTF and Track to xAOD::TrackParticle conversion alg - TrackCountHypo=TrackCountHypoAlgMT() - TrackCountHypo.trackCountKey=recordable("HLT_TrackCount") - TrackCountHypo.tracksKey=recordable("HLT_IDTrack_MinBias_FTF") - - from TrigMinBias.TrackCountMonitoringMT import TrackCountMonitoring - TrackCountHypo.MonTool = TrackCountMonitoring() - - TrkrecoSeq = parOR("TrkrecoSeq", [verifier]+TrkList) - TrkSequence = seqAND("TrkSequence", [TrkInputMakerAlg, TrkrecoSeq]) - TrkInputMakerAlg.ViewNodeName = TrkrecoSeq.name() - - Step2_TrkCount = ChainStep( "Step2_TrkCount", [MenuSequence( Sequence = TrkSequence, - Maker = TrkInputMakerAlg, - Hypo = TrackCountHypo, - HypoToolGen = generateTrackCountHypo )] ) - return Step2_TrkCount + return self.getStep(2,'TrkCount',[MinBiasTrkSequenceCfg]) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasMenuSequences.py index e9b8d2628bd56427e52b9da620663054f7a33f8c..1f3adb4398edb76e73b19ffae563340c750bfc4b 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasMenuSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasMenuSequences.py @@ -1,40 +1,170 @@ # -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # -from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool -from AthenaConfiguration.AllConfigFlags import ConfigFlags +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence +from AthenaCommon.CFElements import parOR +from AthenaCommon.CFElements import seqAND +from TrigInDetConfig.InDetSetup import makeInDetAlgs +from TrigEDMConfig.TriggerEDMRun3 import recordable +from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm +from DecisionHandling.DecisionHandlingConf import ViewCreatorInitialROITool +from AthenaCommon.GlobalFlags import globalflags +from TrigInDetConfig.ConfigSettings import getInDetTrigConfig -from TrigMinBiasHypo.TrigMinBiasHypoConfigMT import TrigMinBiasHypoToolFromDict -from TrigMinBiasHypo.TrigMinBiasHypoConf import MbCountHypoAlgMT +######## +# to move into TrigMinBiasHypoConfigMT? -def minbiasSpacePointMenuSequence(): - # menu components - # retrieve the reco seuqnece - from TriggerMenuMT.HLTMenuConfig.MinBias.MinBiasSPRecoSequences import minbiasSpacePointAthSequence - ( minbiasSpacePointSequence, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(minbiasSpacePointAthSequence,ConfigFlags) +def SPCountHypoToolGen(chainDict): + from TrigT2MinBias.TrigT2MinBiasConf import SPCountHypoTool + hypo = SPCountHypoTool(chainDict["chainName"]) + if "hmt" in chainDict["chainName"]: + hypo.totNumSctSP = int( chainDict["chainParts"][0]["hypoL2Info"].strip("sp") ) + if "mb_sptrk" in chainDict["chainName"]: + hypo.totNumPixSP = 2 + hypo.totNumSctSP = 3 + # will set here thresholds + return hypo - #hypo - mbHypoAlg = MbCountHypoAlgMT("MinBiasHypoAlg_sp") - mbHypoAlg.MinBiasContainerKey=sequenceOut - return MenuSequence( Sequence = minbiasSpacePointSequence, - Maker = InputMakerAlg, - Hypo = mbHypoAlg, - HypoToolGen = TrigMinBiasHypoToolFromDict ) +def TrackCountHypoToolGen(chainDict): + from TrigMinBias.TrigMinBiasConf import TrackCountHypoTool + hypo = TrackCountHypoTool(chainDict["chainName"]) + if "hmt" in chainDict["chainName"]: + hypo.required_ntrks = int( chainDict["chainParts"][0]["hypoEFInfo"].strip("trk") ) + if "mb_sptrk" in chainDict["chainName"]: + hypo.min_pt = 0.2 + hypo.max_z0 = 401 + # will set here cuts + return hypo -def minbiasTrackMenuSequence(): - # menu components - # retrieve the reco seuqnece - from TriggerMenuMT.HLTMenuConfig.MinBias.MinBiasTrkRecoSequences import minbiasTrackAthSequence - (minbiasTrackSequence, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(minbiasTrackAthSequence,ConfigFlags) - #hypo - mbHypoAlg = MbCountHypoAlgMT("MinBiasHypoAlg_trk") - mbHypoAlg.MinBiasContainerKey=sequenceOut +### Now the sequences + +# These are obsoletee and can probably be deleted. Leeft here commented as need feedback fomr experts + +## def minbiasSpacePointMenuSequence(): +## # menu components +## # retrieve the reco seuqnece +## from TriggerMenuMT.HLTMenuConfig.MinBias.MinBiasSPRecoSequences import minbiasSpacePointAthSequence +## ( minbiasSpacePointSequence, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(minbiasSpacePointAthSequence,ConfigFlags) + +## #hypo +## mbHypoAlg = MbCountHypoAlgMT("MinBiasHypoAlg_sp") +## mbHypoAlg.MinBiasContainerKey=sequenceOut + +## return MenuSequence( Sequence = minbiasSpacePointSequence, +## Maker = InputMakerAlg, +## Hypo = mbHypoAlg, +## HypoToolGen = TrigMinBiasHypoToolFromDict ) + + +## #obsolete? +## def minbiasTrackMenuSequence(): +## # menu components +## # retrieve the reco seuqnece +## from TriggerMenuMT.HLTMenuConfig.MinBias.MinBiasTrkRecoSequences import minbiasTrackAthSequence +## (minbiasTrackSequence, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(minbiasTrackAthSequence,ConfigFlags) + +## #hypo +## mbHypoAlg = MbCountHypoAlgMT("MinBiasHypoAlg_trk") +## mbHypoAlg.MinBiasContainerKey=sequenceOut + +## return MenuSequence( Sequence = minbiasTrackSequence, +## Maker = InputMakerAlg, +## Hypo = mbHypoAlg, +## HypoToolGen = TrigMinBiasHypoToolFromDict ) + + +# NEW: +def MinBiasSPSequence(): + SpList = [] + from TrigT2MinBias.TrigT2MinBiasConf import TrigCountSpacePointsMT, SPCountHypoAlgMT + + SPInputMakerAlg = EventViewCreatorAlgorithm("IM_SPEventViewCreator") + SPInputMakerAlg.ViewFallThrough = True + SPInputMakerAlg.RoITool = ViewCreatorInitialROITool() + SPInputMakerAlg.InViewRoIs = "InputRoI" + SPInputMakerAlg.Views = "SPView" + + IDTrigConfig = getInDetTrigConfig( 'minBias' ) + idAlgs, verifier = makeInDetAlgs( config = IDTrigConfig, rois=SPInputMakerAlg.InViewRoIs, viewVerifier='SPViewDataVerifier' ) + verifier.DataObjects += [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+InputRoI' ), + ( 'SCT_ID' , 'DetectorStore+SCT_ID' ), + ( 'PixelID' , 'DetectorStore+PixelID' ), + ( 'TagInfo' , 'DetectorStore+ProcessingTags' )] + + # Make sure required objects are still available at whole-event level + from AthenaCommon.AlgSequence import AlgSequence + topSequence = AlgSequence() + topSequence.SGInputLoader.Load += [( 'SCT_ID' , 'DetectorStore+SCT_ID' ), + ( 'PixelID' , 'DetectorStore+PixelID' ), + ( 'TagInfo' , 'DetectorStore+ProcessingTags' )] + + SpList = idAlgs[:-2] + + SpCount=TrigCountSpacePointsMT() + SpCount.SpacePointsKey=recordable("HLT_SpacePointCounts") + + from TrigT2MinBias.TrigT2MinBiasMonitoringMT import SpCountMonitoring + SpCount.MonTool = SpCountMonitoring() + + SPrecoSeq = parOR("SPrecoSeq", SpList + [ SpCount ]) + SPSequence = seqAND("SPSequence", [SPInputMakerAlg, SPrecoSeq]) + SPInputMakerAlg.ViewNodeName = SPrecoSeq.name() + + + SpCountHypo =SPCountHypoAlgMT() + SpCountHypo.SpacePointsKey=recordable("HLT_SpacePointCounts") + + return MenuSequence( Sequence = SPSequence, + Maker = SPInputMakerAlg, + Hypo = SpCountHypo, + HypoToolGen = SPCountHypoToolGen ) + + +def MinBiasTrkSequence(): + from TrigMinBias.TrigMinBiasConf import TrackCountHypoAlgMT + + TrkInputMakerAlg = EventViewCreatorAlgorithm("IM_TrkEventViewCreator") + TrkInputMakerAlg.ViewFallThrough = True + TrkInputMakerAlg.RoITool = ViewCreatorInitialROITool() + TrkInputMakerAlg.InViewRoIs = "InputRoI" # contract with the consumer + TrkInputMakerAlg.Views = "TrkView" + TrkInputMakerAlg.RequireParentView = True + TrkInputMakerAlg.ViewNodeName = "TrkCountHypoAlgMTNode" + + # prepare algorithms to run in views, first, inform scheduler that input data is available in parent view (has to be done by hand) + IDTrigConfig = getInDetTrigConfig( 'minBias' ) + idAlgs, verifier = makeInDetAlgs( config = IDTrigConfig, rois=TrkInputMakerAlg.InViewRoIs, viewVerifier='TrkrecoSeqDataVerifier') + verifier.DataObjects += [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+InputRoI' ), + ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_FlaggedCondData_TRIG' ), + ( 'InDet::SCT_ClusterContainer' , 'StoreGateSvc+SCT_TrigClusters' ), + ( 'SpacePointContainer' , 'StoreGateSvc+SCT_TrigSpacePoints' ), + ( 'InDet::PixelClusterContainer' , 'StoreGateSvc+PixelTrigClusters' ), + ( 'SpacePointContainer' , 'StoreGateSvc+PixelTrigSpacePoints' )] + + if globalflags.InputFormat.is_bytestream(): + verifier.DataObjects += [( 'IDCInDetBSErrContainer' , 'StoreGateSvc+PixelByteStreamErrs' ), + ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_ByteStreamErrs' )] + + + TrkList = idAlgs[-2:] # FTF and Track to xAOD::TrackParticle conversion alg + TrackCountHypo=TrackCountHypoAlgMT() + TrackCountHypo.trackCountKey=recordable("HLT_TrackCount") + TrackCountHypo.tracksKey=recordable("HLT_IDTrack_MinBias_FTF") + + from TrigMinBias.TrackCountMonitoringMT import TrackCountMonitoring + TrackCountHypo.MonTool = TrackCountMonitoring() + + TrkrecoSeq = parOR("TrkrecoSeq", [verifier]+TrkList) + TrkSequence = seqAND("TrkSequence", [TrkInputMakerAlg, TrkrecoSeq]) + TrkInputMakerAlg.ViewNodeName = TrkrecoSeq.name() + + return MenuSequence( Sequence = TrkSequence, + Maker = TrkInputMakerAlg, + Hypo = TrackCountHypo, + HypoToolGen = TrackCountHypoToolGen ) + - return MenuSequence( Sequence = minbiasTrackSequence, - Maker = InputMakerAlg, - Hypo = mbHypoAlg, - HypoToolGen = TrigMinBiasHypoToolFromDict ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py index 074285b1c74dbd86f8959c9e030178f095e86311..acdc24d9714e7275f5e622cc829f01f4601cda7c 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py @@ -40,7 +40,7 @@ def generateChains(flags, chainDict): HypoToolGen = TrigEgammaFastCaloHypoToolFromDict, CA = accCalo ) - fastCaloStep = ChainStep(firstStepName, [fastCaloSequence]) + fastCaloStep = ChainStep(firstStepName, [fastCaloSequence], multiplicity=[1],chainDicts=[chainDict] ) secondStepName = 'FastPhoton' @@ -64,7 +64,7 @@ def generateChains(flags, chainDict): HypoToolGen = TrigEgammaFastPhotonHypoToolFromDict, CA = accPhoton ) - l2PhotonStep = ChainStep(secondStepName, [l2PhotonSequence]) + l2PhotonStep = ChainStep(secondStepName, [l2PhotonSequence], multiplicity=[1],chainDicts=[chainDict] ) l1Thresholds=[] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/share/full_menu_cf.py b/Trigger/TriggerCommon/TriggerMenuMT/share/full_menu_cf.py index 155328bdfd8d59ccfe691da50dafc36f9ca5c07c..78cbf0474981eb672ad672ee60e5ee33a85bc6c1 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/share/full_menu_cf.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/share/full_menu_cf.py @@ -14,7 +14,7 @@ def generateChains(): from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep, RecoFragmentsPool - from DecisionHandling.TestUtils import makeChain + from DecisionHandling.TestUtils import makeChain, makeChainStep testChains = [] ################################################################## @@ -26,9 +26,9 @@ def generateChains(): electronSeq = RecoFragmentsPool.retrieve( fastElectronSequenceCfg, None ) precisionCaloSeq = RecoFragmentsPool.retrieve( precisionCaloSequenceCfg, None ) - FastCaloStep = ChainStep("ElectronFastCaloStep", [fastCaloSeq]) - FastElectronStep = ChainStep("ElectronFastTrackStep", [electronSeq]) - PrecisionCaloStep = ChainStep("ElectronPrecisionCaloStep", [precisionCaloSeq]) + FastCaloStep = makeChainStep("ElectronFastCaloStep", [fastCaloSeq]) + FastElectronStep = makeChainStep("ElectronFastTrackStep", [electronSeq]) + PrecisionCaloStep = makeChainStep("ElectronPrecisionCaloStep", [precisionCaloSeq]) electronChains = [ makeChain(name='HLT_e3_etcut1step_L1EM3', L1Thresholds=["EM3"], ChainSteps=[FastCaloStep] ), @@ -43,9 +43,9 @@ def generateChains(): fastPhotonSeq = RecoFragmentsPool.retrieve( fastPhotonSequenceCfg, None ) precisionCaloPhotonSeq = RecoFragmentsPool.retrieve( precisionPhotonCaloSequenceCfg, None) - FastCaloStep = ChainStep("PhotonFastCaloStep", [fastCaloSeq]) - fastPhotonStep = ChainStep("PhotonStep2", [fastPhotonSeq]) - precisionCaloPhotonStep = ChainStep("precisionCaloPhotonStep", [precisionCaloPhotonSeq]) + FastCaloStep = makeChainStep("PhotonFastCaloStep", [fastCaloSeq]) + fastPhotonStep = makeChainStep("PhotonStep2", [fastPhotonSeq]) + precisionCaloPhotonStep = makeChainStep("precisionCaloPhotonStep", [precisionCaloPhotonSeq]) photonChains = [ makeChain(name='HLT_g5_etcut_L1EM3', L1Thresholds=["EM3"], ChainSteps=[ FastCaloStep, fastPhotonStep, precisionCaloPhotonStep] ) @@ -62,18 +62,19 @@ def generateChains(): MuonChains = [] # step1 mufastS= muFastSequence() - step1mufast=ChainStep("Step1_muFast", [ mufastS ]) + step1mufast=makeChainStep("Step1_muFast", [ mufastS ]) # step2 mucombS = muCombSequence() - step2muComb=ChainStep("Step2_muComb", [ mucombS ]) + step2muComb=makeChainStep("Step2_muComb", [ mucombS ]) # step3 muEFSAS = muEFSASequence() - step3muEFSA=ChainStep("Step3_muEFSA", [ muEFSAS ]) + step3muEFSA=makeChainStep("Step3_muEFSA", [ muEFSAS ]) + #/step3muIso =makeChainStep("Step3_muIso", [ muIsoSequence() ]) # step4 muEFCBS = muEFCBSequence() - step4muEFCB=ChainStep("Step4_muEFCB", [ muEFCBS ]) + step4muEFCB=makeChainStep("Step4_muEFCB", [ muEFCBS ]) - emptyStep=ChainStep("Step2_empty", multiplicity=[]) + emptyStep=makeChainStep("Step2_empty", multiplicity=[]) ## single muon trigger MuonChains += [ makeChain(name='HLT_mu6fast_L1MU6', L1Thresholds=["MU6"], ChainSteps=[ step1mufast ])] @@ -83,20 +84,20 @@ def generateChains(): # multi muon trigger # 2muons symmetric - step1_2mufast_sym= ChainStep("Step1_2muFast_sym", [ mufastS], multiplicity=[2]) - step2_2muComb_sym= ChainStep("Step2_2muComb_sym", [ mucombS], multiplicity=[2]) + step1_2mufast_sym= makeChainStep("Step1_2muFast_sym", [ mufastS], multiplicity=[2]) + step2_2muComb_sym= makeChainStep("Step2_2muComb_sym", [ mucombS], multiplicity=[2]) - step3_2muEFSA_sym= ChainStep("Step3_2muEFSA_sym", [ muEFSAS], multiplicity=[2]) - step4_2muEFCB_sym= ChainStep("Step4_2muEFCB_sym", [ muEFCBS], multiplicity=[2]) + step3_2muEFSA_sym= makeChainStep("Step3_2muEFSA_sym", [ muEFSAS], multiplicity=[2]) + step4_2muEFCB_sym= makeChainStep("Step4_2muEFCB_sym", [ muEFCBS], multiplicity=[2]) MuonChains += [ makeChain(name='HLT_2mu6Comb_L12MU6', L1Thresholds=["MU6"], ChainSteps=[ step1_2mufast_sym, step2_2muComb_sym ])] # 2muons asymmetric (this will change): 2 sequences, 2 seeds - step1_2mufast_asym= ChainStep("Step1_2muFast_asym", [ mufastS, mufastS], multiplicity=[1,1]) - step2_2muComb_asym= ChainStep("Step1_2muComb_asym", [ mucombS, mucombS], multiplicity=[1,1]) + step1_2mufast_asym= makeChainStep("Step1_2muFast_asym", [ mufastS, mufastS], multiplicity=[1,1]) + step2_2muComb_asym= makeChainStep("Step1_2muComb_asym", [ mucombS, mucombS], multiplicity=[1,1]) - step3_2muEFSA_asym= ChainStep("Step3_2muEFSA_asym", [ muEFSAS, muEFSAS], multiplicity=[1,1]) - step4_2muEFCB_asym= ChainStep("Step4_2muEFCB_asym", [ muEFCBS, muEFCBS], multiplicity=[1,1]) + step3_2muEFSA_asym= makeChainStep("Step3_2muEFSA_asym", [ muEFSAS, muEFSAS], multiplicity=[1,1]) + step4_2muEFCB_asym= makeChainStep("Step4_2muEFCB_asym", [ muEFCBS, muEFCBS], multiplicity=[1,1]) MuonChains += [ makeChain(name='HLT_mu6_mu4_L12MU4', @@ -106,8 +107,8 @@ def generateChains(): #FS Muon trigger # Full scan MS tracking step - stepFSmuEFSA=ChainStep("Step_FSmuEFSA", [muEFSAFSSequence()]) - stepFSmuEFCB=ChainStep("Step_FSmuEFCB", [muEFCBFSSequence()]) + stepFSmuEFSA=makeChainStep("Step_FSmuEFSA", [muEFSAFSSequence()]) + stepFSmuEFCB=makeChainStep("Step_FSmuEFCB", [muEFCBFSSequence()]) MuonChains += [ makeChain(name='HLT_mu6noL1_L1MU6', L1Thresholds=["FSNOSEED"], ChainSteps=[stepFSmuEFSA, stepFSmuEFCB])] testChains += MuonChains @@ -121,23 +122,23 @@ def generateChains(): # small-R jets, different calibrations HLT_AntiKt4EMTopoJets_subjesIS jetSeq_a4_tc_em = jetMenuSequenceFromString("a4_tc_em_subjesIS") - step_a4_tc_em =ChainStep("Step_jet_a4_tc_em", [jetSeq_a4_tc_em]) + step_a4_tc_em =makeChainStep("Step_jet_a4_tc_em", [jetSeq_a4_tc_em]) jetSeq_a4_tc_em_subjes = jetMenuSequenceFromString("a4_tc_em_subjes") - step_a4_tc_em_subjes = ChainStep("Step_jet_a4_subjes_tc_em", [jetSeq_a4_tc_em_subjes]) + step_a4_tc_em_subjes = makeChainStep("Step_jet_a4_subjes_tc_em", [jetSeq_a4_tc_em_subjes]) jetSeq_a4_tc_em_nocalib = jetMenuSequenceFromString("a4_tc_em_nojcalib") - step_a4_tc_em_nocalib=ChainStep("Step_jet_a4_nojcalib_tc_em", [jetSeq_a4_tc_em_nocalib]) + step_a4_tc_em_nocalib=makeChainStep("Step_jet_a4_nojcalib_tc_em", [jetSeq_a4_tc_em_nocalib]) # jetSeq_a4_tc_lcw = jetMenuSequenceFromString("a10_tc_lcw_subjesIS") # step_a4_tc_lcw=ChainStep("Step_jet_a10_tc_lcw", [jetSeq_a4_tc_lcw]) # large-R jets jetSeq_a10_tc_lcw_subjes = jetMenuSequenceFromString("a10_tc_lcw_subjes") - step_a10_tc_lcw_subjes=ChainStep("Step_jet_a10_subjes_tc_lcw", [jetSeq_a10_tc_lcw_subjes]) + step_a10_tc_lcw_subjes=makeChainStep("Step_jet_a10_subjes_tc_lcw", [jetSeq_a10_tc_lcw_subjes]) jetSeq_a10r = jetMenuSequenceFromString("a10r_tc_em_subjesIS") - step_a10r=ChainStep("Step_jet_a10r", [jetSeq_a10r]) + step_a10r=makeChainStep("Step_jet_a10r", [jetSeq_a10r]) jetChains = [ makeChain(name='HLT_j45_L1J20', L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em] ), @@ -164,8 +165,8 @@ def generateChains(): jetSequence = jetMenuSequenceFromString("a4_tc_em_subjesgscIS_ftf") - step1 = ChainStep("Step1_bjet", [jetSequence] ) - step2 = ChainStep("Step2_bjet", [getBJetSequence()]) + step1 = makeChainStep("Step1_bjet", [jetSequence] ) + step2 = makeChainStep("Step2_bjet", [getBJetSequence()]) bjetChains = [ makeChain(name='HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20' , L1Thresholds=["J20"], ChainSteps=[step1,step2] ), @@ -181,14 +182,14 @@ def generateChains(): if opt.doTauSlice == True and False: from TriggerMenuMT.HLTMenuConfig.Tau.TauMenuSequences import getTauSequence - step1=ChainStep("Step1_tau", [getTauSequence('calo')]) - step1MVA=ChainStep("Step1MVA_tau", [getTauSequence('calo_mva')]) + step1=makeChainStep("Step1_tau", [getTauSequence('calo')]) + step1MVA=makeChainStep("Step1MVA_tau", [getTauSequence('calo_mva')]) #This runs the tau-preselection(TP) step - step2TP=ChainStep("Step2TP_tau", [getTauSequence('track_core')]) + step2TP=makeChainStep("Step2TP_tau", [getTauSequence('track_core')]) #This runs the EFTauMV hypo on top of fast tracks - step2PT=ChainStep("Step2PT_tau", [getTauSequence('precision')]) + step2PT=makeChainStep("Step2PT_tau", [getTauSequence('precision')]) tauChains = [ makeChain(name='HLT_tau0_perf_ptonly_L1TAU12', L1Thresholds=["TAU12"], ChainSteps=[step1, step2] ), @@ -211,9 +212,9 @@ def generateChains(): pufitRecoDict = extractMETRecoDict({'EFrecoAlg': "tcpufit"}) metClusterPufitSeq = metMenuSequence(None, **pufitRecoDict) - metCellStep = ChainStep("Step1_met_cell", [metCellSeq]) - metClusterPufitStep = ChainStep("Step1_met_clusterpufit", [metClusterPufitSeq]) - comboStep_cell_clusterpufit = ChainStep("Step1_combo_cell_clusterpufit", [metCellSeq, metClusterPufitSeq], multiplicity=[1,1]) + metCellStep = makeChainStep("Step1_met_cell", [metCellSeq]) + metClusterPufitStep = makeChainStep("Step1_met_clusterpufit", [metClusterPufitSeq]) + comboStep_cell_clusterpufit = makeChainStep("Step1_combo_cell_clusterpufit", [metCellSeq, metClusterPufitSeq], multiplicity=[1,1]) metChains = [ makeChain(name="HLT_xe65_L1XE50", L1Thresholds=["XE50"], ChainSteps=[metCellStep]), @@ -231,10 +232,10 @@ def generateChains(): from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence, muCombSequence, muEFSASequence, muEFCBSequence from TrigBphysHypo.TrigMultiTrkComboHypoConfig import DimuL2ComboHypoCfg, DimuEFComboHypoCfg - step1_dimufast=ChainStep("Step1_dimuFast", [muFastSequence()], multiplicity=[2]) - step2_dimuComb=ChainStep("Step2_dimuComb", [muCombSequence()], multiplicity=[2], comboHypoCfg=DimuL2ComboHypoCfg) - step3_dimuEFSA=ChainStep("Step3_dimuEFSA", [muEFSASequence()], multiplicity=[2]) - step4_dimuEFCB=ChainStep("Step4_dimuEFCB", [muEFCBSequence()], multiplicity=[2], comboHypoCfg=DimuEFComboHypoCfg) + step1_dimufast=makeChainStep("Step1_dimuFast", [muFastSequence()], multiplicity=[2]) + step2_dimuComb=makeChainStep("Step2_dimuComb", [muCombSequence()], multiplicity=[2], comboHypoCfg=DimuL2ComboHypoCfg) + step3_dimuEFSA=makeChainStep("Step3_dimuEFSA", [muEFSASequence()], multiplicity=[2]) + step4_dimuEFCB=makeChainStep("Step4_dimuEFCB", [muEFCBSequence()], multiplicity=[2], comboHypoCfg=DimuEFComboHypoCfg) steps = [step1_dimufast, step2_dimuComb, step3_dimuEFSA, step4_dimuEFCB] BphysChains = [ @@ -256,8 +257,8 @@ def generateChains(): from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence - comboStep_et_mufast = ChainStep("Step1_et_mufast", [fastCaloSeq, muFastSequence()], multiplicity=[1,1]) - comboStep_mufast_etcut1_step1 = ChainStep("Step1_mufast_etcut1", [muFastSequence(), fastCaloSeq], multiplicity=[1,1]) + comboStep_et_mufast = makeChainStep("Step1_et_mufast", [fastCaloSeq, muFastSequence()], multiplicity=[1,1]) + comboStep_mufast_etcut1_step1 = makeChainStep("Step1_mufast_etcut1", [muFastSequence(), fastCaloSeq], multiplicity=[1,1]) comboChains = [ makeChain(name='HLT_e3_etcut_mu6_L1EM8I_MU10', L1Thresholds=["EM8I", "MU10"], ChainSteps=[comboStep_et_mufast ])] # comboChains += [Chain(name='HLT_mu8fast_e8_etcut1step', ChainSteps=[ comboStep_mufast_etcut1_step1 ])]