3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from ROOT
import CaloCell_ID
9 kwargs.setdefault(
'EtaWidth', [0.025, 0.003125, 0.025, 0.05, 0.1, 0.1, 0.2])
10 kwargs.setdefault(
'PhiWidth', [0.098174770424681, 0.098174770424681, 0.024543692606170,
11 0.024543692606170, 0.098174770424681, 0.098174770424681, 0.098174770424681])
12 kwargs.setdefault(
'NRings', [8, 64, 8, 8, 4, 4, 4])
13 kwargs.setdefault(
'CellMaxDEtaDist', .2)
14 kwargs.setdefault(
'CellMaxDPhiDist', .2)
15 kwargs.setdefault(
'Layers', [CaloCell_ID.PreSamplerB, CaloCell_ID.PreSamplerE,
16 CaloCell_ID.EMB1, CaloCell_ID.EME1,
17 CaloCell_ID.EMB2, CaloCell_ID.EME2,
18 CaloCell_ID.EMB3, CaloCell_ID.EME3,
19 CaloCell_ID.HEC0, CaloCell_ID.TileBar0,
20 CaloCell_ID.TileGap3, CaloCell_ID.TileExt0,
21 CaloCell_ID.HEC1, CaloCell_ID.HEC2,
22 CaloCell_ID.TileBar1, CaloCell_ID.TileGap1,
24 CaloCell_ID.HEC3, CaloCell_ID.TileBar2,
25 CaloCell_ID.TileGap2, CaloCell_ID.TileExt2])
26 kwargs.setdefault(
'RingSetNLayers', [2, 2, 2, 2, 4, 5, 4])
27 kwargs.setdefault(
'useShowerShapeBarycenter', flags.CaloRinger.useShowerShapeBarycenter)
28 kwargs.setdefault(
'CellsContainerName', flags.Egamma.Keys.Input.CaloCells)
29 kwargs.setdefault(
'CaloRingsContainerName',
'ElectronCaloRings')
30 kwargs.setdefault(
'RingSetContainerName',
'ElectronRingSets')
31 kwargs.setdefault(
'MinPartEnergy', flags.CaloRinger.minElectronEnergy*GeV)
32 kwargs.setdefault(
'doTransverseEnergy',flags.CaloRinger.doTransverseEnergy)
34 tool = CompFactory.Ringer.CaloRingsBuilder(name, **kwargs)
38 NRings = [8, 64, 8, 8, 4, 4, 4]
39 kwargs.setdefault(
'EtaWidth', [0.025, 0.003125, 0.025, 0.05, 0.1, 0.1, 0.2])
40 kwargs.setdefault(
'PhiWidth', [0.098174770424681, 0.098174770424681,
41 0.024543692606170, 0.024543692606170,
42 0.098174770424681, 0.098174770424681,
44 kwargs.setdefault(
'NRings', [(rings-1)*4+1
for rings
in NRings])
45 kwargs.setdefault(
'CellMaxDEtaDist', .2)
46 kwargs.setdefault(
'CellMaxDPhiDist', .2)
47 kwargs.setdefault(
'Layers', [CaloCell_ID.PreSamplerB, CaloCell_ID.PreSamplerE,
48 CaloCell_ID.EMB1, CaloCell_ID.EME1,
49 CaloCell_ID.EMB2, CaloCell_ID.EME2,
50 CaloCell_ID.EMB3, CaloCell_ID.EME3,
51 CaloCell_ID.HEC0, CaloCell_ID.TileBar0,
52 CaloCell_ID.TileGap3, CaloCell_ID.TileExt0,
53 CaloCell_ID.HEC1, CaloCell_ID.HEC2,
54 CaloCell_ID.TileBar1, CaloCell_ID.TileGap1,
56 CaloCell_ID.HEC3, CaloCell_ID.TileBar2,
57 CaloCell_ID.TileGap2, CaloCell_ID.TileExt2])
58 kwargs.setdefault(
'RingSetNLayers', [2, 2, 2, 2, 4, 5, 4])
59 kwargs.setdefault(
'useShowerShapeBarycenter', flags.CaloRinger.useShowerShapeBarycenter)
60 kwargs.setdefault(
'CellsContainerName', flags.Egamma.Keys.Input.CaloCells)
61 kwargs.setdefault(
'CaloRingsContainerName',
'ElectronCaloAsymRings')
62 kwargs.setdefault(
'RingSetContainerName',
'ElectronAsymRingSets')
63 kwargs.setdefault(
'MinPartEnergy',flags.CaloRinger.minElectronEnergy*GeV)
64 kwargs.setdefault(
'doTransverseEnergy',flags.CaloRinger.doTransverseEnergy)
65 kwargs.setdefault(
'doEtaAxesDivision',
True)
66 kwargs.setdefault(
'doPhiAxesDivision',
True)
68 tool = CompFactory.Ringer.CaloAsymRingsBuilder(name, **kwargs)
73 kwargs.setdefault(
'EtaWidth', [0.025, 0.003125, 0.025, 0.05, 0.1, 0.1, 0.2])
74 kwargs.setdefault(
'PhiWidth', [0.098174770424681, 0.098174770424681,
75 0.024543692606170, 0.024543692606170,
76 0.098174770424681, 0.098174770424681,
78 kwargs.setdefault(
'NRings', [28, 252, 28, 14, 8, 8, 4])
79 kwargs.setdefault(
'Axis', 0)
80 kwargs.setdefault(
'CellMaxDEtaDist', .2)
81 kwargs.setdefault(
'CellMaxDPhiDist', .2)
82 kwargs.setdefault(
'Layers', [CaloCell_ID.PreSamplerB, CaloCell_ID.PreSamplerE,
83 CaloCell_ID.EMB1, CaloCell_ID.EME1,
84 CaloCell_ID.EMB2, CaloCell_ID.EME2,
85 CaloCell_ID.EMB3, CaloCell_ID.EME3,
86 CaloCell_ID.HEC0, CaloCell_ID.TileBar0,
87 CaloCell_ID.TileGap3, CaloCell_ID.TileExt0,
88 CaloCell_ID.HEC1, CaloCell_ID.HEC2,
89 CaloCell_ID.TileBar1, CaloCell_ID.TileGap1,
91 CaloCell_ID.HEC3, CaloCell_ID.TileBar2,
92 CaloCell_ID.TileGap2, CaloCell_ID.TileExt2])
93 kwargs.setdefault(
'RingSetNLayers', [2, 2, 2, 2, 4, 5, 4])
94 kwargs.setdefault(
'useShowerShapeBarycenter', flags.CaloRinger.useShowerShapeBarycenter)
95 kwargs.setdefault(
'CellsContainerName', flags.Egamma.Keys.Input.CaloCells)
96 kwargs.setdefault(
'CaloRingsContainerName',
'ElectronCaloStripsRings')
97 kwargs.setdefault(
'RingSetContainerName',
'ElectronStripsRingSets')
98 kwargs.setdefault(
'MinPartEnergy',flags.CaloRinger.minElectronEnergy*GeV)
99 kwargs.setdefault(
'doTransverseEnergy',flags.CaloRinger.doTransverseEnergy)
100 kwargs.setdefault(
'doEtaAxesDivision',
True)
101 kwargs.setdefault(
'doPhiAxesDivision',
True)
103 tool = CompFactory.Ringer.CaloStripsRingsBuilder(name, **kwargs)
107 kwargs.setdefault(
'EtaWidth', [0.025, 0.003125, 0.025, 0.05, 0.1, 0.1, 0.2])
108 kwargs.setdefault(
'PhiWidth', [0.098174770424681, 0.098174770424681,
109 0.024543692606170, 0.024543692606170,
110 0.098174770424681, 0.098174770424681,
112 kwargs.setdefault(
'NRings', [8, 64, 8, 8, 4, 4, 4])
113 kwargs.setdefault(
'CellMaxDEtaDist', .2)
114 kwargs.setdefault(
'CellMaxDPhiDist', .2)
115 kwargs.setdefault(
'Layers', [CaloCell_ID.PreSamplerB, CaloCell_ID.PreSamplerE,
116 CaloCell_ID.EMB1, CaloCell_ID.EME1,
117 CaloCell_ID.EMB2, CaloCell_ID.EME2,
118 CaloCell_ID.EMB3, CaloCell_ID.EME3,
119 CaloCell_ID.HEC0, CaloCell_ID.TileBar0,
120 CaloCell_ID.TileGap3, CaloCell_ID.TileExt0,
121 CaloCell_ID.HEC1, CaloCell_ID.HEC2,
122 CaloCell_ID.TileBar1, CaloCell_ID.TileGap1,
123 CaloCell_ID.TileExt1,
124 CaloCell_ID.HEC3, CaloCell_ID.TileBar2,
125 CaloCell_ID.TileGap2, CaloCell_ID.TileExt2])
126 kwargs.setdefault(
'RingSetNLayers', [2, 2, 2, 2, 4, 5, 4])
127 kwargs.setdefault(
'useShowerShapeBarycenter', flags.CaloRinger.useShowerShapeBarycenter)
128 kwargs.setdefault(
'CellsContainerName', flags.Egamma.Keys.Input.CaloCells)
129 kwargs.setdefault(
'CaloRingsContainerName',
'PhotonCaloRings')
130 kwargs.setdefault(
'RingSetContainerName',
'PhotonRingSets')
131 kwargs.setdefault(
'MinPartEnergy', flags.CaloRinger.minPhotonEnergy*GeV)
132 kwargs.setdefault(
'doTransverseEnergy',flags.CaloRinger.doTransverseEnergy)
134 tool = CompFactory.Ringer.CaloRingsBuilder(name, **kwargs)
139 NRings = [8, 64, 8, 8, 4, 4, 4]
140 kwargs.setdefault(
'EtaWidth', [0.025, 0.003125, 0.025, 0.05, 0.1, 0.1, 0.2])
141 kwargs.setdefault(
'PhiWidth', [0.098174770424681, 0.098174770424681,
142 0.024543692606170, 0.024543692606170,
143 0.098174770424681, 0.098174770424681,
145 kwargs.setdefault(
'NRings', [(rings-1)*4+1
for rings
in NRings])
146 kwargs.setdefault(
'CellMaxDEtaDist', .2)
147 kwargs.setdefault(
'CellMaxDPhiDist', .2)
148 kwargs.setdefault(
'Layers', [CaloCell_ID.PreSamplerB, CaloCell_ID.PreSamplerE,
149 CaloCell_ID.EMB1, CaloCell_ID.EME1,
150 CaloCell_ID.EMB2, CaloCell_ID.EME2,
151 CaloCell_ID.EMB3, CaloCell_ID.EME3,
152 CaloCell_ID.HEC0, CaloCell_ID.TileBar0,
153 CaloCell_ID.TileGap3, CaloCell_ID.TileExt0,
154 CaloCell_ID.HEC1, CaloCell_ID.HEC2,
155 CaloCell_ID.TileBar1, CaloCell_ID.TileGap1,
156 CaloCell_ID.TileExt1,
157 CaloCell_ID.HEC3, CaloCell_ID.TileBar2,
158 CaloCell_ID.TileGap2, CaloCell_ID.TileExt2])
159 kwargs.setdefault(
'RingSetNLayers', [2, 2, 2, 2, 4, 5, 4])
160 kwargs.setdefault(
'useShowerShapeBarycenter', flags.CaloRinger.useShowerShapeBarycenter)
161 kwargs.setdefault(
'CellsContainerName', flags.Egamma.Keys.Input.CaloCells)
162 kwargs.setdefault(
'CaloRingsContainerName',
'PhotonCaloAsymRings')
163 kwargs.setdefault(
'RingSetContainerName',
'PhotonAsymRingSets')
164 kwargs.setdefault(
'MinPartEnergy', flags.CaloRinger.minPhotonEnergy*GeV)
165 kwargs.setdefault(
'doTransverseEnergy',flags.CaloRinger.doTransverseEnergy)
166 kwargs.setdefault(
'doEtaAxesDivision',
True)
167 kwargs.setdefault(
'doPhiAxesDivision',
True)
169 tool = CompFactory.Ringer.CaloAsymRingsBuilder(name, **kwargs)
174 kwargs.setdefault(
'EtaWidth', [0.025, 0.003125, 0.025, 0.05, 0.1, 0.1, 0.2])
175 kwargs.setdefault(
'PhiWidth', [0.098174770424681, 0.098174770424681,
176 0.024543692606170, 0.024543692606170,
177 0.098174770424681, 0.098174770424681,
179 kwargs.setdefault(
'NRings', [28, 252, 28, 14, 8, 8, 4])
180 kwargs.setdefault(
'Axis', 0)
181 kwargs.setdefault(
'CellMaxDEtaDist', .2)
182 kwargs.setdefault(
'CellMaxDPhiDist', .2)
183 kwargs.setdefault(
'Layers', [CaloCell_ID.PreSamplerB, CaloCell_ID.PreSamplerE,
184 CaloCell_ID.EMB1, CaloCell_ID.EME1,
185 CaloCell_ID.EMB2, CaloCell_ID.EME2,
186 CaloCell_ID.EMB3, CaloCell_ID.EME3,
187 CaloCell_ID.HEC0, CaloCell_ID.TileBar0,
188 CaloCell_ID.TileGap3, CaloCell_ID.TileExt0,
189 CaloCell_ID.HEC1, CaloCell_ID.HEC2,
190 CaloCell_ID.TileBar1, CaloCell_ID.TileGap1,
191 CaloCell_ID.TileExt1,
192 CaloCell_ID.HEC3, CaloCell_ID.TileBar2,
193 CaloCell_ID.TileGap2, CaloCell_ID.TileExt2])
194 kwargs.setdefault(
'RingSetNLayers', [2, 2, 2, 2, 4, 5, 4])
195 kwargs.setdefault(
'useShowerShapeBarycenter', flags.CaloRinger.useShowerShapeBarycenter)
196 kwargs.setdefault(
'CellsContainerName', flags.Egamma.Keys.Input.CaloCells)
197 kwargs.setdefault(
'CaloRingsContainerName',
'PhotonCaloStripsRings')
198 kwargs.setdefault(
'RingSetContainerName',
'PhotonStripsRingSets')
199 kwargs.setdefault(
'MinPartEnergy', flags.CaloRinger.minPhotonEnergy*GeV)
200 kwargs.setdefault(
'doTransverseEnergy',flags.CaloRinger.doTransverseEnergy)
201 kwargs.setdefault(
'doEtaAxesDivision',
True)
202 kwargs.setdefault(
'doPhiAxesDivision',
True)
204 tool = CompFactory.Ringer.CaloStripsRingsBuilder(name, **kwargs)
211 elif 'Strips' in name:
216 kwargs.setdefault(
'crBuilder', builderTool)
217 kwargs.setdefault(
'inputKey', flags.Egamma.Keys.Output.Electrons)
218 kwargs.setdefault(
'builderAvailable',
True)
219 inputReaderTool = CompFactory.Ringer.CaloRingerElectronsReader(name, **kwargs)
221 return inputReaderTool, builderTool
227 elif 'Strips' in name:
232 kwargs.setdefault(
'crBuilder', builderTool)
233 kwargs.setdefault(
'inputKey', flags.Egamma.Keys.Output.Photons)
234 kwargs.setdefault(
'builderAvailable',
True)
235 inputReaderTool = CompFactory.Ringer.CaloRingerPhotonsReader(name, **kwargs)
237 return inputReaderTool, builderTool
242 acc.addPublicTool(electronBuilderTool)
243 acc.addPublicTool(electronInputReaderTool)
244 kwargs.setdefault(
'inputReaderTools', electronInputReaderTool)
246 CaloRingerAlgorithm = CompFactory.Ringer.CaloRingerAlgorithm(name=
'CaloRingerElectronAlgorithm', **kwargs)
247 acc.addEventAlgo(CaloRingerAlgorithm)
253 acc.addPublicTool(electronAsymBuilderTool)
254 acc.addPublicTool(electronAsymInputReaderTool)
255 kwargs.setdefault(
'inputReaderTools', electronAsymInputReaderTool)
257 CaloRingerAsymAlgorithm = CompFactory.Ringer.CaloRingerAlgorithm(name=
'CaloRingerAsymAlgorithm', **kwargs)
258 acc.addEventAlgo(CaloRingerAsymAlgorithm)
264 acc.addPublicTool(electronStripsBuilderTool)
265 acc.addPublicTool(electronStripsInputReaderTool)
266 kwargs.setdefault(
'inputReaderTools', electronStripsInputReaderTool)
268 CaloRingerStripsAlgorithm = CompFactory.Ringer.CaloRingerAlgorithm(name=
'CaloRingerStripsElectronAlgorithm', **kwargs)
269 acc.addEventAlgo(CaloRingerStripsAlgorithm)
275 acc.addPublicTool(photonBuilderTool)
276 acc.addPublicTool(photonInputReaderTool)
277 kwargs.setdefault(
'inputReaderTools', photonInputReaderTool)
279 CaloRingerAlgorithm = CompFactory.Ringer.CaloRingerAlgorithm(name=
'CaloRingerPhotonAlgorithm', **kwargs)
280 acc.addEventAlgo(CaloRingerAlgorithm)
286 acc.addPublicTool(photonAsymBuilderTool)
287 acc.addPublicTool(photonAsymInputReaderTool)
288 kwargs.setdefault(
'inputReaderTools', photonAsymInputReaderTool)
290 CaloAsymRingerAlgorithm = CompFactory.Ringer.CaloRingerAlgorithm(name=
'CaloAsymRingerAlgorithm', **kwargs)
291 acc.addEventAlgo(CaloAsymRingerAlgorithm)
297 acc.addPublicTool(photonStripsBuilderTool)
298 acc.addPublicTool(photonStripsInputReaderTool)
299 kwargs.setdefault(
'inputReaderTools', photonStripsInputReaderTool)
301 CaloRingerStripsAlgorithm = CompFactory.Ringer.CaloRingerAlgorithm(name=
'CaloRingerStripsAlgorithm', **kwargs)
302 acc.addEventAlgo(CaloRingerStripsAlgorithm)
306 from OutputStreamAthenaPool.OutputStreamConfig
import addToAOD, addToESD
310 if flags.CaloRinger.buildElectronRings:
311 toOutput +=[
'xAOD::RingSetContainer#ElectronRingSets',
312 'xAOD::RingSetAuxContainer#ElectronRingSetsAux.',
313 'xAOD::CaloRingsContainer#ElectronCaloRings',
314 'xAOD::CaloRingsAuxContainer#ElectronCaloRingsAux.',
316 if flags.CaloRinger.buildElectronAsymRings:
317 toOutput +=[
'xAOD::RingSetContainer#ElectronAsymRingSets',
318 'xAOD::RingSetAuxContainer#ElectronAsymRingSetsAux.',
319 'xAOD::CaloRingsContainer#ElectronCaloAsymRings',
320 'xAOD::CaloRingsAuxContainer#ElectronCaloAsymRingsAux.',
322 if flags.CaloRinger.buildElectronStripsRings:
323 toOutput +=[
'xAOD::RingSetContainer#ElectronStripsRingSets',
324 'xAOD::RingSetAuxContainer#ElectronStripsRingSetsAux.',
325 'xAOD::CaloRingsContainer#ElectronCaloStripsRings',
326 'xAOD::CaloRingsAuxContainer#ElectronCaloStripsRingsAux.',
328 if flags.CaloRinger.buildPhotonRings:
330 'xAOD::RingSetContainer#PhotonRingSets',
331 'xAOD::RingSetAuxContainer#PhotonRingSetsAux.',
332 'xAOD::CaloRingsContainer#PhotonCaloRings',
333 'xAOD::CaloRingsAuxContainer#PhotonCaloRingsAux.'
335 if flags.CaloRinger.buildPhotonAsymRings:
337 'xAOD::RingSetContainer#PhotonAsymRingSets',
338 'xAOD::RingSetAuxContainer#PhotonAsymRingSetsAux.',
339 'xAOD::CaloRingsContainer#PhotonCaloAsymRings',
340 'xAOD::CaloRingsAuxContainer#PhotonCaloAsymRingsAux.',
342 if flags.CaloRinger.buildPhotonStripsRings:
344 'xAOD::RingSetContainer#PhotonStripsRingSets',
345 'xAOD::RingSetAuxContainer#PhotonStripsRingSetsAux.',
346 'xAOD::CaloRingsContainer#PhotonCaloStripsRings',
347 'xAOD::CaloRingsAuxContainer#PhotonCaloStripsRingsAux.',
349 if flags.Output.doWriteAOD:
350 acc.merge(
addToAOD(flags, toOutput))
351 if flags.Output.doWriteESD:
352 acc.merge(
addToESD(flags, toOutput))
359 if flags.CaloRinger.buildElectronRings:
361 if flags.CaloRinger.buildElectronAsymRings:
363 if flags.CaloRinger.buildElectronStripsRings:
366 if flags.CaloRinger.buildPhotonRings:
368 if flags.CaloRinger.buildPhotonAsymRings:
370 if flags.CaloRinger.buildPhotonStripsRings:
377 if __name__ ==
'__main__':
378 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
379 from AthenaConfiguration.TestDefaults
import defaultTestFiles
381 flags.Input.Files = defaultTestFiles.RDO_RUN2
382 flags.Output.doWriteAOD =
True
383 flags.Output.ESDFileName =
'testing.ESD.root'
385 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg