415 def compile(self, flags):
416
417 nt = self.multiplicity()
418
419 if self.isCalibration():
420 if self.isMuonDSCalibration():
421 self.tool().AcceptAll = True
422 else:
423 self.tool().AcceptAll = False
424 self.tool().DoCalib = True
425 self.tool().PtBins = [ [ 0.0, 2.5 ] ] * nt
426
427 elif self.isPassThrough():
428 self.tool().AcceptAll = True
429 self.tool().PtBins = [ [-10000.,10000.] ]
430 self.tool().PtThresholds = [ [ -1. * GeV ] ]
431 self.tool().PtThresholdForECWeakBRegionA = [ 3. * GeV ]
432 self.tool().PtThresholdForECWeakBRegionB = [ 3. * GeV ]
433
434 else:
436 nt = 1
437 self.log().
debug(
'Set %d thresholds', nt)
438 self.tool().AcceptAll = False
439 self.tool().PtBins = [ [ 0.0, 2.5 ] ] * nt
440 self.tool().PtThresholds = [ [ 5.49 * GeV ] ] * nt
441 self.tool().PtThresholdForECWeakBRegionA = [ 3. * GeV ] * nt
442 self.tool().PtThresholdForECWeakBRegionB = [ 3. * GeV ] * nt
443
444 thvaluename = self.getThresholdName()
445
446 for th in range(nt):
447 try:
448 values = muFastThresholds[thvaluename]
449 self.tool().PtBins[th] = values[0]
450 self.tool().PtThresholds[th] = [ x * GeV for x in values[1] ]
451 self.log().
debug(
'Configration of threshold[%d] %s', th, self.tool().PtThresholds[th])
452 self.log().
debug(
'Configration of PtBins[%d] %s', th, self.tool().PtBins[th])
453 if thvaluename in muFastThresholdsForECWeakBRegion:
454 spThres = muFastThresholdsForECWeakBRegion[thvaluename]
455 self.tool().PtThresholdForECWeakBRegionA[th] = spThres[0] * GeV
456 self.tool().PtThresholdForECWeakBRegionB[th] = spThres[1] * GeV
457 else:
458 self.log().
debug(
'No special thresholds for EC weak Bfield regions for %s. Copy EC1 for region A, EC2 for region B.', thvaluename)
459 spThres = values[0][1]
460 if thvaluename == '2GeV' or thvaluename == '3GeV':
461 self.tool().PtThresholdForECWeakBRegionA[th] = spThres[0] * GeV
462 self.tool().PtThresholdForECWeakBRegionB[th] = spThres[0] * GeV
463 else:
464 self.tool().PtThresholdForECWeakBRegionA[th] = spThres[1] * GeV
465 self.tool().PtThresholdForECWeakBRegionB[th] = spThres[2] * GeV
466
467 self.log().
debug(
'Thresholds for A[%d]/B[%d] = %d/%d', th, th, self.tool().PtThresholdForECWeakBRegionA[th], self.tool().PtThresholdForECWeakBRegionB[th])
468
469 except LookupError:
470 raise Exception('MuFast Hypo Misconfigured: threshold %r not supported' % thvaluename)
471
472 if self.doL2MT():
473 self.setL2MT()
474 elif self.doOverlapRemoval():
475 self.setOverlapRemoval()
476
477 if self.doMonitoring():
478 if self.doOverlapRemoval():
479 from TrigMuonHypo.TrigMuonHypoMonitoring import TrigL2MuonOverlapRemoverMonitoringMufast
480 self.tool().MonTool = TrigL2MuonOverlapRemoverMonitoringMufast(flags, 'TrigMufastHypoTool/' + self.toolName())
481 else:
482 from TrigMuonHypo.TrigMuonHypoMonitoring import TrigMufastHypoMonitoring
483 self.tool().MonTool = TrigMufastHypoMonitoring(flags, 'TrigMufastHypoTool/' + self.toolName())
484
485