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')
 mon_alg_L1_alt = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1eTAUAlt')

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 = ''
bool do_alternative_eTAU_monitoring = False

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 78 of file TrigTauMonitoringConfig.py.

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

Member Function Documentation

◆ _configureAlgorithm()

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

Definition at line 276 of file TrigTauMonitoringConfig.py.

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

◆ _L1_Phase1_threshold_mappings_stdmap()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_threshold_mappings_stdmap ( self)
protected

Definition at line 170 of file TrigTauMonitoringConfig.py.

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

◆ _L1_Phase1_thresholds_stdmap()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_thresholds_stdmap ( self)
protected

Definition at line 162 of file TrigTauMonitoringConfig.py.

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

◆ bookBasicVars()

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

Definition at line 588 of file TrigTauMonitoringConfig.py.

588 def bookBasicVars(self, mon_alg, base_path, trigger, n_prong, online):
589 type_str = 'HLT' if online else 'Offline'
590 mon_group_name = f'{trigger}_{type_str}_basicVars_{n_prong}'
591 mon_group_path = f'{base_path}/basicVars/{trigger}/{type_str}_{n_prong}'
592 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
593
594 binning = self.getCustomPtBinning(trigger, fine=True)
595
596 mon_group.defineHistogram('Pt', title=f'{type_str} p_{{T}}; p_{{T}} [GeV]; Events', xbins=binning, opt='kAlwaysCreate')
597 mon_group.defineHistogram('Eta', title=f'{type_str} #eta; #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
598 mon_group.defineHistogram('Phi', title=f'{type_str} #phi; #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
599 mon_group.defineHistogram('nTrack', title=f'{type_str} Number of tracks; N_{{track}}; Events', xbins=10, xmin=0, xmax=10, opt='kAlwaysCreate')
600 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')
601 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')
602 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')
603 mon_group.defineHistogram('nIsoTrack', title=f'{type_str} Number of isolation tracks; N_{{track}}^{{iso}}; Events', xbins=10, xmin=0, xmax=10, opt='kAlwaysCreate')
604 mon_group.defineHistogram('averageMu', title=f'{type_str} Average #mu; #LT#mu$GT; Events', xbins=20, xmin=0, xmax=80, opt='kAlwaysCreate')
605 mon_group.defineHistogram('TauVertexX', title=f'{type_str} Tau Vertex X; x [mm]; Events', xbins=100, xmin=-1, xmax=1, opt='kAlwaysCreate')
606 mon_group.defineHistogram('TauVertexY', title=f'{type_str} Tau Vertex Y; y [mm]; Events', xbins=100, xmin=-2, xmax=0, opt='kAlwaysCreate')
607 mon_group.defineHistogram('TauVertexZ', title=f'{type_str} Tau Vertex Z; z [mm]; Events', xbins=120, xmin=-120, xmax=120, opt='kAlwaysCreate')
608
609

◆ bookBoostedDiTauVars()

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

Definition at line 674 of file TrigTauMonitoringConfig.py.

674 def bookBoostedDiTauVars(self, mon_alg, base_path, trigger):
675 mon_group_name = f'{trigger}_BoostedDiTauVars'
676 mon_group_path = f'{base_path}/BoostedDiTauVars/{trigger}'
677 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
678
679 mon_group.defineHistogram('omni_score', title='omni_score; omni_score; Events', xbins=50, xmin=0, xmax=1, opt='kAlwaysCreate')
680 mon_group.defineHistogram('R_tracks_lead', title='R_tracks_lead; R_tracks_lead; Events', xbins=50, xmin=0, xmax=0.2, opt='kAlwaysCreate')
681 mon_group.defineHistogram('R_tracks_subl', title='R_tracks_subl; R_tracks_subl; Events', xbins=50, xmin=0, xmax=0.2, opt='kAlwaysCreate')
682 mon_group.defineHistogram('f_core_lead', title='f_core_lead; f_core_lead; Events', xbins=50, xmin=0, xmax=1, opt='kAlwaysCreate')
683 mon_group.defineHistogram('f_core_subl', title='f_core_subl; f_core_subl; Events', xbins=50, xmin=0, xmax=1, opt='kAlwaysCreate')
684 mon_group.defineHistogram('n_track', title='Number of tracks; n_tracks; Events', xbins=51, xmin=-0.5, xmax=50.5, opt='kAlwaysCreate')
685 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')
686 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')
687 mon_group.defineHistogram('Pt', title='p_{T}(#tau,#tau); p_{T} [GeV]; Events', xbins=50, xmin=160, xmax=1300, opt='kAlwaysCreate')
688 mon_group.defineHistogram('Eta', title='#eta(#tau,#tau); #eta(#tau,#tau); Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
689 mon_group.defineHistogram('Phi', title='#phi(#tau,#tau); #phi(#tau,#tau); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
690 mon_group.defineHistogram('M', title='m(#tau,#tau); m_{#tau,#tau}; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
691

◆ bookDiTauHLTEffHistograms()

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

Definition at line 610 of file TrigTauMonitoringConfig.py.

610 def bookDiTauHLTEffHistograms(self, mon_alg, base_path, trigger):
611 mon_group_name = f'{trigger}_DiTauHLT_Efficiency'
612 mon_group_path = f'{base_path}/DiTauHLT_Efficiency/{trigger}/DiTauHLT_Efficiency'
613 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
614
615 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, eff='HLT', high_pt=False):
616 pass_flag = f'{eff}_pass'
617 sfx = ''
618
619 if high_pt:
620 pass_flag += '_highPt'
621 sfx += '_highPt'
622 xlabel += ' (p_{T}^{1,2} > p_{T}^{thr 1,2} + 20 GeV)'
623
624 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffDiTau{eff}_{xvariable}{sfx}_wrt_Offline',
625 title=f'DiTau {eff} Efficiency {trigger};{xlabel};Efficiency',
626 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
627
628 eff_list = ['HLT'] + (['Total'] if self.do_total_efficiency else [])
629 for eff in eff_list:
630 defineEachStepHistograms('dR', '#Delta R(#tau,#tau)', 20, 0, 4, eff)
631 defineEachStepHistograms('dEta', '#Delta#eta(#tau,#tau)', 20, 0, 4, eff)
632 defineEachStepHistograms('dPhi', '#Delta#phi(#tau,#tau)', 8, -3.2, 3.2, eff)
633
634 defineEachStepHistograms('dR', '#Delta R(#tau,#tau)', 20, 0, 4, eff, high_pt=True)
635 defineEachStepHistograms('dEta', '#Delta#eta(#tau,#tau)', 20, 0, 4, eff, high_pt=True)
636 defineEachStepHistograms('dPhi', '#Delta#phi(#tau,#tau)', 8, -3.2, 3.2, eff, high_pt=True)
637 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80, eff)
638
639 # Save quantities in TTree for offline analysis
640 mon_group.defineTree('dR,dEta,dPhi,averageMu,HLT_pass;DiTauHLTEffTree',
641 treedef='dR/F:dEta/F:dPhi/F:averageMu/F:HLT_pass/I')
642
643

◆ bookDiTauVars()

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

Definition at line 644 of file TrigTauMonitoringConfig.py.

644 def bookDiTauVars(self, mon_alg, base_path, trigger):
645 mon_group_name = f'{trigger}_DiTauVars'
646 mon_group_path = f'{base_path}/DiTauVars/{trigger}'
647 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
648
649 mon_group.defineHistogram('leadHLTEt,subleadHLTEt', type='TH2F', title='p_{T}^{lead} vs p_{T}^{sublead}; p_{T}^{lead} [GeV]; p_{T}^{sublead} [GeV]',
650 xbins=50, xmin=0, xmax=250, ybins=50, ymin=0, ymax=250, opt='kAlwaysCreate')
651 mon_group.defineHistogram('leadHLTEta,subleadHLTEta', type='TH2F', title='#eta_{lead} vs #eta_{sublead}; #eta_{lead}; #eta_{sublead}',
652 xbins=26, xmin=-2.6, xmax=2.6, ybins=26, ymin=-2.6, ymax=2.6, opt='kAlwaysCreate')
653 mon_group.defineHistogram('leadHLTPhi,subleadHLTPhi', type='TH2F', title='#phi_{lead} vs #phi_{sublead}; #phi_{lead}; #phi_{sublead}',
654 xbins=16, xmin=-3.2, xmax=3.2, ybins=16, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
655 mon_group.defineHistogram('dR', title='#Delta R(#tau,#tau); #Delta R(#tau,#tau); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
656 mon_group.defineHistogram('dEta', title='#Delta#eta(#tau,#tau); #Delta#eta(#tau,#tau); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
657 mon_group.defineHistogram('dPhi', title='#Delta#phi(#tau,#tau); #Delta#phi(#tau,#tau); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
658
659 mon_group.defineHistogram('Pt', title='p_{T}(#tau,#tau); p_{T} [GeV]; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
660 mon_group.defineHistogram('Eta', title='#eta(#tau,#tau); #eta(#tau,#tau); Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
661 mon_group.defineHistogram('Phi', title='#phi(#tau,#tau); #phi(#tau,#tau); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
662 mon_group.defineHistogram('M', title='m(#tau,#tau); m_{#tau,#tau}; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
663 mon_group.defineHistogram('dPt', title='#Delta p_{T}(#tau, #tau); p_{T} [GeV]; Events', xbins=20, xmin=0, xmax=200, opt='kAlwaysCreate')
664
665 mon_group.defineTree('leadHLTEt,subleadHLTEt,leadHLTEta,subleadHLTEta,leadHLTPhi,subleadHLTPhi,dR,dEta,dPhi,Pt,Eta,Phi,M,dPt;DiTauVarsTree',
666 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')
667
668# def bookBoostedDiTauHLTEffHistograms(self, mon_alg, base_path, trigger):

◆ bookHitZVars()

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

Definition at line 571 of file TrigTauMonitoringConfig.py.

571 def bookHitZVars(self, mon_alg, base_path, trigger, n_prong):
572 info = self.getTriggerInfo(trigger)
573
574 if info.getHLTTauLegContainerSfx() not in self.hlt_hitz_variables: return
575 if not info.getHLTTauHitZAlg() and not info.getHLTTauCaloHitsPreselectionID(): return
576
577 mon_group_name = f'{trigger}_HLT_HitZ_{n_prong}'
578 mon_group_path = f'{base_path}/basicVars/{trigger}/HLT_{n_prong}'
579 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
580
581 for alg, (z0, z0_sigma) in self.hlt_hitz_variables[info.getHLTTauLegContainerSfx()].items():
582 mon_group.defineHistogram(f'{alg}_z0', title=f'{alg} z_{{0}}; z_{{0}} [mm]; Events', xbins=100, xmin=-185, xmax=185, opt='kAlwaysCreate')
583 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')
584 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')
585 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')
586
587

◆ bookHLTEffHistograms()

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

Definition at line 435 of file TrigTauMonitoringConfig.py.

435 def bookHLTEffHistograms(self, mon_alg, base_path, trigger, n_prong):
436 mon_group_name = f'{trigger}_HLT_Efficiency_{n_prong}'
437 mon_group_path = f'{base_path}/HLT_Efficiency/{trigger}/HLT_Efficiency_{n_prong}'
438 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
439
440 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, eff='HLT', high_pt=False, coarse=False):
441 pass_flag = f'{eff}_pass'
442 sfx = ''
443
444 if high_pt:
445 pass_flag += '_highPt'
446 sfx += '_highPt'
447 xlabel += ' (p_{T} > p_{T}^{thr} + 20 GeV)'
448 elif coarse: sfx = '_coarse'
449
450 mon_group.defineHistogram(f'{pass_flag},{xvariable};Eff{eff}_{xvariable}{sfx}_wrt_Offline',
451 title=f'{eff} Efficiency {trigger} {n_prong}; {xlabel}; Efficiency',
452 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
453
454 coarse_binning = self.getCustomPtBinning(trigger)
455
456 eff_list = ['HLT'] + (['Total'] if self.do_total_efficiency else [])
457 for eff in eff_list:
458 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', 60, 0.0, 300., eff)
459 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], eff, coarse=True)
460 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6, eff)
461 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2, eff)
462 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6, eff, high_pt=True)
463 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2, eff, high_pt=True)
464 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80, eff)
465
466 # Save quantities in TTree for offline analysis
467 mon_group.defineTree('tauPt,tauEta,tauPhi,averageMu,HLT_pass;HLTEffTree',
468 treedef='tauPt/F:tauEta/F:tauPhi/F:averageMu/F:HLT_pass/I')
469
470

◆ bookIDInputCluster()

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

Definition at line 513 of file TrigTauMonitoringConfig.py.

513 def bookIDInputCluster(self, mon_alg, base_path, trigger, online):
514 type_str = 'HLT' if online else 'Offline'
515 mon_group_name = f'{trigger}_ID_{type_str}_InputCluster'
516 mon_group_path = f'{base_path}/TauIDVars/InputCluster/{trigger}/{type_str}'
517 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
518
519 mon_group.defineHistogram('n_cluster', title='Number of clusters; N_{cluster}; Events', xbins=30, xmin=0, xmax=30, opt='kAlwaysCreate')
520 mon_group.defineHistogram('cluster_et_log', title='cluster_et_log; cluster_et_log; Events', xbins=30, xmin=0, xmax=6, opt='kAlwaysCreate')
521 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')
522 mon_group.defineHistogram('cluster_eta', title='Cluster #eta; #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
523 mon_group.defineHistogram('cluster_phi', title='Cluster #phi; #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
524 mon_group.defineHistogram('cluster_dEta', title='Cluster #Delta#eta; #Delta#eta; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
525 mon_group.defineHistogram('cluster_dPhi', title='Cluster #Delta#phi; #Delta#phi; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
526 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')
527 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')
528 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')
529 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')
530 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')
531
532

◆ bookIDInputScalar()

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

Definition at line 471 of file TrigTauMonitoringConfig.py.

471 def bookIDInputScalar(self, mon_alg, base_path, trigger, n_prong, online):
472 type_str = 'HLT' if online else 'Offline'
473 mon_group_name = f'{trigger}_ID_{type_str}_InputScalar_{n_prong}'
474 mon_group_path = f'{base_path}/TauIDVars/InputScalar_{n_prong}/{trigger}/{type_str}'
475 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
476
477 mon_group.defineHistogram('centFrac', title=f'Centrality Fraction ({n_prong}); centFrac; Events', xbins=50, xmin=-0.05, xmax=1.2, opt='kAlwaysCreate')
478 mon_group.defineHistogram('etOverPtLeadTrk', title=f'etOverPtLeadTrk log ({n_prong}); etOverPtLeadTrk_log; Events', xbins=60, xmin=-3, xmax=3, opt='kAlwaysCreate')
479 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')
480 mon_group.defineHistogram('absipSigLeadTrk', title=f'AbsIpSigLeadTrk ({n_prong}); absipSigLeadTrk; Events', xbins=25, xmin=0.0, xmax=20.0, opt='kAlwaysCreate')
481 mon_group.defineHistogram('sumPtTrkFrac', title=f'SumPtTrkFrac ({n_prong}); SumPtTrkFrac; Events', xbins=50, xmin=-0.5, xmax=1.1, opt='kAlwaysCreate')
482 mon_group.defineHistogram('emPOverTrkSysP', title=f'EMPOverTrkSysP log ({n_prong}); EMPOverTrkSysP_log; Events', xbins=50, xmin=-5, xmax=3, opt='kAlwaysCreate')
483 mon_group.defineHistogram('ptRatioEflowApprox', title=f'ptRatioEflowApprox ({n_prong}); ptRatioEflowApprox; Events', xbins=50, xmin=0.0, xmax=2.0, opt='kAlwaysCreate')
484 mon_group.defineHistogram('mEflowApprox', title=f'mEflowApprox log ({n_prong}); mEflowApprox_log; Events', xbins=50, xmin=0, xmax=5, opt='kAlwaysCreate')
485 mon_group.defineHistogram('ptDetectorAxis', title=f'ptDetectorAxis log ({n_prong}); ptDetectorAxis_log; Events', xbins=50, xmin=0, xmax=5, opt='kAlwaysCreate')
486 if n_prong == 'MP' or n_prong == '3P':
487 mon_group.defineHistogram('massTrkSys', title=f'massTrkSys log ({n_prong}); massTrkSys_log; Events', xbins=50, xmin=0, xmax=3, opt='kAlwaysCreate')
488 mon_group.defineHistogram('trFlightPathSig', title=f'trFlightPathSig ({n_prong}); trFlightPathSig; Events', xbins=100, xmin=-20, xmax=40, opt='kAlwaysCreate')
489
490

◆ bookIDInputTrack()

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

Definition at line 491 of file TrigTauMonitoringConfig.py.

491 def bookIDInputTrack(self, mon_alg, base_path, trigger, online):
492 type_str = 'HLT' if online else 'Offline'
493 mon_group_name = f'{trigger}_ID_{type_str}_InputTrack'
494 mon_group_path = f'{base_path}/TauIDVars/InputTrack/{trigger}/{type_str}'
495 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
496
497 mon_group.defineHistogram('n_track', title='Number of tracks; N_{track}; Events', xbins=15, xmin=0, xmax=15, opt='kAlwaysCreate')
498 mon_group.defineHistogram('track_pt_log', title='track_pt_log; track_pt_log; Events', xbins=20, xmin=2, xmax=7, opt='kAlwaysCreate')
499 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')
500 mon_group.defineHistogram('track_eta', title='Track #eta; #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
501 mon_group.defineHistogram('track_phi', title='Track #phi; #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
502 mon_group.defineHistogram('track_dEta', title='Track #Delta#eta; #Delta#eta; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
503 mon_group.defineHistogram('track_dPhi', title='Track #Delta#phi; #Delta#phi; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
504 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')
505 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')
506 mon_group.defineHistogram('track_nIBLHitsAndExp', title='track_nIBLHitsAndExp; track_nIBLHitsAndExp; Events', xbins=3, xmin=0, xmax=3, opt='kAlwaysCreate')
507 mon_group.defineHistogram('track_nPixelHitsPlusDeadSensors', title='track_nPixelHitsPlusDeadSensors; track_nPixelHitsPlusDeadSensors; Events', xbins=11, xmin=0, xmax=11, opt='kAlwaysCreate')
508 mon_group.defineHistogram('track_nSCTHitsPlusDeadSensors', title='track_nSCTHitsPlusDeadSensors; track_nSCTHitsPlusDeadSensors; Events', xbins=20, xmin=0, xmax=20, opt='kAlwaysCreate')
509 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')
510 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')
511
512

◆ bookIDScores()

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

Definition at line 533 of file TrigTauMonitoringConfig.py.

533 def bookIDScores(self, mon_alg, base_path, trigger, n_prong, online):
534 info = self.getTriggerInfo(trigger)
535
536 if online:
537 variables = {}
538 if info.getHLTTauLegContainerSfx() in self.hlt_tauid_scores:
539 store_all = info.getHLTTauID() in ['idperf', 'perf']
540 variables |= {
541 tau_id: p
542 for tau_id, p in self.hlt_tauid_scores[info.getHLTTauLegContainerSfx()].items()
543 if tau_id == info.getHLTTauID() or store_all
544 }
545 if info.getHLTTauLegContainerSfx() in self.hlt_calohits_presel_scores:
546 store_all = info.getHLTTauCaloHitsPreselectionID() in ['', 'idperfCHP']
547 variables |= {
548 tau_id: p
549 for tau_id, p in self.hlt_calohits_presel_scores[info.getHLTTauLegContainerSfx()].items()
550 if tau_id == info.getHLTTauCaloHitsPreselectionID() or store_all
551 }
552
553 else:
554 variables = self.offline_tauid_scores
555
556 if not variables: return
557
558 type_str = 'HLT' if online else 'Offline'
559 mon_group_name = f'{trigger}_{type_str}_IDScores_{n_prong}'
560 mon_group_path = f'{base_path}/basicVars/{trigger}/{type_str}_{n_prong}'
561 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
562
563 for tau_id, (score, score_sig_trans) in variables.items():
564 if online and tau_id in ['RNN', 'DeepSet', 'RNNLLP', 'GNTau', 'GNTauDev1'] or not online and tau_id in ['RNN']: xbins, xmax = 20, 1
565 else: xbins, xmax = 100, 7
566
567 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')
568 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')
569
570

◆ bookL1EffHistograms()

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

Definition at line 795 of file TrigTauMonitoringConfig.py.

795 def bookL1EffHistograms(self, mon_alg, base_path, trigger, n_prong):
796 mon_group_name = f'{trigger}_L1_Efficiency_{n_prong}'
797 mon_group_path = f'{base_path}/L1_Efficiency/{trigger}/L1_Efficiency_{n_prong}'
798 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
799
800 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, high_pt=False, coarse=False):
801 pass_flag = 'L1_pass'
802 sfx = ''
803
804 if high_pt:
805 pass_flag += '_highPt'
806 sfx += '_highPt'
807 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau thr} + 20 GeV)'
808 elif coarse:
809 sfx += '_coarse'
810
811 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffL1_{xvariable}{sfx}_wrt_Offline',
812 title=f'L1 Efficiency {trigger} {n_prong}; {xlabel}; Efficiency',
813 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
814
815 coarse_binning = self.getCustomPtBinning(trigger)
816
817 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', 60, 0, 300)
818 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], coarse=True)
819 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6)
820 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2)
821 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6, high_pt=True)
822 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2, high_pt=True)
823 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80)
824
825

◆ bookL1Vars()

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

Definition at line 826 of file TrigTauMonitoringConfig.py.

826 def bookL1Vars(self, mon_alg, base_path, trigger):
827 mon_group_name = f'{trigger}_L1Vars'
828 mon_group_path = f'{base_path}/L1Vars/{trigger}'
829 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
830
831 mon_group.defineHistogram('L1RoIEt,L1RoIEta', type='TH2F', title='L1 RoI E_{T} vs #eta; E_{T} [GeV]; #eta',
832 xbins=60, xmin=0, xmax=300,
833 ybins=60, ymin=-2.6, ymax=2.6, opt='kAlwaysCreate')
834 mon_group.defineHistogram('L1RoIEt,L1RoIPhi', type='TH2F', title='L1 RoI E_{T} vs #phi; E_{T} [GeV]; #phi',
835 xbins=60, xmin=0, xmax=300,
836 ybins=60, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
837 mon_group.defineHistogram('L1RoIEta,L1RoIPhi', type='TH2F', title='L1 RoI #eta vs #phi; #eta; #phi',
838 xbins=60, xmin=-2.6, xmax=2.6,
839 ybins=60, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
840 mon_group.defineHistogram('L1RoIEta', title='L1 RoI #eta; #eta; RoIs', xbins=60, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
841 mon_group.defineHistogram('L1RoIPhi', title='L1 RoI #phi; #phi; RoIs', xbins=60, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
842 mon_group.defineHistogram('L1RoIEt', title='L1 RoI E_{T}; E_{T} [GeV]; RoIs', xbins=60, xmin=0, xmax=300, opt='kAlwaysCreate')
843
844 if 'eTAU' in trigger:
845 mon_group.defineHistogram('L1eFexRoIRCore', title='L1 eTAU RoI rCore Isolation; rCore Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
846 mon_group.defineHistogram('L1eFexRoIRHad' , title='L1 eTAU RoI rHad Isolation; rHad Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
847 mon_group.defineHistogram('L1eFexRoIBDTScore' , title='L1 eTAU RoI BDT score; BDT Score; RoIs', xbins=128, xmin=512, xmax=1024, opt='kAlwaysCreate')
848
849 elif 'cTAU' in trigger:
850 mon_group.defineHistogram('L1eFexRoIRCore', title='L1 eTAU RoI rCore Isolation; eTAU rCore Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
851 mon_group.defineHistogram('L1eFexRoIRHad', title='L1 eTAU RoI rHad Isolation; eTAU rHad Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
852 mon_group.defineHistogram('L1cTauRoITopoMatch', title='L1Topo match between eTAU and jTAU RoI; Match; RoIs', xbins=2, xmin=0, xmax=2, opt='kAlwaysCreate')
853 mon_group.defineHistogram('L1jFexRoIIso', title='L1 jTAU RoI Isolation; E_{T}^{jTAU Iso} [GeV]; RoIs', xbins=25, xmin=0, xmax=50, opt='kAlwaysCreate')
854 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')
855 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')
856 mon_group.defineHistogram('L1eFexRoIBDTScore' , title='L1 eTAU RoI BDT score; BDT Score; RoIs', xbins=128, xmin=512, xmax=1024, opt='kAlwaysCreate')
857

◆ bookTAndPHLTEffHistograms()

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

Definition at line 692 of file TrigTauMonitoringConfig.py.

692 def bookTAndPHLTEffHistograms(self, mon_alg, base_path, trigger):
693 mon_group_name = f'{trigger}_TAndPHLT_Efficiency'
694 mon_group_path = f'{base_path}/TAndPHLT_Efficiency/{trigger}/TAndPHLT_Efficiency'
695 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
696
697 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, high_pt=False, coarse=False):
698 pass_flag = 'HLT_pass'
699 sfx = ''
700
701 if high_pt:
702 pass_flag += '_highPt'
703 sfx += '_highPt'
704 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau thr} + 20 GeV)'
705 elif coarse:
706 sfx += '_coarse'
707
708 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffTAndPHLT_{xvariable}{sfx}_wrt_Offline',
709 title=f'TAndP HLT Efficiency {trigger}; {xlabel}; Efficiency',
710 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
711
712 coarse_binning = self.getCustomPtBinning(trigger)
713
714 defineEachStepHistograms('tauPt', 'p_{T}^{#tau} [GeV]', 60, 0.0, 300)
715 defineEachStepHistograms('tauPt', 'p_{T}^{#tau} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], coarse=True)
716 defineEachStepHistograms('tauEta', '#eta_{#tau}', 13, -2.6, 2.6)
717 defineEachStepHistograms('tauPhi', '#phi_{#tau}', 16, -3.2, 3.2)
718 defineEachStepHistograms('tauEta', '#eta_{#tau}', 13, -2.6, 2.6, high_pt=True)
719 defineEachStepHistograms('tauPhi', '#phi_{#tau}', 16, -3.2, 3.2, high_pt=True)
720 defineEachStepHistograms('dR', '#Delta R(#tau,lep)', 20, 0, 4)
721 defineEachStepHistograms('dEta', '#Delta#eta(#tau,lep)', 20, 0,4)
722 defineEachStepHistograms('dPhi', '#Delta#phi(#tau,lep)', 8, -3.2, 3.2)
723 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80)
724
725 # Save quantities in TTree for offline analysis
726 mon_group.defineTree('tauPt,tauEta,tauPhi,dR,dEta,dPhi,averageMu,HLT_pass;TAndPHLTEffTree',
727 treedef='tauPt/F:tauEta/F:tauPhi/F:dR/F:dEta/F:dPhi/F:averageMu/F:HLT_pass/I')
728
729

◆ bookTAndPVars()

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

Definition at line 730 of file TrigTauMonitoringConfig.py.

730 def bookTAndPVars(self, mon_alg, base_path, trigger):
731 mon_group_name = f'{trigger}_TAndPVars'
732 mon_group_path = f'{base_path}/TAndPVars/{trigger}'
733 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
734
735 mon_group.defineHistogram('dR', title='#Delta R(#tau,lep); #Delta R(#tau,lep); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
736 mon_group.defineHistogram('dEta', title='#Delta#eta(#tau,lep); #Delta#eta(#tau,lep); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
737 mon_group.defineHistogram('dPhi', title='#Delta#phi(#tau,lep); #Delta#phi(#tau,lep); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
738
739 mon_group.defineHistogram('Pt', title='p_{T}(#tau,lep); p_{T} [GeV]; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
740 mon_group.defineHistogram('Eta', title='#eta(#tau,lep); #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
741 mon_group.defineHistogram('Phi', title='#phi(#tau,lep); #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
742 mon_group.defineHistogram('M', title='m(#tau,lep); m_{#tau,lep}; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
743 mon_group.defineHistogram('dPt', title='#Delta p_{T}(#tau,lep); p_{T} [GeV]; Events', xbins=20, xmin=0, xmax=200, opt='kAlwaysCreate')
744
745

◆ bookTruthEfficiency()

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

Definition at line 746 of file TrigTauMonitoringConfig.py.

746 def bookTruthEfficiency(self, mon_alg, base_path, trigger, n_prong):
747 mon_group_name = f'{trigger}_Truth_Efficiency_{n_prong}'
748 mon_group_path = f'{base_path}/Truth_Efficiency/{trigger}/Truth_Efficiency_{n_prong}'
749 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
750
751 info = self.getTriggerInfo(trigger)
752
753 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, high_pt=False, coarse=False):
754 pass_flag = 'HLT_pass'
755 sfx = ''
756
757 if high_pt:
758 pass_flag += '_highPt'
759 sfx += '_highPt'
760 if info.isHLTDiTau():
761 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau min thr} + 20 GeV)'
762 else:
763 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau thr} + 20 GeV)'
764 elif coarse:
765 sfx += '_coarse'
766
767 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffHLT_{xvariable}{sfx}_wrt_Truth',
768 title=f'HLT Efficiency {trigger} {n_prong}; {xlabel}; Efficiency',
769 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax)
770
771 coarse_binning = self.getCustomPtBinning(trigger)
772
773 defineEachStepHistograms('pt_vis', 'p_{T, vis} [GeV]', 60, 0.0, 300)
774 if info.isHLTSingleTau() or info.isHLTTandP(): defineEachStepHistograms('pt_vis', 'p_{T, vis} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], coarse=True)
775 defineEachStepHistograms('eta_vis', '#eta_{vis}', 13, -2.6, 2.6)
776 defineEachStepHistograms('phi_vis', '#phi_{vis}', 16, -3.2, 3.2)
777 defineEachStepHistograms('eta_vis', '#eta_{vis}', 13, -2.6, 2.6, high_pt=True)
778 defineEachStepHistograms('phi_vis', '#phi_{vis}', 16, -3.2, 3.2, high_pt=True)
779
780

◆ bookTruthVars()

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

Definition at line 781 of file TrigTauMonitoringConfig.py.

781 def bookTruthVars(self, mon_alg, base_path, trigger, n_prong):
782 mon_group_name = f'{trigger}_TruthVars_{n_prong}'
783 mon_group_path = f'{base_path}/TruthVars/{trigger}/TruthVars_{n_prong}'
784 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
785
786 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)
787 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)
788 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)
789
790 mon_group.defineHistogram('pt_vis', title='p_{T, vis}; p_{T, vis}; Events', xbins=50, xmin=0, xmax=250)
791 mon_group.defineHistogram('eta_vis', title='#eta_{vis}; #eta_{vis}; Events', xbins=26, xmin=-2.6, xmax=2.6)
792 mon_group.defineHistogram('phi_vis', title='#phi_{vis}; #phi_{vis}; Events', xbins=16, xmin=-3.2, xmax=3.2)
793
794

◆ configure()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configure ( self)

Definition at line 136 of file TrigTauMonitoringConfig.py.

136 def configure(self):
137 # First load and classify the list of triggers
138 self.configureTriggers()
139
140 # Now create, configure, and book the histograms for all the individual algorithms
141 self.logger.info('Creating the Tau monitoring algorithms...')
142
143 if self.activate_single_tau:
144 self.configureAlgorithmSingle()
145
146 if self.activate_ditau:
147 self.configureAlgorithmDiTau()
148
149 if self.activate_boosted_ditau:
150 self.configureAlgorithmBoostedDiTau()
151
152 if self.activate_tag_and_probe:
153 self.configureAlgorithmTagAndProbe()
154
155 if self.activate_truth:
156 self.configureAlgorithmTruth()
157
158 if self.activate_L1:
159 self.configureAlgorithmL1()
160
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 355 of file TrigTauMonitoringConfig.py.

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

◆ configureAlgorithmDiTau()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmDiTau ( self)

Definition at line 342 of file TrigTauMonitoringConfig.py.

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

◆ configureAlgorithmL1()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmL1 ( self)

Definition at line 386 of file TrigTauMonitoringConfig.py.

386 def configureAlgorithmL1(self):
387 has_xtob_etau_rois = 'L1_eTauxRoI' in self.helper.flags.Input.Collections or self.helper.flags.DQ.Environment == "tier0"
388
389 self.mon_alg_L1 = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1')
390 self.mon_alg_L1.TriggerList = self.L1_items
391 self.mon_alg_L1.RequireOfflineTaus = self.require_offline_taus
392 self.mon_alg_L1.OfflineTauID = 2
393 if not has_xtob_etau_rois:
394 self.logger.info(' |- No L1_eTauxRoI container is available: e/cTAU BDT scores will be set to 0')
395 self.mon_alg_L1.Phase1L1eTauxRoIKey = ''
396
397 self.logger.info(' |- Booking all histograms')
398 for trigger in self.L1_items:
399 for p in ('1P', '3P'):
400 self.bookL1EffHistograms(self.mon_alg_L1, self.base_path, trigger, n_prong=p)
401 self.bookL1Vars(self.mon_alg_L1, self.base_path, trigger)
402
403 if self.do_duplicate_var_plots_without_offline_taus:
404 self.mon_alg_L1_no_offline = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1NoOffline')
405 self.mon_alg_L1_no_offline.TriggerList = self.L1_items
406 self.mon_alg_L1_no_offline.RequireOfflineTaus = False
407 self.mon_alg_L1_no_offline.DoEfficiencyPlots = False
408 if not has_xtob_etau_rois:
409 self.logger.info(' |- No L1_eTauxRoI container is available: e/cTAU BDT scores will be set to 0')
410 self.mon_alg_L1_no_offline.Phase1L1eTauxRoIKey = ''
411
412 self.logger.info(' |- Booking all histograms')
413 path = f'{self.base_path}/OnlineOnlyVars'
414 for trigger in self.L1_items:
415 self.bookL1Vars(self.mon_alg_L1_no_offline, path, trigger)
416
417 if self.do_alternative_eTAU_monitoring:
418 self.mon_alg_L1_alt = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1eTAUAlt')
419 self.mon_alg_L1_alt.Phase1L1eTauRoIKey = 'L1_eTauRoIAltSim' # Use alternative RoIs (with heuristic eTAU algorithm simulation)
420 self.mon_alg_L1_alt.SelectL1ByETOnly = True # We don't have threshold patterns for the Alt RoIs, so we match by ET only
421 self.mon_alg_L1_alt.RequireOfflineTaus = False
422 self.mon_alg_L1_alt.Phase1L1eTauxRoIKey = ''
423
424 l1_items = [item for item in self.L1_items if 'eTAU' in item and not self.getTriggerInfo(item).isL1TauIsolated()] # Only non-isolated eTAU items
425 self.mon_alg_L1_alt.TriggerList = l1_items
426
427 self.logger.info(' |- Booking all histograms')
428 path = f'{self.base_path}/L1eTAUAlt'
429 for trigger in l1_items:
430 for p in ('1P', '3P'):
431 self.bookL1EffHistograms(self.mon_alg_L1_alt, path, trigger, n_prong=p)
432 self.bookL1Vars(self.mon_alg_L1_alt, path, trigger)
433
434

◆ configureAlgorithmSingle()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmSingle ( self)

Definition at line 286 of file TrigTauMonitoringConfig.py.

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

◆ configureAlgorithmTagAndProbe()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmTagAndProbe ( self)

Definition at line 363 of file TrigTauMonitoringConfig.py.

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

◆ configureAlgorithmTruth()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmTruth ( self)

Definition at line 375 of file TrigTauMonitoringConfig.py.

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

◆ configureMode()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureMode ( self)

Definition at line 117 of file TrigTauMonitoringConfig.py.

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

◆ configureTriggers()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureTriggers ( self)

Definition at line 186 of file TrigTauMonitoringConfig.py.

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

858 def getCustomPtBinning(self, trigger, fine=False):
859 info = self.getTriggerInfo(trigger)
860
861 def getList(ranges, others=[250]):
862 ret = set(others + [500]) # The upper end of the x-axis will always be 500
863 for jump, interval in ranges.items():
864 ret.update(range(interval[0], interval[1], jump), interval)
865 return sorted(list(ret))
866
867 if info.isL1TauOnly():
868 thr = info.getL1TauThreshold()
869
870 if thr <= 8: return getList({5:(0, 30), 50:(50, 150)})
871 elif thr <= 12: return getList({5:(0, 30), 50:(50, 150)})
872 elif thr <= 20: return getList({5:(5, 40), 10:(40, 70), 50:(100, 150)})
873 elif thr <= 30: return getList({5:(15, 50), 10:(50, 70), 50:(100, 150)})
874 elif thr <= 35: return getList({5:(20, 55), 10:(60, 80), 50:(100, 150)})
875 elif thr <= 40: return getList({5:(25, 60), 10:(60, 80), 50:(100, 150)})
876 elif thr <= 60: return getList({5:(45, 80), 10:(80, 100), 50:(100, 150)})
877 elif thr <= 100: return getList({5:(85, 120), 10:(120, 140), 20:(140, 180), 50:(200, 250)})
878 else: return getList({50:(0, 200)})
879
880 else: # HLT triggers
881 thr = info.getHLTTauThreshold()
882
883 if fine:
884 if thr == 0: return getList({5:(0, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
885 elif thr <= 20: return getList({5:(15, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
886 elif thr <= 25: return getList({5:(20, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
887 elif thr <= 30: return getList({5:(25, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
888 elif thr <= 35: return getList({5:(30, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
889 elif thr <= 60: return getList({5:(55, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
890 elif thr <= 80: return getList({5:(75, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
891 elif thr <= 160: return getList({5:(155, 160), 40:(160, 240), 60:(240, 420)}, [])
892 elif thr <= 180: return getList({5:(175, 180), 40:(180, 260), 60:(260, 380)}, [])
893 else: return getList({5:(195, 200), 40:(200, 240), 60:(240, 420)}, [])
894
895 else:
896 if thr == 0:
897 if info.getL1TauItems(): return self.getCustomPtBinning(f'L1{info.getL1TauItem()}')
898 else: return getList({5:(0, 30), 50:(50, 150)})
899 elif thr <= 20: return getList({5:(10, 40), 10:(40, 60), 20:(60, 80)}, [150, 250])
900 elif thr <= 25: return getList({5:(15, 40), 10:(40, 60), 20:(60, 80)}, [150, 250])
901 elif thr <= 30: return getList({5:(20, 50), 10:(50, 60), 20:(60, 80)}, [150, 250])
902 elif thr <= 35: return getList({5:(25, 50), 10:(50, 60), 20:(60, 80)}, [150, 250])
903 elif thr <= 60: return getList({5:(50, 70), 10:(70, 80)}, [110, 150, 250])
904 elif thr <= 80: return getList({5:(70, 90)}, [110, 150, 250])
905 elif thr <= 160: return getList({5:(150, 170), 10:(170, 180), 20:(180, 200)}, [240, 300])
906 elif thr <= 180: return getList({5:(170, 180), 10:(180, 200)}, [240, 300])
907 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 178 of file TrigTauMonitoringConfig.py.

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

Member Data Documentation

◆ _L1_Phase1_threshold_mappings_stdmap

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_threshold_mappings_stdmap
protected

Definition at line 181 of file TrigTauMonitoringConfig.py.

◆ _L1_Phase1_thresholds_stdmap

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_thresholds_stdmap
protected

Definition at line 181 of file TrigTauMonitoringConfig.py.

◆ activate_boosted_ditau

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

Definition at line 98 of file TrigTauMonitoringConfig.py.

◆ activate_ditau

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

Definition at line 94 of file TrigTauMonitoringConfig.py.

◆ activate_L1

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

Definition at line 110 of file TrigTauMonitoringConfig.py.

◆ activate_single_tau

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

Definition at line 90 of file TrigTauMonitoringConfig.py.

◆ activate_tag_and_probe

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

Definition at line 102 of file TrigTauMonitoringConfig.py.

◆ activate_truth

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

Definition at line 106 of file TrigTauMonitoringConfig.py.

◆ base_path

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

Definition at line 82 of file TrigTauMonitoringConfig.py.

◆ data_type

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

Definition at line 120 of file TrigTauMonitoringConfig.py.

◆ do_alternative_eTAU_monitoring

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.do_alternative_eTAU_monitoring = False
static

Definition at line 76 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 83 of file TrigTauMonitoringConfig.py.

◆ HLT_boosted_ditau_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_boosted_ditau_items = []

Definition at line 100 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 96 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 92 of file TrigTauMonitoringConfig.py.

◆ HLT_tag_and_probe_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_tag_and_probe_items = []

Definition at line 104 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 108 of file TrigTauMonitoringConfig.py.

◆ is_mc

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.is_mc = False

Definition at line 118 of file TrigTauMonitoringConfig.py.

◆ L1_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.L1_items = []

Definition at line 112 of file TrigTauMonitoringConfig.py.

◆ L1_Phase1_threshold_mappings

dict python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.L1_Phase1_threshold_mappings = {}

Definition at line 87 of file TrigTauMonitoringConfig.py.

◆ L1_Phase1_thresholds

dict python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.L1_Phase1_thresholds = {}

Definition at line 86 of file TrigTauMonitoringConfig.py.

◆ logger

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

Definition at line 80 of file TrigTauMonitoringConfig.py.

◆ mon_alg_boosted_ditau

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_boosted_ditau = None

Definition at line 99 of file TrigTauMonitoringConfig.py.

◆ mon_alg_ditau

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_ditau = None

Definition at line 95 of file TrigTauMonitoringConfig.py.

◆ mon_alg_L1

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_L1 = None

Definition at line 111 of file TrigTauMonitoringConfig.py.

◆ mon_alg_L1_alt

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_L1_alt = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1eTAUAlt')

Definition at line 418 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 404 of file TrigTauMonitoringConfig.py.

◆ mon_alg_single

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_single = None

Definition at line 91 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 321 of file TrigTauMonitoringConfig.py.

◆ mon_alg_tag_and_probe

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_tag_and_probe = None

Definition at line 103 of file TrigTauMonitoringConfig.py.

◆ mon_alg_truth

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_truth = None

Definition at line 107 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: