ATLAS Offline Software
Loading...
Searching...
No Matches
LArCellBuilderConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5LArCellBuilderFromLArRawChannelTool, LArCellMerger, LArCellNoiseMaskingTool=CompFactory.getComps("LArCellBuilderFromLArRawChannelTool","LArCellMerger","LArCellNoiseMaskingTool",)
6from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
7from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
8from LArCalibUtils.LArHVScaleConfig import LArHVScaleCfg
9from LArConfiguration.LArConfigFlags import RawChannelSource
10
11def 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
27def 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
60def LArHVCellContCorrCfg(configFlags):
61 acc=ComponentAccumulator()
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
68def LArDeadOTXCorrCfg(configFlags):
69 acc=ComponentAccumulator()
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
93def LArDeadOTXAlgCfg(configFlags,keySC="SC_ET_ID_RoI"):
94 acc=ComponentAccumulator()
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
Building LArCell objects from LArRawChannel.
Replace cells in calo cell container with cells from alternate raw channel container.
LArDeadOTXAlgCfg(configFlags, keySC="SC_ET_ID_RoI")