8def LArR4ElecCalibCalcCfg(flags):
9
10 result=ComponentAccumulator()
11
12 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
13 result.merge(LArGMCfg(flags))
14 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
15 result.merge(LArOnOffIdMappingCfg(flags))
16
17
18 from LArRecUtils.LArRecUtilsConfig import LArMCSymCondAlgCfg
19 result.merge (LArMCSymCondAlgCfg (flags))
20
21 from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBCfg
22 result.merge(LArElecCalibDBCfg(flags,["DAC2uA","uA2MeV"]))
23
24
25 theLArElecCalibCalculator = CompFactory.LArR4ElecCalibCalculator(OutputLevel=1)
26
27 result.addEventAlgo(theLArElecCalibCalculator)
28
29 theLArCompleteToFlat = CompFactory.LArCompleteToFlat(FolderBase="/LAR/ElecCalibMC",
30 nGains=2,
31 PedestalInput="Pedestal",
32 RampInput="RampSym",
33 NoiseInput="LArNoiseSym")
34
35 result.addEventAlgo(theLArCompleteToFlat)
36
37
38 from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
39 result.merge(OutputConditionsAlgCfg(flags,
40 CrestDir="./crestOut",
41 ObjectList=["CondAttrListCollection#/LAR/ElecCalibMC/Ramp#/LAR/ElecCalibMC/Ramp",
42 "CondAttrListCollection#/LAR/ElecCalibMC/Pedestal#/LAR/ElecCalibMC/Pedestal",
43 "CondAttrListCollection#/LAR/ElecCalibMC/Noise#/LAR/ElecCalibMC/Noise"],
44 IOVTagList=["LARElecCalibMCRamp-R4-00",
45 "LARElecCalibMCPedestal-R4-00",
46 "LARElecCalibMCNoise-R4-00"],
47 Run1=flags.LArCalib.IOVStart,
48 Run2=flags.LArCalib.IOVEnd
49 ))
50
51
52
53
54
55
56
57
58
59 rootfile=flags.LArCalib.Output.ROOTFile
60
61 if rootfile != "":
62 result.addEventAlgo(CompFactory.LArNoise2Ntuple(ContainerKey="LArNoiseSym",
63 nGains=2,
64 AddFEBTempInfo = False,
65 RealGeometry = False,
66 OffId = True,
67 BadChanKey = "",
68 ))
69
70
71 result.addEventAlgo(CompFactory.LArRamps2Ntuple( RampKey="LArRampSym",
72 nGains=2,
73 ContainerKey = [],
74 AddFEBTempInfo = False,
75 RealGeometry = False,
76 OffId = True,
77 AddCalib = False,
78 RawRamp = False,
79 SaveAllSamples = False,
80 BadChanKey = "",
81 ApplyCorr=False,
82 ))
83 import os
84 if os.path.exists(rootfile):
85 os.remove(rootfile)
86 result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
87 result.setAppProperty("HistogramPersistency","ROOT")
88 pass
89
90
91 from LArRecUtils.LArADC2MeVCondAlgConfig import LArADC2MeVCondAlgCfg
92 result.merge(LArADC2MeVCondAlgCfg(flags))
93 result.getCondAlgo("LArADC2MeVCondAlg").OutputLevel=2
94 result.addEventAlgo(CompFactory.LArADC2MeV2Ntuple( OffId=True,
95 AddBadChannelInfo=False,
96 nGains=2,
97 ))
98
99
100 result.addEventAlgo(CompFactory.LAruA2MeV2Ntuple(uA2MeVKey="LAruA2MeVSym",
101 DAC2uAKey="LArDAC2uASym",
102 isSC = False,
103 OffId=True,
104 nGains=2,
105 AddBadChannelInfo=False
106 ))
107
108
109
110 from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
111 result.merge(McEventSelectorCfg(flags,
112 RunNumber = 500000,
113 EventsPerRun = 1,
114 FirstEvent = 1,
115 InitialTimeStamp = 0,
116 TimeStampInterval = 1))
117
118 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
119 result.merge(PerfMonMTSvcCfg(flags))
120
121 return result
122
123