ATLAS Offline Software
Loading...
Searching...
No Matches
python.LArCalib_PedestalAutoCorrConfig Namespace Reference

Functions

 RawCalibDataReadingCfg (flags, digKey)
 AccCalibDataReadingCfg (flags, digKey)
 LArPedestalAutoCorrCfg (flags)

Variables

 ConfigFlags = initConfigFlags()
 Dir
 Type
 RunNumbers
 Files
 ROOTFile
 POOLFile
 DBConnection
 GlobalTag
 DatabaseInstance
 AtlasVersion
 log = Logging.logging.getLogger( 'Athena' )
 cfg = MainServicesCfg(ConfigFlags)

Function Documentation

◆ AccCalibDataReadingCfg()

python.LArCalib_PedestalAutoCorrConfig.AccCalibDataReadingCfg ( flags,
digKey )

Definition at line 21 of file LArCalib_PedestalAutoCorrConfig.py.

21def AccCalibDataReadingCfg(flags, digKey):
22 result=ComponentAccumulator()
23 result.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArAccDigitKey=digKey,
24 LArFebHeaderKey="LArFebHeader",
25 FailOnCorruption=False,
26 SubCaloPreselection=flags.LArCalib.Input.SubDet,
27 PosNegPreselection=flags.LArCalib.Preselection.Side,
28 BEPreselection=flags.LArCalib.Preselection.BEC,
29 FTNumPreselection=flags.LArCalib.Preselection.FT))
30 return result
31
32

◆ LArPedestalAutoCorrCfg()

python.LArCalib_PedestalAutoCorrConfig.LArPedestalAutoCorrCfg ( flags)

Definition at line 33 of file LArCalib_PedestalAutoCorrConfig.py.

33def LArPedestalAutoCorrCfg(flags):
34
35 #Get basic services and cond-algos
36 from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg
37 result=LArCalibBaseCfg(flags)
38
39 #Add ByteStream reading
40 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
41 result.merge(ByteStreamReadCfg(flags))
42
43
44 #Calibration runs are taken in fixed gain.
45 #The SG key of the digit-container is name of the gain
46 gainStrMap={0:"HIGH",1:"MEDIUM",2:"LOW"}
47
48 if not flags.LArCalib.isSC:
49 digKey=gainStrMap[flags.LArCalib.Gain]
50 if flags.LArCalib.Input.isRawData:
51 result.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArDigitKey=digKey,
52 LArFebHeaderKey="LArFebHeader",
53 FailOnCorruption=False,
54 SubCaloPreselection=flags.LArCalib.Input.SubDet,
55 PosNegPreselection=flags.LArCalib.Preselection.Side,
56 BEPreselection=flags.LArCalib.Preselection.BEC,
57 FTNumPreselection=flags.LArCalib.Preselection.FT))
58
59 result.addEventAlgo(CompFactory.LArDigitsAccumulator("LArDigitsAccumulator", KeyList = [digKey],
60 LArAccuDigitContainerName = "", NTriggersPerStep = 100,
61 isSC = flags.LArCalib.isSC, DropPercentTrig = 0))
62 else:
63 result.merge(AccCalibDataReadingCfg(flags, digKey))
64
65 from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
66 result.merge(LArFebErrorSummaryMakerCfg(flags))
67 result.getEventAlgo("LArFebErrorSummaryMaker").CheckAllFEB=False
68 result.addEventAlgo(CompFactory.LArBadEventCatcher(CheckAccCalibDigitCont=True,
69 CheckBSErrors=True,
70 KeyList=[digKey,],
71 StopOnError=False))
72
73 else:
74 digKey="SC"
75 theLArLATOMEDecoder = CompFactory.LArLATOMEDecoder("LArLATOMEDecoder",
76 IgnoreBarrelChannels = flags.LArCalib.SCIgnoreBarrelChannels,
77 IgnoreEndcapChannels = flags.LArCalib.SCIgnoreEndcapChannels)
78
79 if flags.LArCalib.Input.isRawData:
80 result.addEventAlgo(CompFactory.LArRawSCDataReadingAlg(adcCollKey = digKey, adcBasCollKey = "", etCollKey = "",
81 etIdCollKey = "", LATOMEDecoder = theLArLATOMEDecoder))
82 result.addEventAlgo(CompFactory.LArDigitsAccumulator("LArDigitsAccumulator", KeyList = [digKey],
83 LArAccuDigitContainerName = "", NTriggersPerStep = 100,
84 isSC = flags.LArCalib.isSC, DropPercentTrig = 0))
85 else:
86 # this needs also legacy maps
87 from LArCabling.LArCablingConfig import LArCalibIdMappingCfg,LArOnOffIdMappingCfg,LArCalibIdMappingSCCfg,LArOnOffIdMappingSCCfg
88 result.merge(LArOnOffIdMappingCfg(flags))
89 result.merge(LArCalibIdMappingSCCfg(flags))
90 result.merge(LArOnOffIdMappingSCCfg(flags))
91 result.merge(LArCalibIdMappingCfg(flags))
92
93 result.addEventAlgo(CompFactory.LArRawSCCalibDataReadingAlg(LArSCAccDigitKey = digKey, LATOMEDecoder = theLArLATOMEDecoder))
94
95 LArPedACBuilder=CompFactory.LArPedestalAutoCorrBuilder()
96 LArPedACBuilder.KeyList = [digKey,]
97 LArPedACBuilder.PedestalKey = "Pedestal"
98 LArPedACBuilder.AutoCorrKey = "LArAutoCorr"
99 LArPedACBuilder.GroupingType = flags.LArCalib.GroupingType
100
101 result.addEventAlgo(LArPedACBuilder)
102
103 if flags.LArCalib.isSC:
104 bcKey = "LArBadChannelSC"
105 else:
106 bcKey = "LArBadChannel"
107
108 if flags.LArCalib.CorrectBadChannels:
109 theLArAcorrPatcher=CompFactory.getComp("LArCalibPatchingAlg<LArAutoCorrComplete>")("LArAcorrPatch")
110 theLArAcorrPatcher.ContainerKey = "LArAutoCorr"
111 theLArAcorrPatcher.BadChanKey = bcKey
112 theLArAcorrPatcher.SuperCells = flags.LArCalib.isSC
113 theLArAcorrPatcher.PatchMethod="FEBNeighbor"
115 if flags.LArCalib.isSC:
116 theLArAcorrPatcher.ProblemsToPatch = [ "problematicForUnknownReason","transmissionErrorFibre"]
117 theLArAcorrPatcher.OnOffMap="LArOnOffIdMapSC"
118 theLArAcorrPatcher.CalibLineKey="LArCalibIdMapSC"
119 else:
120 theLArAcorrPatcher.ProblemsToPatch = [ "badAutoCorr", ]
121
122 theLArAcorrPatcher.UseCorrChannels=False
123 result.addEventAlgo(theLArAcorrPatcher)
124 pass
125
126 #ROOT ntuple writing:
127 rootfile=flags.LArCalib.Output.ROOTFile
128 if rootfile != "":
129 result.addEventAlgo(CompFactory.LArPedestals2Ntuple(ContainerKey = "Pedestal",
130 AddFEBTempInfo = False,
131 RealGeometry = True,
132 OffId = True,
133 AddCalib = True,
134 isSC = flags.LArCalib.isSC,
135 BadChanKey = bcKey
136 )
137 )
138
139 result.addEventAlgo(CompFactory.LArAutoCorr2Ntuple(ContainerKey = "LArAutoCorr",
140 AddFEBTempInfo = False, isSC = flags.LArCalib.isSC,
141 BadChanKey = bcKey,
142 OffId=True,
143 ApplyCorrection = True,
144 AddCorrUndo = True,
145 AddCalib = True
146 )
147 )
148
149 import os
150 if os.path.exists(rootfile):
151 os.remove(rootfile)
152 result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
153 result.setAppProperty("HistogramPersistency","ROOT")
154 pass # end if ROOT ntuple writing
155
156
157
158 #Get the current folder tag by interrogating the database:
159 from LArCalibProcessing.utils import FolderTagResolver
160 FolderTagResolver._globalTag=flags.IOVDb.GlobalTag
161 tagResolver=FolderTagResolver()
162 pedestalTag=tagResolver.getFolderTag(flags.LArCalib.Pedestal.Folder)
163 autocorrTag=tagResolver.getFolderTag(flags.LArCalib.AutoCorr.Folder)
164 del tagResolver
165
166
167 #Output (POOL + sqlite) file writing:
168 from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
169 result.merge(OutputConditionsAlgCfg(flags,
170 outputFile=flags.LArCalib.Output.POOLFile,
171 ObjectList=["LArPedestalComplete#Pedestal#"+flags.LArCalib.Pedestal.Folder,
172 "LArAutoCorrComplete#LArAutoCorr#"+flags.LArCalib.AutoCorr.Folder],
173 IOVTagList=[pedestalTag,autocorrTag],
174 Run1=flags.LArCalib.IOVStart,
175 Run2=flags.LArCalib.IOVEnd
176 ))
177
178 #RegistrationSvc
179 result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False))
180
181 #Validation (comparision with reference):
182 if flags.LArCalib.doValidation:
183 from IOVDbSvc.IOVDbSvcConfig import addFolders
184
185 #result.merge(addFolders(flags,"/LAR/ElecCalibOnl/Pedestal<key>PedestalRef</key>","LAR_ONL"))
186 result.merge(addFolders(flags,"/LAR/ElecCalibFlat/Pedestal<key>PedestalRefIn</key>","LAR_ONL","CondAttrListCollection"))
187 LArPedestalCondAlg = CompFactory.getComp("LArFlatConditionsAlg<LArPedestalFlat>")
188 result.addCondAlgo(LArPedestalCondAlg("LArFlatPedCondAlg",ReadKey="PedestalRefIn", WriteKey="PedestalRef"))
189 from LArCalibDataQuality.Thresholds import pedThr,rmsThr, pedThrFEB,rmsThrFEB
190 from AthenaCommon.Constants import ERROR,WARNING
191
192 thePedestalValidationAlg=CompFactory.LArPedestalValidationAlg("PedestalVal")
193 #thePedestalValidationAlg.BadChannelMaskingTool=theLArPedValBCMask
194 thePedestalValidationAlg.UseBadChannelInfo=False
195 thePedestalValidationAlg.ValidationKey="Pedestal"
196 thePedestalValidationAlg.ReferenceKey="PedestalRef"
197 thePedestalValidationAlg.PedestalTolerance=pedThr
198 thePedestalValidationAlg.PedestalRMSTolerance=rmsThr
199 thePedestalValidationAlg.PedestalToleranceFEB=pedThrFEB
200 thePedestalValidationAlg.PedestalRMSToleranceFEB=rmsThrFEB
201 thePedestalValidationAlg.MsgLevelForDeviations=WARNING
202 thePedestalValidationAlg.ListOfDevFEBs="pedFebs.txt"
203 thePedestalValidationAlg.CheckCompletness=True
204 thePedestalValidationAlg.PatchMissingFEBs=True
205 thePedestalValidationAlg.UseCorrChannels=False #Corrections go into the regular data channels
206 if flags.LArCalib.isSC:
207 thePedestalValidationAlg.CablingKey = "LArOnOffIdMapSC"
208 thePedestalValidationAlg.CalibLineKey = "LArCalibIdMapSC"
209 thePedestalValidationAlg.BadChanKey = bcKey
210 result.addEventAlgo(thePedestalValidationAlg)
211
212
213 theBadPedestal=CompFactory.LArPedestalValidationAlg("PedestalFail")
214 #theBadPedestal.BadChannelMaskingTool=theLArPedValBCMask
215 theBadPedestal.UseBadChannelInfo=False
216 theBadPedestal.ValidationKey="Pedestal"
217 theBadPedestal.ReferenceKey="PedestalRef"
218 theBadPedestal.PedestalTolerance = ["10,10,10"]
219 theBadPedestal.PedestalRMSTolerance = ["0.5, 0.5, 0.5"]
220 theBadPedestal.PedestalToleranceFEB = ["8, 8, 8"]
221 theBadPedestal.PedestalRMSToleranceFEB = ["1.2, 1.2, 1.2"]
222
223 theBadPedestal.MsgLevelForDeviations=ERROR
224 theBadPedestal.CheckCompletness=False
225 theBadPedestal.ListOfDevFEBs="Bad_pedFebs.txt"
226 if flags.LArCalib.isSC:
227 theBadPedestal.CablingKey = "LArOnOffIdMapSC"
228 theBadPedestal.CalibLineKey = "LArCalibIdMapSC"
229 theBadPedestal.BadChanKey = bcKey
230 result.addEventAlgo(theBadPedestal)
231
232
233 result.merge(addFolders(flags,"/LAR/ElecCalibOfl/AutoCorrs/AutoCorr<key>LArAutoCorrRef</key>","LAR_OFL"))
234 from LArCalibDataQuality.Thresholds import acThr, acThrFEB
235 theAutoCorrValidationAlg=CompFactory.LArAutoCorrValidationAlg("AutoCorrVal")
236 theAutoCorrValidationAlg.UseBadChannelInfo=False
237 theAutoCorrValidationAlg.ValidationKey="LArAutoCorr"
238 theAutoCorrValidationAlg.ReferenceKey="LArAutoCorrRef"
239 theAutoCorrValidationAlg.AutoCorrTolerance=acThr
240 theAutoCorrValidationAlg.AutoCorrToleranceFEB=acThrFEB
241 theAutoCorrValidationAlg.MsgLevelForDeviations=WARNING
242 theAutoCorrValidationAlg.ListOfDevFEBs="ACFebs.txt"
243 theAutoCorrValidationAlg.CheckCompletness=True
244 theAutoCorrValidationAlg.PatchMissingFEBs=True
245 theAutoCorrValidationAlg.UseCorrChannels=False #Corrections go into the regular data channels
246 if flags.LArCalib.isSC:
247 theAutoCorrValidationAlg.CablingKey = "LArOnOffIdMapSC"
248 theAutoCorrValidationAlg.CalibLineKey = "LArCalibIdMapSC"
249 theAutoCorrValidationAlg.BadChanKey = bcKey
250 result.addEventAlgo(theAutoCorrValidationAlg)
251
252
253 theBadAutoCorr=CompFactory.LArAutoCorrValidationAlg("AutoCorrFail")
254 theBadAutoCorr.UseBadChannelInfo=False
255 theBadAutoCorr.ValidationKey="LArAutoCorr"
256 theBadAutoCorr.ReferenceKey="LArAutoCorrRef"
257 theBadAutoCorr.AutoCorrTolerance = ["0.15, 0.15, 0.15"]
258 theBadAutoCorr.AutoCorrToleranceFEB = ["0.15, 0.15, 0.15"]
259 theBadAutoCorr.MsgLevelForDeviations=ERROR
260 theBadAutoCorr.CheckFifthSample=True
261 theBadAutoCorr.ListOfDevFEBs="Bad_ACFebs.txt"
262 theBadAutoCorr.CheckCompletness=False
263 if flags.LArCalib.isSC:
264 theBadAutoCorr.CablingKey = "LArOnOffIdMapSC"
265 theBadAutoCorr.CalibLineKey = "LArCalibIdMapSC"
266 theBadAutoCorr.BadChanKey = bcKey
267 result.addEventAlgo(theBadAutoCorr)
268
269 result.getService("IOVDbSvc").DBInstance=""
270
271 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
272 result.merge(PerfMonMTSvcCfg(flags))
273
274
275 return result
276
277

◆ RawCalibDataReadingCfg()

python.LArCalib_PedestalAutoCorrConfig.RawCalibDataReadingCfg ( flags,
digKey )

Definition at line 7 of file LArCalib_PedestalAutoCorrConfig.py.

7def RawCalibDataReadingCfg(flags, digKey):
8 result=ComponentAccumulator()
9 result.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArDigitKey=digKey,
10 LArFebHeaderKey="LArFebHeader",
11 FailOnCorruption=False,
12 SubCaloPreselection=flags.LArCalib.Input.SubDet,
13 PosNegPreselection=flags.LArCalib.Preselection.Side,
14 BEPreselection=flags.LArCalib.Preselection.BEC,
15 FTNumPreselection=flags.LArCalib.Preselection.FT))
16 result.addEventAlgo(CompFactory.LArDigitsAccumulator("LArDigitsAccumulator", KeyList = [digKey],
17 LArAccuDigitContainerName = "", NTriggersPerStep = 100,
18 isSC = flags.LArCalib.isSC, DropPercentTrig = 0))
19 return result
20

Variable Documentation

◆ AtlasVersion

python.LArCalib_PedestalAutoCorrConfig.AtlasVersion

Definition at line 300 of file LArCalib_PedestalAutoCorrConfig.py.

◆ cfg

python.LArCalib_PedestalAutoCorrConfig.cfg = MainServicesCfg(ConfigFlags)

Definition at line 311 of file LArCalib_PedestalAutoCorrConfig.py.

◆ ConfigFlags

python.LArCalib_PedestalAutoCorrConfig.ConfigFlags = initConfigFlags()

Definition at line 285 of file LArCalib_PedestalAutoCorrConfig.py.

◆ DatabaseInstance

python.LArCalib_PedestalAutoCorrConfig.DatabaseInstance

Definition at line 299 of file LArCalib_PedestalAutoCorrConfig.py.

◆ DBConnection

python.LArCalib_PedestalAutoCorrConfig.DBConnection

Definition at line 297 of file LArCalib_PedestalAutoCorrConfig.py.

◆ Dir

python.LArCalib_PedestalAutoCorrConfig.Dir

Definition at line 288 of file LArCalib_PedestalAutoCorrConfig.py.

◆ Files

python.LArCalib_PedestalAutoCorrConfig.Files

Definition at line 293 of file LArCalib_PedestalAutoCorrConfig.py.

◆ GlobalTag

python.LArCalib_PedestalAutoCorrConfig.GlobalTag

Definition at line 298 of file LArCalib_PedestalAutoCorrConfig.py.

◆ log

python.LArCalib_PedestalAutoCorrConfig.log = Logging.logging.getLogger( 'Athena' )

Definition at line 306 of file LArCalib_PedestalAutoCorrConfig.py.

◆ POOLFile

python.LArCalib_PedestalAutoCorrConfig.POOLFile

Definition at line 296 of file LArCalib_PedestalAutoCorrConfig.py.

◆ ROOTFile

python.LArCalib_PedestalAutoCorrConfig.ROOTFile

Definition at line 295 of file LArCalib_PedestalAutoCorrConfig.py.

◆ RunNumbers

python.LArCalib_PedestalAutoCorrConfig.RunNumbers

Definition at line 291 of file LArCalib_PedestalAutoCorrConfig.py.

◆ Type

python.LArCalib_PedestalAutoCorrConfig.Type

Definition at line 290 of file LArCalib_PedestalAutoCorrConfig.py.