ATLAS Offline Software
Loading...
Searching...
No Matches
TrigTauHypoMonitoring.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.AthConfigFlags import AthConfigFlags
4from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
5
6def getTrigTauPrecisionIDHypoToolMonitoring(flags: AthConfigFlags, name: str, tau_ids: list[str]):
7 monTool = GenericMonitoringTool(flags, f'MonTool_{name}')
8 monTool.HistPath = f'TrigTauRecMerged_TrigTauPrecisionIDHypo/{name}'
9
10 # Define quantities to be monitored
11 monTool.defineHistogram('NInputTaus', path='EXPERT', type='TH1F', title='Input Taus (before selection); N Taus; Entries', xbins=10, xmin=0, xmax=10)
12
13 labels = ['Initial', 'p_{T}', 'NTracks & NIsoTracks', 'ID']
14 monTool.defineHistogram('CutCounter', path='EXPERT', type='TH1I', title='Passed Tau cuts; Cut; Entries', xbins=len(labels), xmin=0, xmax=len(labels), xlabels=labels)
15
16 monTool.defineHistogram('PtAccepted', path='EXPERT', type='TH1F', title='Accepted Tau p_{T}; p_{T} [GeV]; Entries', xbins=80, xmin=0, xmax=800)
17 monTool.defineHistogram('NTracksAccepted', path='EXPERT', type='TH1F', title='Accepted Tau Tracks; N Tracks; Entries', xbins=10, xmin=0, xmax=10)
18 monTool.defineHistogram('NIsoTracksAccepted', path='EXPERT', type='TH1F', title='Accepted Tau Isolation Tracks; N Isolation Tracks; Entries', xbins=10, xmin=0, xmax=10)
19
20 for tau_id in tau_ids:
21 tau_id_flags = getattr(flags.Trigger.Offline.Tau, tau_id)
22 if hasattr(tau_id_flags, 'NetworkConfig') or tau_id_flags.OutputDiscriminant == 1: xmax = 1
23 else: xmax = 5
24
25 monTool.defineHistogram(f'{tau_id}_TauJetScoreAccepted_0p', path='EXPERT', type='TH1F', title=f'Accepted 0-prong {tau_id} Tau ID score; Score; Entries', xbins=100, xmin=0, xmax=xmax)
26 monTool.defineHistogram(f'{tau_id}_TauJetScoreTransAccepted_0p', path='EXPERT', type='TH1F', title=f'Accepted 0-prong {tau_id} Tau ID transformed score; Transformed Signal Score; Entries', xbins=100, xmin=0, xmax=1)
27
28 monTool.defineHistogram(f'{tau_id}_TauJetScoreAccepted_1p', path='EXPERT', type='TH1F', title=f'Accepted 1-prong {tau_id} Tau ID score; Score; Entries', xbins=100, xmin=0, xmax=xmax)
29 monTool.defineHistogram(f'{tau_id}_TauJetScoreTransAccepted_1p', path='EXPERT', type='TH1F', title=f'Accepted 1-prong {tau_id} Tau ID transformed score; Transformed Signal Score; Entries', xbins=100, xmin=0, xmax=1)
30
31 monTool.defineHistogram(f'{tau_id}_TauJetScoreAccepted_mp', path='EXPERT', type='TH1F', title=f'Accepted multi-prong {tau_id} Tau ID score; Score; Entries', xbins=100, xmin=0, xmax=xmax)
32 monTool.defineHistogram(f'{tau_id}_TauJetScoreTransAccepted_mp', path='EXPERT', type='TH1F', title=f'Accepted multi-prong {tau_id} Tau ID transformed score; Transformed Signal Score; Entries', xbins=100, xmin=0, xmax=1)
33
34 return monTool
35
36
37def getTrigTauPrecisionDiKaonHypoToolMonitoring(flags: AthConfigFlags, name: str):
38 monTool = GenericMonitoringTool(flags, f'MonTool_{name}')
39 monTool.HistPath = 'ComboHypo/' + name.replace('leg001_', '')
40
41 # We will fix the naming convention as soon as the first weekly HLT Reprocessing validation goes through, because it will break the references
42
43 monTool.defineHistogram('NInputTaus', path='EXPERT', type='TH1F', title='Input Taus (before selection); N Taus; Entries', xbins=10, xmin=0, xmax=10)
44
45 monTool.defineHistogram('PtAccepted', path='EXPERT', type='TH1F', title='Accepted Tau p_{T}; p_{T} [GeV]; Entries', xbins=80, xmin=0, xmax=800)
46 monTool.defineHistogram('NTracksAccepted', path='EXPERT', type='TH1F', title='Accepted Tau Tracks; N Tracks; Entries', xbins=10, xmin=0, xmax=10)
47 monTool.defineHistogram('NIsoTracksAccepted', path='EXPERT', type='TH1F', title='Accepted Tau Isolation Tracks; N Isolation Tracks; Entries', xbins=10, xmin=0, xmax=10)
48
49 monTool.defineHistogram('dRAccepted', path='EXPERT', type='TH1F', title='Accepted Tau Maximum #DeltaR(Tau, Tracks); Maximum #DeltaR(Tau, Tracks); Entries', xbins=40, xmin=0, xmax=0.4)
50 monTool.defineHistogram('massTrkSysAccepted', path='EXPERT', type='TH1F', title='Accepted Tau Di-pion system Mass; m_{#pi#pi} [GeV]; Entries', xbins=50, xmin=0, xmax=3)
51 monTool.defineHistogram('massTrkSysKaonAccepted', path='EXPERT', type='TH1F', title='Accepted Tau Di-kaon system Mass; m_{KK} [GeV]; Entries', xbins=50, xmin=0, xmax=3)
52 monTool.defineHistogram('massTrkSysKaonPiAccepted', path='EXPERT', type='TH1F', title='Accepted Tau Kaon+Pion system Mass; m_{K#pi} [GeV]; Entries', xbins=50, xmin=0, xmax=3)
53 monTool.defineHistogram('leadTrkPtAccepted', path='EXPERT', type='TH1F', title='Accepted Tau Leading Track p_{T}; Leading Track p_{T} [GeV]; Entries', xbins=50, xmin=0, xmax=300)
54 monTool.defineHistogram('etOverPtLeadTrkAccepted', path='EXPERT', type='TH1F', title='Accepted Tau (E_{T}^{EM} + E_{T}^{Had}) / p_{T}^{lead trk.}; (E_{T}^{EM} + E_{T}^{Had}) / p_{T}^{lead trk.}; Entries', xbins=50, xmin=0, xmax=5)
55 monTool.defineHistogram('EMOverTrkSysPAccepted', path='EXPERT', type='TH1F', title='Accepted Tau E_{T}^{EM} over Track system p_{T}; E_{T}^{EM} / p_{T}^{trk sys}; Entries', xbins=50, xmin=0, xmax=5)
56
57 return monTool
getTrigTauPrecisionIDHypoToolMonitoring(AthConfigFlags flags, str name, list[str] tau_ids)
getTrigTauPrecisionDiKaonHypoToolMonitoring(AthConfigFlags flags, str name)