ATLAS Offline Software
Loading...
Searching...
No Matches
TileRawChannelBuilderTestConfig.PrepareDataAlg Class Reference
Inheritance diagram for TileRawChannelBuilderTestConfig.PrepareDataAlg:
Collaboration diagram for TileRawChannelBuilderTestConfig.PrepareDataAlg:

Public Member Functions

 __init__ (self, name)
 initialize (self)
 execute (self)
 make_rc (self, digits)
 make_rc_coll (self, idHelper, hashFunc, icoll, colldata)
 make_bad_rc (self, baddq)

Detailed Description

Definition at line 171 of file TileRawChannelBuilderTestConfig.py.

Constructor & Destructor Documentation

◆ __init__()

TileRawChannelBuilderTestConfig.PrepareDataAlg.__init__ ( self,
name )

Definition at line 172 of file TileRawChannelBuilderTestConfig.py.

172 def __init__ (self, name):
173 Alg.__init__ (self, name)
174 return
175
176

Member Function Documentation

◆ execute()

TileRawChannelBuilderTestConfig.PrepareDataAlg.execute ( self)

Definition at line 181 of file TileRawChannelBuilderTestConfig.py.

181 def execute (self):
182 iev = self.getContext().evt()
183
184 if iev == 1:
185 baddq = {146: (2, 10)}
186 rc = self.make_bad_rc (baddq)
187 elif iev == 3:
188 rc = self.make_rc (digits_0)
189 else:
190 rc = self.make_rc ({})
191
192 self.evtStore.record (rc, 'TRCDQ', False)
193
194 return StatusCode.Success
195
196

◆ initialize()

TileRawChannelBuilderTestConfig.PrepareDataAlg.initialize ( self)

Definition at line 177 of file TileRawChannelBuilderTestConfig.py.

177 def initialize (self):
178 return StatusCode.Success
179
180
void initialize()

◆ make_bad_rc()

TileRawChannelBuilderTestConfig.PrepareDataAlg.make_bad_rc ( self,
baddq )

Definition at line 232 of file TileRawChannelBuilderTestConfig.py.

232 def make_bad_rc (self, baddq):
233 cont = ROOT.TileRawChannelContainer (False, TileFragHash.OptFilterDsp, 0)
234 hashFunc = cont.hashFunc()
235 for icoll, chans in baddq.items():
236 coll = ROOT.TileRawChannelCollection (hashFunc.identifier (icoll))
237 mask = 0
238 for chan in chans:
239 mask |= (1<<(chan//3))
240 coll.setFragMemoryPar(mask)
241 cont.addCollection (coll, ROOT.IdentifierHash(icoll))
242 ROOT.SetOwnership (coll, False)
243 return cont
244
245
246

◆ make_rc()

TileRawChannelBuilderTestConfig.PrepareDataAlg.make_rc ( self,
digits )

Definition at line 197 of file TileRawChannelBuilderTestConfig.py.

197 def make_rc (self, digits):
198 idHelper = self.detStore['CaloCell_ID'].tile_idHelper()
199
200 unit = 0 # TileRawChannelUnit::ADCcounts
201 typ = TileFragHash.Default
202 cont = ROOT.TileRawChannelContainer (False, typ, unit)
203 hashFunc = cont.hashFunc()
204
205 digits = dict (digits)
206 for icoll in range(256):
207 colldata = digits.get (icoll, [])
208
209 coll = self.make_rc_coll (idHelper, hashFunc, icoll, colldata)
210 cont.addCollection (coll, ROOT.IdentifierHash(icoll))
211 ROOT.SetOwnership (coll, False)
212
213 return cont
214
215

◆ make_rc_coll()

TileRawChannelBuilderTestConfig.PrepareDataAlg.make_rc_coll ( self,
idHelper,
hashFunc,
icoll,
colldata )

Definition at line 216 of file TileRawChannelBuilderTestConfig.py.

216 def make_rc_coll (self, idHelper, hashFunc, icoll, colldata):
217 coll = ROOT.TileRawChannelCollection (hashFunc.identifier(icoll))
218
219 for addr, data in colldata:
220 if isinstance(addr, tuple):
221 adc_id = idHelper.adc_id (*addr)
222 chan = ROOT.TileRawChannel (adc_id, *data)
223 else:
224 hwid = ROOT.HWIdentifier (addr)
225 chan = ROOT.TileRawChannel (hwid, *data)
226 chan.setPedestal (0)
227 coll.push_back (chan)
228
229 return coll
230
231

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