ATLAS Offline Software
xAODTrigL1CaloCreator.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 # Import the package's configurables:
4 import xAODTrigL1CaloCnv.xAODTrigL1CaloCnvConf as conf
5 
6 
7 def xAODTrigL1CaloCreator( sequence = None, stream = None ):
8  """
9  Helper function that schedules all the components that create xAOD
10  LVL1 RoI objects out of existing AOD objects.
11 
12  Arguments:
13  sequence: Optional sequence to which the components should be added.
14  If not specified, the main algorithm sequence is used.
15  stream: Optional stream that the objects should be written to.
16  If not specified, the objects are added to StreamXAOD.
17  """
18 
19  # Create a logger for the function:
20  from AthenaCommon.Logging import logging
21  logger = logging.getLogger( "xAODTrigL1CaloCreator" )
22 
23  # Tell the user what's happening:
24  logger.info( "Creating xAOD L1Calo objects from ESD L1Calo objects" )
25 
26  # Get the main sequence if necessary:
27  if sequence is None:
28  from AthenaCommon.AlgSequence import AlgSequence
29  sequence = AlgSequence()
30  pass
31 
32  # Access the stream if necessary:
33  if stream is None:
34  from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
35  stream = MSMgr.GetStream( "StreamXAOD" )
36  pass
37 
38 
40  SGkey = "CMMCPHits"
41  alg = conf.xAODMaker__CMMCPHitsCnvAlg()
42  alg.ESDKey = SGkey
43  alg.xAODKey = SGkey
44  sequence += alg
45  # Add the CMMCPHits objects to the output:
46  stream.AddItem( "xAOD::CMMCPHitsContainer_v1#%s" % SGkey )
47  stream.AddItem( "xAOD::CMMCPHitsAuxContainer_v1#%sAux." % SGkey )
48 
49  # Add the CMMEtSums converter algorithm:
50  SGkey = "CMMEtSums"
51  alg = conf.xAODMaker__CMMEtSumsCnvAlg()
52  alg.ESDKey = SGkey
53  alg.xAODKey = SGkey
54  sequence += alg
55  # Add the CMMEtSums objects to the output:
56  stream.AddItem( "xAOD::CMMEtSumsContainer_v1#%s" % SGkey )
57  stream.AddItem( "xAOD::CMMEtSumsAuxContainer_v1#%sAux." % SGkey )
58 
59  # Add the CMMJetHits converter algorithm:
60  SGkey = "CMMJetHits"
61  alg = conf.xAODMaker__CMMJetHitsCnvAlg()
62  alg.ESDKey = SGkey
63  alg.xAODKey = SGkey
64  sequence += alg
65  # Add the CMMJetHits objects to the output:
66  stream.AddItem( "xAOD::CMMJetHitsContainer_v1#%s" % SGkey )
67  stream.AddItem( "xAOD::CMMJetHitsAuxContainer_v1#%sAux." % SGkey )
68 
69  # Add the CMMRoIs converter algorithm:
70  SGkey = "CMMRoIs"
71  alg = conf.xAODMaker__CMMRoICnvAlg()
72  alg.ESDKey = SGkey
73  alg.xAODKey = SGkey
74  sequence += alg
75  # Add the CMMRoI objects to the output:
76  stream.AddItem( "xAOD::CMMRoI_v1#%s" % SGkey )
77  stream.AddItem( "xAOD::CMMRoIAuxInfo_v1#%sAux." % SGkey )
78 
79 
80 
82  SGkey = "CPMHits"
83  alg = conf.xAODMaker__CPMHitsCnvAlg()
84  alg.ESDKey = SGkey
85  alg.xAODKey = SGkey
86  sequence += alg
87  # Add the CMMCPHits objects to the output:
88  stream.AddItem( "xAOD::CPMHitsContainer_v1#%s" % SGkey )
89  stream.AddItem( "xAOD::CPMHitsAuxContainer_v1#%sAux." % SGkey )
90 
91  # Add the CPMTower converter algorithm:
92  SGkey = "CPMTowers"
93  alg = conf.xAODMaker__CPMTowerCnvAlg()
94  alg.ESDKey = SGkey
95  alg.xAODKey = SGkey
96  sequence += alg
97  # Add the CMMCPHits objects to the output:
98  stream.AddItem( "xAOD::CPMTowerContainer_v1#%s" % SGkey )
99  stream.AddItem( "xAOD::CPMTowerAuxContainer_v1#%sAux." % SGkey )
100 
101  # Add the CPMRoI converter algorithm:
102  SGkey = "CPMRoIs"
103  alg = conf.xAODMaker__CPMRoICnvAlg()
104  alg.ESDKey = SGkey
105  alg.xAODKey = SGkey
106  sequence += alg
107  # Add the CMMCPHits objects to the output:
108  stream.AddItem( "xAOD::CPMRoIContainer_v1#%s" % SGkey )
109  stream.AddItem( "xAOD::CPMRoIAuxContainer_v1#%sAux." % SGkey )
110 
111 
112 
114  SGkey = "JEMHits"
115  alg = conf.xAODMaker__JEMHitsCnvAlg()
116  alg.ESDKey = SGkey
117  alg.xAODKey = SGkey
118  sequence += alg
119  # Add the CMMCPHits objects to the output:
120  stream.AddItem( "xAOD::JEMHitsContainer_v1#%s" % SGkey )
121  stream.AddItem( "xAOD::JEMHitsAuxContainer_v1#%sAux." % SGkey )
122 
123  # Add the JEMEtSums converter algorithm:
124  SGkey = "JEMEtSums"
125  alg = conf.xAODMaker__JEMEtSumsCnvAlg()
126  alg.ESDKey = SGkey
127  alg.xAODKey = SGkey
128  sequence += alg
129  # Add the CMMCPHits objects to the output:
130  stream.AddItem( "xAOD::JEMEtSumsContainer_v1#%s" % SGkey )
131  stream.AddItem( "xAOD::JEMEtSumsAuxContainer_v1#%sAux." % SGkey )
132 
133  # Add the JEMRoI converter algorithm:
134  SGkey = "JEMRoIs"
135  alg = conf.xAODMaker__JEMRoICnvAlg()
136  alg.ESDKey = SGkey
137  alg.xAODKey = SGkey
138  sequence += alg
139  # Add the CMMCPHits objects to the output:
140  stream.AddItem( "xAOD::JEMRoIContainer_v1#%s" % SGkey )
141  stream.AddItem( "xAOD::JEMRoIAuxContainer_v1#%sAux." % SGkey )
142 
143 
144 
145 
146  # Add the JetElement converter algorithm:
147  SGkey = "JetElements"
148  alg = conf.xAODMaker__JetElementCnvAlg()
149  alg.ESDKey = SGkey
150  alg.xAODKey = SGkey
151  sequence += alg
152  # Add the CMMCPHits objects to the output:
153  stream.AddItem( "xAOD::JetElementContainer_v1#%s" % SGkey )
154  stream.AddItem( "xAOD::JetElementAuxContainer_v1#%sAux." % SGkey )
155 
156  # Add the RODHeaders converter algorithm:
157  SGkey = "RODHeaders"
158  alg = conf.xAODMaker__RODHeaderCnvAlg()
159  alg.ESDKey = SGkey
160  alg.xAODKey = SGkey
161  sequence += alg
162  # Add the CMMCPHits objects to the output:
163  stream.AddItem( "xAOD::RODHeaderContainer_v1#%s" % SGkey )
164  stream.AddItem( "xAOD::RODHeaderAuxContainer_v1#%sAux." % SGkey )
165 
166  # Add the TriggerTower converter algorithm:
167  SGkey = "TriggerTowers"
168  alg = conf.xAODMaker__TriggerTowerCnvAlg()
169  alg.ESDKey = SGkey
170  alg.xAODKey = SGkey
171  sequence += alg
172  # Add the CMMCPHits objects to the output:
173  stream.AddItem( "xAOD::TriggerTowerContainer_v1#%s" % SGkey )
174  stream.AddItem( "xAOD::TriggerTowerAuxContainer_v1#%sAux." % SGkey )
175 
176  pass
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
xAODTrigL1CaloCreator.xAODTrigL1CaloCreator
def xAODTrigL1CaloCreator(sequence=None, stream=None)
Helper function for creating xAODTrigL1Calo objects/containers.
Definition: xAODTrigL1CaloCreator.py:7