ATLAS Offline Software
LArSuperCellConfig.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 def LArSuperCellCfg(inputFlags):
6 
7  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8  from AthenaConfiguration.ComponentFactory import CompFactory
9  from OutputStreamAthenaPool.OutputStreamConfig import addToESD, addToAOD
10  acc = ComponentAccumulator()
11 
12  # should we create bcid'ed container ?
13  if inputFlags.LAr.DT.storeET_ID:
14  from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingCfg
15  acc.merge(LArRawSCDataReadingCfg(inputFlags))
16  acc.addCondAlgo(CompFactory.CaloSuperCellAlignCondAlg('CaloSuperCellAlignCondAlg'))
17  from LArCellRec.LArRAWtoSuperCellConfig import LArRAWtoSuperCellCfg
18  acc.merge(LArRAWtoSuperCellCfg(inputFlags,mask=inputFlags.LAr.DT.doSCMasking, SCellContainerOut=inputFlags.LAr.DT.ET_IDKey) )
19 
20  acc.merge(addToESD(inputFlags, ["CaloCellContainer#"+inputFlags.LAr.DT.ET_IDKey]))
21  acc.merge(addToAOD(inputFlags, ["CaloCellContainer#"+inputFlags.LAr.DT.ET_IDKey]))
22 
23  # should we create additional containers ?
24  if inputFlags.LAr.DT.storeET_additional:
25  from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingCfg
26  acc.merge(LArRawSCDataReadingCfg(inputFlags))
27  acc.addCondAlgo(CompFactory.CaloSuperCellAlignCondAlg('CaloSuperCellAlignCondAlg'))
28  from LArCellRec.LArRAWtoSuperCellConfig import LArRAWtoSuperCellCfg
29  acc.merge(LArRAWtoSuperCellCfg(inputFlags,name='LArRAWtoSuperCellPlus', mask=inputFlags.LAr.DT.doSCMasking, SCellContainerOut=inputFlags.LAr.DT.ET_PlusKey, bcidShift=1) )
30  outContainers = ["CaloCellContainer#"+inputFlags.LAr.DT.ET_PlusKey]
31  acc.merge(LArRAWtoSuperCellCfg(inputFlags,name='LArRAWtoSuperCellMinus', mask=inputFlags.LAr.DT.doSCMasking, SCellContainerOut=inputFlags.LAr.DT.ET_MinusKey, bcidShift=-1) )
32  outContainers += ["CaloCellContainer#"+inputFlags.LAr.DT.ET_MinusKey]
33 
34  acc.merge(addToESD(inputFlags,outContainers))
35  acc.merge(addToAOD(inputFlags,outContainers))
36 
37  return acc
38 
39 
40 
41 if __name__=='__main__':
42 
43  from AthenaConfiguration.AllConfigFlags import initConfigFlags
45  from AthenaCommon.Logging import log
46  from AthenaCommon.Constants import DEBUG
47  log.setLevel(DEBUG)
48 
49 
50  #from AthenaConfiguration.TestDefaults import defaultTestFiles
51  #flags.Input.Files = defaultTestFiles.RAW_RUN2
52  flags.Input.Files = ["/eos/home-p/pavol/data/data23_13p6TeV.00452669.express_express.merge.RAW._lb0987._SFO-ALL._0001.1"]
53 
54  flags.LAr.DT.storeET_ID = True
55  flags.LAr.DT.storeET_additional = True
56 
57  flags.lock()
58 
59  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
60  cfg = MainServicesCfg(flags)
61  from CaloRec.CaloRecoConfig import CaloRecoCfg
62  cfg.merge(CaloRecoCfg(flags))
63 
64  acc = LArSuperCellCfg(flags)
65  cfg.merge(acc)
66 
67  from AthenaCommon.SystemOfUnits import GeV
68  from AthenaConfiguration.ComponentFactory import CompFactory
69  cfg.addEventAlgo(CompFactory.CaloCellDumper(InputContainer=flags.LAr.DT.ET_IDKey,EnergyCut=1*GeV),sequenceName="AthAlgSeq")
70 
71  cfg.getService("MessageSvc").OutputLevel=DEBUG
72  cfg.getService("StoreGateSvc").Dump=True
73 
74  cfg.printConfig()
75 
76  flags.dump()
77  f=open("LArSuperCell.pkl","wb")
78  cfg.store(f)
79  f.close()
80 
81  cfg.run(10)
SystemOfUnits
python.CaloRecoConfig.CaloRecoCfg
def CaloRecoCfg(flags, clustersname=None)
Definition: CaloRecoConfig.py:9
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
LArRAWtoSuperCellConfig.LArRAWtoSuperCellCfg
def LArRAWtoSuperCellCfg(flags, name="LArRAWtoSuperCell", mask=True, SCellContainerOut="", SCIn="", doReco=False, bcidShift=0)
Definition: LArRAWtoSuperCellConfig.py:8
python.LArSuperCellConfig.LArSuperCellCfg
def LArSuperCellCfg(inputFlags)
Definition: LArSuperCellConfig.py:5
python.LArRawSCDataReadingConfig.LArRawSCDataReadingCfg
def LArRawSCDataReadingCfg(configFlags, **kwargs)
Definition: LArRawSCDataReadingConfig.py:8
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:252
Constants
some useful constants -------------------------------------------------—
python.OutputStreamConfig.addToESD
def addToESD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:127
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.OutputStreamConfig.addToAOD
def addToAOD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:142