ATLAS Offline Software
Loading...
Searching...
No Matches
python.CaloThinCellsByClusterAlg_test.CheckThinningAlg Class Reference
Inheritance diagram for python.CaloThinCellsByClusterAlg_test.CheckThinningAlg:
Collaboration diagram for python.CaloThinCellsByClusterAlg_test.CheckThinningAlg:

Public Member Functions

 isCloseTo (self, elt, eta, phi)
 execute (self)

Detailed Description

Definition at line 85 of file CaloThinCellsByClusterAlg_test.py.

Member Function Documentation

◆ execute()

python.CaloThinCellsByClusterAlg_test.CheckThinningAlg.execute ( self)

Definition at line 91 of file CaloThinCellsByClusterAlg_test.py.

91 def execute (self):
92 ctx = self.getContext()
93 mgr = self.condStore['CaloDetDescrManager'].find (ctx.eventID())
94 dec = self.evtStore['AllCalo_THINNED_StreamAOD.thinAlg']
95
96 for i in range (dec.size()):
97 elt = mgr.get_element (ROOT.IdentifierHash (i))
98 if elt.getSampling() == 3:
99 close = (self.isCloseTo (elt, 0.5, 1) or
100 self.isCloseTo (elt, -0.5, 1))
101 if not dec.thinned(i):
102 assert close
103 else:
104 assert not close
105 else:
106 if not dec.thinned(i):
107 assert i in cell_hashes
108 else:
109 assert i not in cell_hashes
110 return StatusCode.Success
111
112

◆ isCloseTo()

python.CaloThinCellsByClusterAlg_test.CheckThinningAlg.isCloseTo ( self,
elt,
eta,
phi )

Definition at line 86 of file CaloThinCellsByClusterAlg_test.py.

86 def isCloseTo (self, elt, eta, phi):
87 # Assuming no phi wrapping.
88 return (abs (elt.eta() - eta) < 3*0.025 and
89 abs (elt.phi() - phi) < 7*2*pi/256)
90

The documentation for this class was generated from the following file: