2 from AthenaConfiguration.ComponentFactory
import CompFactory
3 from AthenaConfiguration.Enums
import LHCPeriod, ProductionStep
4 from LArRecUtils.LArADC2MeVCondAlgConfig
import LArADC2MeVCondAlgCfg
5 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBCfg
6 from LArRecUtils.LArRecUtilsConfig
import LArOFCCondAlgCfg
7 from LArConfiguration.LArConfigFlags
import RawChannelSource
13 kwargs.setdefault(
"name",
"LArRawChannelBuilder")
14 kwargs.setdefault(
"firstSample", flags.LAr.ROD.FirstSample)
15 obj =
"AthenaAttributeList"
16 dspkey =
'Run2DSPThresholdsKey'
17 from IOVDbSvc.IOVDbSvcConfig
import addFolders
21 kwargs.setdefault(
"LArRawChannelKey",
"LArRawChannels")
22 kwargs.setdefault(
"ShapeKey",
"LArShapeSym")
23 if flags.GeoModel.Run
is LHCPeriod.Run1:
24 kwargs.setdefault(
"useDB",
False)
27 fld=
"/LAR/NoiseOfl/DSPThresholds"
31 acc.merge(
addFolders(flags,fld, dbInstance, className=obj, db=dbString))
33 if flags.Common.ProductionStep
is ProductionStep.PileUpPresampling:
34 kwargs.setdefault(
"LArDigitKey", flags.Overlay.BkgPrefix +
"LArDigitContainer_MC")
36 kwargs.setdefault(
"LArDigitKey",
"LArDigitContainer_MC")
39 if flags.Overlay.DataOverlay:
40 kwargs.setdefault(
"LArDigitKey",
"LArDigitContainer_MC")
41 kwargs.setdefault(
"LArRawChannelKey",
"LArRawChannels")
43 kwargs.setdefault(
"LArRawChannelKey",
"LArRawChannels_FromDigits")
44 if 'COMP200' in flags.IOVDb.DatabaseInstance:
45 fld=
'/LAR/Configuration/DSPThreshold/Thresholds'
46 obj=
'LArDSPThresholdsComplete'
47 dspkey =
'Run1DSPThresholdsKey'
48 sgkey=
'LArDSPThresholds'
51 fld=
"/LAR/Configuration/DSPThresholdFlat/Thresholds"
55 acc.merge(
addFolders(flags,fld, dbInstance, className=obj, db=dbString))
57 kwargs.setdefault(dspkey, sgkey)
59 if flags.LAr.ROD.forceIter
or flags.LAr.RawChannelSource
is RawChannelSource.Calculated:
61 kwargs.setdefault(
'minSample',2)
62 kwargs.setdefault(
'maxSample',12)
63 kwargs.setdefault(
'minADCforIterInSigma',4)
64 kwargs.setdefault(
'minADCforIter',15)
65 kwargs.setdefault(
'defaultPhase',12)
68 larformat=
getLArFormatForRun(flags.Input.RunNumbers[0],connstring=
"COOLONL_LAR/"+flags.IOVDb.DatabaseInstance)
69 if larformat
is not None:
70 nominalPeakSample = larformat.firstSample()
72 print(
"WARNING: larformat not found, use nominalPeakSample = 2")
74 if (nominalPeakSample > 1) :
75 kwargs.setdefault(
'DefaultShiftTimeSample',nominalPeakSample-2)
77 kwargs.setdefault(
'DefaultShiftTimeSample',0)
79 acc.addEventAlgo(CompFactory.LArRawChannelBuilderIterAlg(**kwargs))
82 acc.addEventAlgo(CompFactory.LArRawChannelBuilderAlg(**kwargs))
87 if __name__==
"__main__":
89 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
90 from AthenaCommon.Logging
import log
94 from AthenaConfiguration.TestDefaults
import defaultTestFiles,defaultGeometryTags
96 flags.Input.Files = defaultTestFiles.RAW_RUN2
97 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
100 flags.Input.isMC =
False
101 flags.Detector.GeometryTile =
False
105 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
106 from LArByteStream.LArRawDataReadingConfig
import LArRawDataReadingCfg
112 DumpLArRawChannels=CompFactory.DumpLArRawChannels
113 acc.addEventAlgo(
DumpLArRawChannels(LArRawChannelContainerName=
"LArRawChannels_FromDigits",),sequenceName=
"AthAlgSeq")
114 acc.getService(
"IOVDbSvc").GlobalTag=
"CREST-RUN12-SDR-25-MC"
115 acc.getService(
"IOVDbSvc").Source=
"CREST"
116 acc.getService(
"IOVDbSvc").OutputLevel=DEBUG
117 acc.getService(
"IOVDbSvc").DBInstance=
""
118 acc.getService(
"IOVDbSvc").crestServer=
"http://crest-03.cern.ch:8090"