10 from __future__
import print_function
11 import AthenaPython.PyAthena
as PyAthena
13 from array
import array
17 PyAthena.Alg.__init__(self,name)
44 'L1_TAU8_FIRSTEMPTY'])
47 print (
"==> initializing ", self.
name)
54 self.
sg = PyAthena.py_svc(
"StoreGateSvc")
55 self.
cond = PyAthena.py_svc(
'StoreGateSvc/ConditionStore')
56 self.
det = PyAthena.py_svc(
"StoreGateSve/DetectorStore")
59 self.
tdt = PyAthena.py_tool(
'Trig::TrigDecisionTool/TrigDecisionTool')
61 self.
hectree = ROOT.TTree(
"HECNoise",
"HECNoise")
117 self.
hectree.Branch(
"e",self.
e,
"e/F")
118 self.
hectree.Branch(
"t",self.
t,
"t/F")
121 self.
hectree.Branch(
"z",self.
z,
"z/F")
122 self.
hectree.Branch(
"r",self.
r,
"r/F")
132 eid=ROOT.Gaudi.Hive.currentContext().eventID()
133 lcsCont = self.
cond.
retrieve(
"CondCont<LArOnOffIdMapping>",
"LArOnOffIdMap")
134 lcs=lcsCont.find(eid)
135 pedCont = self.
cond.
retrieve(
"CondCont<ILArPedestal>",
"LArPedestal")
136 ped=pedCont.find(eid)
137 cddCont = self.
cond.
retrieve(
"CondCont<CaloDetDescrManager>",
"CaloDetDescrManager")
138 cdd=cddCont.find(eid)
140 passedTrigger =
False
144 if self.
tdt.isPassed(tl):
154 ldc = self.
sg.
retrieve(
"LArDigitContainer",
"LArDigitContainer_Thinned")
156 hid = ld.hardwareID()
157 if self.
LArOID.isHECchannel(hid):
163 samp0= ld.samples()[0]
164 for samp
in ld.samples():
166 self.
iDigi[isamp] = samp
168 if samp-samp0 > sigmax:
172 if samp-samp0 < sigmin:
180 ei = self.
sg.
retrieve(
"xAOD::EventInfo",
"EventInfo")
181 cc = self.
sg.
retrieve(
"CaloCellContainer",
"AllCalo")
182 self.
iRun[0] = ei.runNumber()
183 self.
iEvent[0] = ei.eventNumber()
185 self.
iTime[0] = ei.timeStamp()
186 self.
iLB[0] = ei.lumiBlock()
187 self.
iBCID[0] = ei.bcid()
188 self.
avgMu[0] = ei.averageInteractionsPerCrossing()
189 self.
actMu[0] = ei.actualInteractionsPerCrossing()
190 self.
iGain[0] = ld.gain()
191 oid = lcs.cnvToIdentifier(hid)
192 self.
iOID[0] = ld.channelID().get_compact()
193 self.
Ped[0] = ped.pedestal(ld.channelID(),ld.gain())
194 self.
PedRMS[0] = ped.pedestalRMS(ld.channelID(),ld.gain())
195 self.
iSide[0] = self.
cid.pos_neg(oid)
196 self.
iSamp[0] = self.
cid.sampling(oid)
197 self.
iReg[0] = self.
cid.region(oid)
202 ihash = self.
cid.calo_cell_hash(oid)
203 rcell = cc.findCell(ihash)
207 if rcell.ID() != oid:
208 print (
"Cell iHash does not match ...")
211 self.
e[0] = rcell.e()
212 self.
t[0] = rcell.time()
215 cdde = cdd.get_element(oid)
216 self.
eta[0] = cdde.eta()
217 self.
phi[0] = cdde.phi()
221 self.setFilterPassed(
True)
226 print (
'Event passed HECNoise Filter')
229 print (
'Event failed HECNoise Filter')
230 self.setFilterPassed(
False)