3 __author__  = 
'Javier Montejo' 
    4 __version__=
"$Revision: 2.0 $" 
    5 __doc__=
"Enumerations for trigger types and periods" 
    7 from enum 
import IntEnum
 
   28     el          = el_single | el_multi
 
   29     mu          = mu_single | mu_multi
 
   30     j           = j_single  | j_multi
 
   31     bj          = bj_single | bj_multi
 
   32     tau         = tau_single| tau_multi
 
   33     g           = g_single  | g_multi
 
   35     ALL         = el | mu | j | bj | tau | g | xe | ht | mu_bphys | exotics | afp
 
   42             if val == e.value: 
return e.name 
 
   43             if bin(e.value).
count(
'1')!=1: 
continue  
   44             if e.value & val: out += [e.name]
 
   45         if not out: 
return "undefined" 
   53     y2016periodBD3    = 1 << 2
 
   54     y2016periodD4plus = 1 << 3
 
   55     y2017periodB1     = 1 << 4
 
   56     y2017periodB2B4   = 1 << 5
 
   57     y2017periodB5B7   = 1 << 6
 
   58     y2017periodB8     = 1 << 7
 
   60     y2017periodD1D5   = 1 << 9
 
   61     y2017periodD6     = 1 << 10
 
   62     y2017periodEF     = 1 << 11
 
   63     y2017periodGHIK   = 1 << 12
 
   65     y2018periodBE     = 1 << 14
 
   66     y2018periodFI     = 1 << 15
 
   68     y2018periodKQ     = 1 << 17
 
   71     future1p8e34      = 1 << 19 
 
   74     y2017periodB      = y2017periodB1   | y2017periodB2B4 | y2017periodB5B7 | y2017periodB8
 
   75     y2017periodD      = y2017periodD1D5 | y2017periodD6
 
   76     y2017periodAll    = y2017periodB    | y2017periodC    | y2017periodD    | y2017periodEF | y2017periodGHIK 
 
   77     y2018             = y2018periodBE   | y2018periodFI   | y2018periodKQ  
 
   78     y2017             = y2017periodAll
 
   79     y2016             = y2016periodA    | y2016periodBD3  | y2016periodD4plus
 
   80     future            = future1p8e34    | future2e34
 
   83         return TriggerPeriod.isRunNumber(self) 
or all([self & x == 0 
or self & x == self 
for x 
in TriggerPeriod])
 
   91         return (number==0 
or (number > TriggerPeriod.runNumber 
and number < TriggerPeriod.runNumber*2))
 
   95         return [x 
for x 
in TriggerPeriod 
if x.isBasePeriod()]
 
   99         return p 
if TriggerPeriod.isRunNumber(p) 
else p.name
 
  103         return p 
if TriggerPeriod.isRunNumber(p) 
else TriggerPeriod[p]
 
  106     ''' List of LBs to be skipped.  
  107         Usually due to accidental prescales that will be taken into account in future GRLs or via reduced luminosity. 
  108         Users can modify this if needed, but hopefully there is no need ;) 
  112        276262: [(72 , 75 )], 
 
  113        281317: [(116, 118)], 
 
  114        299055: [(650, 700)], 
 
  115        301932: [(233, 234)], 
 
  117        336506: [(212, 260)], 
 
  118        341294: [(137, 156)], 
 
  119        355650: [(117, 117)], 
 
  120        357283: [(117, 117)], 
 
  121        359623: [(129, 129)], 
 
  125     ''' Pairs of triggers that have been renamed at some point 
  126         The code will complete each other so that each contains 
  128         Assumes that they are orthogonal, i.e. they haven't run both at the same time 
  131         (
"HLT_mu20_mu8noL1_e9_lhvloose_nod0",
"HLT_e9_lhvloose_nod0_mu20_mu8noL1"),
 
  132         (
"HLT_mu20_mu8noL1_e9_lhvloose_nod0_L1EM8VH_MU20",
"HLT_e9_lhvloose_nod0_mu20_mu8noL1_L1EM8VH_MU20"),
 
  133         (
"HLT_mu20_mu8noL1_e9_lhvloose_nod0_L1EM7_MU20",
"HLT_e9_lhvloose_nod0_mu20_mu8noL1_L1EM7_MU20"),
 
  136 if __name__ == 
"__main__":
 
  137     from AthenaCommon.Logging 
import logging
 
  138     log = logging.getLogger(__name__)
 
  139     log.info(TriggerPeriod.y2015.isBasePeriod() )
 
  140     log.info(TriggerPeriod.y2017.isBasePeriod() )
 
  141     log.info(TriggerPeriod.basePeriods() )