ATLAS Offline Software
TileDetailsD3PDObject.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 
4 from D3PDMakerCoreComps.D3PDObject import D3PDObject
5 from CaloD3PDMaker.TileCellFilterAlgConfig import TileCellFilterAlgCfg
6 from D3PDMakerCoreComps.IndexMultiAssociation import IndexMultiAssociation
7 from AthenaConfiguration.ComponentFactory import CompFactory
8 
9 D3PD = CompFactory.D3PD
10 
11 
12 BaseSGKey='holder'
13 
14 def makeTileD3PDObject (name, prefix, object_name='TileDetailsD3PDObject', getter = None,
15  sgkey = None,
16  label = None):
17  global BaseSGKey
18  BaseSGKey=sgkey
19  sgkey = prefix
20  if label is None: label = prefix
21 
22 
23  print(" makeTileD3PDObject: name = ", name)
24  print(" makeTileD3PDObject: prefix = ", prefix)
25  print(" makeTileD3PDObject: object_name = ", object_name)
26  print(" makeTileD3PDObject: sgkey = ", sgkey)
27 
28  if not getter:
30  (name + '_Getter',
31  TypeName = 'CaloCellContainer',
32  SGKey = sgkey,
33  Label = label)
34 
35  # create the selected cells
36  from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
37  return D3PD.VectorFillerTool (name,
38  Prefix = prefix,
39  Getter = getter,
40  ObjectName = object_name,
41  SaveMetadata = \
42  D3PDMakerFlags.SaveObjectMetadata)
43 
44 
45 
46 # function to create the CaloCellContainer for selected
47 def hookForTileCellFilterAlg(c, flags, acc, *args, **kw):
48 
49  cellSigmaCut=-1.
50  global BaseSGKey
51  if BaseSGKey is None or BaseSGKey=='holder' : BaseSGKey='AllCalo'
52  print ('aaa', args, kw)
53  sgkey = kw['prefix']
54 
55  print(" in makeTileD3PDObject, sgkey, cellSigmaCut = ", sgkey, cellSigmaCut)
56 
57  acc.merge (TileCellFilterAlgCfg (flags,
58  OutputCellsName=sgkey,
59  CellSigmaCut=cellSigmaCut,
60  CellsName = BaseSGKey))
61  return
62 
63 def TileCellRawAssoc(parent,prefix='',target='',level=0,blockname=None,*args,**kw):
64 
65  if blockname is None:
66  blockname=prefix+'TileCellRawAssociation'
67 
68  return IndexMultiAssociation(parent,
70  target,
71  prefix,
72  level,
73  blockname,
74  nrowName='')
75 
76 def TileCellDigitAssoc(parent,prefix='',target='',level=0,blockname=None,*args,**kw):
77  if blockname is None:
78  blockname=prefix+'TileCellDigitAssociation'
79 
80  return IndexMultiAssociation(parent,
82  target,
83  prefix,
84  level,
85  blockname,
86  nrowName='')
87 
88 
89 def makeTileCellD3PDObject (maker, prefix,object_name) :
90 
91  cellD3PDObject = D3PDObject (maker, prefix, object_name)
92  cellD3PDObject.defineHook(hookForTileCellFilterAlg)
93 
94  cellD3PDObject.defineBlock (0, 'Kinematics',
96  WriteE=True,
97  WritePt=True,
98  WriteEtaPhi=True,
99  WriteM=False,
100  )
101 
102  cellD3PDObject.defineBlock (1, 'TileDetails',
104  SaveCellDetails=True,
105  SavePositionInfo=False,
106  )
107 
108  return cellD3PDObject
109 
110 
111 
112 # All Tile cells
113 TileDetailsD3PDObject = makeTileCellD3PDObject(makeTileD3PDObject,'tilecell_',
114  'TileDetailsD3PDObject')
python.TileDetailsD3PDObject.hookForTileCellFilterAlg
def hookForTileCellFilterAlg(c, flags, acc, *args, **kw)
Definition: TileDetailsD3PDObject.py:47
D3PD::TileCellDetailsFillerTool
Definition: TileCellDetailsFillerTool.h:26
python.TileDetailsD3PDObject.TileCellRawAssoc
def TileCellRawAssoc(parent, prefix='', target='', level=0, blockname=None, *args, **kw)
Definition: TileDetailsD3PDObject.py:63
python.TileDetailsD3PDObject.makeTileCellD3PDObject
def makeTileCellD3PDObject(maker, prefix, object_name)
Definition: TileDetailsD3PDObject.py:89
python.TileDetailsD3PDObject.TileCellDigitAssoc
def TileCellDigitAssoc(parent, prefix='', target='', level=0, blockname=None, *args, **kw)
Definition: TileDetailsD3PDObject.py:76
D3PD::SGDataVectorGetterTool
Getter tool to retrieve DataVector/List collections from StoreGate.
Definition: SGDataVectorGetterTool.h:55
python.IndexMultiAssociation.IndexMultiAssociation
def IndexMultiAssociation(parent, assoctool, target, prefix='', level=0, blockname=None, allowMissing=False, nrowName='n', containerIndexName='', **kw)
Definition: IndexMultiAssociation.py:18
D3PD::TileCellRawAssociationTool
Definition: TileCellRawAssociationTool.h:29
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
D3PD::FourMomFillerTool
Block filler tool for a four-momentum.
Definition: FourMomFillerTool.h:56
D3PD::TileCellDigitAssociationTool
Definition: TileCellDigitAssociationTool.h:27
python.TileDetailsD3PDObject.makeTileD3PDObject
def makeTileD3PDObject(name, prefix, object_name='TileDetailsD3PDObject', getter=None, sgkey=None, label=None)
Definition: TileDetailsD3PDObject.py:14
D3PD::VectorFillerTool
Object filler tool for a collection of objects, saved as vectors.
Definition: VectorFillerTool.h:70