ATLAS Offline Software
Loading...
Searching...
No Matches
LArDigitThinnerConfig.py
Go to the documentation of this file.
1"""Configuration for the LAr Digit Thinner algorithm
2
3Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4"""
5from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory import CompFactory
7from AthenaConfiguration.Enums import BeamType, Format
8from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
9from LArConfiguration.LArConfigFlags import RawChannelSource
10from OutputStreamAthenaPool.OutputStreamConfig import addToESD
11
12def LArDigitThinnerCfg(flags, **kwargs):
13 """Return ComponentAccumulator for LArDigitThinner algorithm"""
14 # based on DefaultLArDigitThinner
15 acc = ComponentAccumulator()
16
17 if not flags.Input.isMC and not flags.Overlay.DataOverlay:
18 kwargs.setdefault("InputContainerName","FREE")
19 if flags.Input.Format is Format.BS:
20 from LArByteStream.LArRawDataReadingConfig import LArRawDataReadingCfg
21 acc.merge(LArRawDataReadingCfg(flags,LArDigitKey="FREE"))
22
23
24 acc.merge(LArOnOffIdMappingCfg(flags))
25
26 if flags.Beam.Type is BeamType.Cosmics:
27 kwargs.setdefault("EnergyCuts_Barrel", [1000, 500, 1000, 1000])
28 kwargs.setdefault("EnergyCuts_Endcap", [1000, 500, 1000, 1000])
29 kwargs.setdefault("EnergyCut_HEC", 2000)
30 kwargs.setdefault("EnergyCut_FCAL", 3000)
31 else:
32 kwargs.setdefault("EnergyCuts_Barrel", [1000, 1000, 1000, 1000])
33 kwargs.setdefault("EnergyCuts_Endcap", [2000, 2000, 2000, 2000])
34 kwargs.setdefault("EnergyCut_HEC", 5000)
35 kwargs.setdefault("EnergyCut_FCAL", 20000)
36
37 if flags.LAr.RawChannelSource is RawChannelSource.Calculated:
38 kwargs.setdefault("RawChannelContainerName","LArRawChannels_FromDigits")
39
40 acc.addEventAlgo(CompFactory.LArDigitThinner(**kwargs))
41 acc.merge(addToESD(flags,["LArDigitContainer#LArDigitContainer_Thinned",]))
42 return acc