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_single_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorSingleAlgorithm, 'TrigTauMonAlgSingleGNTau')
 mon_alg_ditau_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorDiTauAlgorithm, 'TrigTauMonAlgDiTauGNTau')
 mon_alg_tag_and_probe_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorTandPAlgorithm, 'TrigTauMonAlgTandPGNTau')
 mon_alg_L1_no_offline = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1NoOffline')
 mon_alg_L1_alt = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1eTAUAlt')
 mon_alg_L1_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1GNTau')

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
bool do_duplicate_with_offline_gntau = 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 79 of file TrigTauMonitoringConfig.py.

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

Member Function Documentation

◆ _configureAlgorithm()

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

Definition at line 277 of file TrigTauMonitoringConfig.py.

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

◆ _L1_Phase1_threshold_mappings_stdmap()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_threshold_mappings_stdmap ( self)
protected

Definition at line 171 of file TrigTauMonitoringConfig.py.

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

◆ _L1_Phase1_thresholds_stdmap()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_thresholds_stdmap ( self)
protected

Definition at line 163 of file TrigTauMonitoringConfig.py.

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

◆ bookBasicVars()

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

Definition at line 661 of file TrigTauMonitoringConfig.py.

661 def bookBasicVars(self, mon_alg, base_path, trigger, n_prong, online):
662 type_str = 'HLT' if online else 'Offline'
663 mon_group_name = f'{trigger}_{type_str}_basicVars_{n_prong}'
664 mon_group_path = f'{base_path}/basicVars/{trigger}/{type_str}_{n_prong}'
665 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
666
667 binning = self.getCustomPtBinning(trigger, fine=True)
668
669 mon_group.defineHistogram('Pt', title=f'{type_str} p_{{T}}; p_{{T}} [GeV]; Events', xbins=binning, opt='kAlwaysCreate')
670 mon_group.defineHistogram('Eta', title=f'{type_str} #eta; #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
671 mon_group.defineHistogram('Phi', title=f'{type_str} #phi; #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
672 mon_group.defineHistogram('nTrack', title=f'{type_str} Number of tracks; N_{{track}}; Events', xbins=10, xmin=0, xmax=10, opt='kAlwaysCreate')
673 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')
674 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')
675 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')
676 mon_group.defineHistogram('nIsoTrack', title=f'{type_str} Number of isolation tracks; N_{{track}}^{{iso}}; Events', xbins=10, xmin=0, xmax=10, opt='kAlwaysCreate')
677 mon_group.defineHistogram('averageMu', title=f'{type_str} Average #mu; #LT#mu$GT; Events', xbins=20, xmin=0, xmax=80, opt='kAlwaysCreate')
678 mon_group.defineHistogram('TauVertexX', title=f'{type_str} Tau Vertex X; x [mm]; Events', xbins=100, xmin=-1, xmax=1, opt='kAlwaysCreate')
679 mon_group.defineHistogram('TauVertexY', title=f'{type_str} Tau Vertex Y; y [mm]; Events', xbins=100, xmin=-2, xmax=0, opt='kAlwaysCreate')
680 mon_group.defineHistogram('TauVertexZ', title=f'{type_str} Tau Vertex Z; z [mm]; Events', xbins=120, xmin=-120, xmax=120, opt='kAlwaysCreate')
681
682

◆ bookBoostedDiTauVars()

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

Definition at line 747 of file TrigTauMonitoringConfig.py.

747 def bookBoostedDiTauVars(self, mon_alg, base_path, trigger):
748 mon_group_name = f'{trigger}_BoostedDiTauVars'
749 mon_group_path = f'{base_path}/BoostedDiTauVars/{trigger}'
750 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
751
752 mon_group.defineHistogram('omni_score', title='omni_score; omni_score; Events', xbins=50, xmin=0, xmax=1, opt='kAlwaysCreate')
753 mon_group.defineHistogram('R_tracks_lead', title='R_tracks_lead; R_tracks_lead; Events', xbins=50, xmin=0, xmax=0.2, opt='kAlwaysCreate')
754 mon_group.defineHistogram('R_tracks_subl', title='R_tracks_subl; R_tracks_subl; Events', xbins=50, xmin=0, xmax=0.2, opt='kAlwaysCreate')
755 mon_group.defineHistogram('f_core_lead', title='f_core_lead; f_core_lead; Events', xbins=50, xmin=0, xmax=1, opt='kAlwaysCreate')
756 mon_group.defineHistogram('f_core_subl', title='f_core_subl; f_core_subl; Events', xbins=50, xmin=0, xmax=1, opt='kAlwaysCreate')
757 mon_group.defineHistogram('n_track', title='Number of tracks; n_tracks; Events', xbins=51, xmin=-0.5, xmax=50.5, opt='kAlwaysCreate')
758 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')
759 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')
760 mon_group.defineHistogram('Pt', title='p_{T}(#tau,#tau); p_{T} [GeV]; Events', xbins=50, xmin=160, xmax=1300, opt='kAlwaysCreate')
761 mon_group.defineHistogram('Eta', title='#eta(#tau,#tau); #eta(#tau,#tau); Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
762 mon_group.defineHistogram('Phi', title='#phi(#tau,#tau); #phi(#tau,#tau); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
763 mon_group.defineHistogram('M', title='m(#tau,#tau); m_{#tau,#tau}; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
764

◆ bookDiTauHLTEffHistograms()

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

Definition at line 683 of file TrigTauMonitoringConfig.py.

683 def bookDiTauHLTEffHistograms(self, mon_alg, base_path, trigger):
684 mon_group_name = f'{trigger}_DiTauHLT_Efficiency'
685 mon_group_path = f'{base_path}/DiTauHLT_Efficiency/{trigger}/DiTauHLT_Efficiency'
686 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
687
688 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, eff='HLT', high_pt=False):
689 pass_flag = f'{eff}_pass'
690 sfx = ''
691
692 if high_pt:
693 pass_flag += '_highPt'
694 sfx += '_highPt'
695 xlabel += ' (p_{T}^{1,2} > p_{T}^{thr 1,2} + 20 GeV)'
696
697 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffDiTau{eff}_{xvariable}{sfx}_wrt_Offline',
698 title=f'DiTau {eff} Efficiency {trigger};{xlabel};Efficiency',
699 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
700
701 eff_list = ['HLT'] + (['Total'] if self.do_total_efficiency else [])
702 for eff in eff_list:
703 defineEachStepHistograms('dR', '#Delta R(#tau,#tau)', 20, 0, 4, eff)
704 defineEachStepHistograms('dEta', '#Delta#eta(#tau,#tau)', 20, 0, 4, eff)
705 defineEachStepHistograms('dPhi', '#Delta#phi(#tau,#tau)', 8, -3.2, 3.2, eff)
706
707 defineEachStepHistograms('dR', '#Delta R(#tau,#tau)', 20, 0, 4, eff, high_pt=True)
708 defineEachStepHistograms('dEta', '#Delta#eta(#tau,#tau)', 20, 0, 4, eff, high_pt=True)
709 defineEachStepHistograms('dPhi', '#Delta#phi(#tau,#tau)', 8, -3.2, 3.2, eff, high_pt=True)
710 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80, eff)
711
712 # Save quantities in TTree for offline analysis
713 mon_group.defineTree('dR,dEta,dPhi,averageMu,HLT_pass;DiTauHLTEffTree',
714 treedef='dR/F:dEta/F:dPhi/F:averageMu/F:HLT_pass/I')
715
716

◆ bookDiTauVars()

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

Definition at line 717 of file TrigTauMonitoringConfig.py.

717 def bookDiTauVars(self, mon_alg, base_path, trigger):
718 mon_group_name = f'{trigger}_DiTauVars'
719 mon_group_path = f'{base_path}/DiTauVars/{trigger}'
720 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
721
722 mon_group.defineHistogram('leadHLTEt,subleadHLTEt', type='TH2F', title='p_{T}^{lead} vs p_{T}^{sublead}; p_{T}^{lead} [GeV]; p_{T}^{sublead} [GeV]',
723 xbins=50, xmin=0, xmax=250, ybins=50, ymin=0, ymax=250, opt='kAlwaysCreate')
724 mon_group.defineHistogram('leadHLTEta,subleadHLTEta', type='TH2F', title='#eta_{lead} vs #eta_{sublead}; #eta_{lead}; #eta_{sublead}',
725 xbins=26, xmin=-2.6, xmax=2.6, ybins=26, ymin=-2.6, ymax=2.6, opt='kAlwaysCreate')
726 mon_group.defineHistogram('leadHLTPhi,subleadHLTPhi', type='TH2F', title='#phi_{lead} vs #phi_{sublead}; #phi_{lead}; #phi_{sublead}',
727 xbins=16, xmin=-3.2, xmax=3.2, ybins=16, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
728 mon_group.defineHistogram('dR', title='#Delta R(#tau,#tau); #Delta R(#tau,#tau); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
729 mon_group.defineHistogram('dEta', title='#Delta#eta(#tau,#tau); #Delta#eta(#tau,#tau); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
730 mon_group.defineHistogram('dPhi', title='#Delta#phi(#tau,#tau); #Delta#phi(#tau,#tau); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
731
732 mon_group.defineHistogram('Pt', title='p_{T}(#tau,#tau); p_{T} [GeV]; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
733 mon_group.defineHistogram('Eta', title='#eta(#tau,#tau); #eta(#tau,#tau); Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
734 mon_group.defineHistogram('Phi', title='#phi(#tau,#tau); #phi(#tau,#tau); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
735 mon_group.defineHistogram('M', title='m(#tau,#tau); m_{#tau,#tau}; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
736 mon_group.defineHistogram('dPt', title='#Delta p_{T}(#tau, #tau); p_{T} [GeV]; Events', xbins=20, xmin=0, xmax=200, opt='kAlwaysCreate')
737
738 mon_group.defineTree('leadHLTEt,subleadHLTEt,leadHLTEta,subleadHLTEta,leadHLTPhi,subleadHLTPhi,dR,dEta,dPhi,Pt,Eta,Phi,M,dPt;DiTauVarsTree',
739 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')
740
741# def bookBoostedDiTauHLTEffHistograms(self, mon_alg, base_path, trigger):

◆ bookHitZVars()

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

Definition at line 644 of file TrigTauMonitoringConfig.py.

644 def bookHitZVars(self, mon_alg, base_path, trigger, n_prong):
645 info = self.getTriggerInfo(trigger)
646
647 if info.getHLTTauLegContainerSfx() not in self.hlt_hitz_variables: return
648 if not info.getHLTTauHitZAlg() and not info.getHLTTauCaloHitsPreselectionID(): return
649
650 mon_group_name = f'{trigger}_HLT_HitZ_{n_prong}'
651 mon_group_path = f'{base_path}/basicVars/{trigger}/HLT_{n_prong}'
652 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
653
654 for alg, (z0, z0_sigma) in self.hlt_hitz_variables[info.getHLTTauLegContainerSfx()].items():
655 mon_group.defineHistogram(f'{alg}_z0', title=f'{alg} z_{{0}}; z_{{0}} [mm]; Events', xbins=100, xmin=-185, xmax=185, opt='kAlwaysCreate')
656 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')
657 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')
658 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')
659
660

◆ bookHLTEffHistograms()

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

Definition at line 508 of file TrigTauMonitoringConfig.py.

508 def bookHLTEffHistograms(self, mon_alg, base_path, trigger, n_prong):
509 mon_group_name = f'{trigger}_HLT_Efficiency_{n_prong}'
510 mon_group_path = f'{base_path}/HLT_Efficiency/{trigger}/HLT_Efficiency_{n_prong}'
511 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
512
513 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, eff='HLT', high_pt=False, coarse=False):
514 pass_flag = f'{eff}_pass'
515 sfx = ''
516
517 if high_pt:
518 pass_flag += '_highPt'
519 sfx += '_highPt'
520 xlabel += ' (p_{T} > p_{T}^{thr} + 20 GeV)'
521 elif coarse: sfx = '_coarse'
522
523 mon_group.defineHistogram(f'{pass_flag},{xvariable};Eff{eff}_{xvariable}{sfx}_wrt_Offline',
524 title=f'{eff} Efficiency {trigger} {n_prong}; {xlabel}; Efficiency',
525 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
526
527 coarse_binning = self.getCustomPtBinning(trigger)
528
529 eff_list = ['HLT'] + (['Total'] if self.do_total_efficiency else [])
530 for eff in eff_list:
531 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', 60, 0.0, 300., eff)
532 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], eff, coarse=True)
533 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6, eff)
534 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2, eff)
535 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6, eff, high_pt=True)
536 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2, eff, high_pt=True)
537 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80, eff)
538
539 # Save quantities in TTree for offline analysis
540 mon_group.defineTree('tauPt,tauEta,tauPhi,averageMu,HLT_pass;HLTEffTree',
541 treedef='tauPt/F:tauEta/F:tauPhi/F:averageMu/F:HLT_pass/I')
542
543

◆ bookIDInputCluster()

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

Definition at line 586 of file TrigTauMonitoringConfig.py.

586 def bookIDInputCluster(self, mon_alg, base_path, trigger, online):
587 type_str = 'HLT' if online else 'Offline'
588 mon_group_name = f'{trigger}_ID_{type_str}_InputCluster'
589 mon_group_path = f'{base_path}/TauIDVars/InputCluster/{trigger}/{type_str}'
590 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
591
592 mon_group.defineHistogram('n_cluster', title='Number of clusters; N_{cluster}; Events', xbins=30, xmin=0, xmax=30, opt='kAlwaysCreate')
593 mon_group.defineHistogram('cluster_et_log', title='cluster_et_log; cluster_et_log; Events', xbins=30, xmin=0, xmax=6, opt='kAlwaysCreate')
594 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')
595 mon_group.defineHistogram('cluster_eta', title='Cluster #eta; #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
596 mon_group.defineHistogram('cluster_phi', title='Cluster #phi; #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
597 mon_group.defineHistogram('cluster_dEta', title='Cluster #Delta#eta; #Delta#eta; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
598 mon_group.defineHistogram('cluster_dPhi', title='Cluster #Delta#phi; #Delta#phi; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
599 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')
600 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')
601 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')
602 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')
603 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')
604
605

◆ bookIDInputScalar()

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

Definition at line 544 of file TrigTauMonitoringConfig.py.

544 def bookIDInputScalar(self, mon_alg, base_path, trigger, n_prong, online):
545 type_str = 'HLT' if online else 'Offline'
546 mon_group_name = f'{trigger}_ID_{type_str}_InputScalar_{n_prong}'
547 mon_group_path = f'{base_path}/TauIDVars/InputScalar_{n_prong}/{trigger}/{type_str}'
548 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
549
550 mon_group.defineHistogram('centFrac', title=f'Centrality Fraction ({n_prong}); centFrac; Events', xbins=50, xmin=-0.05, xmax=1.2, opt='kAlwaysCreate')
551 mon_group.defineHistogram('etOverPtLeadTrk', title=f'etOverPtLeadTrk log ({n_prong}); etOverPtLeadTrk_log; Events', xbins=60, xmin=-3, xmax=3, opt='kAlwaysCreate')
552 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')
553 mon_group.defineHistogram('absipSigLeadTrk', title=f'AbsIpSigLeadTrk ({n_prong}); absipSigLeadTrk; Events', xbins=25, xmin=0.0, xmax=20.0, opt='kAlwaysCreate')
554 mon_group.defineHistogram('sumPtTrkFrac', title=f'SumPtTrkFrac ({n_prong}); SumPtTrkFrac; Events', xbins=50, xmin=-0.5, xmax=1.1, opt='kAlwaysCreate')
555 mon_group.defineHistogram('emPOverTrkSysP', title=f'EMPOverTrkSysP log ({n_prong}); EMPOverTrkSysP_log; Events', xbins=50, xmin=-5, xmax=3, opt='kAlwaysCreate')
556 mon_group.defineHistogram('ptRatioEflowApprox', title=f'ptRatioEflowApprox ({n_prong}); ptRatioEflowApprox; Events', xbins=50, xmin=0.0, xmax=2.0, opt='kAlwaysCreate')
557 mon_group.defineHistogram('mEflowApprox', title=f'mEflowApprox log ({n_prong}); mEflowApprox_log; Events', xbins=50, xmin=0, xmax=5, opt='kAlwaysCreate')
558 mon_group.defineHistogram('ptDetectorAxis', title=f'ptDetectorAxis log ({n_prong}); ptDetectorAxis_log; Events', xbins=50, xmin=0, xmax=5, opt='kAlwaysCreate')
559 if n_prong == 'MP' or n_prong == '3P':
560 mon_group.defineHistogram('massTrkSys', title=f'massTrkSys log ({n_prong}); massTrkSys_log; Events', xbins=50, xmin=0, xmax=3, opt='kAlwaysCreate')
561 mon_group.defineHistogram('trFlightPathSig', title=f'trFlightPathSig ({n_prong}); trFlightPathSig; Events', xbins=100, xmin=-20, xmax=40, opt='kAlwaysCreate')
562
563

◆ bookIDInputTrack()

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

Definition at line 564 of file TrigTauMonitoringConfig.py.

564 def bookIDInputTrack(self, mon_alg, base_path, trigger, online):
565 type_str = 'HLT' if online else 'Offline'
566 mon_group_name = f'{trigger}_ID_{type_str}_InputTrack'
567 mon_group_path = f'{base_path}/TauIDVars/InputTrack/{trigger}/{type_str}'
568 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
569
570 mon_group.defineHistogram('n_track', title='Number of tracks; N_{track}; Events', xbins=15, xmin=0, xmax=15, opt='kAlwaysCreate')
571 mon_group.defineHistogram('track_pt_log', title='track_pt_log; track_pt_log; Events', xbins=20, xmin=2, xmax=7, opt='kAlwaysCreate')
572 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')
573 mon_group.defineHistogram('track_eta', title='Track #eta; #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
574 mon_group.defineHistogram('track_phi', title='Track #phi; #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
575 mon_group.defineHistogram('track_dEta', title='Track #Delta#eta; #Delta#eta; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
576 mon_group.defineHistogram('track_dPhi', title='Track #Delta#phi; #Delta#phi; Events', xbins=100, xmin=-0.5, xmax=0.5, opt='kAlwaysCreate')
577 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')
578 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')
579 mon_group.defineHistogram('track_nIBLHitsAndExp', title='track_nIBLHitsAndExp; track_nIBLHitsAndExp; Events', xbins=3, xmin=0, xmax=3, opt='kAlwaysCreate')
580 mon_group.defineHistogram('track_nPixelHitsPlusDeadSensors', title='track_nPixelHitsPlusDeadSensors; track_nPixelHitsPlusDeadSensors; Events', xbins=11, xmin=0, xmax=11, opt='kAlwaysCreate')
581 mon_group.defineHistogram('track_nSCTHitsPlusDeadSensors', title='track_nSCTHitsPlusDeadSensors; track_nSCTHitsPlusDeadSensors; Events', xbins=20, xmin=0, xmax=20, opt='kAlwaysCreate')
582 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')
583 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')
584
585

◆ bookIDScores()

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

Definition at line 606 of file TrigTauMonitoringConfig.py.

606 def bookIDScores(self, mon_alg, base_path, trigger, n_prong, online):
607 info = self.getTriggerInfo(trigger)
608
609 if online:
610 variables = {}
611 if info.getHLTTauLegContainerSfx() in self.hlt_tauid_scores:
612 store_all = info.getHLTTauID() in ['idperf', 'perf']
613 variables |= {
614 tau_id: p
615 for tau_id, p in self.hlt_tauid_scores[info.getHLTTauLegContainerSfx()].items()
616 if tau_id == info.getHLTTauID() or store_all
617 }
618 if info.getHLTTauLegContainerSfx() in self.hlt_calohits_presel_scores:
619 store_all = info.getHLTTauCaloHitsPreselectionID() in ['', 'idperfCHP']
620 variables |= {
621 tau_id: p
622 for tau_id, p in self.hlt_calohits_presel_scores[info.getHLTTauLegContainerSfx()].items()
623 if tau_id == info.getHLTTauCaloHitsPreselectionID() or store_all
624 }
625
626 else:
627 variables = self.offline_tauid_scores
628
629 if not variables: return
630
631 type_str = 'HLT' if online else 'Offline'
632 mon_group_name = f'{trigger}_{type_str}_IDScores_{n_prong}'
633 mon_group_path = f'{base_path}/basicVars/{trigger}/{type_str}_{n_prong}'
634 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
635
636 for tau_id, (score, score_sig_trans) in variables.items():
637 if online and tau_id in ['RNN', 'DeepSet', 'RNNLLP', 'GNTau', 'GNTauDev1'] or not online and tau_id in ['RNN']: xbins, xmax = 20, 1
638 else: xbins, xmax = 100, 7
639
640 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')
641 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')
642
643

◆ bookL1EffHistograms()

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

Definition at line 868 of file TrigTauMonitoringConfig.py.

868 def bookL1EffHistograms(self, mon_alg, base_path, trigger, n_prong):
869 mon_group_name = f'{trigger}_L1_Efficiency_{n_prong}'
870 mon_group_path = f'{base_path}/L1_Efficiency/{trigger}/L1_Efficiency_{n_prong}'
871 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
872
873 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, high_pt=False, coarse=False):
874 pass_flag = 'L1_pass'
875 sfx = ''
876
877 if high_pt:
878 pass_flag += '_highPt'
879 sfx += '_highPt'
880 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau thr} + 20 GeV)'
881 elif coarse:
882 sfx += '_coarse'
883
884 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffL1_{xvariable}{sfx}_wrt_Offline',
885 title=f'L1 Efficiency {trigger} {n_prong}; {xlabel}; Efficiency',
886 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
887
888 coarse_binning = self.getCustomPtBinning(trigger)
889
890 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', 60, 0, 300)
891 defineEachStepHistograms('tauPt', 'p_{T} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], coarse=True)
892 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6)
893 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2)
894 defineEachStepHistograms('tauEta', '#eta', 13, -2.6, 2.6, high_pt=True)
895 defineEachStepHistograms('tauPhi', '#phi', 16, -3.2, 3.2, high_pt=True)
896 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80)
897
898

◆ bookL1Vars()

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

Definition at line 899 of file TrigTauMonitoringConfig.py.

899 def bookL1Vars(self, mon_alg, base_path, trigger):
900 mon_group_name = f'{trigger}_L1Vars'
901 mon_group_path = f'{base_path}/L1Vars/{trigger}'
902 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
903
904 mon_group.defineHistogram('L1RoIEt,L1RoIEta', type='TH2F', title='L1 RoI E_{T} vs #eta; E_{T} [GeV]; #eta',
905 xbins=60, xmin=0, xmax=300,
906 ybins=60, ymin=-2.6, ymax=2.6, opt='kAlwaysCreate')
907 mon_group.defineHistogram('L1RoIEt,L1RoIPhi', type='TH2F', title='L1 RoI E_{T} vs #phi; E_{T} [GeV]; #phi',
908 xbins=60, xmin=0, xmax=300,
909 ybins=60, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
910 mon_group.defineHistogram('L1RoIEta,L1RoIPhi', type='TH2F', title='L1 RoI #eta vs #phi; #eta; #phi',
911 xbins=60, xmin=-2.6, xmax=2.6,
912 ybins=60, ymin=-3.2, ymax=3.2, opt='kAlwaysCreate')
913 mon_group.defineHistogram('L1RoIEta', title='L1 RoI #eta; #eta; RoIs', xbins=60, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
914 mon_group.defineHistogram('L1RoIPhi', title='L1 RoI #phi; #phi; RoIs', xbins=60, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
915 mon_group.defineHistogram('L1RoIEt', title='L1 RoI E_{T}; E_{T} [GeV]; RoIs', xbins=60, xmin=0, xmax=300, opt='kAlwaysCreate')
916
917 if 'eTAU' in trigger:
918 mon_group.defineHistogram('L1eFexRoIRCore', title='L1 eTAU RoI rCore Isolation; rCore Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
919 mon_group.defineHistogram('L1eFexRoIRHad' , title='L1 eTAU RoI rHad Isolation; rHad Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
920 mon_group.defineHistogram('L1eFexRoIBDTScore' , title='L1 eTAU RoI BDT score; BDT Score; RoIs', xbins=128, xmin=512, xmax=1024, opt='kAlwaysCreate')
921
922 elif 'cTAU' in trigger:
923 mon_group.defineHistogram('L1eFexRoIRCore', title='L1 eTAU RoI rCore Isolation; eTAU rCore Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
924 mon_group.defineHistogram('L1eFexRoIRHad', title='L1 eTAU RoI rHad Isolation; eTAU rHad Isolation; RoIs', xbins=250, xmin=0, xmax=1, opt='kAlwaysCreate')
925 mon_group.defineHistogram('L1cTauRoITopoMatch', title='L1Topo match between eTAU and jTAU RoI; Match; RoIs', xbins=2, xmin=0, xmax=2, opt='kAlwaysCreate')
926 mon_group.defineHistogram('L1jFexRoIIso', title='L1 jTAU RoI Isolation; E_{T}^{jTAU Iso} [GeV]; RoIs', xbins=25, xmin=0, xmax=50, opt='kAlwaysCreate')
927 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')
928 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')
929 mon_group.defineHistogram('L1eFexRoIBDTScore' , title='L1 eTAU RoI BDT score; BDT Score; RoIs', xbins=128, xmin=512, xmax=1024, opt='kAlwaysCreate')
930
931 elif 'jTAU' in trigger:
932 mon_group.defineHistogram('L1jFexRoIIso', title='L1 jTAU RoI Isolation; jTAU Isolation [GeV]; N RoI', xbins=25, xmin=0, xmax=50, opt='kAlwaysCreate')
933

◆ bookTAndPHLTEffHistograms()

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

Definition at line 765 of file TrigTauMonitoringConfig.py.

765 def bookTAndPHLTEffHistograms(self, mon_alg, base_path, trigger):
766 mon_group_name = f'{trigger}_TAndPHLT_Efficiency'
767 mon_group_path = f'{base_path}/TAndPHLT_Efficiency/{trigger}/TAndPHLT_Efficiency'
768 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
769
770 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, high_pt=False, coarse=False):
771 pass_flag = 'HLT_pass'
772 sfx = ''
773
774 if high_pt:
775 pass_flag += '_highPt'
776 sfx += '_highPt'
777 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau thr} + 20 GeV)'
778 elif coarse:
779 sfx += '_coarse'
780
781 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffTAndPHLT_{xvariable}{sfx}_wrt_Offline',
782 title=f'TAndP HLT Efficiency {trigger}; {xlabel}; Efficiency',
783 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax, opt='kAlwaysCreate')
784
785 coarse_binning = self.getCustomPtBinning(trigger)
786
787 defineEachStepHistograms('tauPt', 'p_{T}^{#tau} [GeV]', 60, 0.0, 300)
788 defineEachStepHistograms('tauPt', 'p_{T}^{#tau} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], coarse=True)
789 defineEachStepHistograms('tauEta', '#eta_{#tau}', 13, -2.6, 2.6)
790 defineEachStepHistograms('tauPhi', '#phi_{#tau}', 16, -3.2, 3.2)
791 defineEachStepHistograms('tauEta', '#eta_{#tau}', 13, -2.6, 2.6, high_pt=True)
792 defineEachStepHistograms('tauPhi', '#phi_{#tau}', 16, -3.2, 3.2, high_pt=True)
793 defineEachStepHistograms('dR', '#Delta R(#tau,lep)', 20, 0, 4)
794 defineEachStepHistograms('dEta', '#Delta#eta(#tau,lep)', 20, 0,4)
795 defineEachStepHistograms('dPhi', '#Delta#phi(#tau,lep)', 8, -3.2, 3.2)
796 defineEachStepHistograms('averageMu', '#LT#mu#GT', 10, 0, 80)
797
798 # Save quantities in TTree for offline analysis
799 mon_group.defineTree('tauPt,tauEta,tauPhi,dR,dEta,dPhi,averageMu,HLT_pass;TAndPHLTEffTree',
800 treedef='tauPt/F:tauEta/F:tauPhi/F:dR/F:dEta/F:dPhi/F:averageMu/F:HLT_pass/I')
801
802

◆ bookTAndPVars()

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

Definition at line 803 of file TrigTauMonitoringConfig.py.

803 def bookTAndPVars(self, mon_alg, base_path, trigger):
804 mon_group_name = f'{trigger}_TAndPVars'
805 mon_group_path = f'{base_path}/TAndPVars/{trigger}'
806 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
807
808 mon_group.defineHistogram('dR', title='#Delta R(#tau,lep); #Delta R(#tau,lep); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
809 mon_group.defineHistogram('dEta', title='#Delta#eta(#tau,lep); #Delta#eta(#tau,lep); Events', xbins=40, xmin=0, xmax=4, opt='kAlwaysCreate')
810 mon_group.defineHistogram('dPhi', title='#Delta#phi(#tau,lep); #Delta#phi(#tau,lep); Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
811
812 mon_group.defineHistogram('Pt', title='p_{T}(#tau,lep); p_{T} [GeV]; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
813 mon_group.defineHistogram('Eta', title='#eta(#tau,lep); #eta; Events', xbins=26, xmin=-2.6, xmax=2.6, opt='kAlwaysCreate')
814 mon_group.defineHistogram('Phi', title='#phi(#tau,lep); #phi; Events', xbins=16, xmin=-3.2, xmax=3.2, opt='kAlwaysCreate')
815 mon_group.defineHistogram('M', title='m(#tau,lep); m_{#tau,lep}; Events', xbins=50, xmin=0, xmax=250, opt='kAlwaysCreate')
816 mon_group.defineHistogram('dPt', title='#Delta p_{T}(#tau,lep); p_{T} [GeV]; Events', xbins=20, xmin=0, xmax=200, opt='kAlwaysCreate')
817
818

◆ bookTruthEfficiency()

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

Definition at line 819 of file TrigTauMonitoringConfig.py.

819 def bookTruthEfficiency(self, mon_alg, base_path, trigger, n_prong):
820 mon_group_name = f'{trigger}_Truth_Efficiency_{n_prong}'
821 mon_group_path = f'{base_path}/Truth_Efficiency/{trigger}/Truth_Efficiency_{n_prong}'
822 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
823
824 info = self.getTriggerInfo(trigger)
825
826 def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax, high_pt=False, coarse=False):
827 pass_flag = 'HLT_pass'
828 sfx = ''
829
830 if high_pt:
831 pass_flag += '_highPt'
832 sfx += '_highPt'
833 if info.isHLTDiTau():
834 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau min thr} + 20 GeV)'
835 else:
836 xlabel += ' (p_{T}^{#tau} > p_{T}^{#tau thr} + 20 GeV)'
837 elif coarse:
838 sfx += '_coarse'
839
840 mon_group.defineHistogram(f'{pass_flag},{xvariable};EffHLT_{xvariable}{sfx}_wrt_Truth',
841 title=f'HLT Efficiency {trigger} {n_prong}; {xlabel}; Efficiency',
842 type='TEfficiency', xbins=xbins, xmin=xmin, xmax=xmax)
843
844 coarse_binning = self.getCustomPtBinning(trigger)
845
846 defineEachStepHistograms('pt_vis', 'p_{T, vis} [GeV]', 60, 0.0, 300)
847 if info.isHLTSingleTau() or info.isHLTTandP(): defineEachStepHistograms('pt_vis', 'p_{T, vis} [GeV]', coarse_binning, coarse_binning[0], coarse_binning[-1], coarse=True)
848 defineEachStepHistograms('eta_vis', '#eta_{vis}', 13, -2.6, 2.6)
849 defineEachStepHistograms('phi_vis', '#phi_{vis}', 16, -3.2, 3.2)
850 defineEachStepHistograms('eta_vis', '#eta_{vis}', 13, -2.6, 2.6, high_pt=True)
851 defineEachStepHistograms('phi_vis', '#phi_{vis}', 16, -3.2, 3.2, high_pt=True)
852
853

◆ bookTruthVars()

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

Definition at line 854 of file TrigTauMonitoringConfig.py.

854 def bookTruthVars(self, mon_alg, base_path, trigger, n_prong):
855 mon_group_name = f'{trigger}_TruthVars_{n_prong}'
856 mon_group_path = f'{base_path}/TruthVars/{trigger}/TruthVars_{n_prong}'
857 mon_group = self.helper.addGroup(mon_alg, mon_group_name, mon_group_path)
858
859 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)
860 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)
861 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)
862
863 mon_group.defineHistogram('pt_vis', title='p_{T, vis}; p_{T, vis}; Events', xbins=50, xmin=0, xmax=250)
864 mon_group.defineHistogram('eta_vis', title='#eta_{vis}; #eta_{vis}; Events', xbins=26, xmin=-2.6, xmax=2.6)
865 mon_group.defineHistogram('phi_vis', title='#phi_{vis}; #phi_{vis}; Events', xbins=16, xmin=-3.2, xmax=3.2)
866
867

◆ configure()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configure ( self)

Definition at line 137 of file TrigTauMonitoringConfig.py.

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

403 def configureAlgorithmBoostedDiTau(self):
404 self.mon_alg_boosted_ditau = self._configureAlgorithm(CompFactory.TrigTauMonitorBoostedDiTauAlgorithm, 'TrigTauMonAlgBoostedDiTau')
405 self.mon_alg_boosted_ditau.TriggerList = self.HLT_boosted_ditau_items
406
407 self.logger.info(' |- Booking all histograms')
408 for trigger in self.HLT_boosted_ditau_items:
409 self.bookBoostedDiTauVars(self.mon_alg_boosted_ditau, self.base_path, trigger)
410

◆ configureAlgorithmDiTau()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmDiTau ( self)

Definition at line 378 of file TrigTauMonitoringConfig.py.

378 def configureAlgorithmDiTau(self):
379 self.mon_alg_ditau = self._configureAlgorithm(CompFactory.TrigTauMonitorDiTauAlgorithm, 'TrigTauMonAlgDiTau')
380 self.mon_alg_ditau.TriggerList = self.HLT_ditau_items
381 self.mon_alg_ditau.DoTotalEfficiency = self.do_total_efficiency
382 self.mon_alg_ditau.RequireOfflineTaus = self.require_offline_taus
383
384 self.logger.info(' |- Booking all histograms')
385 for trigger in self.HLT_ditau_items:
386 self.bookDiTauHLTEffHistograms(self.mon_alg_ditau, self.base_path, trigger)
387 self.bookDiTauVars(self.mon_alg_ditau, self.base_path, trigger)
388
389
390 if self.do_duplicate_with_offline_gntau:
391 self.mon_alg_ditau_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorDiTauAlgorithm, 'TrigTauMonAlgDiTauGNTau')
392 self.mon_alg_ditau_gntau.TriggerList = self.HLT_ditau_items
393 self.mon_alg_ditau_gntau.DoTotalEfficiency = self.do_total_efficiency
394 self.mon_alg_ditau_gntau.RequireOfflineTaus = self.require_offline_taus
395 self.mon_alg_ditau_gntau.OfflineTauID = 2
396
397 self.logger.info(' |- Booking all histograms')
398 path = f'{self.base_path}/OfflineGNTau'
399 for trigger in self.HLT_ditau_items:
400 self.bookDiTauHLTEffHistograms(self.mon_alg_ditau_gntau, path, trigger)
401 self.bookDiTauVars(self.mon_alg_ditau_gntau, path, trigger)
402

◆ configureAlgorithmL1()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmL1 ( self)

Definition at line 445 of file TrigTauMonitoringConfig.py.

445 def configureAlgorithmL1(self):
446 has_xtob_etau_rois = 'L1_eTauxRoI' in self.helper.flags.Input.Collections or self.helper.flags.DQ.Environment == "tier0"
447
448 self.mon_alg_L1 = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1')
449 self.mon_alg_L1.TriggerList = self.L1_items
450 self.mon_alg_L1.RequireOfflineTaus = self.require_offline_taus
451 if not has_xtob_etau_rois:
452 self.logger.info(' |- No L1_eTauxRoI container is available: e/cTAU BDT scores will be set to 0')
453 self.mon_alg_L1.Phase1L1eTauxRoIKey = ''
454
455 self.logger.info(' |- Booking all histograms')
456 for trigger in self.L1_items:
457 for p in ('1P', '3P'):
458 self.bookL1EffHistograms(self.mon_alg_L1, self.base_path, trigger, n_prong=p)
459 self.bookL1Vars(self.mon_alg_L1, self.base_path, trigger)
460
461 if self.do_duplicate_var_plots_without_offline_taus:
462 self.mon_alg_L1_no_offline = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1NoOffline')
463 self.mon_alg_L1_no_offline.TriggerList = self.L1_items
464 self.mon_alg_L1_no_offline.RequireOfflineTaus = False
465 self.mon_alg_L1_no_offline.DoEfficiencyPlots = False
466 if not has_xtob_etau_rois:
467 self.logger.info(' |- No L1_eTauxRoI container is available: e/cTAU BDT scores will be set to 0')
468 self.mon_alg_L1_no_offline.Phase1L1eTauxRoIKey = ''
469
470 self.logger.info(' |- Booking all histograms')
471 path = f'{self.base_path}/OnlineOnlyVars'
472 for trigger in self.L1_items:
473 self.bookL1Vars(self.mon_alg_L1_no_offline, path, trigger)
474
475 if self.do_alternative_eTAU_monitoring:
476 self.mon_alg_L1_alt = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1eTAUAlt')
477 self.mon_alg_L1_alt.Phase1L1eTauRoIKey = 'L1_eTauRoIAltSim' # Use alternative RoIs (with heuristic eTAU algorithm simulation)
478 self.mon_alg_L1_alt.SelectL1ByETOnly = True # We don't have threshold patterns for the Alt RoIs, so we match by ET only
479 self.mon_alg_L1_alt.RequireOfflineTaus = False
480 self.mon_alg_L1_alt.Phase1L1eTauxRoIKey = ''
481
482 l1_items = [item for item in self.L1_items if 'eTAU' in item and not self.getTriggerInfo(item).isL1TauIsolated()] # Only non-isolated eTAU items
483 self.mon_alg_L1_alt.TriggerList = l1_items
484
485 self.logger.info(' |- Booking all histograms')
486 path = f'{self.base_path}/L1eTAUAlt'
487 for trigger in l1_items:
488 for p in ('1P', '3P'):
489 self.bookL1EffHistograms(self.mon_alg_L1_alt, path, trigger, n_prong=p)
490 self.bookL1Vars(self.mon_alg_L1_alt, path, trigger)
491
492 if self.do_duplicate_with_offline_gntau:
493 self.mon_alg_L1_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1GNTau')
494 self.mon_alg_L1_gntau.TriggerList = self.L1_items
495 self.mon_alg_L1_gntau.RequireOfflineTaus = self.require_offline_taus
496 if not has_xtob_etau_rois:
497 self.logger.info(' |- No L1_eTauxRoI container is available: e/cTAU BDT scores will be set to 0')
498 self.mon_alg_L1_gntau.Phase1L1eTauxRoIKey = ''
499
500 self.logger.info(' |- Booking all histograms')
501 path = f'{self.base_path}/OfflineGNTau'
502 for trigger in self.L1_items:
503 for p in ('1P', '3P'):
504 self.bookL1EffHistograms(self.mon_alg_L1_gntau, path, trigger, n_prong=p)
505 self.bookL1Vars(self.mon_alg_L1_gntau, path, trigger)
506
507

◆ configureAlgorithmSingle()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmSingle ( self)

Definition at line 287 of file TrigTauMonitoringConfig.py.

287 def configureAlgorithmSingle(self):
288 self.mon_alg_single = self._configureAlgorithm(CompFactory.TrigTauMonitorSingleAlgorithm, 'TrigTauMonAlgSingle')
289 self.mon_alg_single.TriggerList = self.HLT_single_items
290 self.mon_alg_single.DoTotalEfficiency = self.do_total_efficiency
291 self.mon_alg_single.RequireOfflineTaus = self.require_offline_taus
292 self.mon_alg_single.HLTTauIDScores = self.hlt_tauid_scores
293 self.mon_alg_single.HLTTauCaloHitsPreselIDScores = self.hlt_calohits_presel_scores
294 self.mon_alg_single.HLTTauHitZVars = self.hlt_hitz_variables
295 self.mon_alg_single.OfflineTauIDScores = self.offline_tauid_scores
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 if self.do_duplicate_with_offline_gntau:
342 self.mon_alg_single_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorSingleAlgorithm, 'TrigTauMonAlgSingleGNTau')
343 self.mon_alg_single_gntau.TriggerList = self.HLT_single_items
344 self.mon_alg_single_gntau.DoTotalEfficiency = self.do_total_efficiency
345 self.mon_alg_single_gntau.RequireOfflineTaus = self.require_offline_taus
346 self.mon_alg_single_gntau.HLTTauIDScores = self.hlt_tauid_scores
347 self.mon_alg_single_gntau.HLTTauCaloHitsPreselIDScores = self.hlt_calohits_presel_scores
348 self.mon_alg_single_gntau.HLTTauHitZVars = self.hlt_hitz_variables
349 self.mon_alg_single_gntau.OfflineTauIDScores = self.offline_tauid_scores
350 self.mon_alg_single_gntau.OfflineTauID = 2
351
352 self.logger.info(' |- Booking all histograms')
353 path = f'{self.base_path}/OfflineGNTau'
354 for trigger in self.HLT_single_items:
355 # Efficiencies
356 for p in ('1P', '3P'):
357 self.bookHLTEffHistograms(self.mon_alg_single_gntau, path, trigger, n_prong=p)
358
359 # Online distributions
360 for p in ('0P', '1P', 'MP'):
361 self.bookBasicVars(self.mon_alg_single_gntau, path, trigger, n_prong=p, online=True)
362 self.bookIDScores(self.mon_alg_single_gntau, path, trigger, n_prong=p, online=True)
363 self.bookIDInputScalar(self.mon_alg_single_gntau, path, trigger, n_prong=p, online=True)
364 self.bookHitZVars(self.mon_alg_single_gntau, path, trigger, n_prong=p)
365 self.bookIDInputTrack(self.mon_alg_single_gntau, path, trigger, online=True)
366 self.bookIDInputCluster(self.mon_alg_single_gntau, path, trigger, online=True)
367
368 # Offline distributions
369 for p in ('1P', '3P'):
370 self.bookBasicVars(self.mon_alg_single_gntau, path, trigger, p, online=False)
371 self.bookIDScores(self.mon_alg_single_gntau, path, trigger, p, online=False)
372 self.bookIDInputScalar(self.mon_alg_single_gntau, path, trigger, n_prong=p, online=False)
373 self.bookIDInputTrack(self.mon_alg_single_gntau, path, trigger, online=False)
374 self.bookIDInputCluster(self.mon_alg_single_gntau, path, trigger, online=False)
375
376
377

◆ configureAlgorithmTagAndProbe()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmTagAndProbe ( self)

Definition at line 411 of file TrigTauMonitoringConfig.py.

411 def configureAlgorithmTagAndProbe(self):
412 self.mon_alg_tag_and_probe = self._configureAlgorithm(CompFactory.TrigTauMonitorTandPAlgorithm, 'TrigTauMonAlgTandP')
413 self.mon_alg_tag_and_probe.TriggerList = self.HLT_tag_and_probe_items
414 self.mon_alg_tag_and_probe.RequireOfflineTaus = self.require_offline_taus
415
416 self.logger.info(' |- Booking all histograms')
417 for trigger in self.HLT_tag_and_probe_items:
418 self.bookTAndPHLTEffHistograms(self.mon_alg_tag_and_probe, self.base_path, trigger)
419 self.bookTAndPVars(self.mon_alg_tag_and_probe, self.base_path, trigger)
420
421
422 if self.do_duplicate_with_offline_gntau:
423 self.mon_alg_tag_and_probe_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorTandPAlgorithm, 'TrigTauMonAlgTandPGNTau')
424 self.mon_alg_tag_and_probe_gntau.TriggerList = self.HLT_tag_and_probe_items
425 self.mon_alg_tag_and_probe_gntau.RequireOfflineTaus = self.require_offline_taus
426
427 self.logger.info(' |- Booking all histograms')
428 path = f'{self.base_path}/OfflineGNTau'
429 for trigger in self.HLT_tag_and_probe_items:
430 self.bookTAndPHLTEffHistograms(self.mon_alg_tag_and_probe_gntau, path, trigger)
431 self.bookTAndPVars(self.mon_alg_tag_and_probe_gntau, path, trigger)
432
433

◆ configureAlgorithmTruth()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureAlgorithmTruth ( self)

Definition at line 434 of file TrigTauMonitoringConfig.py.

434 def configureAlgorithmTruth(self):
435 self.mon_alg_truth = self._configureAlgorithm(CompFactory.TrigTauMonitorTruthAlgorithm, 'TrigTauMonAlgTruth')
436 self.mon_alg_truth.TriggerList = self.HLT_truth_items
437
438 self.logger.info(' |- Booking all histograms')
439 for trigger in self.HLT_truth_items:
440 for p in ('1P', '3P'):
441 self.bookTruthEfficiency(self.mon_alg_truth, self.base_path, trigger, n_prong=p)
442 self.bookTruthVars(self.mon_alg_truth, self.base_path, trigger, n_prong=p)
443
444

◆ configureMode()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureMode ( self)

Definition at line 118 of file TrigTauMonitoringConfig.py.

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

◆ configureTriggers()

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.configureTriggers ( self)

Definition at line 187 of file TrigTauMonitoringConfig.py.

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

934 def getCustomPtBinning(self, trigger, fine=False):
935 info = self.getTriggerInfo(trigger)
936
937 def getList(ranges, others=[250]):
938 ret = set(others + [500]) # The upper end of the x-axis will always be 500
939 for jump, interval in ranges.items():
940 ret.update(range(interval[0], interval[1], jump), interval)
941 return sorted(list(ret))
942
943 if info.isL1TauOnly():
944 thr = info.getL1TauThreshold()
945
946 if thr <= 8: return getList({5:(0, 30), 50:(50, 150)})
947 elif thr <= 12: return getList({5:(0, 30), 50:(50, 150)})
948 elif thr <= 20: return getList({5:(5, 40), 10:(40, 70), 50:(100, 150)})
949 elif thr <= 30: return getList({5:(15, 50), 10:(50, 70), 50:(100, 150)})
950 elif thr <= 35: return getList({5:(20, 55), 10:(60, 80), 50:(100, 150)})
951 elif thr <= 40: return getList({5:(25, 60), 10:(60, 80), 50:(100, 150)})
952 elif thr <= 60: return getList({5:(45, 80), 10:(80, 100), 50:(100, 150)})
953 elif thr <= 100: return getList({5:(85, 120), 10:(120, 140), 20:(140, 180), 50:(200, 250)})
954 else: return getList({50:(0, 200)})
955
956 else: # HLT triggers
957 thr = info.getHLTTauThreshold()
958
959 if fine:
960 if thr == 0: return getList({5:(0, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
961 elif thr <= 20: return getList({5:(15, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
962 elif thr <= 25: return getList({5:(20, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
963 elif thr <= 30: return getList({5:(25, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
964 elif thr <= 35: return getList({5:(30, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
965 elif thr <= 60: return getList({5:(55, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
966 elif thr <= 80: return getList({5:(75, 80), 10:(80, 120), 20:(120, 160), 40:(160, 240), 60:(240, 420)}, [])
967 elif thr <= 160: return getList({5:(155, 160), 40:(160, 240), 60:(240, 420)}, [])
968 elif thr <= 180: return getList({5:(175, 180), 40:(180, 260), 60:(260, 380)}, [])
969 else: return getList({5:(195, 200), 40:(200, 240), 60:(240, 420)}, [])
970
971 else:
972 if thr == 0:
973 if info.getL1TauItems(): return self.getCustomPtBinning(f'L1{info.getL1TauItem()}')
974 else: return getList({5:(0, 30), 50:(50, 150)})
975 elif thr <= 20: return getList({5:(10, 40), 10:(40, 60), 20:(60, 80)}, [150, 250])
976 elif thr <= 25: return getList({5:(15, 40), 10:(40, 60), 20:(60, 80)}, [150, 250])
977 elif thr <= 30: return getList({5:(20, 50), 10:(50, 60), 20:(60, 80)}, [150, 250])
978 elif thr <= 35: return getList({5:(25, 50), 10:(50, 60), 20:(60, 80)}, [150, 250])
979 elif thr <= 60: return getList({5:(50, 70), 10:(70, 80)}, [110, 150, 250])
980 elif thr <= 80: return getList({5:(70, 90)}, [110, 150, 250])
981 elif thr <= 160: return getList({5:(150, 170), 10:(170, 180), 20:(180, 200)}, [240, 300])
982 elif thr <= 180: return getList({5:(170, 180), 10:(180, 200)}, [240, 300])
983 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 179 of file TrigTauMonitoringConfig.py.

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

Member Data Documentation

◆ _L1_Phase1_threshold_mappings_stdmap

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_threshold_mappings_stdmap
protected

Definition at line 182 of file TrigTauMonitoringConfig.py.

◆ _L1_Phase1_thresholds_stdmap

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder._L1_Phase1_thresholds_stdmap
protected

Definition at line 182 of file TrigTauMonitoringConfig.py.

◆ activate_boosted_ditau

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

Definition at line 99 of file TrigTauMonitoringConfig.py.

◆ activate_ditau

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

Definition at line 95 of file TrigTauMonitoringConfig.py.

◆ activate_L1

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

Definition at line 111 of file TrigTauMonitoringConfig.py.

◆ activate_single_tau

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

Definition at line 91 of file TrigTauMonitoringConfig.py.

◆ activate_tag_and_probe

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

Definition at line 103 of file TrigTauMonitoringConfig.py.

◆ activate_truth

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

Definition at line 107 of file TrigTauMonitoringConfig.py.

◆ base_path

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

Definition at line 83 of file TrigTauMonitoringConfig.py.

◆ data_type

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

Definition at line 121 of file TrigTauMonitoringConfig.py.

◆ do_alternative_eTAU_monitoring

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.do_alternative_eTAU_monitoring = False
static

Definition at line 77 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_duplicate_with_offline_gntau

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.do_duplicate_with_offline_gntau = True
static

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

◆ HLT_boosted_ditau_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_boosted_ditau_items = []

Definition at line 101 of file TrigTauMonitoringConfig.py.

◆ hlt_calohits_presel_scores

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

Definition at line 64 of file TrigTauMonitoringConfig.py.

◆ HLT_ditau_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_ditau_items = []

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

◆ HLT_single_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_single_items = []

Definition at line 93 of file TrigTauMonitoringConfig.py.

◆ HLT_tag_and_probe_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_tag_and_probe_items = []

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

◆ HLT_truth_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.HLT_truth_items = []

Definition at line 109 of file TrigTauMonitoringConfig.py.

◆ is_mc

bool python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.is_mc = False

Definition at line 119 of file TrigTauMonitoringConfig.py.

◆ L1_items

list python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.L1_items = []

Definition at line 113 of file TrigTauMonitoringConfig.py.

◆ L1_Phase1_threshold_mappings

dict python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.L1_Phase1_threshold_mappings = {}

Definition at line 88 of file TrigTauMonitoringConfig.py.

◆ L1_Phase1_thresholds

dict python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.L1_Phase1_thresholds = {}

Definition at line 87 of file TrigTauMonitoringConfig.py.

◆ logger

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

Definition at line 81 of file TrigTauMonitoringConfig.py.

◆ mon_alg_boosted_ditau

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_boosted_ditau = None

Definition at line 100 of file TrigTauMonitoringConfig.py.

◆ mon_alg_ditau

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_ditau = None

Definition at line 96 of file TrigTauMonitoringConfig.py.

◆ mon_alg_ditau_gntau

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_ditau_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorDiTauAlgorithm, 'TrigTauMonAlgDiTauGNTau')

Definition at line 391 of file TrigTauMonitoringConfig.py.

◆ mon_alg_L1

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_L1 = None

Definition at line 112 of file TrigTauMonitoringConfig.py.

◆ mon_alg_L1_alt

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

Definition at line 476 of file TrigTauMonitoringConfig.py.

◆ mon_alg_L1_gntau

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_L1_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorL1Algorithm, 'TrigTauMonAlgL1GNTau')

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

◆ mon_alg_single

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_single = None

Definition at line 92 of file TrigTauMonitoringConfig.py.

◆ mon_alg_single_gntau

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_single_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorSingleAlgorithm, 'TrigTauMonAlgSingleGNTau')

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

◆ mon_alg_tag_and_probe_gntau

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_tag_and_probe_gntau = self._configureAlgorithm(CompFactory.TrigTauMonitorTandPAlgorithm, 'TrigTauMonAlgTandPGNTau')

Definition at line 423 of file TrigTauMonitoringConfig.py.

◆ mon_alg_truth

python.TrigTauMonitoringConfig.TrigTauMonAlgBuilder.mon_alg_truth = None

Definition at line 108 of file TrigTauMonitoringConfig.py.

◆ offline_GNTau_WP

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

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

◆ offline_taujets

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

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