ATLAS Offline Software
LArSCHitD3PDObject.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from D3PDMakerCoreComps.D3PDObject import D3PDObject
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 D3PD = CompFactory.D3PD
7 
8 
9 def _hookForLArSCHitD3PDObject_(c, flags, acc, *args, **kw):
10 
11  basFiller = c.BlockFillers[0]
12  print("getattr(c, c.name()) / Type= ", type(basFiller))
13  if "CaloEtaCut" in list(kw.keys()):
14  basFiller.CaloEtaCut = kw["CaloEtaCut"]
15  if "CaloPhiCut" in list(kw.keys()):
16  basFiller.CaloPhiCut = kw["CaloPhiCut"]
17  if "CaloLayers" in list(kw.keys()):
18  basFiller.CaloLayers = kw["CaloLayers"]
19  if "CaloDetectors" in list(kw.keys()):
20  basFiller.CaloDetectors = kw["CaloDetectors"]
21 
22  print("%s - CaloEtaCut = " % (basFiller.name), basFiller.CaloEtaCut)
23  print("%s - CaloPhiCut = " % (basFiller.name), basFiller.CaloPhiCut)
24  print("%s - CaloLayersCut = " % (basFiller.name), basFiller.CaloLayers)
25  print("%s - CaloDetectors = " % (basFiller.name), basFiller.CaloDetectors)
26 
27  return
28 
29 def _makeLArSCHit_obj_(name, prefix, object_name,
30  getter=None,
31  sgKey=None,
32  typeName=None,
33  ):
34 
35  from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
36  if not typeName:
37  typeName = "LArHitContainer"
38  if not sgKey:
39  sgKey="LArHitEMB"
40  if not getter:
41  getter = D3PD.SGObjGetterTool(
42  name + '_Getter',
43  TypeName = typeName,
44  SGKey = sgKey)
45 
46 
47  return D3PD.ObjFillerTool( name,
48  Prefix = prefix,
49  Getter = getter,
50  ObjectName = object_name,
51  SaveMetadata = \
52  D3PDMakerFlags.SaveObjectMetadata
53  )
54 
55 def make_LArSCHitD3PDObject( typeName="LArHitContainer",
56  sgKey="LArHitEMB",
57  prefix="sch_",
58  object_name="LArSCHitD3PDObject",
59  *args, **kw ):
60 
61  obj = D3PDObject(_makeLArSCHit_obj_, prefix, object_name,
62  allow_args=["CaloEtaCut","CaloPhiCut",
63  "CaloLayers","CaloDetectors"],
64  sgkey=sgKey,
65  typename=typeName)
66  obj.defineBlock( 0, 'Basic', D3PD.LArSCHitFillerTool)
67  obj.defineHook( _hookForLArSCHitD3PDObject_ )
68  return obj
69 
70 LArSCHitD3PDObject = make_LArSCHitD3PDObject( typeName="LArHitContainer",
71  sgKey = "LArHitEMB",
72  prefix = "hsc_",
73  CaloEtaCut=[],
74  CaloPhiCut=[],
75  CaloLayers=[],
76  CaloDetectors=[],)
D3PD::SGObjGetterTool
Getter tool to retrieve single objects from StoreGate.
Definition: SGObjGetterTool.h:48
python.LArSCHitD3PDObject.make_LArSCHitD3PDObject
def make_LArSCHitD3PDObject(typeName="LArHitContainer", sgKey="LArHitEMB", prefix="sch_", object_name="LArSCHitD3PDObject", *args, **kw)
Definition: LArSCHitD3PDObject.py:55
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
D3PD::ObjFillerTool
Object filler tool for a single object.
Definition: ObjFillerTool.h:52
python.LArSCHitD3PDObject._hookForLArSCHitD3PDObject_
def _hookForLArSCHitD3PDObject_(c, flags, acc, *args, **kw)
Definition: LArSCHitD3PDObject.py:9
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.LArSCHitD3PDObject._makeLArSCHit_obj_
def _makeLArSCHit_obj_(name, prefix, object_name, getter=None, sgKey=None, typeName=None)
Definition: LArSCHitD3PDObject.py:29
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
D3PD::LArSCHitFillerTool
Block filler tool for EM samplings from a CaloCluster.
Definition: LArSCHitFillerTool.h:50