ATLAS Offline Software
TrigIsoHPtTrackTriggerHypoTool.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon.SystemOfUnits import GeV
4 from AthenaCommon.Logging import logging
5 log = logging.getLogger("TrigLongLivedParticlesHypo.TrigIsoHPtTrackTriggerHypoTool")
6 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
7 
8 
9 
10 log = logging.getLogger('TrigIsoHPtTrackTriggerHypoTool')
11 
13  """ Use menu decoded chain dictionary to configure the tool """
14  cparts = [i for i in chainDict['chainParts'] if i['signature']=='UnconventionalTracking']
15  thresholds = sum([ [cpart['threshold']]*int(cpart['multiplicity']) for cpart in cparts], [])
16 
17  name = chainDict['chainName']
18  from AthenaConfiguration.ComponentFactory import CompFactory
19  tool = CompFactory.TrigIsoHPtTrackTriggerHypoTool(name)
20 
21  monTool = GenericMonitoringTool(flags, "IM_MonTool"+name)
22  monTool.defineHistogram('CutCounter', type='TH1I', path='EXPERT', title="IsoHPtTrackTrigger Hypo Cut Counter;Cut Counter", xbins=8, xmin=-1.5, xmax=7.5, opt="kCumulative")
23  monTool.defineHistogram('trackPt', type='TH1F', path='EXPERT', title="IsoHPtTrackTrigger Hypo p_{T}^{track} [MeV];p_{T}^{track} [MeV];Nevents", xbins=30, xmin=0, xmax=300000)
24  monTool.defineHistogram('trackd0', type='TH1F', path='EXPERT', title="IsoHPtTrackTrigger Hypo d0^{track} ; d0^{track} ;Nevents", xbins=100, xmin=0, xmax=10)
25  monTool.defineHistogram('trackNPixHits', type='TH1F', path='EXPERT', title="IsoHPtTrackTrigger Hypo N. Pix Hits^{track} ; N. Pix Hits^{track} ;Nevents", xbins=10, xmin=0, xmax=10)
26 
27  monTool.defineHistogram('trackNSCTHits', type='TH1F', path='EXPERT', title="IsoHPtTrackTrigger Hypo N. SCT Hits^{track} ; N. SCT Hits^{track} ;Nevents", xbins=20, xmin=0, xmax=20)
28  monTool.defineHistogram('trackd0Sig', type='TH1F', path='EXPERT', title="IsoHPtTrackTrigger Hypo d0 Sig^{track} ; d0 Sig^{track} ;Nevents", xbins=60, xmin=0, xmax=6)
29  monTool.defineHistogram('trackEta', type='TH1F', path='EXPERT', title="IsoHPtTrackTrigger Hypo Eta^{track} ; Eta^{track} ;Nevents", xbins=30, xmin=-3, xmax=3)
30  monTool.defineHistogram('trackIsoPt', type='TH1F', path='EXPERT', title="IsoHPtTrackTrigger Hypo Iso p_{T}^{track} [MeV]; Isolation Cone p_{T}^{track} [MeV];Nevents", xbins=100, xmin=0, xmax=100000)
31  monTool.defineHistogram('trackAggrIsoPt', type='TH1F', path='EXPERT', title="IsoHPtTrackTrigger Hypo Iso p_{T}^{track} [MeV]; Isolation Cumalitive Cone p_{T}^{track} [MeV];Nevents", xbins=100, xmin=0, xmax=100000)
32 
33 
34 
35  monTool.HistPath = 'IsoHPtTrackTriggerHypoAlg/'+tool.getName()
36  tool.MonTool = monTool
37 
38  strThr = ""
39 
40  thresholds = [ float(THR)*GeV for THR in thresholds]
41 
42  for THR in thresholds:
43  strThr += str(THR)+", "
44 
45  log.debug("Threshold Values are: %s",strThr)
46 
47  nt = len( thresholds )
48  tool.MinTrackPt = thresholds
49  tool.MinTrackNPixHits = [ 2 ] *nt
50  tool.MinTrackNSCTHits = [ 5 ] *nt
51 
52  EnIso=[]
53  IsoCum=[]
54  IsoCone=[]
55  IsoPt=[]
56 
57  TrackEta=[]
58  Trackd0=[]
59  Trackd0Sig=[]
60 
61 
62  for cpart in cparts:
63  # For isolation working points are defined iloose/medium/aggrmedium/aggrloose
64  log.debug("Isolation is bound to be set to %s and event working point %s",cpart['isoInfo'],cpart['IDinfo'])
65  if cpart['isoInfo'] =="iloose":
66  log.debug("Loose isolation is set")
67  EnIso.append(True)
68  IsoCum.append(False)
69  IsoCone.append(0.3)
70  IsoPt.append(5*GeV)
71  elif cpart['isoInfo'] =="imedium":
72  log.debug("Medium isolation is set")
73  EnIso.append(True)
74  IsoCum.append(False)
75  IsoCone.append(0.3)
76  IsoPt.append(3*GeV)
77  elif cpart['isoInfo'] =="iaggrloose":
78  log.debug("Loose Cummulative(Aggregate) isolation is set")
79  EnIso.append(True)
80  IsoCum.append(True)
81  IsoCone.append(0.3)
82  IsoPt.append(20*GeV)
83  elif cpart['isoInfo'] =="iaggrmedium":
84  log.debug("Medium Cummulative(Aggregate) isolation is set")
85  EnIso.append(True)
86  IsoCum.append(True)
87  IsoCone.append(0.3)
88  IsoPt.append(10*GeV)
89  else:
90  log.debug("Isolation is not set")
91  EnIso.append(False)
92  IsoCum.append(False)
93  IsoCone.append(0.3)
94  IsoPt.append(5*GeV)
95 
96  #Working point defenitions
97  if cpart['IDinfo'] =="loose":
98  log.debug("Loose ID working point is set")
99  TrackEta.append(2.5)
100  Trackd0.append(1000.)
101  Trackd0Sig.append(10.)
102 
103  elif cpart['IDinfo'] =="tight":
104  log.debug("Tight ID working point is set")
105  TrackEta.append(2.0)
106  Trackd0.append(1000.)
107  Trackd0Sig.append(5.)
108  else:
109  log.debug("Medium ID working point is set")
110  TrackEta.append(2.5)
111  Trackd0.append(1000.)
112  Trackd0Sig.append(5.)
113 
114 
115 
116  tool.MinTrackEta = TrackEta
117  tool.MaxTrackd0 = Trackd0
118  tool.MaxTrackd0Sig = Trackd0Sig
119 
120  tool.EnableTrackIsolation = EnIso
121  tool.EnableCumalitiveIsolation = IsoCum
122  tool.TrackIsoCone = IsoCone
123  tool.MinIsoTrackPt = IsoPt
124 
125  return tool
SystemOfUnits
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
GenericMonitoringTool
Definition: GenericMonitoringTool.py:1
python.TrigIsoHPtTrackTriggerHypoTool.TrigIsoHPtTrackTriggerHypoToolFromDict
def TrigIsoHPtTrackTriggerHypoToolFromDict(flags, chainDict)
Definition: TrigIsoHPtTrackTriggerHypoTool.py:12
str
Definition: BTagTrackIpAccessor.cxx:11
readCCLHist.float
float
Definition: readCCLHist.py:83