def trigMatched(self, event, leg, legName):
     '''Returns true if the leg is matched to a trigger object as defined in the
     triggerMap parameter'''
     if not hasattr( self.cfg_ana, 'triggerMap'):
         return True
     path = event.hltPath
     triggerObjects = event.triggerObjects
     filters = self.cfg_ana.triggerMap[ path ]
     filter = None
     if legName == 'leg1':
         filter = filters[0]
     elif legName == 'leg2':
         filter = filters[1]
     elif legName == 'jet':
         filter = filters[2]
     else:
         raise ValueError( 'legName should be leg1 or leg2, not {leg}'.format(
             leg=legName )  )
     # the dR2Max value is 0.3^2
     pdgIds = None
     if len(filter) == 2:
         filter, pdgIds = filter[0], filter[1]
     return triggerMatched(leg, triggerObjects, path, filter,
                           # dR2Max=0.089999,
                           dR2Max=0.25,
                           pdgIds=pdgIds )
Beispiel #2
0
 def trigMatched(self, event, leg, legName, trigpath):
     '''Returns true if the leg is matched to a trigger object as defined in the
     triggerMap parameter'''
     if not hasattr( self.cfg_ana, 'triggerMap'):
         return True
     #path = event.hltPath this works if you have only one path
     path = trigpath
     #import pdb ; pdb.set_trace()
     triggerObjects = event.triggerObjects
     filters = self.cfg_ana.triggerMap[ path ]
     filter = None
     if   legName == 'leg1':
         filter = filters[0]
     elif legName == 'leg2':
         filter = filters[1]
     elif legName == 'jet':
         filter = filters[2]
     else:
         raise ValueError( 'legName should be leg1 or leg2, not {leg}'.format(
             leg=legName )  )
     # the default dR2Max value is 0.3^2
     pdgIds = None
     if len(filter) == 2:
         filter, pdgIds = filter[0], filter[1]
         
     return triggerMatched(leg, triggerObjects, path, filter,
                           dR2Max=0.5*0.5,dRMax=0.5,
                           pdgIds=pdgIds )
Beispiel #3
0
    def trigMatched(self, event, trigpath, leg):
        '''Returns true if the leg is matched to a trigger object'''
        if not hasattr( self.cfg_ana, 'triggerMap'):
            return True

        triggerObjects = event.triggerObjects
        filters = self.cfg_ana.triggerMap[ trigpath ]
        pdgIds = None

        flag = False

        if triggerMatched(leg, triggerObjects, trigpath, filters[0], dR2Max=0.09, pdgIds=pdgIds) or \
           triggerMatched(leg, triggerObjects, trigpath, filters[1], dR2Max=0.09, pdgIds=pdgIds):
            flag = True

        return flag
Beispiel #4
0
 def trigMatched2(self, event, leg, legName, trigpath, trigObj=None):
     '''Returns true if the leg is matched to a trigger object as defined in the
     triggerMap parameter'''
     #import pdb ; pdb.set_trace
     path = trigpath
     if trigObj is None : triggerObjects = event.triggerObjects
     else               : triggerObjects = trigObj
     filters = pathsAndFilters[ path ]
     filter = None
     #import pdb ; pdb.set_trace
     if   legName == 'leg1':
         filter = filters[0]
         #import pdb ; pdb.set_trace
     elif legName == 'leg2':
         filter = filters[1]
         #import pdb ; pdb.set_trace
     else:
         raise ValueError( 'legName should be leg1 or leg2, not {leg}'.format(
             leg=legName )  )
     # the default dR2Max value is 0.3^2
     pdgIds = None
     if len(filter) == 2:
         filter, pdgIds = filter[0], filter[1]
         
     return triggerMatched(leg, triggerObjects, path, filter, dR2Max=0.5*0.5, dRMax=0.5, pdgIds=pdgIds, index=True )
Beispiel #5
0
 def trigMatched(self, particle, event):
     if not hasattr( self.cfg_ana, 'triggerMap'):
         return True
     # import pdb; pdb.set_trace()
     path = event.hltPath
     triggerObjects = event.triggerObjects
     theFilter = self.filterForPath( path )
     return triggerMatched(particle, triggerObjects, path, theFilter, dR2Max=0.089999)
Beispiel #6
0
 def trigMatched(self, event, leg):
     '''Returns true if the leg is matched to a trigger object as defined in the
     triggerMap parameter'''
     if not hasattr( self.cfg_ana, 'triggerMap'):
         return True
     path = event.hltPath
     triggerObjects = event.triggerObjects
     filters = self.cfg_ana.triggerMap[ path ]
     # the dR2Max value is 0.1^2
     return triggerMatched(leg, triggerObjects, path, filters,
                           dR2Max=0.01,
                           pdgIds=None )
Beispiel #7
0
 def trigMatched(self, event, leg):
     '''Returns true if the leg is matched to a trigger object as defined in the
     triggerMap parameter'''
     #print 'ok '
     if not event.passedTriggerAnalyzer:
         return False
     if not hasattr( self.cfg_ana, 'triggerMap'):
      #   print 'seofnio'
         return True
     path = event.hltPath
    # print 'seofniwergrero', event.triggerObjects
     triggerObjects = event.triggerObjects
     #print 'ok i' 
     filters = self.cfg_ana.triggerMap[ path ]
     # the dR2Max value is 0.1^2
     #print 'ok 2' 
     return triggerMatched(leg, triggerObjects, path, filters,
                           dR2Max=0.01,
                           pdgIds=None )
Beispiel #8
0
    def trigMatched(self, event, trigpath, leg):
        '''Returns true if the leg is matched to a trigger object'''
        if not hasattr( self.cfg_ana, 'triggerMap'):
            return True
        triggerObjects = event.triggerObjects
        filters = self.cfg_ana.triggerMap[ trigpath ]
        filter = filters[0]
        pdgIds = None


        flag = triggerMatched(leg, triggerObjects, trigpath, filter,
                              dR2Max=0.089999,
                              pdgIds=pdgIds )


        if filter.find('Mu8_Ele17')!=-1 or filter.find('Mu17_Ele8')!=-1:
            return flag
        else:
            return False
def trigMatched(self, event, leg):
    '''Returns true if the leg is matched to a trigger object as defined in the
    triggerMap parameter'''
    # print 'inside trigMatched'
    if not event.passedTriggerAnalyzer:
        # print 'not event.passedTriggerAnalyzer'
        return False
    if not hasattr( self.cfg_ana, 'triggerMap'):
        # print 'not hasattr( self.cfg_ana, \'triggerMap\')'
        return True
    path = event.hltPath
    # print 'path ', path
    triggerObjects = event.triggerObjects
    # print 'triggerObjects ',triggerObjects
    filters = self.cfg_ana.triggerMap[ path ]
    # print 'filters ',filters
    # the dR2Max value is 0.1^2
    # print 'triggerMatched ',triggerMatched(leg, triggerObjects, path, filters,dR2Max=0.01,pdgIds=None )
    return triggerMatched(leg, triggerObjects, path, filters,
                          dR2Max=0.01,
                          pdgIds=None )