ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEgammaInfo.py
Go to the documentation of this file.
2# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3#
4
5from ROOT.ChainNameParser import HLTChainInfo
6
7
8class TrigEgammaInfo(object):
9
10 EM = {"e", "electron"}
11 GAMMA = {"g", "photon"}
12
13
14 def __init__(self, trigger):
15 self.__chain = trigger
16 self.__legs = HLTChainInfo(trigger)
17 self.__sigs = {leg.signature.lower() for leg in self.__legs}
18
19 def chain(self):
20 return self.__chain
21
22 def legs(self):
23 return self.__legs
24
25 def signatures(self):
26 return self.__sigs
27
28 def isElectron(self):
29 sigs = self.__sigs
30 return bool(sigs & self.EM) and not (sigs & self.GAMMA)
31
32 def isPhoton(self):
33 sigs = self.__sigs
34 return bool(sigs & self.GAMMA) and not (sigs & self.EM)
35
37 sigs = self.__sigs
38 return (
39 "probe" in self.__chain.lower()
40 or (bool(sigs & self.EM) and bool(sigs & self.GAMMA))
41 )
42
43 def threshold(self):
44 if self.isElectron() or self.isPhoton():
45 thresholdValue = self.__legs.threshold
46 thresholdString = str(thresholdValue)
47
48 elif self.isTagAndProbeZeeg():
49 if self.__sigs & self.GAMMA: # photon/gamma-like signature
50 thresholdValue = self.__legs.threshold
51 thresholdString = str(thresholdValue)
52
53 return thresholdString
54
55 def pidname(self):
56 if not self.__legs:
57 return None
58 pid = None
59
60 if self.isElectron() or self.isPhoton():
61 pid = self.__legs.legParts[0]
62
63 elif self.isTagAndProbeZeeg():
64 if self.__sigs & self.GAMMA: # photon/gamma-like signature
65 pid = self.__legs.legParts[0]
66
67 return pid
68
69 def isIsolated(self):
70 for part_name in ['iloose', 'ivarloose', 'icaloloose', 'icalovloose', 'icalotight']:
71 if part_name in self.chain():
72 return True
73 return False
74
75
76
77