ATLAS Offline Software
LArCellBuilderConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 LArCellBuilderFromLArRawChannelTool, LArCellMerger, LArCellNoiseMaskingTool=CompFactory.getComps("LArCellBuilderFromLArRawChannelTool","LArCellMerger","LArCellNoiseMaskingTool",)
6 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
7 from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
8 from LArCalibUtils.LArHVScaleConfig import LArHVScaleCfg
9 from LArConfiguration.LArConfigFlags import RawChannelSource
10 
11 def LArCellBuilderCfg(configFlags):
12  result=ComponentAccumulator()
13  result.merge(LArOnOffIdMappingCfg(configFlags))
14  result.merge(LArBadFebCfg(configFlags))
15  theLArCellBuilder = LArCellBuilderFromLArRawChannelTool()
16  theLArCellBuilder.LArCablingKey = "ConditionStore+LArOnOffIdMap"
17  theLArCellBuilder.MissingFebKey = "ConditionStore+LArBadFeb"
18  if configFlags.LAr.RawChannelSource is RawChannelSource.Calculated:
19  theLArCellBuilder.RawChannelsName="LArRawChannels_FromDigits"
20  else:
21  theLArCellBuilder.RawChannelsName = "LArRawChannels"
22  theLArCellBuilder.addDeadOTX = True #Create flag? Requires bad-feb DB access
23  result.setPrivateTools(theLArCellBuilder)
24  return result
25 
26 
27 def LArCellCorrectorCfg(configFlags):
28  result=ComponentAccumulator()
29 
30  correctionTools=[]
31 
32  if configFlags.LAr.RawChannelSource in (RawChannelSource.Both, RawChannelSource.Input) and not configFlags.Input.isMC and not configFlags.Overlay.DataOverlay:
33  theMerger=LArCellMerger(RawChannelsName="LArRawChannels_FromDigits")
34  correctionTools.append(theMerger)
35 
36  if configFlags.LAr.doCellNoiseMasking or configFlags.LAr.doCellSporadicNoiseMasking:
37  result.merge(LArBadChannelCfg(configFlags))
38  theNoiseMasker=LArCellNoiseMaskingTool(qualityCut = 4000)
39  if configFlags.LAr.doCellNoiseMasking:
40  theNoiseMasker.ProblemsToMask=["highNoiseHG","highNoiseMG","highNoiseLG","deadReadout","deadPhys"]
41  pass
42  if configFlags.LAr.doCellSporadicNoiseMasking:
43  theNoiseMasker.SporadicProblemsToMask=["sporadicBurstNoise",]
44  pass
45  correctionTools.append(theNoiseMasker)
46 
47  if configFlags.LAr.doBadFebMasking:
48  if not configFlags.Input.isMC:
49  from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
50  result.merge(LArFebErrorSummaryMakerCfg(configFlags))
51  badFebMask=CompFactory.LArBadFebMaskingTool(noFebErrors=configFlags.Input.isMC)
52 
53  correctionTools.append(badFebMask)
54 
55 
56  result.setPrivateTools(correctionTools)
57  return result
58 
59 
60 def LArHVCellContCorrCfg(configFlags):
62  acc.merge(LArHVScaleCfg(configFlags)) #CondAlgo & co for HVScale Corr
63  LArCellContHVCorrTool=CompFactory.LArCellContHVCorrTool
64  theLArCellHVCorrTool = LArCellContHVCorrTool()
65  acc.setPrivateTools(theLArCellHVCorrTool)
66  return acc
67 
68 def LArDeadOTXCorrCfg(configFlags):
70  acc.merge(LArBadFebCfg(configFlags))
71  from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg
72  acc.merge(LArOnOffIdMappingSCCfg(configFlags))
73  from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg
74  acc.merge(LArBadChannelCfg(configFlags,isSC=True))
75  from LArConditionsCommon.LArRunFormat import getLArDTInfoForRun
76  runinfo=getLArDTInfoForRun(configFlags.Input.RunNumbers[0], connstring="COOLONL_LAR/CONDBR2")
77  SCInput="SC_ET"
78  for i in range(0,len(runinfo.streamTypes())):
79  if runinfo.streamTypes()[i] == "SelectedEnergy":
80  SCInput="SC_ET_ID"
81 
82  #Schedule reading of Super-Cell info from ByteStream
83  from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingCfg
84  acc.merge(LArRawSCDataReadingCfg(configFlags))
85 
86  acc.addCondAlgo(CompFactory.LArDeadOTXCondAlg())
87 
88  deadOTXTool=CompFactory.LArCelldeadOTXTool("LArCelldeadOTXTool", keySC=SCInput)
89  acc.setPrivateTools(deadOTXTool)
90  return acc
91 
92 
93 def LArDeadOTXAlgCfg(configFlags,keySC="SC_ET_ID_RoI"):
95  acc.merge(LArBadFebCfg(configFlags))
96  from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg
97  acc.merge(LArOnOffIdMappingSCCfg(configFlags))
98  from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg
99  acc.merge(LArBadChannelCfg(configFlags,isSC=True))
100 
101  deadOTXAlg=CompFactory.LArCelldeadOTXAlg(name="LArCelldeadOTXAlg",keyMF="LArBadFeb",
102  keyCabling="LArOnOffIdMap", keySCCabling="LArOnOffIdMapSC",
103  keySC=keySC,SCEneCut=0)
104  acc.addEventAlgo(deadOTXAlg)
105  return acc
LArCellBuilderFromLArRawChannelTool
Building LArCell objects from LArRawChannel.
Definition: LArCellBuilderFromLArRawChannelTool.h:54
LArCablingConfig.LArOnOffIdMappingSCCfg
def LArOnOffIdMappingSCCfg(configFlags)
Definition: LArCablingConfig.py:65
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:342
python.LArBadChannelConfig.LArBadFebCfg
def LArBadFebCfg(configFlags, tag=None, dbname=None)
Definition: LArBadChannelConfig.py:43
LArCellNoiseMaskingTool
Definition: LArCellNoiseMaskingTool.h:16
python.LArBadChannelConfig.LArBadChannelCfg
def LArBadChannelCfg(configFlags, tag=None, isSC=False)
Definition: LArBadChannelConfig.py:8
LArCellBuilderConfig.LArDeadOTXAlgCfg
def LArDeadOTXAlgCfg(configFlags, keySC="SC_ET_ID_RoI")
Definition: LArCellBuilderConfig.py:93
python.LArFebErrorSummaryMakerConfig.LArFebErrorSummaryMakerCfg
def LArFebErrorSummaryMakerCfg(flags)
Definition: LArFebErrorSummaryMakerConfig.py:7
LArCellContHVCorrTool
Definition: LArCellContHVCorrTool.h:18
python.LArRunFormat.getLArDTInfoForRun
def getLArDTInfoForRun(run, quiet=False, connstring="COOLONL_LAR/CONDBR2")
Definition: LArRunFormat.py:153
LArRunFormat
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
LArCellBuilderConfig.LArHVCellContCorrCfg
def LArHVCellContCorrCfg(configFlags)
Definition: LArCellBuilderConfig.py:60
LArCellBuilderConfig.LArCellBuilderCfg
def LArCellBuilderCfg(configFlags)
Definition: LArCellBuilderConfig.py:11
LArCellBuilderConfig.LArDeadOTXCorrCfg
def LArDeadOTXCorrCfg(configFlags)
Definition: LArCellBuilderConfig.py:68
LArCellMerger
Replace cells in calo cell container with cells from alternate raw channel container.
Definition: LArCellMerger.h:36
python.LArHVScaleConfig.LArHVScaleCfg
def LArHVScaleCfg(configFlags)
Definition: LArHVScaleConfig.py:8
LArCellBuilderConfig.LArCellCorrectorCfg
def LArCellCorrectorCfg(configFlags)
Definition: LArCellBuilderConfig.py:27
python.LArRawSCDataReadingConfig.LArRawSCDataReadingCfg
def LArRawSCDataReadingCfg(configFlags, ROBList=None, name="LArRawSCDataReadingAlg", **kwargs)
Definition: LArRawSCDataReadingConfig.py:8