ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
TileCellBuilderTestConfig.PrepareDataAlg Class Reference
Inheritance diagram for TileCellBuilderTestConfig.PrepareDataAlg:
Collaboration diagram for TileCellBuilderTestConfig.PrepareDataAlg:

Public Member Functions

def __init__ (self, name)
 
def initialize (self)
 
def execute (self)
 
def record_raw_data (self, hits, typ, baddq, bsflags, dspbsflags=0, dspcolls=set(), rawname='TileRawChannelCnt')
 

Public Attributes

 exp_cells
 
 exp_mbts
 
 extra_ei_flags
 
 tool
 
 rctype
 

Detailed Description

Definition at line 244 of file TileCellBuilderTestConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def TileCellBuilderTestConfig.PrepareDataAlg.__init__ (   self,
  name 
)

Definition at line 245 of file TileCellBuilderTestConfig.py.

245  def __init__ (self, name):
246  Alg.__init__ (self, name)
247  return
248 

Member Function Documentation

◆ execute()

def TileCellBuilderTestConfig.PrepareDataAlg.execute (   self)

Definition at line 252 of file TileCellBuilderTestConfig.py.

252  def execute (self):
253  iev = self.getContext().evt()
254 
255  hits = hits_0
256  self.exp_cells = exp_cells_0
257  self.exp_mbts = exp_mbts_0
258  self.extra_ei_flags = 0
259  self.tool = 'tool1'
260  baddq = {}
261  bsflags = 0x32002000
262  dspbsflags = 0x32002000
263  self.rctype = TileFragHash.OptFilterOffline
264  dspcolls = set()
265  dqhits = {}
266 
267  if iev == 0:
268  # Event 0: nominal
269  pass
270 
271  elif iev == 1:
272  # Event 1: Add an underflow.
273  hits = hits_1
274  self.extra_ei_flags = 0x40
275  self.exp_cells = exp_cells_1
276 
277  elif iev == 2:
278  # Event 2: Add an overflow.
279  hits = hits_2
280  self.extra_ei_flags = 0x400
281  self.exp_cells = exp_cells_2
282 
283  elif iev == 3:
284  # Event 3: Bad channels
285  self.tool = 'tool2'
286  self.exp_cells = exp_cells_3
287  self.exp_mbts = exp_mbts_3
288 
289  elif iev == 4:
290  # Event 4: Bad channels from TileDQstatus
291  self.rctype = TileFragHash.OptFilterDsp
292  baddq = {146 : [2, 10]}
293  self.exp_cells = exp_cells_4
294  dqhits = hits
295 
296  elif iev == 5:
297  # Event 5: fakeCrackCells
298  self.tool = 'tool5'
299  self.exp_cells = exp_cells_5
300 
301  elif iev == 6:
302  # Event 6: Threshold.
303  self.tool = 'tool6'
304  self.exp_cells = exp_cells_6
305 
306  elif iev == 7:
307  # Event 7: Corrections
308  self.tool = 'tool7'
309  bsflags = 0x32000000
310  self.exp_cells = exp_cells_7
311  self.exp_mbts = exp_mbts_7
312 
313  elif iev == 8:
314  # Event 8: noise filter
315  self.tool = 'tool8'
316  self.exp_cells = exp_cells_8
317 
318  elif iev == 9:
319  # Event 9: dsp container
320  self.tool = 'tool9'
321  dspcolls.add (0)
322 
323  elif iev == 10:
324  # Event 10: dsp container + corrections
325  self.tool = 'tool10'
326  dspcolls.add (0)
327  bsflags = 0x32000000
328  dspbsflags = 0x20000000
329  self.exp_cells = exp_cells_10
330  self.exp_mbts = exp_mbts_7
331 
332  else:
333  # Event 11: dsp container + noise filter
334  self.tool = 'tool11'
335  dspcolls.add (0)
336  self.exp_cells = exp_cells_8
337 
338 
339  self.record_raw_data (hits, self.rctype, baddq, bsflags, dspbsflags, dspcolls)
340 
341  self.record_raw_data (dqhits, self.rctype, baddq, bsflags,
342  rawname = 'TRCDQ')
343 
344  return StatusCode.Success
345 
346 

◆ initialize()

def TileCellBuilderTestConfig.PrepareDataAlg.initialize (   self)

Definition at line 249 of file TileCellBuilderTestConfig.py.

249  def initialize (self):
250  return StatusCode.Success
251 

◆ record_raw_data()

def TileCellBuilderTestConfig.PrepareDataAlg.record_raw_data (   self,
  hits,
  typ,
  baddq,
  bsflags,
  dspbsflags = 0,
  dspcolls = set(),
  rawname = 'TileRawChannelCnt' 
)

Definition at line 347 of file TileCellBuilderTestConfig.py.

347  def record_raw_data (self, hits, typ, baddq, bsflags,
348  dspbsflags=0, dspcolls=set(),
349  rawname = 'TileRawChannelCnt'):
350  idHelper = self.detStore['CaloCell_ID'].tile_idHelper()
351 
352  unit = 0 # TileRawChannelUnit::ADCcounts
353  cont = ROOT.TileRawChannelContainer (False, typ, unit)
354  cont.set_bsflags (bsflags)
355  hashFunc = cont.hashFunc()
356 
357  dspcont = None
358  if dspcolls:
359  dspcont = ROOT.TileRawChannelContainer (False, typ, unit)
360  dspcont.set_bsflags (dspbsflags)
361 
362  for icoll, colldata in hits:
363  coll = ROOT.TileRawChannelCollection (hashFunc.identifier(icoll))
364 
365  mask = 0
366  for chan in baddq.get (icoll, []):
367  mask |= (1<<(chan//3))
368  coll.setFragMemoryPar(mask)
369 
370  for addr, data in colldata:
371  if isinstance(addr, tuple):
372  adc_id = idHelper.adc_id (*addr)
373  chan = ROOT.TileRawChannel (adc_id, *data)
374  else:
375  hwid = ROOT.HWIdentifier (addr)
376  chan = ROOT.TileRawChannel (hwid, *data)
377  coll.push_back (chan)
378 
379  if icoll in dspcolls:
380  thiscont = dspcont
381  else:
382  thiscont = cont
383  thiscont.addCollection (coll, ROOT.IdentifierHash(icoll))
384  ROOT.SetOwnership (coll, False)
385 
386  self.evtStore.record (cont, rawname, False)
387  if dspcont:
388  self.evtStore.record (dspcont, 'TileRawChannelCntDsp', False)
389  return
390 
391 

Member Data Documentation

◆ exp_cells

TileCellBuilderTestConfig.PrepareDataAlg.exp_cells

Definition at line 256 of file TileCellBuilderTestConfig.py.

◆ exp_mbts

TileCellBuilderTestConfig.PrepareDataAlg.exp_mbts

Definition at line 257 of file TileCellBuilderTestConfig.py.

◆ extra_ei_flags

TileCellBuilderTestConfig.PrepareDataAlg.extra_ei_flags

Definition at line 258 of file TileCellBuilderTestConfig.py.

◆ rctype

TileCellBuilderTestConfig.PrepareDataAlg.rctype

Definition at line 263 of file TileCellBuilderTestConfig.py.

◆ tool

TileCellBuilderTestConfig.PrepareDataAlg.tool

Definition at line 259 of file TileCellBuilderTestConfig.py.


The documentation for this class was generated from the following file:
initialize
void initialize()
Definition: run_EoverP.cxx:894
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18