12 from AthenaCommon.Logging
import logging
13 mlog_SCD = logging.getLogger(
'LArSCRecoTestSkeleton' )
15 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
18 from LArCafJobs.LArSCDumperFlags
import addSCDumpFlags
20 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
28 flags.Input.Files=runArgs.inputBSFile
29 flags.LArSCDump.outputNtup=runArgs.outputNTUP_SCRecoFile
32 flags.LArSCDump.doGeom=
False
34 flags.LArSCDump.doBC=
True
38 runinfo=
getLArDTInfoForRun(flags.Input.RunNumbers[0], connstring=
"COOLONL_LAR/CONDBR2")
40 mlog_SCD.warning(
"Could not get DT run info, using defaults !")
41 flags.LArSCDump.doEt=
True
42 flags.LArSCDump.nSamples=5
45 flags.LArSCDump.digitsKey=
"SC_ADC_BAS"
47 flags.LArSCDump.digitsKey=
""
48 for i
in range(0,len(runinfo.streamTypes())):
49 if runinfo.streamTypes()[i] ==
"SelectedEnergy":
51 flags.LArSCDump.doEt=
True
52 flags.LArSCDump.nEt=runinfo.streamLengths()[i]
53 elif runinfo.streamTypes()[i] ==
"Energy":
55 flags.LArSCDump.doEt=
True
56 flags.LArSCDump.nEt=runinfo.streamLengths()[i]
57 elif runinfo.streamTypes()[i] ==
"RawADC":
58 flags.LArSCDump.digitsKey=
"SC"
59 flags.LArSCDump.nSamples=runinfo.streamLengths()[i]
60 elif runinfo.streamTypes()[i] ==
"ADC":
61 flags.LArSCDump.digitsKey=
"SC_ADC_BAS"
62 flags.LArSCDump.nSamples=runinfo.streamLengths()[i]
65 flags.LArSCDump.doRawChan=
True
67 print(
"Autoconfigured: ",flags.LArSCDump.nEt, flags.LArSCDump.nSamples)
76 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg, LArOnOffIdMappingSCCfg
80 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBSCCfg
81 cfg.merge(
LArElecCalibDBSCCfg(flags, condObjs=[
"Ramp",
"DAC2uA",
"Pedestal",
"uA2MeV",
"MphysOverMcal",
"OFC",
"Shape",
"HVScaleCorr"]))
83 from TrigConfigSvc.TrigConfigSvcCfg
import BunchGroupCondAlgCfg
87 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
90 if flags.LArSCDump.doBC:
91 from LArBadChannelTool.LArBadChannelConfig
import LArBadChannelCfg
95 from LArByteStream.LArRawDataReadingConfig
import LArRawDataReadingCfg
98 from LArROD.LArRawChannelBuilderAlgConfig
import LArRawChannelBuilderAlgCfg
101 from LArByteStream.LArRawSCDataReadingConfig
import LArRawSCDataReadingCfg
103 SCData_acc.OutputLevel=3
104 cfg.merge(SCData_acc)
106 from AthenaConfiguration.ComponentFactory
import CompFactory
107 larLATOMEBuilderAlg=CompFactory.LArLATOMEBuilderAlg(
"LArLATOMEBuilderAlg",LArDigitKey=flags.LArSCDump.digitsKey, isADCBas=
"BAS" in flags.LArSCDump.digitsKey, nEnergies = flags.LArSCDump.nSamples - 3, startEnergy=runArgs.startSampleShift)
108 cfg.addEventAlgo(larLATOMEBuilderAlg)
110 cfg.addEventAlgo(CompFactory.LArSC2NtupleEB(
"LArSC2NtupleEB", isSC=
True, AddBadChannelInfo=flags.LArSCDump.doBC, BadChanKey=
"LArBadChannelSC",
111 OffId=flags.LArSCDump.doOfflineId, AddHash=flags.LArSCDump.doHash, AddCalib=flags.LArSCDump.doCalib, RealGeometry=flags.LArSCDump.doGeom, ExpandId=flags.LArSCDump.expandId,
112 FillBCID=flags.LArSCDump.doBCID, EnergyContainerKey=SCKey,
113 scNet=flags.LArSCDump.nEt, EnergyCut=runArgs.energyCut,
114 RecoContainerKey=
"SC_ET_RECO", RawChanContainerKey=
"LArRawChannels",
117 if os.path.exists(flags.LArSCDump.outputNtup):
118 os.remove(flags.LArSCDump.outputNtup)
119 cfg.addService(CompFactory.NTupleSvc(Output = [
"FILE1 DATAFILE='"+flags.LArSCDump.outputNtup+
"' OPT='NEW'" ]))
120 cfg.setAppProperty(
"HistogramPersistency",
"ROOT")
132 sys.exit(
not sc.isSuccess())