ATLAS Offline Software
Loading...
Searching...
No Matches
python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder Class Reference
Collaboration diagram for python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder:

Public Member Functions

 __init__ (self, helper)
 configureMode (self)
 configure (self)
 getTriggerInfo (self, str trigger, use_thresholds=True)
 configureTriggers (self)
 configureAlgorithmSingle (self)
 configureAlgorithmDiTau (self)
 configureAlgorithmBoostedDiTau (self)
 configureAlgorithmTagAndProbe (self)
 configureAlgorithmTruth (self)
 configureAlgorithmL1 (self)
 bookHLTEffHistograms (self, mon_alg, base_path, trigger, n_prong)
 bookIDInputScalar (self, mon_alg, base_path, trigger, n_prong, online)
 bookIDInputTrack (self, mon_alg, base_path, trigger, online)
 bookIDInputCluster (self, mon_alg, base_path, trigger, online)
 bookIDScores (self, mon_alg, base_path, trigger, n_prong, online)
 bookHitZVars (self, mon_alg, base_path, trigger, n_prong)
 bookBasicVars (self, mon_alg, base_path, trigger, n_prong, online)
 bookDiTauHLTEffHistograms (self, mon_alg, base_path, trigger)
 bookDiTauVars (self, mon_alg, base_path, trigger)
 bookBoostedDiTauVars (self, mon_alg, base_path, trigger)
 bookTAndPHLTEffHistograms (self, mon_alg, base_path, trigger)
 bookTAndPVars (self, mon_alg, base_path, trigger)
 bookTruthEfficiency (self, mon_alg, base_path, trigger, n_prong)
 bookTruthVars (self, mon_alg, base_path, trigger, n_prong)
 bookL1EffHistograms (self, mon_alg, base_path, trigger, n_prong)
 bookL1Vars (self, mon_alg, base_path, trigger)
 getCustomPtBinning (self, trigger, fine=False)

Public Attributes

 logger = logging.getLogger('TrigTauMonAlgBuilder')
str base_path = 'HLT/TauMon'
 helper = helper
dict L1_Phase1_thresholds = {}
dict L1_Phase1_threshold_mappings = {}
bool activate_single_tau = self.do_single_tau
 mon_alg_single = None
list HLT_single_items = []
bool activate_ditau = self.do_ditau
 mon_alg_ditau = None
list HLT_ditau_items = []
bool activate_boosted_ditau = self.do_boosted_ditau
 mon_alg_boosted_ditau = None
list HLT_boosted_ditau_items = []
bool activate_tag_and_probe = self.do_tag_and_probe
 mon_alg_tag_and_probe = None
list HLT_tag_and_probe_items = []
bool activate_truth = self.do_truth
 mon_alg_truth = None
list HLT_truth_items = []
bool activate_L1 = self.do_L1
 mon_alg_L1 = None
list L1_items = []
bool is_mc = False
 data_type = self.helper.flags.DQ.DataType
 mon_alg_single_no_offline = self._configureAlgorithm(CompFactory.TrigTauMonitorSingleAlgorithm, 'TrigTauMonAlgSingleNoOffline')
 mon_alg_L1_no_offline = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1NoOffline')

Static Public Attributes

bool do_single_tau = True
bool do_L1 = True
bool do_ditau = True
bool do_boosted_ditau = True
bool do_tag_and_probe = True
bool do_truth = True
bool do_total_efficiency = False
bool require_offline_taus = True
bool do_duplicate_var_plots_without_offline_taus = True
dict hlt_tauid_scores
dict hlt_hitz_variables
dict hlt_calohits_presel_scores
dict offline_tauid_scores
str offline_taujets = 'TauJets'
str offline_GNTau_WP = ''

Protected Member Functions

 _L1_Phase1_thresholds_stdmap (self)
 _L1_Phase1_threshold_mappings_stdmap (self)
 _configureAlgorithm (self, algorithm_factory, name)

Protected Attributes

 _L1_Phase1_thresholds_stdmap
 _L1_Phase1_threshold_mappings_stdmap

Detailed Description

Definition at line 8 of file TrigTauMonitoringConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.__init__ ( self,
helper )

Definition at line 77 of file TrigTauMonitoringConfig.py.

77 def __init__(self, helper):
78 from AthenaCommon.Logging import logging
79 self.logger = logging.getLogger('TrigTauMonAlgBuilder')
80
81 self.base_path = 'HLT/TauMon'
82 self.helper = helper
83
84 # Threshold information for all Phase 1 items
85 self.L1_Phase1_thresholds = {} # E_T cuts
86 self.L1_Phase1_threshold_mappings = {} # thresholdMappings bit masks
87
88 # Monitoring algorithms, and lists of items to monitor (will be filled on configure())
89 self.activate_single_tau = self.do_single_tau
90 self.mon_alg_single = None
91 self.HLT_single_items = []
92
93 self.activate_ditau = self.do_ditau
94 self.mon_alg_ditau = None
95 self.HLT_ditau_items = []
96
97 self.activate_boosted_ditau = self.do_boosted_ditau
98 self.mon_alg_boosted_ditau = None
99 self.HLT_boosted_ditau_items = []
100
101 self.activate_tag_and_probe = self.do_tag_and_probe
102 self.mon_alg_tag_and_probe = None
103 self.HLT_tag_and_probe_items = []
104
105 self.activate_truth = self.do_truth
106 self.mon_alg_truth = None
107 self.HLT_truth_items = []
108
109 self.activate_L1 = self.do_L1
110 self.mon_alg_L1 = None
111 self.L1_items = []
112
113 self.configureMode()
114
115

Member Function Documentation

◆ _configureAlgorithm()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._configureAlgorithm ( self,
algorithm_factory,
name )
protected

Definition at line 273 of file TrigTauMonitoringConfig.py.

273 def _configureAlgorithm(self, algorithm_factory, name):
274 self.logger.info(f'Creating the monitoring algorithm: {name}')
275 mon_alg = self.helper.addAlgorithm(algorithm_factory, name)
276 mon_alg.L1Phase1Thresholds = self.L1_Phase1_thresholds
277 mon_alg.L1Phase1ThresholdPatterns = self.L1_Phase1_threshold_mappings
278 mon_alg.OfflineTauJetKey = self.offline_taujets
279 mon_alg.OfflineGNTauDecorKey = self.offline_GNTau_WP
280 return mon_alg
281
282

◆ _L1_Phase1_threshold_mappings_stdmap()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_threshold_mappings_stdmap ( self)
protected

Definition at line 167 of file TrigTauMonitoringConfig.py.

167 def _L1_Phase1_threshold_mappings_stdmap(self):
168 import ROOT
169 m = ROOT.std.map[ROOT.std.string, ROOT.uint64_t]()
170 for item, thr in self.L1_Phase1_threshold_mappings.items():
171 m[item] = thr
172 return m
173

◆ _L1_Phase1_thresholds_stdmap()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_thresholds_stdmap ( self)
protected

Definition at line 159 of file TrigTauMonitoringConfig.py.

159 def _L1_Phase1_thresholds_stdmap(self):
160 import ROOT
161 m = ROOT.std.map[ROOT.std.string, ROOT.float]()
162 for item, thr in self.L1_Phase1_thresholds.items():
163 m[item] = thr
164 return m
165

◆ bookBasicVars()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookBasicVars ( self,
mon_alg,
base_path,
trigger,
n_prong,
online )

Definition at line 567 of file TrigTauMonitoringConfig.py.

567 def bookBasicVars(self, mon_alg, base_path, trigger, n_prong, online):
568 type_str = 'HLT' if online else 'Offline'
569 mon_group_name = f'{trigger}_{type_str}_basicVars_{n_prong}'
570 mon_group_path = f'{base_path}/basicVars/{trigger}/{type_str}_{n_prong}'
571 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
572
573 binning = self.getCustomPtBinning(trigger, fine=True)
574
575 mon_group.defineHistogram('Pt', title=f'{type_str} p_{{T}}; p_{{T}} [GeV]; Events', xbins=binning, opt='kAlwaysCreate')
576 mon_group.defineHistogram('Eta', title=f'{type_str} #eta; #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
577 mon_group.defineHistogram('Phi', title=f'{type_str} #phi; #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
578 mon_group.defineHistogram('nTrack', title=f'{type_str} Number of tracks; N_{{track}}; Events', xbins=10, xmin=0, xmax=10, opt='kAlwaysCreate')
579 mon_group.defineHistogram('Eta,Phi', type='TH2F', title=f'{type_str} #eta vs #phi; #eta; #phi', xbins=26, xmin=-2.6, xmax=2.6, ybins=16, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
580 mon_group.defineHistogram('Pt,Phi', type='TH2F', title=f'{type_str} p_{{T}} vs #phi; p_{{T}} [GeV]; #phi', xbins=binning, ybins=16, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
581 mon_group.defineHistogram('Pt,Eta', type='TH2F', title=f'{type_str} p_{{T}} vs #eta; p_{{T}} [GeV]; #eta', xbins=binning, ybins=26, ymin=-2.6, ymax=2.6, opt='kAlwaysCreate')
582 mon_group.defineHistogram('nIsoTrack', title=f'{type_str} Number of isolation tracks; N_{{track}}^{{iso}}; Events', xbins=10, xmin=0, xmax=10, opt='kAlwaysCreate')
583 mon_group.defineHistogram('averageMu', title=f'{type_str} Average #mu; #LT#mu$GT; Events', xbins=20, xmin=0, xmax=80, opt='kAlwaysCreate')
584 mon_group.defineHistogram('TauVertexX', title=f'{type_str} Tau Vertex X; x [mm]; Events', xbins=100, xmin=-1, xmax=1, opt='kAlwaysCreate')
585 mon_group.defineHistogram('TauVertexY', title=f'{type_str} Tau Vertex Y; y [mm]; Events', xbins=100, xmin=-2, xmax=0, opt='kAlwaysCreate')
586 mon_group.defineHistogram('TauVertexZ', title=f'{type_str} Tau Vertex Z; z [mm]; Events', xbins=120, xmin=-120, xmax=120, opt='kAlwaysCreate')
587
588

◆ bookBoostedDiTauVars()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookBoostedDiTauVars ( self,
mon_alg,
base_path,
trigger )

Definition at line 653 of file TrigTauMonitoringConfig.py.

653 def bookBoostedDiTauVars(self, mon_alg, base_path, trigger):
654 mon_group_name = f'{trigger}_BoostedDiTauVars'
655 mon_group_path = f'{base_path}/BoostedDiTauVars/{trigger}'
656 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
657
658 mon_group.defineHistogram('omni_score', title='omni_score; omni_score; Events', xbins=50, xmin=0, xmax=1, opt='kAlwaysCreate')
659 mon_group.defineHistogram('R_tracks_lead', title='R_tracks_lead; R_tracks_lead; Events', xbins=50, xmin=0, xmax=0.2, opt='kAlwaysCreate')
660 mon_group.defineHistogram('R_tracks_subl', title='R_tracks_subl; R_tracks_subl; Events', xbins=50, xmin=0, xmax=0.2, opt='kAlwaysCreate')
661 mon_group.defineHistogram('f_core_lead', title='f_core_lead; f_core_lead; Events', xbins=50, xmin=0, xmax=1, opt='kAlwaysCreate')
662 mon_group.defineHistogram('f_core_subl', title='f_core_subl; f_core_subl; Events', xbins=50, xmin=0, xmax=1, opt='kAlwaysCreate')
663 mon_group.defineHistogram('n_track', title='Number of tracks; n_tracks; Events', xbins=51, xmin=-0.5, xmax=50.5, opt='kAlwaysCreate')
664 mon_group.defineHistogram('n_tracks_lead', title='Number of Lead tracks; n_tracks_lead; Events', xbins=11, xmin=-0.5, xmax=10.5, opt='kAlwaysCreate')
665 mon_group.defineHistogram('n_tracks_subl', title='Number of Sub-Lead tracks; n_tracks_subl; Events', xbins=11, xmin=-0.5, xmax=10.5, opt='kAlwaysCreate')
666 mon_group.defineHistogram('Pt', title='p_{T}(#tau,#tau); p_{T} [GeV]; Events', xbins=50, xmin=160, xmax=1300, opt='kAlwaysCreate')
667 mon_group.defineHistogram('Eta', title='#eta(#tau,#tau); #eta(#tau,#tau); Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
668 mon_group.defineHistogram('Phi', title='#phi(#tau,#tau); #phi(#tau,#tau); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
669 mon_group.defineHistogram('M', title='m(#tau,#tau); m_{#tau,#tau}; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
670

◆ bookDiTauHLTEffHistograms()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookDiTauHLTEffHistograms ( self,
mon_alg,
base_path,
trigger )

Definition at line 589 of file TrigTauMonitoringConfig.py.

589 def bookDiTauHLTEffHistograms(self, mon_alg, base_path, trigger):
590 mon_group_name = f'{trigger}_DiTauHLT_Efficiency'
591 mon_group_path = f'{base_path}/DiTauHLT_Efficiency/{trigger}/DiTauHLT_Efficiency'
592 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
593
594 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, eff='HLT', high_pt=False):
595 pass_flag = f'{eff}_pass'
596 sfx = ''
597
598 if high_pt:
599 pass_flag += '_highPt'
600 sfx += '_highPt'
601 xlabel += ' (p_{T}^{1,2} > p_{T}^{thr 1,2} + 20 GeV)'
602
603 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffDiTau{eff}_{xvariable}{sfx}_wrt_Offline',
604 title=f'DiTau {eff} Efficiency {trigger};{xlabel};Efficiency',
605 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
606
607 eff_list = ['HLT'] + (['Total'] if self.do_total_efficiency else [])
608 for eff in eff_list:
609 defineEachStepHistograms('dR', '#Delta R(#tau,#tau)', 20, 0, 4, eff)
610 defineEachStepHistograms('dEta', '#Delta#eta(#tau,#tau)', 20, 0, 4, eff)
611 defineEachStepHistograms('dPhi', '#Delta#phi(#tau,#tau)', 8, -3.2, 3.2, eff)
612
613 defineEachStepHistograms('dR', '#Delta R(#tau,#tau)', 20, 0, 4, eff, high_pt=True)
614 defineEachStepHistograms('dEta', '#Delta#eta(#tau,#tau)', 20, 0, 4, eff, high_pt=True)
615 defineEachStepHistograms('dPhi', '#Delta#phi(#tau,#tau)', 8, -3.2, 3.2, eff, high_pt=True)
616 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80, eff)
617
618 # Save quantities in TTree for offline analysis
619 mon_group.defineTree('dR,dEta,dPhi,averageMu,HLT_pass;DiTauHLTEffTree',
620 treedef='dR/F:dEta/F:dPhi/F:averageMu/F:HLT_pass/I')
621
622

◆ bookDiTauVars()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookDiTauVars ( self,
mon_alg,
base_path,
trigger )

Definition at line 623 of file TrigTauMonitoringConfig.py.

623 def bookDiTauVars(self, mon_alg, base_path, trigger):
624 mon_group_name = f'{trigger}_DiTauVars'
625 mon_group_path = f'{base_path}/DiTauVars/{trigger}'
626 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
627
628 mon_group.defineHistogram('leadHLTEt,subleadHLTEt', type='TH2F', title='p_{T}^{lead} vs p_{T}^{sublead}; p_{T}^{lead} [GeV]; p_{T}^{sublead} [GeV]',
629 xbins=50, xmin=0, xmax=250, ybins=50, ymin=0, ymax=250, opt='kAlwaysCreate')
630 mon_group.defineHistogram('leadHLTEta,subleadHLTEta', type='TH2F', title='#eta_{lead} vs #eta_{sublead}; #eta_{lead}; #eta_{sublead}',
631 xbins=26, xmin=-2.6, xmax=2.6, ybins=26, ymin=-2.6, ymax=2.6, opt='kAlwaysCreate')
632 mon_group.defineHistogram('leadHLTPhi,subleadHLTPhi', type='TH2F', title='#phi_{lead} vs #phi_{sublead}; #phi_{lead}; #phi_{sublead}',
633 xbins=16, xmin=-3.2, xmax=3.2, ybins=16, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
634 mon_group.defineHistogram('dR', title='#Delta R(#tau,#tau); #Delta R(#tau,#tau); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
635 mon_group.defineHistogram('dEta', title='#Delta#eta(#tau,#tau); #Delta#eta(#tau,#tau); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
636 mon_group.defineHistogram('dPhi', title='#Delta#phi(#tau,#tau); #Delta#phi(#tau,#tau); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
637
638 mon_group.defineHistogram('Pt', title='p_{T}(#tau,#tau); p_{T} [GeV]; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
639 mon_group.defineHistogram('Eta', title='#eta(#tau,#tau); #eta(#tau,#tau); Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
640 mon_group.defineHistogram('Phi', title='#phi(#tau,#tau); #phi(#tau,#tau); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
641 mon_group.defineHistogram('M', title='m(#tau,#tau); m_{#tau,#tau}; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
642 mon_group.defineHistogram('dPt', title='#Delta p_{T}(#tau, #tau); p_{T} [GeV]; Events', xbins=20, xmin=0, xmax=200, opt='kAlwaysCreate')
643
644 mon_group.defineTree('leadHLTEt,subleadHLTEt,leadHLTEta,subleadHLTEta,leadHLTPhi,subleadHLTPhi,dR,dEta,dPhi,Pt,Eta,Phi,M,dPt;DiTauVarsTree',
645 treedef='leadHLTEt/F:subleadHLTEt/F:leadHLTEta/F:subleadHLTEta/F:leadHLTPhi/F:subleadHLTPhi/F:dR/F:dEta/F:dPhi/F:Pt/F:Eta/F:Phi/F:M/F:dPt/F')
646
647# def bookBoostedDiTauHLTEffHistograms(self, mon_alg, base_path, trigger):

◆ bookHitZVars()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookHitZVars ( self,
mon_alg,
base_path,
trigger,
n_prong )

Definition at line 550 of file TrigTauMonitoringConfig.py.

550 def bookHitZVars(self, mon_alg, base_path, trigger, n_prong):
551 info = self.getTriggerInfo(trigger)
552
553 if info.getHLTTauLegContainerSfx() not in self.hlt_hitz_variables: return
554 if not info.getHLTTauHitZAlg() and not info.getHLTTauCaloHitsPreselectionID(): return
555
556 mon_group_name = f'{trigger}_HLT_HitZ_{n_prong}'
557 mon_group_path = f'{base_path}/basicVars/{trigger}/HLT_{n_prong}'
558 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
559
560 for alg, (z0, z0_sigma) in self.hlt_hitz_variables[info.getHLTTauLegContainerSfx()].items():
561 mon_group.defineHistogram(f'{alg}_z0', title=f'{alg} z_{{0}}; z_{{0}} [mm]; Events', xbins=100, xmin=-185, xmax=185, opt='kAlwaysCreate')
562 mon_group.defineHistogram(f'{alg}_z0_sigma', title=f'{alg} #sigma_{{z_{{0}}}}; #sigma_{{z_{{0}}}} [mm]; Events', xbins=100, xmin=0, xmax=100, opt='kAlwaysCreate')
563 mon_group.defineHistogram(f'{alg}_z0_delta', title=f'{alg} z_{{0}} - z_{{#tau}}; z_{{0}} - z_{{#tau}} [mm]; Events', xbins=100, xmin=-185, xmax=185, opt='kAlwaysCreate')
564 mon_group.defineHistogram(f'{alg}_z0_delta_sig', title=f'{alg} (z_{{0}} - z_{{#tau}}) / #sigma_{{z_{{0}}}}; (z_{{0}} - z_{{#tau}}) / #sigma_{{z_{{0}}}}; Events', xbins=100, xmin=-10, xmax=10, opt='kAlwaysCreate')
565
566

◆ bookHLTEffHistograms()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookHLTEffHistograms ( self,
mon_alg,
base_path,
trigger,
n_prong )

Definition at line 414 of file TrigTauMonitoringConfig.py.

414 def bookHLTEffHistograms(self, mon_alg, base_path, trigger, n_prong):
415 mon_group_name = f'{trigger}_HLT_Efficiency_{n_prong}'
416 mon_group_path = f'{base_path}/HLT_Efficiency/{trigger}/HLT_Efficiency_{n_prong}'
417 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
418
419 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, eff='HLT', high_pt=False, coarse=False):
420 pass_flag = f'{eff}_pass'
421 sfx = ''
422
423 if high_pt:
424 pass_flag += '_highPt'
425 sfx += '_highPt'
426 xlabel += ' (p_{T} > p_{T}^{thr} + 20 GeV)'
427 elif coarse: sfx = '_coarse'
428
429 mon_group.defineHistogram(f'{pass_flag},{xvariable};Eff{eff}_{xvariable}{sfx}_wrt_Offline',
430 title=f'{eff} Efficiency {trigger} {n_prong}; {xlabel}; Efficiency',
431 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
432
433 coarse_binning = self.getCustomPtBinning(trigger)
434
435 eff_list = ['HLT'] + (['Total'] if self.do_total_efficiency else [])
436 for eff in eff_list:
437 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', 60, 0.0, 300., eff)
438 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], eff, coarse=True)
439 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6, eff)
440 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2, eff)
441 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6, eff, high_pt=True)
442 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2, eff, high_pt=True)
443 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80, eff)
444
445 # Save quantities in TTree for offline analysis
446 mon_group.defineTree('tauPt,tauEta,tauPhi,averageMu,HLT_pass;HLTEffTree',
447 treedef='tauPt/F:tauEta/F:tauPhi/F:averageMu/F:HLT_pass/I')
448
449

◆ bookIDInputCluster()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookIDInputCluster ( self,
mon_alg,
base_path,
trigger,
online )

Definition at line 492 of file TrigTauMonitoringConfig.py.

492 def bookIDInputCluster(self, mon_alg, base_path, trigger, online):
493 type_str = 'HLT' if online else 'Offline'
494 mon_group_name = f'{trigger}_ID_{type_str}_InputCluster'
495 mon_group_path = f'{base_path}/TauIDVars/InputCluster/{trigger}/{type_str}'
496 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
497
498 mon_group.defineHistogram('n_cluster', title='Number of clusters; N_{cluster}; Events', xbins=30, xmin=0, xmax=30, opt='kAlwaysCreate')
499 mon_group.defineHistogram('cluster_et_log', title='cluster_et_log; cluster_et_log; Events', xbins=30, xmin=0, xmax=6, opt='kAlwaysCreate')
500 mon_group.defineHistogram('cluster_pt_jetseed_log', title='cluster_pt_jetseed_log; cluster_pt_jetseed_log; Events', xbins=50, xmin=2, xmax=7, opt='kAlwaysCreate')
501 mon_group.defineHistogram('cluster_eta', title='Cluster #eta; #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
502 mon_group.defineHistogram('cluster_phi', title='Cluster #phi; #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
503 mon_group.defineHistogram('cluster_dEta', title='Cluster #Delta#eta; #Delta#eta; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
504 mon_group.defineHistogram('cluster_dPhi', title='Cluster #Delta#phi; #Delta#phi; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
505 mon_group.defineHistogram('cluster_SECOND_R_log10', title='cluster_SECOND_R_log10; cluster_SECOND_R_log10; Events', xbins=50, xmin=-3, xmax=7, opt='kAlwaysCreate')
506 mon_group.defineHistogram('cluster_SECOND_LAMBDA_log10', title='cluster_SECOND_LAMBDA_log10; cluster_SECOND_LAMBDA_log10; Events', xbins=50, xmin=-3, xmax=7, opt='kAlwaysCreate')
507 mon_group.defineHistogram('cluster_CENTER_LAMBDA_log10', title='cluster_CENTER_LAMBDA_log10; cluster_CENTER_LAMBDA_log10; Events', xbins=50, xmin=-2, xmax=5, opt='kAlwaysCreate')
508 mon_group.defineHistogram('cluster_eta,cluster_phi', type='TH2F', title='Cluster #eta vs #phi; #eta; #phi', xbins=26, xmin=-2.6, xmax=2.6, ybins=16, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
509 mon_group.defineHistogram('cluster_dEta,cluster_dPhi', type='TH2F', title='Cluster #Delta#eta vs #Delta#phi; #Delta#eta; #Delta#phi', xbins=100, xmin=-0.5, xmax=0.5, ybins=100, ymin=-0.5, ymax=0.5, opt='kAlwaysCreate')
510
511

◆ bookIDInputScalar()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookIDInputScalar ( self,
mon_alg,
base_path,
trigger,
n_prong,
online )

Definition at line 450 of file TrigTauMonitoringConfig.py.

450 def bookIDInputScalar(self, mon_alg, base_path, trigger, n_prong, online):
451 type_str = 'HLT' if online else 'Offline'
452 mon_group_name = f'{trigger}_ID_{type_str}_InputScalar_{n_prong}'
453 mon_group_path = f'{base_path}/TauIDVars/InputScalar_{n_prong}/{trigger}/{type_str}'
454 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
455
456 mon_group.defineHistogram('centFrac', title=f'Centrality Fraction ({n_prong}); centFrac; Events', xbins=50, xmin=-0.05, xmax=1.2, opt='kAlwaysCreate')
457 mon_group.defineHistogram('etOverPtLeadTrk', title=f'etOverPtLeadTrk log ({n_prong}); etOverPtLeadTrk_log; Events', xbins=60, xmin=-3, xmax=3, opt='kAlwaysCreate')
458 mon_group.defineHistogram('dRmax', title=f'max dR of associated tracks ({n_prong}); dRmax; Events', xbins=50, xmin=-0.1, xmax=0.3, opt='kAlwaysCreate')
459 mon_group.defineHistogram('absipSigLeadTrk', title=f'AbsIpSigLeadTrk ({n_prong}); absipSigLeadTrk; Events', xbins=25, xmin=0.0, xmax=20.0, opt='kAlwaysCreate')
460 mon_group.defineHistogram('sumPtTrkFrac', title=f'SumPtTrkFrac ({n_prong}); SumPtTrkFrac; Events', xbins=50, xmin=-0.5, xmax=1.1, opt='kAlwaysCreate')
461 mon_group.defineHistogram('emPOverTrkSysP', title=f'EMPOverTrkSysP log ({n_prong}); EMPOverTrkSysP_log; Events', xbins=50, xmin=-5, xmax=3, opt='kAlwaysCreate')
462 mon_group.defineHistogram('ptRatioEflowApprox', title=f'ptRatioEflowApprox ({n_prong}); ptRatioEflowApprox; Events', xbins=50, xmin=0.0, xmax=2.0, opt='kAlwaysCreate')
463 mon_group.defineHistogram('mEflowApprox', title=f'mEflowApprox log ({n_prong}); mEflowApprox_log; Events', xbins=50, xmin=0, xmax=5, opt='kAlwaysCreate')
464 mon_group.defineHistogram('ptDetectorAxis', title=f'ptDetectorAxis log ({n_prong}); ptDetectorAxis_log; Events', xbins=50, xmin=0, xmax=5, opt='kAlwaysCreate')
465 if n_prong == 'MP' or n_prong == '3P':
466 mon_group.defineHistogram('massTrkSys', title=f'massTrkSys log ({n_prong}); massTrkSys_log; Events', xbins=50, xmin=0, xmax=3, opt='kAlwaysCreate')
467 mon_group.defineHistogram('trFlightPathSig', title=f'trFlightPathSig ({n_prong}); trFlightPathSig; Events', xbins=100, xmin=-20, xmax=40, opt='kAlwaysCreate')
468
469

◆ bookIDInputTrack()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookIDInputTrack ( self,
mon_alg,
base_path,
trigger,
online )

Definition at line 470 of file TrigTauMonitoringConfig.py.

470 def bookIDInputTrack(self, mon_alg, base_path, trigger, online):
471 type_str = 'HLT' if online else 'Offline'
472 mon_group_name = f'{trigger}_ID_{type_str}_InputTrack'
473 mon_group_path = f'{base_path}/TauIDVars/InputTrack/{trigger}/{type_str}'
474 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
475
476 mon_group.defineHistogram('n_track', title='Number of tracks; N_{track}; Events', xbins=15, xmin=0, xmax=15, opt='kAlwaysCreate')
477 mon_group.defineHistogram('track_pt_log', title='track_pt_log; track_pt_log; Events', xbins=20, xmin=2, xmax=7, opt='kAlwaysCreate')
478 mon_group.defineHistogram('track_pt_jetseed_log', title='track_pt_jetseed_log; track_pt_jetseed_log; Events', xbins=50, xmin=2, xmax=7, opt='kAlwaysCreate')
479 mon_group.defineHistogram('track_eta', title='Track #eta; #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
480 mon_group.defineHistogram('track_phi', title='Track #phi; #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
481 mon_group.defineHistogram('track_dEta', title='Track #Delta#eta; #Delta#eta; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
482 mon_group.defineHistogram('track_dPhi', title='Track #Delta#phi; #Delta#phi; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
483 mon_group.defineHistogram('track_d0_abs_log', title='track_d0_abs_log; track_d0_abs_log; Events', xbins=50, xmin=-7, xmax=2, opt='kAlwaysCreate')
484 mon_group.defineHistogram('track_z0sinthetaTJVA_abs_log', title='track_z0sinthetaTJVA_abs_log; track_z0sinthetaTJVA_abs_log; Events', xbins=50, xmin=-10, xmax=4, opt='kAlwaysCreate')
485 mon_group.defineHistogram('track_nIBLHitsAndExp', title='track_nIBLHitsAndExp; track_nIBLHitsAndExp; Events', xbins=3, xmin=0, xmax=3, opt='kAlwaysCreate')
486 mon_group.defineHistogram('track_nPixelHitsPlusDeadSensors', title='track_nPixelHitsPlusDeadSensors; track_nPixelHitsPlusDeadSensors; Events', xbins=11, xmin=0, xmax=11, opt='kAlwaysCreate')
487 mon_group.defineHistogram('track_nSCTHitsPlusDeadSensors', title='track_nSCTHitsPlusDeadSensors; track_nSCTHitsPlusDeadSensors; Events', xbins=20, xmin=0, xmax=20, opt='kAlwaysCreate')
488 mon_group.defineHistogram('track_eta,track_phi', type='TH2F', title='Track #eta vs #phi; #eta; #phi', xbins=26, xmin=-2.6, xmax=2.6, ybins=16, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
489 mon_group.defineHistogram('track_dEta,track_dPhi', type='TH2F', title='Track #Delta#eta vs #Delta#phi; #Delta#eta; #Delta#phi', xbins=100, xmin=-0.5, xmax=0.5, ybins=100, ymin=-0.5, ymax=0.5, opt='kAlwaysCreate')
490
491

◆ bookIDScores()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookIDScores ( self,
mon_alg,
base_path,
trigger,
n_prong,
online )

Definition at line 512 of file TrigTauMonitoringConfig.py.

512 def bookIDScores(self, mon_alg, base_path, trigger, n_prong, online):
513 info = self.getTriggerInfo(trigger)
514
515 if online:
516 variables = {}
517 if info.getHLTTauLegContainerSfx() in self.hlt_tauid_scores:
518 store_all = info.getHLTTauID() in ['idperf', 'perf']
519 variables |= {
520 tau_id: p
521 for tau_id, p in self.hlt_tauid_scores[info.getHLTTauLegContainerSfx()].items()
522 if tau_id == info.getHLTTauID() or store_all
523 }
524 if info.getHLTTauLegContainerSfx() in self.hlt_calohits_presel_scores:
525 store_all = info.getHLTTauCaloHitsPreselectionID() in ['', 'idperfCHP']
526 variables |= {
527 tau_id: p
528 for tau_id, p in self.hlt_calohits_presel_scores[info.getHLTTauLegContainerSfx()].items()
529 if tau_id == info.getHLTTauCaloHitsPreselectionID() or store_all
530 }
531
532 else:
533 variables = self.offline_tauid_scores
534
535 if not variables: return
536
537 type_str = 'HLT' if online else 'Offline'
538 mon_group_name = f'{trigger}_{type_str}_IDScores_{n_prong}'
539 mon_group_path = f'{base_path}/basicVars/{trigger}/{type_str}_{n_prong}'
540 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
541
542 for tau_id, (score, score_sig_trans) in variables.items():
543 if online and tau_id in ['RNN', 'DeepSet', 'RNNLLP', 'GNTau', 'GNTauDev1'] or not online and tau_id in ['RNN']: xbins, xmax = 20, 1
544 else: xbins, xmax = 100, 7
545
546 mon_group.defineHistogram(f'{tau_id}_TauIDScore', title=f'{type_str} {tau_id} TauID score; TauID score; Events', xbins=xbins, xmin=0, xmax=xmax, opt='kAlwaysCreate')
547 mon_group.defineHistogram(f'{tau_id}_TauIDScoreSigTrans', title=f'{type_str} {tau_id} TauID score sig. transformed; TauID score sig. transformed; Events', xbins=xbins, xmin=0, xmax=1, opt='kAlwaysCreate')
548
549

◆ bookL1EffHistograms()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookL1EffHistograms ( self,
mon_alg,
base_path,
trigger,
n_prong )

Definition at line 774 of file TrigTauMonitoringConfig.py.

774 def bookL1EffHistograms(self, mon_alg, base_path, trigger, n_prong):
775 mon_group_name = f'{trigger}_L1_Efficiency_{n_prong}'
776 mon_group_path = f'{base_path}/L1_Efficiency/{trigger}/L1_Efficiency_{n_prong}'
777 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
778
779 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, high_pt=False, coarse=False):
780 pass_flag = 'L1_pass'
781 sfx = ''
782
783 if high_pt:
784 pass_flag += '_highPt'
785 sfx += '_highPt'
786 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau thr} + 20 GeV)'
787 elif coarse:
788 sfx += '_coarse'
789
790 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffL1_{xvariable}{sfx}_wrt_Offline',
791 title=f'L1 Efficiency {trigger} {n_prong}; {xlabel}; Efficiency',
792 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
793
794 coarse_binning = self.getCustomPtBinning(trigger)
795
796 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', 60, 0, 300)
797 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], coarse=True)
798 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6)
799 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2)
800 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6, high_pt=True)
801 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2, high_pt=True)
802 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80)
803
804

◆ bookL1Vars()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookL1Vars ( self,
mon_alg,
base_path,
trigger )

Definition at line 805 of file TrigTauMonitoringConfig.py.

805 def bookL1Vars(self, mon_alg, base_path, trigger):
806 mon_group_name = f'{trigger}_L1Vars'
807 mon_group_path = f'{base_path}/L1Vars/{trigger}'
808 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
809
810 mon_group.defineHistogram('L1RoIEt,L1RoIEta', type='TH2F', title='L1 RoI E_{T} vs #eta; E_{T} [GeV]; #eta',
811 xbins=60, xmin=0, xmax=300,
812 ybins=60, ymin=-2.6, ymax=2.6, opt='kAlwaysCreate')
813 mon_group.defineHistogram('L1RoIEt,L1RoIPhi', type='TH2F', title='L1 RoI E_{T} vs #phi; E_{T} [GeV]; #phi',
814 xbins=60, xmin=0, xmax=300,
815 ybins=60, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
816 mon_group.defineHistogram('L1RoIEta,L1RoIPhi', type='TH2F', title='L1 RoI #eta vs #phi; #eta; #phi',
817 xbins=60, xmin=-2.6, xmax=2.6,
818 ybins=60, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
819 mon_group.defineHistogram('L1RoIEta', title='L1 RoI #eta; #eta; RoIs', xbins=60, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
820 mon_group.defineHistogram('L1RoIPhi', title='L1 RoI #phi; #phi; RoIs', xbins=60, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
821 mon_group.defineHistogram('L1RoIEt', title='L1 RoI E_{T}; E_{T} [GeV]; RoIs', xbins=60, xmin=0, xmax=300, opt='kAlwaysCreate')
822
823 if 'eTAU' in trigger:
824 mon_group.defineHistogram('L1eFexRoIRCore', title='L1 eTAU RoI rCore Isolation; rCore Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
825 mon_group.defineHistogram('L1eFexRoIRHad' , title='L1 eTAU RoI rHad Isolation; rHad Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
826 mon_group.defineHistogram('L1eFexRoIBDTScore' , title='L1 eTAU RoI BDT score; BDT Score; RoIs', xbins=128, xmin=512, xmax=1024, opt='kAlwaysCreate')
827
828 elif 'cTAU' in trigger:
829 mon_group.defineHistogram('L1eFexRoIRCore', title='L1 eTAU RoI rCore Isolation; eTAU rCore Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
830 mon_group.defineHistogram('L1eFexRoIRHad', title='L1 eTAU RoI rHad Isolation; eTAU rHad Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
831 mon_group.defineHistogram('L1cTauRoITopoMatch', title='L1Topo match between eTAU and jTAU RoI; Match; RoIs', xbins=2, xmin=0, xmax=2, opt='kAlwaysCreate')
832 mon_group.defineHistogram('L1jFexRoIIso', title='L1 jTAU RoI Isolation; E_{T}^{jTAU Iso} [GeV]; RoIs', xbins=25, xmin=0, xmax=50, opt='kAlwaysCreate')
833 mon_group.defineHistogram('L1cTauMatchedRoIIso', title='L1 cTAU Isolation score; E_{T}^{jTAU Iso}/E_{T}^{eTAU}; RoIs', xbins=50, xmin=0, xmax=5, opt='kAlwaysCreate')
834 mon_group.defineHistogram('L1RoIcTauMatchedEtRatio', title='Et ratio between matched eTAU and jTAU RoIs; E_{T}^{jTAU}/E_{T}^{eTAU}; RoIs', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
835 mon_group.defineHistogram('L1eFexRoIBDTScore' , title='L1 eTAU RoI BDT score; BDT Score; RoIs', xbins=128, xmin=512, xmax=1024, opt='kAlwaysCreate')
836

◆ bookTAndPHLTEffHistograms()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookTAndPHLTEffHistograms ( self,
mon_alg,
base_path,
trigger )

Definition at line 671 of file TrigTauMonitoringConfig.py.

671 def bookTAndPHLTEffHistograms(self, mon_alg, base_path, trigger):
672 mon_group_name = f'{trigger}_TAndPHLT_Efficiency'
673 mon_group_path = f'{base_path}/TAndPHLT_Efficiency/{trigger}/TAndPHLT_Efficiency'
674 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
675
676 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, high_pt=False, coarse=False):
677 pass_flag = 'HLT_pass'
678 sfx = ''
679
680 if high_pt:
681 pass_flag += '_highPt'
682 sfx += '_highPt'
683 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau thr} + 20 GeV)'
684 elif coarse:
685 sfx += '_coarse'
686
687 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffTAndPHLT_{xvariable}{sfx}_wrt_Offline',
688 title=f'TAndP HLT Efficiency {trigger}; {xlabel}; Efficiency',
689 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
690
691 coarse_binning = self.getCustomPtBinning(trigger)
692
693 defineEachStepHistograms('tauPt', 'p_{T}^{#tau} [GeV]', 60, 0.0, 300)
694 defineEachStepHistograms('tauPt', 'p_{T}^{#tau} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], coarse=True)
695 defineEachStepHistograms('tauEta', '#eta_{#tau}', 13, -2.6, 2.6)
696 defineEachStepHistograms('tauPhi', '#phi_{#tau}', 16, -3.2, 3.2)
697 defineEachStepHistograms('tauEta', '#eta_{#tau}', 13, -2.6, 2.6, high_pt=True)
698 defineEachStepHistograms('tauPhi', '#phi_{#tau}', 16, -3.2, 3.2, high_pt=True)
699 defineEachStepHistograms('dR', '#Delta R(#tau,lep)', 20, 0, 4)
700 defineEachStepHistograms('dEta', '#Delta#eta(#tau,lep)', 20, 0,4)
701 defineEachStepHistograms('dPhi', '#Delta#phi(#tau,lep)', 8, -3.2, 3.2)
702 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80)
703
704 # Save quantities in TTree for offline analysis
705 mon_group.defineTree('tauPt,tauEta,tauPhi,dR,dEta,dPhi,averageMu,HLT_pass;TAndPHLTEffTree',
706 treedef='tauPt/F:tauEta/F:tauPhi/F:dR/F:dEta/F:dPhi/F:averageMu/F:HLT_pass/I')
707
708

◆ bookTAndPVars()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookTAndPVars ( self,
mon_alg,
base_path,
trigger )

Definition at line 709 of file TrigTauMonitoringConfig.py.

709 def bookTAndPVars(self, mon_alg, base_path, trigger):
710 mon_group_name = f'{trigger}_TAndPVars'
711 mon_group_path = f'{base_path}/TAndPVars/{trigger}'
712 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
713
714 mon_group.defineHistogram('dR', title='#Delta R(#tau,lep); #Delta R(#tau,lep); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
715 mon_group.defineHistogram('dEta', title='#Delta#eta(#tau,lep); #Delta#eta(#tau,lep); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
716 mon_group.defineHistogram('dPhi', title='#Delta#phi(#tau,lep); #Delta#phi(#tau,lep); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
717
718 mon_group.defineHistogram('Pt', title='p_{T}(#tau,lep); p_{T} [GeV]; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
719 mon_group.defineHistogram('Eta', title='#eta(#tau,lep); #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
720 mon_group.defineHistogram('Phi', title='#phi(#tau,lep); #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
721 mon_group.defineHistogram('M', title='m(#tau,lep); m_{#tau,lep}; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
722 mon_group.defineHistogram('dPt', title='#Delta p_{T}(#tau,lep); p_{T} [GeV]; Events', xbins=20, xmin=0, xmax=200, opt='kAlwaysCreate')
723
724

◆ bookTruthEfficiency()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookTruthEfficiency ( self,
mon_alg,
base_path,
trigger,
n_prong )

Definition at line 725 of file TrigTauMonitoringConfig.py.

725 def bookTruthEfficiency(self, mon_alg, base_path, trigger, n_prong):
726 mon_group_name = f'{trigger}_Truth_Efficiency_{n_prong}'
727 mon_group_path = f'{base_path}/Truth_Efficiency/{trigger}/Truth_Efficiency_{n_prong}'
728 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
729
730 info = self.getTriggerInfo(trigger)
731
732 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, high_pt=False, coarse=False):
733 pass_flag = 'HLT_pass'
734 sfx = ''
735
736 if high_pt:
737 pass_flag += '_highPt'
738 sfx += '_highPt'
739 if info.isHLTDiTau():
740 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau min thr} + 20 GeV)'
741 else:
742 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau thr} + 20 GeV)'
743 elif coarse:
744 sfx += '_coarse'
745
746 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffHLT_{xvariable}{sfx}_wrt_Truth',
747 title=f'HLT Efficiency {trigger} {n_prong}; {xlabel}; Efficiency',
748 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax)
749
750 coarse_binning = self.getCustomPtBinning(trigger)
751
752 defineEachStepHistograms('pt_vis', 'p_{T, vis} [GeV]', 60, 0.0, 300)
753 if info.isHLTSingleTau() or info.isHLTTandP(): defineEachStepHistograms('pt_vis', 'p_{T, vis} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], coarse=True)
754 defineEachStepHistograms('eta_vis', '#eta_{vis}', 13, -2.6, 2.6)
755 defineEachStepHistograms('phi_vis', '#phi_{vis}', 16, -3.2, 3.2)
756 defineEachStepHistograms('eta_vis', '#eta_{vis}', 13, -2.6, 2.6, high_pt=True)
757 defineEachStepHistograms('phi_vis', '#phi_{vis}', 16, -3.2, 3.2, high_pt=True)
758
759

◆ bookTruthVars()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.bookTruthVars ( self,
mon_alg,
base_path,
trigger,
n_prong )

Definition at line 760 of file TrigTauMonitoringConfig.py.

760 def bookTruthVars(self, mon_alg, base_path, trigger, n_prong):
761 mon_group_name = f'{trigger}_TruthVars_{n_prong}'
762 mon_group_path = f'{base_path}/TruthVars/{trigger}/TruthVars_{n_prong}'
763 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
764
765 mon_group.defineHistogram('pt_vis,PtRatio', title='p_{T} ratio vs p_{T, vis}; p_{T, vis} [GeV]; (p_{T}^{reco} - p_{T, vis}^{truth})/p_{T, vis}^{truth}', type='TProfile', xbins=21, xmin=20, xmax=250)
766 mon_group.defineHistogram('eta_vis,PtRatio', title='p_{T} ratio vs #eta_{vis}; #eta_{vis}; (p_{T}^{reco} - p_{T, vis}^{truth})/p_{T, vis}^{truth}', type='TProfile', xbins=21, xmin=-3, xmax=3)
767 mon_group.defineHistogram('phi_vis,PtRatio', title='p_{T} ratio vs #phi_{vis}; #phi_{vis}; (p_{T}^{reco} - p_{T, vis}^{truth})/p_{T, vis}^{truth}', type='TProfile', xbins=21, xmin=-3, xmax=3)
768
769 mon_group.defineHistogram('pt_vis', title='p_{T, vis}; p_{T, vis}; Events', xbins=50, xmin=0, xmax=250)
770 mon_group.defineHistogram('eta_vis', title='#eta_{vis}; #eta_{vis}; Events', xbins=26, xmin=-2.6, xmax=2.6)
771 mon_group.defineHistogram('phi_vis', title='#phi_{vis}; #phi_{vis}; Events', xbins=16, xmin=-3.2, xmax=3.2)
772
773

◆ configure()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configure ( self)

Definition at line 133 of file TrigTauMonitoringConfig.py.

133 def configure(self):
134 # First load and classify the list of triggers
135 self.configureTriggers()
136
137 # Now create, configure, and book the histograms for all the individual algorithms
138 self.logger.info('Creating the Tau monitoring algorithms...')
139
140 if self.activate_single_tau:
141 self.configureAlgorithmSingle()
142
143 if self.activate_ditau:
144 self.configureAlgorithmDiTau()
145
146 if self.activate_boosted_ditau:
147 self.configureAlgorithmBoostedDiTau()
148
149 if self.activate_tag_and_probe:
150 self.configureAlgorithmTagAndProbe()
151
152 if self.activate_truth:
153 self.configureAlgorithmTruth()
154
155 if self.activate_L1:
156 self.configureAlgorithmL1()
157
bool configure(asg::AnaToolHandle< ITrigGlobalEfficiencyCorrectionTool > &tool, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronEffToolsHandles, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronSFToolsHandles, ToolHandleArray< CP::IMuonTriggerScaleFactors > &muonToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonEffToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonSFToolsHandles, const std::string &triggers, const std::map< std::string, std::string > &legsPerTool, unsigned long nToys, bool debug)

◆ configureAlgorithmBoostedDiTau()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmBoostedDiTau ( self)

Definition at line 352 of file TrigTauMonitoringConfig.py.

352 def configureAlgorithmBoostedDiTau(self):
353 self.mon_alg_boosted_ditau = self._configureAlgorithm(CompFactory.TrigTauMonitorBoostedDiTauAlgorithm, 'TrigTauMonAlgBoostedDiTau')
354 self.mon_alg_boosted_ditau.TriggerList = self.HLT_boosted_ditau_items
355
356 self.logger.info(' |- Booking all histograms')
357 for trigger in self.HLT_boosted_ditau_items:
358 self.bookBoostedDiTauVars(self.mon_alg_boosted_ditau, self.base_path, trigger)
359

◆ configureAlgorithmDiTau()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmDiTau ( self)

Definition at line 339 of file TrigTauMonitoringConfig.py.

339 def configureAlgorithmDiTau(self):
340 self.mon_alg_ditau = self._configureAlgorithm(CompFactory.TrigTauMonitorDiTauAlgorithm, 'TrigTauMonAlgDiTau')
341 self.mon_alg_ditau.TriggerList = self.HLT_ditau_items
342 self.mon_alg_ditau.DoTotalEfficiency = self.do_total_efficiency
343 self.mon_alg_ditau.RequireOfflineTaus = self.require_offline_taus
344 self.mon_alg_ditau.OfflineTauID = 2
345
346 self.logger.info(' |- Booking all histograms')
347 for trigger in self.HLT_ditau_items:
348 self.bookDiTauHLTEffHistograms(self.mon_alg_ditau, self.base_path, trigger)
349 self.bookDiTauVars(self.mon_alg_ditau, self.base_path, trigger)
350
351

◆ configureAlgorithmL1()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmL1 ( self)

Definition at line 383 of file TrigTauMonitoringConfig.py.

383 def configureAlgorithmL1(self):
384 has_xtob_etau_rois = 'L1_eTauxRoI' in self.helper.flags.Input.Collections or self.helper.flags.DQ.Environment == "tier0"
385
386 self.mon_alg_L1 = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1')
387 self.mon_alg_L1.TriggerList = self.L1_items
388 self.mon_alg_L1.RequireOfflineTaus = self.require_offline_taus
389 self.mon_alg_L1.OfflineTauID = 2
390 if not has_xtob_etau_rois:
391 self.logger.info(' |- No L1_eTauxRoI container is available: e/cTAU BDT scores will be set to 0')
392 self.mon_alg_L1.Phase1L1eTauxRoIKey = ''
393
394 self.logger.info(' |- Booking all histograms')
395 for trigger in self.L1_items:
396 for p in ('1P', '3P'):
397 self.bookL1EffHistograms(self.mon_alg_L1, self.base_path, trigger, n_prong=p)
398 self.bookL1Vars(self.mon_alg_L1, self.base_path, trigger)
399
400 if self.do_duplicate_var_plots_without_offline_taus:
401 self.mon_alg_L1_no_offline = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1NoOffline')
402 self.mon_alg_L1_no_offline.TriggerList = self.L1_items
403 self.mon_alg_L1_no_offline.RequireOfflineTaus = False
404 self.mon_alg_L1_no_offline.DoEfficiencyPlots = False
405 if not has_xtob_etau_rois:
406 self.logger.info(' |- No L1_eTauxRoI container is available: e/cTAU BDT scores will be set to 0')
407 self.mon_alg_L1_no_offline.Phase1L1eTauxRoIKey = ''
408
409 self.logger.info(' |- Booking all histograms')
410 path = f'{self.base_path}/OnlineOnlyVars'
411 for trigger in self.L1_items:
412 self.bookL1Vars(self.mon_alg_L1_no_offline, path, trigger)
413

◆ configureAlgorithmSingle()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmSingle ( self)

Definition at line 283 of file TrigTauMonitoringConfig.py.

283 def configureAlgorithmSingle(self):
284 self.mon_alg_single = self._configureAlgorithm(CompFactory.TrigTauMonitorSingleAlgorithm, 'TrigTauMonAlgSingle')
285 self.mon_alg_single.TriggerList = self.HLT_single_items
286 self.mon_alg_single.DoTotalEfficiency = self.do_total_efficiency
287 self.mon_alg_single.RequireOfflineTaus = self.require_offline_taus
288 self.mon_alg_single.HLTTauIDScores = self.hlt_tauid_scores
289 self.mon_alg_single.HLTTauCaloHitsPreselIDScores = self.hlt_calohits_presel_scores
290 self.mon_alg_single.HLTTauHitZVars = self.hlt_hitz_variables
291 self.mon_alg_single.OfflineTauIDScores = self.offline_tauid_scores
292 self.mon_alg_single.OfflineTauID = 2
293
294 self.logger.info(' |- Booking all histograms')
295 for trigger in self.HLT_single_items:
296 # Efficiencies
297 for p in ('1P', '3P'):
298 self.bookHLTEffHistograms(self.mon_alg_single, self.base_path, trigger, n_prong=p)
299
300 # Online distributions
301 for p in ('0P', '1P', 'MP'):
302 self.bookBasicVars(self.mon_alg_single, self.base_path, trigger, n_prong=p, online=True)
303 self.bookIDScores(self.mon_alg_single, self.base_path, trigger, n_prong=p, online=True)
304 self.bookIDInputScalar(self.mon_alg_single, self.base_path, trigger, n_prong=p, online=True)
305 self.bookHitZVars(self.mon_alg_single, self.base_path, trigger, n_prong=p)
306 self.bookIDInputTrack(self.mon_alg_single, self.base_path, trigger, online=True)
307 self.bookIDInputCluster(self.mon_alg_single, self.base_path, trigger, online=True)
308
309 # Offline distributions
310 for p in ('1P', '3P'):
311 self.bookBasicVars(self.mon_alg_single, self.base_path, trigger, p, online=False)
312 self.bookIDScores(self.mon_alg_single, self.base_path, trigger, p, online=False)
313 self.bookIDInputScalar(self.mon_alg_single, self.base_path, trigger, n_prong=p, online=False)
314 self.bookIDInputTrack(self.mon_alg_single, self.base_path, trigger, online=False)
315 self.bookIDInputCluster(self.mon_alg_single, self.base_path, trigger, online=False)
316
317 if self.do_duplicate_var_plots_without_offline_taus:
318 self.mon_alg_single_no_offline = self._configureAlgorithm(CompFactory.TrigTauMonitorSingleAlgorithm, 'TrigTauMonAlgSingleNoOffline')
319 self.mon_alg_single_no_offline.TriggerList = self.HLT_single_items
320 self.mon_alg_single_no_offline.RequireOfflineTaus = False
321 self.mon_alg_single_no_offline.DoOfflineTausDistributions = False
322 self.mon_alg_single_no_offline.DoEfficiencyPlots = False
323 self.mon_alg_single_no_offline.HLTTauIDScores = self.hlt_tauid_scores
324 self.mon_alg_single_no_offline.HLTTauCaloHitsPreselIDScores = self.hlt_calohits_presel_scores
325 self.mon_alg_single_no_offline.HLTTauHitZVars = self.hlt_hitz_variables
326
327 self.logger.info(' |- Booking all histograms')
328 path = f'{self.base_path}/OnlineOnlyVars'
329 for trigger in self.HLT_single_items:
330 for p in ('0P', '1P', 'MP'):
331 self.bookBasicVars(self.mon_alg_single_no_offline, path, trigger, n_prong=p, online=True)
332 self.bookIDScores(self.mon_alg_single_no_offline, path, trigger, n_prong=p, online=True)
333 self.bookIDInputScalar(self.mon_alg_single_no_offline, path, trigger, n_prong=p, online=True)
334 self.bookHitZVars(self.mon_alg_single_no_offline, path, trigger, n_prong=p)
335 self.bookIDInputTrack(self.mon_alg_single_no_offline, path, trigger, online=True)
336 self.bookIDInputCluster(self.mon_alg_single_no_offline, path, trigger, online=True)
337
338

◆ configureAlgorithmTagAndProbe()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmTagAndProbe ( self)

Definition at line 360 of file TrigTauMonitoringConfig.py.

360 def configureAlgorithmTagAndProbe(self):
361 self.mon_alg_tag_and_probe = self._configureAlgorithm(CompFactory.TrigTauMonitorTandPAlgorithm, 'TrigTauMonAlgTandP')
362 self.mon_alg_tag_and_probe.TriggerList = self.HLT_tag_and_probe_items
363 self.mon_alg_tag_and_probe.RequireOfflineTaus = self.require_offline_taus
364 self.mon_alg_tag_and_probe.OfflineTauID = 2
365
366 self.logger.info(' |- Booking all histograms')
367 for trigger in self.HLT_tag_and_probe_items:
368 self.bookTAndPHLTEffHistograms(self.mon_alg_tag_and_probe, self.base_path, trigger)
369 self.bookTAndPVars(self.mon_alg_tag_and_probe, self.base_path, trigger)
370
371

◆ configureAlgorithmTruth()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmTruth ( self)

Definition at line 372 of file TrigTauMonitoringConfig.py.

372 def configureAlgorithmTruth(self):
373 self.mon_alg_truth = self._configureAlgorithm(CompFactory.TrigTauMonitorTruthAlgorithm, 'TrigTauMonAlgTruth')
374 self.mon_alg_truth.TriggerList = self.HLT_truth_items
375
376 self.logger.info(' |- Booking all histograms')
377 for trigger in self.HLT_truth_items:
378 for p in ('1P', '3P'):
379 self.bookTruthEfficiency(self.mon_alg_truth, self.base_path, trigger, n_prong=p)
380 self.bookTruthVars(self.mon_alg_truth, self.base_path, trigger, n_prong=p)
381
382

◆ configureMode()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureMode ( self)

Definition at line 116 of file TrigTauMonitoringConfig.py.

116 def configureMode(self):
117 self.is_mc = False
118
119 self.data_type = self.helper.flags.DQ.DataType
120 self.logger.debug('Configuring for %s', self.data_type)
121
122 if self.data_type is DQDataType.MC:
123 self.is_mc = True
124 self.logger.debug('Enabling Truth monitoring')
125 else:
126 self.activate_truth = False
127 self.logger.debug('Using default monitoring configuration for collisions')
128
129 # We don't have any configuration specific for Cosmics or HI (the HLT Tau Monitoring is disabled for this one)
130 # If we did, we could specify it here
131
132
const bool debug

◆ configureTriggers()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureTriggers ( self)

Definition at line 183 of file TrigTauMonitoringConfig.py.

183 def configureTriggers(self):
184 self.logger.info('Configuring triggers')
185
186 from TrigConfigSvc.TriggerConfigAccess import getL1MenuAccess, getHLTMenuAccess, getHLTMonitoringAccess
187 # The L1 and HLT menus should always be available
188 L1_menu = getL1MenuAccess(self.helper.flags)
189 HLT_menu = getHLTMenuAccess(self.helper.flags)
190
191 # Try to load the monitoring groups
192 HLT_monitoring = getHLTMonitoringAccess(self.helper.flags)
193 all_items = HLT_monitoring.monitoredChains(signatures='tauMon', monLevels=['shifter', 't0', 'val'])
194 # If the mon groups are not available, fallback to the hard-coded trigger monitoring list
195 if not all_items:
196 from TrigTauMonitoring.ManualChains import monitored_chains
197 self.logger.info('Could not find any monitored tau chains in the HLTMonitoring information. Will use the available items from the fallback trigger list')
198 all_items = monitored_chains
199
200 # Classify HLT trigger chains:
201 for trigger in all_items:
202 # Skip items not included in the menu. This is needed if e.g. using the fallback list on new files without Legacy triggers, or old files
203 # without PhI triggers. Also some old SMKs have broken HLTMonitoring DB links, with chains that are not in the Trigger Menu
204 if trigger not in HLT_menu: continue
205
206 info = self.getTriggerInfo(trigger, use_thresholds=False)
207
208 if self.activate_single_tau and info.isHLTSingleTau():
209 self.HLT_single_items.append(trigger)
210 elif self.activate_ditau and info.isHLTDiTau():
211 self.HLT_ditau_items.append(trigger)
212 elif self.activate_boosted_ditau and info.isHLTBoostedDiTau():
213 self.HLT_boosted_ditau_items.append(trigger)
214 elif self.activate_tag_and_probe and info.isHLTTandP():
215 self.HLT_tag_and_probe_items.append(trigger)
216
217 if len(info.getL1TauItems()):
218 for l1_tau_item in map(str, info.getL1TauItems()): # The objects are of type std::string by default, and 'in' doesn't work properly on them
219 is_phase_1 = 'eTAU' in l1_tau_item or 'cTAU' in l1_tau_item
220 if is_phase_1 and l1_tau_item not in self.L1_Phase1_thresholds:
221 # We have only one threshold entry, because we don't use eta-dependent thresholds for Phase 1 TAU items:
222 self.L1_Phase1_thresholds[l1_tau_item] = float(L1_menu.thresholds()[l1_tau_item]['thrValues'][0]['value'])
223
224 self.L1_Phase1_threshold_mappings[l1_tau_item] = 1 << int(L1_menu.thresholds()[l1_tau_item]['mapping']) # thresholdPatterns property mask
225
226 if self.activate_L1 and f'L1{l1_tau_item}' not in self.L1_items:
227 self.L1_items.append(f'L1{l1_tau_item}')
228
229 if self.activate_single_tau:
230 self.HLT_single_items.sort()
231 self.logger.info(f'Configuring HLT single-tau monitored chains: {self.HLT_single_items}')
232 if not self.HLT_single_items:
233 self.logger.warning('Empty trigger list, disabling the single-tau monitoring')
234 self.activate_single_tau = False
235
236 if self.activate_ditau:
237 self.HLT_ditau_items.sort()
238 self.logger.info(f'Configuring HLT di-tau monitored chains: {self.HLT_ditau_items}')
239 if not self.HLT_ditau_items:
240 self.logger.warning('Empty trigger list, disabling the di-tau monitoring')
241 self.activate_ditau = False
242
243 if self.activate_boosted_ditau:
244 self.HLT_boosted_ditau_items.sort()
245 self.logger.info(f'Configuring HLT Boosted di-tau monitored chains: {self.HLT_boosted_ditau_items}')
246 if not self.HLT_boosted_ditau_items:
247 self.logger.warning('Empty trigger list, disabling the boosted di-tau monitoring')
248 self.activate_boosted_ditau = False
249
250 if self.activate_tag_and_probe:
251 self.HLT_tag_and_probe_items.sort()
252 self.logger.info(f'Configuring HLT Tag and Probe tau monitored chains: {self.HLT_tag_and_probe_items}')
253 if not self.HLT_tag_and_probe_items:
254 self.logger.warning('Empty trigger list, disabling the tag and probe monitoring')
255 self.activate_tag_and_probe = False
256
257 if self.activate_truth:
258 # We add all chains to the Truth monitoring
259 self.HLT_truth_items = self.HLT_single_items
260 self.logger.info(f'Configuring HLT truth tau monitored chains: {self.HLT_truth_items}')
261 if not self.HLT_truth_items:
262 self.logger.warning('Empty trigger list, disabling the truth tau monitoring')
263 self.activate_truth = False
264
265 if self.activate_L1:
266 self.L1_items.sort()
267 self.logger.info(f'Configuring L1 tau monitored items: {self.L1_items}')
268 if not self.L1_items:
269 self.logger.warning('Empty trigger list, disabling the L1 tau monitoring')
270 self.activate_L1 = False
271
272
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
STL class.

◆ getCustomPtBinning()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.getCustomPtBinning ( self,
trigger,
fine = False )

Definition at line 837 of file TrigTauMonitoringConfig.py.

837 def getCustomPtBinning(self, trigger, fine=False):
838 info = self.getTriggerInfo(trigger)
839
840 def getList(ranges, others=[250]):
841 ret = set(others + [500]) # The upper end of the x-axis will always be 500
842 for jump, interval in ranges.items():
843 ret.update(range(interval[0], interval[1], jump), interval)
844 return sorted(list(ret))
845
846 if info.isL1TauOnly():
847 thr = info.getL1TauThreshold()
848
849 if thr <= 8: return getList({5:(0, 30), 50:(50, 150)})
850 elif thr <= 12: return getList({5:(0, 30), 50:(50, 150)})
851 elif thr <= 20: return getList({5:(5, 40), 10:(40, 70), 50:(100, 150)})
852 elif thr <= 30: return getList({5:(15, 50), 10:(50, 70), 50:(100, 150)})
853 elif thr <= 35: return getList({5:(20, 55), 10:(60, 80), 50:(100, 150)})
854 elif thr <= 40: return getList({5:(25, 60), 10:(60, 80), 50:(100, 150)})
855 elif thr <= 60: return getList({5:(45, 80), 10:(80, 100), 50:(100, 150)})
856 elif thr <= 100: return getList({5:(85, 120), 10:(120, 140), 20:(140, 180), 50:(200, 250)})
857 else: return getList({50:(0, 200)})
858
859 else: # HLT triggers
860 thr = info.getHLTTauThreshold()
861
862 if fine:
863 if thr == 0: return getList({5:(0, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
864 elif thr <= 20: return getList({5:(15, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
865 elif thr <= 25: return getList({5:(20, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
866 elif thr <= 30: return getList({5:(25, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
867 elif thr <= 35: return getList({5:(30, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
868 elif thr <= 60: return getList({5:(55, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
869 elif thr <= 80: return getList({5:(75, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
870 elif thr <= 160: return getList({5:(155, 160), 40:(160, 240), 60:(240, 420)}, [])
871 elif thr <= 180: return getList({5:(175, 180), 40:(180, 260), 60:(260, 380)}, [])
872 else: return getList({5:(195, 200), 40:(200, 240), 60:(240, 420)}, [])
873
874 else:
875 if thr == 0:
876 if info.getL1TauItems(): return self.getCustomPtBinning(f'L1{info.getL1TauItem()}')
877 else: return getList({5:(0, 30), 50:(50, 150)})
878 elif thr <= 20: return getList({5:(10, 40), 10:(40, 60), 20:(60, 80)}, [150, 250])
879 elif thr <= 25: return getList({5:(15, 40), 10:(40, 60), 20:(60, 80)}, [150, 250])
880 elif thr <= 30: return getList({5:(20, 50), 10:(50, 60), 20:(60, 80)}, [150, 250])
881 elif thr <= 35: return getList({5:(25, 50), 10:(50, 60), 20:(60, 80)}, [150, 250])
882 elif thr <= 60: return getList({5:(50, 70), 10:(70, 80)}, [110, 150, 250])
883 elif thr <= 80: return getList({5:(70, 90)}, [110, 150, 250])
884 elif thr <= 160: return getList({5:(150, 170), 10:(170, 180), 20:(180, 200)}, [240, 300])
885 elif thr <= 180: return getList({5:(170, 180), 10:(180, 200)}, [240, 300])
886 else: return getList({5:(190, 200), 10:(200, 210)}, [240, 300])
STL class.

◆ getTriggerInfo()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.getTriggerInfo ( self,
str trigger,
use_thresholds = True )

Definition at line 175 of file TrigTauMonitoringConfig.py.

175 def getTriggerInfo(self, trigger: str, use_thresholds=True):
176 from TrigTauMonitoring.TrigTauInfo import TrigTauInfo
177 if use_thresholds:
178 return TrigTauInfo(trigger, self._L1_Phase1_thresholds_stdmap, self._L1_Phase1_threshold_mappings_stdmap)
179 else:
180 return TrigTauInfo(trigger)
181
182

Member Data Documentation

◆ _L1_Phase1_threshold_mappings_stdmap

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_threshold_mappings_stdmap
protected

Definition at line 178 of file TrigTauMonitoringConfig.py.

◆ _L1_Phase1_thresholds_stdmap

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_thresholds_stdmap
protected

Definition at line 178 of file TrigTauMonitoringConfig.py.

◆ activate_boosted_ditau

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.activate_boosted_ditau = self.do_boosted_ditau

Definition at line 97 of file TrigTauMonitoringConfig.py.

◆ activate_ditau

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.activate_ditau = self.do_ditau

Definition at line 93 of file TrigTauMonitoringConfig.py.

◆ activate_L1

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.activate_L1 = self.do_L1

Definition at line 109 of file TrigTauMonitoringConfig.py.

◆ activate_single_tau

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.activate_single_tau = self.do_single_tau

Definition at line 89 of file TrigTauMonitoringConfig.py.

◆ activate_tag_and_probe

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.activate_tag_and_probe = self.do_tag_and_probe

Definition at line 101 of file TrigTauMonitoringConfig.py.

◆ activate_truth

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.activate_truth = self.do_truth

Definition at line 105 of file TrigTauMonitoringConfig.py.

◆ base_path

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.base_path = 'HLT/TauMon'

Definition at line 81 of file TrigTauMonitoringConfig.py.

◆ data_type

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.data_type = self.helper.flags.DQ.DataType

Definition at line 119 of file TrigTauMonitoringConfig.py.

◆ do_boosted_ditau

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.do_boosted_ditau = True
static

Definition at line 20 of file TrigTauMonitoringConfig.py.

◆ do_ditau

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.do_ditau = True
static

Definition at line 19 of file TrigTauMonitoringConfig.py.

◆ do_duplicate_var_plots_without_offline_taus

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.do_duplicate_var_plots_without_offline_taus = True
static

Definition at line 32 of file TrigTauMonitoringConfig.py.

◆ do_L1

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.do_L1 = True
static

Definition at line 18 of file TrigTauMonitoringConfig.py.

◆ do_single_tau

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.do_single_tau = True
static

Definition at line 17 of file TrigTauMonitoringConfig.py.

◆ do_tag_and_probe

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.do_tag_and_probe = True
static

Definition at line 21 of file TrigTauMonitoringConfig.py.

◆ do_total_efficiency

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.do_total_efficiency = False
static

Definition at line 27 of file TrigTauMonitoringConfig.py.

◆ do_truth

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.do_truth = True
static

Definition at line 22 of file TrigTauMonitoringConfig.py.

◆ helper

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.helper = helper

Definition at line 82 of file TrigTauMonitoringConfig.py.

◆ HLT_boosted_ditau_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_boosted_ditau_items = []

Definition at line 99 of file TrigTauMonitoringConfig.py.

◆ hlt_calohits_presel_scores

dict python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.hlt_calohits_presel_scores
static
Initial value:
= {
}

Definition at line 63 of file TrigTauMonitoringConfig.py.

◆ HLT_ditau_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_ditau_items = []

Definition at line 95 of file TrigTauMonitoringConfig.py.

◆ hlt_hitz_variables

dict python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.hlt_hitz_variables
static
Initial value:
= {
'MVA': {
'HitZ': ('HitZ_z0', 'HitZ_z0_sigma'),
},
}

Definition at line 57 of file TrigTauMonitoringConfig.py.

◆ HLT_single_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_single_items = []

Definition at line 91 of file TrigTauMonitoringConfig.py.

◆ HLT_tag_and_probe_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_tag_and_probe_items = []

Definition at line 103 of file TrigTauMonitoringConfig.py.

◆ hlt_tauid_scores

dict python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.hlt_tauid_scores
static
Initial value:
= {
'MVA': {
'GNTauDev1': ('GNTauDev1_Score', 'GNTauDev1_ScoreSigTrans'),
'GNTau': ('GNTau_Score', 'GNTau_ScoreSigTrans'),
'DeepSet': ('RNNJetScore', 'RNNJetScoreSigTrans'),
},
'LLP': {
'RNNLLP': ('RNNJetScore', 'RNNJetScoreSigTrans'),
},
'LRT': {
'RNNLLP': ('RNNJetScore', 'RNNJetScoreSigTrans'),
},
}

Definition at line 40 of file TrigTauMonitoringConfig.py.

◆ HLT_truth_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_truth_items = []

Definition at line 107 of file TrigTauMonitoringConfig.py.

◆ is_mc

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.is_mc = False

Definition at line 117 of file TrigTauMonitoringConfig.py.

◆ L1_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.L1_items = []

Definition at line 111 of file TrigTauMonitoringConfig.py.

◆ L1_Phase1_threshold_mappings

dict python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.L1_Phase1_threshold_mappings = {}

Definition at line 86 of file TrigTauMonitoringConfig.py.

◆ L1_Phase1_thresholds

dict python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.L1_Phase1_thresholds = {}

Definition at line 85 of file TrigTauMonitoringConfig.py.

◆ logger

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.logger = logging.getLogger('TrigTauMonAlgBuilder')

Definition at line 79 of file TrigTauMonitoringConfig.py.

◆ mon_alg_boosted_ditau

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_boosted_ditau = None

Definition at line 98 of file TrigTauMonitoringConfig.py.

◆ mon_alg_ditau

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_ditau = None

Definition at line 94 of file TrigTauMonitoringConfig.py.

◆ mon_alg_L1

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_L1 = None

Definition at line 110 of file TrigTauMonitoringConfig.py.

◆ mon_alg_L1_no_offline

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_L1_no_offline = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1NoOffline')

Definition at line 401 of file TrigTauMonitoringConfig.py.

◆ mon_alg_single

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_single = None

Definition at line 90 of file TrigTauMonitoringConfig.py.

◆ mon_alg_single_no_offline

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_single_no_offline = self._configureAlgorithm(CompFactory.TrigTauMonitorSingleAlgorithm, 'TrigTauMonAlgSingleNoOffline')

Definition at line 318 of file TrigTauMonitoringConfig.py.

◆ mon_alg_tag_and_probe

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_tag_and_probe = None

Definition at line 102 of file TrigTauMonitoringConfig.py.

◆ mon_alg_truth

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_truth = None

Definition at line 106 of file TrigTauMonitoringConfig.py.

◆ offline_GNTau_WP

str python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.offline_GNTau_WP = ''
static

Definition at line 71 of file TrigTauMonitoringConfig.py.

◆ offline_tauid_scores

dict python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.offline_tauid_scores
static
Initial value:
= {
'RNN': ('RNNJetScore', 'RNNJetScoreSigTrans'),
'GNTau': ('GNTauScore_v0prune', 'GNTauScoreSigTrans_v0prune'),
}

Definition at line 66 of file TrigTauMonitoringConfig.py.

◆ offline_taujets

str python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.offline_taujets = 'TauJets'
static

Definition at line 70 of file TrigTauMonitoringConfig.py.

◆ require_offline_taus

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.require_offline_taus = True
static

Definition at line 29 of file TrigTauMonitoringConfig.py.


The documentation for this class was generated from the following file: