ATLAS Offline Software
Loading...
Searching...
No Matches
LArReadCellsConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5
6def LArReadCellsCfg(flags):
7
8 result=ComponentAccumulator()
9
10 #setup Calo reco
11 from CaloRec.CaloRecoConfig import CaloRecoCfg
12 result.merge(CaloRecoCfg(flags))
13 result.getEventAlgo("LArRawChannelBuilder").TimingContainerKey="LArOFIterResult"
14
15 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1TriggerByteStreamDecoderCfg
16 result.merge(L1TriggerByteStreamDecoderCfg(flags))
17
18 from LArCafJobs.LArSCDumperSkeleton import L1CaloMenuCfg
19 result.merge(L1CaloMenuCfg(flags))
20
21 from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
22 result.merge(BunchCrossingCondAlgCfg(flags))
23
24 from IOVDbSvc.IOVDbSvcConfig import addFolders
25 result.merge(addFolders(flags,
26 '/LAR/ElecCalibOfl/Shape/RTM/4samples3bins17phases<tag>LARElecCalibOflShapeRTM4samples3bins17phases-RUN2-UPD3-00</tag><key>LArShape17phases</key>',
27 'LAR_OFL'))
28
29 result.getService("PoolSvc").ReadCatalog += ["apcfile:poolcond/PoolCat_comcond_castor.xml"]
30
31 result.merge(addFolders(flags,'/LAR/ElecCalibOfl/AutoCorrs/AutoCorr<tag>LARElecCalibOflAutoCorrsAutoCorr-RUN2-UPD3-00</tag>','LAR_OFL'))
32 result.getService("IOVDbSvc").overrideTags+=['<prefix>/LAR/ElecCalibOfl/Shape/RTM/5samples1phase</prefix><tag>LARElecCalibOflShapeRTM5samples1phase-RUN2-UPD1-04</tag>']
33 # for splashes: FIXME later
34 result.getService("IOVDbSvc").overrideTags+=['<prefix>/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples3bins17phases</prefix><tag>LARElecCalibOflOFCPhysWaveRTM4samples3bins17phases-RUN2-UPD3-00</tag>']
35 result.getService("IOVDbSvc").overrideTags+=['<prefix>/LAR/ElecCalibOfl/Shape/RTM/4samples3bins17phases</prefix><tag>LARElecCalibOflShapeRTM4samples3bins17phases-RUN2-UPD3-00</tag>']
36
37 print("Dumping flags: ")
38 flags.dump()
39 dumperAlg=CompFactory.LArReadCells("LArReadCells")
40 dumperAlg.output = flags.LArShapeDump.outputNtup
41 dumperAlg.etCut = -1500.
42 dumperAlg.etCut2 = -1500.
43
44 result.addEventAlgo(dumperAlg)
45
46 return result
47
48def LArReadSCCfg(flags):
49
50 result=ComponentAccumulator()
51 from AthenaCommon.Logging import logging
52 mlog = logging.getLogger( 'LArReadSCCfg' )
53
54 #setup SC reading
55 from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg
56 result.merge(LArOnOffIdMappingSCCfg(flags))
57 from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingCfg
58 result.merge(LArRawSCDataReadingCfg(flags))
59 result.addCondAlgo(CompFactory.CaloSuperCellAlignCondAlg('CaloSuperCellAlignCondAlg'))
60 from LArCellRec.LArRAWtoSuperCellConfig import LArRAWtoSuperCellCfg
61 result.merge(LArRAWtoSuperCellCfg(flags,mask=True, SCellContainerOut="SCell") )
62
63 from LArCafJobs.LArSCDumperSkeleton import L1CaloMenuCfg
64 result.merge(L1CaloMenuCfg(flags))
65
66 from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
67 result.merge(BunchCrossingCondAlgCfg(flags))
68
69 from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBSCCfg
70 result.merge(LArElecCalibDBSCCfg(flags, condObjs=["Pedestal"]))
71
72 #setup SC reco
73 if flags.LArShapeDump.doSCReco:
74 # and elec. calib. coeffs
75 result.merge(LArElecCalibDBSCCfg(flags, condObjs=["Ramp","DAC2uA", "uA2MeV", "MphysOverMcal", "OFC", "Shape", "HVScaleCorr"]))
76 larLATOMEBuilderAlg=CompFactory.LArLATOMEBuilderAlg("LArLATOMEBuilderAlg")
77
78 dumperAlg=CompFactory.LArReadSC("LArReadSC")
79
80 from LArConditionsCommon.LArRunFormat import getLArDTInfoForRun
81 try:
82 runinfo=getLArDTInfoForRun(flags.Input.RunNumbers[0], connstring="COOLONL_LAR/CONDBR2")
83 streamTypes=runinfo.streamTypes()
84 except Exception as e:
85 mlog.warning("Could not get DT run info, using defaults !")
86 mlog.warning(e)
87 streamTypes=["RawADC"]
88
89 for i in range(0,len(streamTypes)):
90 if streamTypes[i] == "RawADC":
91 dumperAlg.DigitsKey = "SC"
92 if flags.LArShapeDump.doSCReco:
93 larLATOMEBuilderAlg.LArDigitKey = "SC"
94 larLATOMEBuilderAlg.isADCBas = False
95 if streamTypes[i] == "ADC":
96 if flags.LArShapeDump.doSCReco:
97 larLATOMEBuilderAlg.isADCBas = True
98 larLATOMEBuilderAlg.LArDigitKey = "SC_ADC_BAS"
99 dumperAlg.DigitsKey = "SC_ADC_BAS"
100
101 if flags.LArShapeDump.doSCReco:
102 result.addEventAlgo(larLATOMEBuilderAlg)
103 result.merge(LArRAWtoSuperCellCfg(flags,name="LArRAWRecotoSuperCell",mask=True,doReco=True,SCIn="SC_ET_RECO",SCellContainerOut="SCell_RECO") )
104
105 dumperAlg.output = flags.LArShapeDump.outputNtup
106 dumperAlg.SCContainerKey = "SCell"
107 if flags.LArShapeDump.doSCReco:
108 dumperAlg.SCRecoContainerKey = "SCell_RECO"
109 dumperAlg.etCut = -1500.
110
111 result.addEventAlgo(dumperAlg)
112
113 return result
114
115
116if __name__=="__main__":
117
118 from AthenaConfiguration.AllConfigFlags import initConfigFlags
119 flags=initConfigFlags()
120 from LArShapeDumperFlags import addShapeDumpFlags
121 addShapeDumpFlags(flags)
122
123 from AthenaConfiguration.TestDefaults import defaultTestFiles
124 flags.Input.Files=defaultTestFiles.RAW_RUN2
125 flags.LAr.ROD.forceIter=True
126 flags.LArShapeDump.outputNtup="SPLASH"
127 flags.lock()
128
129 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
130
131 cfg=MainServicesCfg(flags)
132 cfg.addService(CompFactory.THistSvc(Output=["SPLASH DATAFILE='ntuple.root' OPT='RECREATE'",]))
133 cfg.merge(LArReadCellsCfg(flags))
134
135
136 cfg.run(10)
void print(char *figname, TCanvas *c1)