472 def getTriggerType(self, legs, l1seed):
473 mtype = TriggerType.UNDEFINED
474
475 for l in legs:
476 if mtype & TriggerType.el and l.legtype & TriggerType.el:
477 mtype |= TriggerType.el_multi
478 mtype &= ~TriggerType.el_single
479 elif mtype & TriggerType.mu and l.legtype & TriggerType.mu:
480 mtype |= TriggerType.mu_multi
481 mtype &= ~TriggerType.mu_single
482 elif mtype & TriggerType.tau and l.legtype & TriggerType.tau:
483 mtype |= TriggerType.tau_multi
484 mtype &= ~TriggerType.tau_single
485 elif mtype & TriggerType.j and l.legtype & TriggerType.j:
486 mtype |= TriggerType.j_multi
487 mtype &= ~TriggerType.j_single
488 elif mtype & TriggerType.bj and l.legtype & TriggerType.bj:
489 mtype |= TriggerType.bj_multi
490 mtype &= ~TriggerType.bj_single
491 elif mtype & TriggerType.g and l.legtype & TriggerType.g:
492 mtype |= TriggerType.g_multi
493 mtype &= ~TriggerType.g_single
494 elif l.legtype & TriggerType.mu_bphys:
495 mtype |= TriggerType.mu_bphys
496 mtype &= ~(TriggerType.mu_single | TriggerType.mu_multi)
497 elif l.legtype & TriggerType.exotics:
498 mtype |= TriggerType.exotics
499 elif l.legtype & TriggerType.afp:
500 mtype = TriggerType.afp
501 else:
502 mtype |= l.legtype
503
504 l1seed= l1seed.replace("L1_","")
505 if mtype & TriggerType.exotics or mtype & TriggerType.afp:
506 return mtype
507 for token in l1seed.split("_"):
508 m = self.l1pattern.
match(token)
509 if m:
510 count,legtype,thr = m.groups()
511 count = int(count) if count else 1
512 if 'EM' in legtype or 'TAU' in legtype:
513 pass
514 elif 'MU' in legtype:
515 if not mtype & TriggerType.mu_bphys:
516 if count > 1: mtype |= TriggerType.mu_multi
517 elif not mtype & TriggerType.mu_multi: mtype |= TriggerType.mu_single
518 elif 'J' in legtype:
519 if not mtype & TriggerType.bj and not mtype & TriggerType.j and not mtype & TriggerType.tau and not mtype & TriggerType.ht:
520 if count > 1: mtype |= TriggerType.j_multi
521 elif not mtype & TriggerType.j_multi: mtype |= TriggerType.j_single
522 elif 'XE' in legtype or 'XS' in legtype:
523 mtype |= TriggerType.xe
524 elif 'HT' in legtype:
525 mtype |= TriggerType.ht
526 else:
527 log.info("Unknown trigger type: %s %s %s %s", legtype, mtype, token, self.name)
528 return mtype
529
bool match(std::string s1, std::string s2)
match the individual directories of two strings