def getTriggerList( trigger_type, matching_pattern="", reject_list=[] ): # Gets list of unprescaled triggers from the current/future menu # -- uses "list_unprescaled1p8e34" + "list_unprescaled2e34" generated during build # Loops through retrieved trigger list to search for given type/pattern # -- trigger_type format = TriggerType.(physics object + _ + single/multi) # -- physics objects: el, mu, j, bj, tau, g [also xe, ht, exotics] triggerList = [] lowestUnprescaled = TriggerAPI.getLowestUnprescaled( TriggerPeriod.future, trigger_type, matchPattern=matching_pattern ) lowestUnprescaledAny = TriggerAPI.getLowestUnprescaledAnyPeriod( TriggerPeriod.future, trigger_type, matchPattern=matching_pattern ) unprescaled = TriggerAPI.getUnprescaled( TriggerPeriod.future, trigger_type, matchPattern=matching_pattern ) unprescaled_triggers = lowestUnprescaled + lowestUnprescaledAny + unprescaled for trigger in unprescaled_triggers: if trigger in triggerList: continue isRejected = False for reject in reject_list: if reject is not "" and reject in trigger: isRejected = True if isRejected == True: continue triggerList.append( trigger ) return triggerList
def main(outfolder): with open(outfolder+"/list_unprescaled1p8e34.py","w") as outfile: outfile.write(header()) for triggerType in TriggerType: outfile.write( to_nice_list( TriggerAPI.getUnprescaled(TriggerPeriod.future1p8e34, triggerType), triggerType.name) ) with open(outfolder+"/list_unprescaled2e34.py","w") as outfile: outfile.write(header()) for triggerType in TriggerType: outfile.write( to_nice_list( TriggerAPI.getUnprescaled(TriggerPeriod.future2e34, triggerType), triggerType.name ) )
def MET_Trig(): API_MET_Triggers = TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2015, TriggerType.xe) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2016, TriggerType.xe) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2017, TriggerType.xe) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2018, TriggerType.xe) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.future, TriggerType.xe) return API_MET_Triggers
def multi_mu_Trig(): API_multiMuTriggers = TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2015, TriggerType.mu_multi) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2016, TriggerType.mu_multi) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2017, TriggerType.mu_multi) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2018, TriggerType.mu_multi) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.future, TriggerType.mu_multi) return API_multiMuTriggers
def single_mu_Trig(): API_singleMuTriggers = TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2015, TriggerType.mu_single) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2016, TriggerType.mu_single) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2017, TriggerType.mu_single) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.y2018, TriggerType.mu_single) + TriggerAPI.getLowestUnprescaled( TriggerPeriod.future, TriggerType.mu_single) return API_singleMuTriggers
def jetTrig(): period2015tofuture = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future period2017tofuture = TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future API_jetTrig = TriggerAPI.getActive(period2015tofuture, TriggerType.j_single) # Large-radius multijet triggers API_jetTrig += TriggerAPI.getActive(period2017tofuture, TriggerType.j_multi, matchPattern=".*_a10t_.*") # Eta-intercalibration triggers (one central, one forward jet) API_jetTrig += TriggerAPI.getActive(period2015tofuture, TriggerType.j_multi, matchPattern="HLT_j.*_320eta490") return API_jetTrig
def main(): from TriggerMenu.api.TriggerAPI import TriggerAPI from TriggerMenu.api.TriggerEnums import TriggerPeriod, TriggerType from AthenaCommon.Logging import logging log = logging.getLogger("checkMenuPrimaries") log.setLevel(logging.INFO) TriggerAPI.setRelease("current") inconsistent = TriggerAPI.checkPeriodConsistency(TriggerPeriod.future2e34, TriggerType.ALL) if inconsistent: log.error( "Some items are tighter than primaries but are lacking the 'Primary:20000' tag, please fix" ) log.error(inconsistent) else: log.info( "All primaries and backups have the 'Primary:20000' tag, cool") return 0
#!/usr/bin/env python from TriggerMenu.api.TriggerAPI import TriggerAPI from TriggerMenu.api.TriggerEnums import TriggerPeriod, TriggerType # List of lowest-unprescaled for a given type and period # Loading periods is slow the first time and can take up to minutes, # the information is cached and pickled and takes seconds for subsequent calls # See TriggerEnums for all possibilities of types and periods for triggerType in TriggerType: print "\n------------- TriggerType:", triggerType for triggerPeriod in TriggerPeriod: unprescaled = TriggerAPI.getLowestUnprescaled(triggerPeriod, triggerType) print "- TriggerPeriod:", triggerPeriod print unprescaled # Further options: # - ask for specific runs and/or specific patterns print "Pattern match :", TriggerAPI.getLowestUnprescaled( 337833, TriggerType.mu_bphys, matchPattern="bJpsi|bUpsi") # - combined items, example bjet + ht, bjet + met # bj = bj_single | bj_multi print "Bjet combined items:", TriggerAPI.getLowestUnprescaled( 337833, TriggerType.bj, TriggerType.xe | TriggerType.ht) # - combined items, example electron + anything print "Ele combined items:", TriggerAPI.getLowestUnprescaled( 337833, TriggerType.el, TriggerType.ALL) # - lowest unprescaled in at least one period. # Allows to get items that were accidentally prescaled in some period or changed over time # E.g. no multi b-jet trigger is unprescaled over the full 2017
AssocConfig('Soft', '')] PHYSLITE_cfg = METAssocConfig('AnalysisMET', associators, doPFlow=True) METCommon.customMETConfigs.setdefault('AnalysisMET',{})[PHYSLITE_cfg.suffix] = PHYSLITE_cfg scheduleMETAssocAlg(sequence=SeqPHYSLITE,configlist="AnalysisMET") #==================================================================== # TRIGGER CONTENT #==================================================================== # See https://twiki.cern.ch/twiki/bin/view/Atlas/TriggerAPI # Get single and multi mu, e, photon triggers # Jet, tau, multi-object triggers not available in the matching code # Note this comes relatively late as we have to re-do the matching to our analysis objects allperiods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future2e34 trig_el = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, livefraction=0.8) trig_mu = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, livefraction=0.8) trig_g = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.g, livefraction=0.8) trig_tau = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.tau, livefraction=0.8) # Add cross-triggers for some sets trig_em = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.mu, livefraction=0.8) trig_et = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.tau, livefraction=0.8) trig_mt = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, additionalTriggerType=TriggerType.tau, livefraction=0.8) # Note that this seems to pick up both isolated and non-isolated triggers already, so no need for extra grabs trig_txe = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.tau, additionalTriggerType=TriggerType.xe, livefraction=0.8) # Merge and remove duplicates trigger_names_full_notau = list(set(trig_el+trig_mu+trig_g+trig_em+trig_et+trig_mt)) trigger_names_full_tau = list(set(trig_tau+trig_txe)) # Now reduce the list...
goodMuonTool.MuQuality = 3 # turn of the momentum correction which is not needed for IDHits cut and Preselection goodMuonTool.TurnOffMomCorr = True ToolSvc += goodMuonTool print goodMuonTool from PrimaryDPDMaker.PrimaryDPDMakerConf import DerivationFramework__DRAW_ZMUMUSkimmingTool goodMuonSkimmingTool = DerivationFramework__DRAW_ZMUMUSkimmingTool( name="DRAW_ZMUMU_GoodMuon_SkimmingTool", MuonContainerKey="Muons", MuonSelectorTool=goodMuonTool, MinimumNumberOfMuons=1, MuonPtCut=20.0) ToolSvc += goodMuonSkimmingTool periods = TriggerPeriod.future | TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 allUnprescaledTriggers = TriggerAPI.getLowestUnprescaledAnyPeriod( periods, TriggerType.mu) print "DRAW_ZMUMU: will skim on an OR of the following muon triggers (list provided at run-time by the TriggerAPI):" print allUnprescaledTriggers from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__TriggerSkimmingTool triggerSkimmingTool = DerivationFramework__TriggerSkimmingTool( name="DRAWZMUMUTriggerSkimmingTool", TriggerListOR=allUnprescaledTriggers) ToolSvc += triggerSkimmingTool # Event selection tool from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__FilterCombinationAND DRAW_ZMUMU_SkimmingTool = DerivationFramework__FilterCombinationAND( name="DRAW_ZMUMU_FinalFilter", FilterList=[ dimuonMassSkimmingTool, goodMuonSkimmingTool, triggerSkimmingTool ]) ToolSvc += DRAW_ZMUMU_SkimmingTool
def single_photon_Trig(): API_singlePhotonTriggers = TriggerAPI.getActive( TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future, TriggerType.g_single) return API_singlePhotonTriggers