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 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
#!/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