ATLAS Offline Software
Functions | Variables
python.LArCalib_PedestalAutoCorrConfig Namespace Reference

Functions

def RawCalibDataReadingCfg (flags, digKey)
 
def AccCalibDataReadingCfg (flags, digKey)
 
def 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()

def python.LArCalib_PedestalAutoCorrConfig.AccCalibDataReadingCfg (   flags,
  digKey 
)

Definition at line 20 of file LArCalib_PedestalAutoCorrConfig.py.

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

◆ LArPedestalAutoCorrCfg()

def python.LArCalib_PedestalAutoCorrConfig.LArPedestalAutoCorrCfg (   flags)

Definition at line 32 of file LArCalib_PedestalAutoCorrConfig.py.

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

◆ RawCalibDataReadingCfg()

def python.LArCalib_PedestalAutoCorrConfig.RawCalibDataReadingCfg (   flags,
  digKey 
)

Definition at line 6 of file LArCalib_PedestalAutoCorrConfig.py.

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

Variable Documentation

◆ AtlasVersion

python.LArCalib_PedestalAutoCorrConfig.AtlasVersion

Definition at line 299 of file LArCalib_PedestalAutoCorrConfig.py.

◆ cfg

python.LArCalib_PedestalAutoCorrConfig.cfg = MainServicesCfg(ConfigFlags)

Definition at line 310 of file LArCalib_PedestalAutoCorrConfig.py.

◆ ConfigFlags

python.LArCalib_PedestalAutoCorrConfig.ConfigFlags = initConfigFlags()

Definition at line 284 of file LArCalib_PedestalAutoCorrConfig.py.

◆ DatabaseInstance

python.LArCalib_PedestalAutoCorrConfig.DatabaseInstance

Definition at line 298 of file LArCalib_PedestalAutoCorrConfig.py.

◆ DBConnection

python.LArCalib_PedestalAutoCorrConfig.DBConnection

Definition at line 296 of file LArCalib_PedestalAutoCorrConfig.py.

◆ Dir

python.LArCalib_PedestalAutoCorrConfig.Dir

Definition at line 287 of file LArCalib_PedestalAutoCorrConfig.py.

◆ Files

python.LArCalib_PedestalAutoCorrConfig.Files

Definition at line 292 of file LArCalib_PedestalAutoCorrConfig.py.

◆ GlobalTag

python.LArCalib_PedestalAutoCorrConfig.GlobalTag

Definition at line 297 of file LArCalib_PedestalAutoCorrConfig.py.

◆ log

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

Definition at line 305 of file LArCalib_PedestalAutoCorrConfig.py.

◆ POOLFile

python.LArCalib_PedestalAutoCorrConfig.POOLFile

Definition at line 295 of file LArCalib_PedestalAutoCorrConfig.py.

◆ ROOTFile

python.LArCalib_PedestalAutoCorrConfig.ROOTFile

Definition at line 294 of file LArCalib_PedestalAutoCorrConfig.py.

◆ RunNumbers

python.LArCalib_PedestalAutoCorrConfig.RunNumbers

Definition at line 290 of file LArCalib_PedestalAutoCorrConfig.py.

◆ Type

python.LArCalib_PedestalAutoCorrConfig.Type

Definition at line 289 of file LArCalib_PedestalAutoCorrConfig.py.

LArCablingConfig.LArOnOffIdMappingSCCfg
def LArOnOffIdMappingSCCfg(configFlags)
Definition: LArCablingConfig.py:65
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.LArElecCalibDBConfig.LArPedestalCondAlg
LArPedestalCondAlg
Definition: LArElecCalibDBConfig.py:26
OutputConditionsAlgConfig.OutputConditionsAlgCfg
def OutputConditionsAlgCfg(flags, name="OutputConditionsAlg", outputFile='condobjs.root', **kwargs)
Definition: OutputConditionsAlgConfig.py:5
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
python.PerfMonCompsConfig.PerfMonMTSvcCfg
def PerfMonMTSvcCfg(flags, **kwargs)
A minimal new-style configuration for PerfMonMTSvc.
Definition: PerfMonCompsConfig.py:10
python.LArFebErrorSummaryMakerConfig.LArFebErrorSummaryMakerCfg
def LArFebErrorSummaryMakerCfg(flags)
Definition: LArFebErrorSummaryMakerConfig.py:7
Constants
some useful constants -------------------------------------------------—
python.LArCalib_PedestalAutoCorrConfig.LArPedestalAutoCorrCfg
def LArPedestalAutoCorrCfg(flags)
Definition: LArCalib_PedestalAutoCorrConfig.py:32
python.LArCalib_PedestalAutoCorrConfig.RawCalibDataReadingCfg
def RawCalibDataReadingCfg(flags, digKey)
Definition: LArCalib_PedestalAutoCorrConfig.py:6
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
python.LArCalibBaseConfig.LArCalibBaseCfg
def LArCalibBaseCfg(flags)
Definition: LArCalibBaseConfig.py:5
LArCablingConfig.LArCalibIdMappingSCCfg
def LArCalibIdMappingSCCfg(configFlags)
Definition: LArCablingConfig.py:86
python.LArCalib_PedestalAutoCorrConfig.AccCalibDataReadingCfg
def AccCalibDataReadingCfg(flags, digKey)
Definition: LArCalib_PedestalAutoCorrConfig.py:20
LArCablingConfig.LArCalibIdMappingCfg
def LArCalibIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:83