10 import AthenaPython.PyAthena
as PyAthena
12 from array
import array
16 PyAthena.Alg.__init__(self,name)
43 'L1_TAU8_FIRSTEMPTY'])
46 print (
"==> initializing ", self.
name)
53 self.
sg = PyAthena.py_svc(
"StoreGateSvc")
54 self.
cond = PyAthena.py_svc(
'StoreGateSvc/ConditionStore')
55 self.
det = PyAthena.py_svc(
"StoreGateSve/DetectorStore")
58 self.
tdt = PyAthena.py_tool(
'Trig::TrigDecisionTool/TrigDecisionTool')
60 self.
hectree = ROOT.TTree(
"HECNoise",
"HECNoise")
116 self.
hectree.Branch(
"e",self.
e,
"e/F")
117 self.
hectree.Branch(
"t",self.
t,
"t/F")
120 self.
hectree.Branch(
"z",self.
z,
"z/F")
121 self.
hectree.Branch(
"r",self.
r,
"r/F")
131 eid=ROOT.Gaudi.Hive.currentContext().eventID()
132 lcsCont = self.
cond.
retrieve(
"CondCont<LArOnOffIdMapping>",
"LArOnOffIdMap")
133 lcs=lcsCont.find(eid)
134 pedCont = self.
cond.
retrieve(
"CondCont<ILArPedestal>",
"LArPedestal")
135 ped=pedCont.find(eid)
136 cddCont = self.
cond.
retrieve(
"CondCont<CaloDetDescrManager>",
"CaloDetDescrManager")
137 cdd=cddCont.find(eid)
139 passedTrigger =
False
143 if self.
tdt.isPassed(tl):
153 ldc = self.
sg.
retrieve(
"LArDigitContainer",
"LArDigitContainer_Thinned")
155 hid = ld.hardwareID()
156 if self.
LArOID.isHECchannel(hid):
162 samp0= ld.samples()[0]
163 for samp
in ld.samples():
165 self.
iDigi[isamp] = samp
167 if samp-samp0 > sigmax:
171 if samp-samp0 < sigmin:
179 ei = self.
sg.
retrieve(
"xAOD::EventInfo",
"EventInfo")
180 cc = self.
sg.
retrieve(
"CaloCellContainer",
"AllCalo")
181 self.
iRun[0] = ei.runNumber()
182 self.
iEvent[0] = ei.eventNumber()
184 self.
iTime[0] = ei.timeStamp()
185 self.
iLB[0] = ei.lumiBlock()
186 self.
iBCID[0] = ei.bcid()
187 self.
avgMu[0] = ei.averageInteractionsPerCrossing()
188 self.
actMu[0] = ei.actualInteractionsPerCrossing()
189 self.
iGain[0] = ld.gain()
190 oid = lcs.cnvToIdentifier(hid)
191 self.
iOID[0] = ld.channelID().get_compact()
192 self.
Ped[0] = ped.pedestal(ld.channelID(),ld.gain())
193 self.
PedRMS[0] = ped.pedestalRMS(ld.channelID(),ld.gain())
194 self.
iSide[0] = self.
cid.pos_neg(oid)
195 self.
iSamp[0] = self.
cid.sampling(oid)
196 self.
iReg[0] = self.
cid.region(oid)
201 ihash = self.
cid.calo_cell_hash(oid)
202 rcell = cc.findCell(ihash)
206 if rcell.ID() != oid:
207 print (
"Cell iHash does not match ...")
210 self.
e[0] = rcell.e()
211 self.
t[0] = rcell.time()
214 cdde = cdd.get_element(oid)
215 self.
eta[0] = cdde.eta()
216 self.
phi[0] = cdde.phi()
220 self.setFilterPassed(
True)
225 print (
'Event passed HECNoise Filter')
228 print (
'Event failed HECNoise Filter')
229 self.setFilterPassed(
False)