ATLAS Offline Software
LArRAWtoSuperCellConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg
6 from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArMaskedSCCfg
7 
8 def LArRAWtoSuperCellCfg(flags,name="LArRAWtoSuperCell",mask=True,SCellContainerOut="",SCIn="",doReco=False, bcidShift=0):
9  result=ComponentAccumulator()
10  from AthenaCommon.Logging import logging
11  mlog = logging.getLogger( 'LArRAWtoSuperCellCfg:' )
12  result.merge(LArOnOffIdMappingSCCfg(flags))
13  SCInput=""
14  if (SCIn != ""):
15  SCInput = SCIn
16  elif flags.Input.RunNumbers:
17  from LArConditionsCommon.LArRunFormat import getLArDTInfoForRun
18  runinfo=getLArDTInfoForRun(flags.Input.RunNumbers[0], connstring="COOLONL_LAR/CONDBR2")
19  for i in range(0,len(runinfo.streamTypes())):
20  if runinfo.streamTypes()[i] == "SelectedEnergy":
21  SCInput="SC_ET_ID"
22  else :
23  SCInput=flags.LAr.LATOME.DTInfoForL1
24  if mask :
25  LArBadChannelKey="LArBadChannelSC"
26  else :
27  LArBadChannelKey=""
28  result.merge(LArBadChannelCfg(flags,isSC=True) )
29 
30  if SCellContainerOut=="": SCellContainerOut=flags.LAr.DT.ET_IDKey
31 
32  algo = CompFactory.LArRAWtoSuperCell(name,SCellContainerOut=SCellContainerOut,LArBadChannelKey=LArBadChannelKey,BCIDOffset=bcidShift)
33 
34  if mask and not flags.Input.isMC:
35  # also setup to read OTF masked supercells if running on data
36  result.merge(LArMaskedSCCfg(flags))
37  algo.LArMaskedChannelKey="LArMaskedSC"
38 
39  algo = CompFactory.LArRAWtoSuperCell(name,isReco=doReco,SCellContainerOut=SCellContainerOut,LArBadChannelKey=LArBadChannelKey)
40  if ( SCInput == ""):
41  mlog.info("Not setting SCInput container name")
42  else :
43  mlog.info("Setting SCInput container name to %s",SCInput)
44  algo.SCellContainerIn = SCInput
45 
46  result.addEventAlgo(algo)
47 
48  return result
LArCablingConfig.LArOnOffIdMappingSCCfg
def LArOnOffIdMappingSCCfg(configFlags)
Definition: LArCablingConfig.py:65
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.LArBadChannelConfig.LArBadChannelCfg
def LArBadChannelCfg(configFlags, tag=None, isSC=False)
Definition: LArBadChannelConfig.py:8
python.LArRunFormat.getLArDTInfoForRun
def getLArDTInfoForRun(run, quiet=False, connstring="COOLONL_LAR/CONDBR2")
Definition: LArRunFormat.py:114
LArRunFormat
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.LArBadChannelConfig.LArMaskedSCCfg
def LArMaskedSCCfg(configFlags)
Definition: LArBadChannelConfig.py:59