7def LArADC2MeVCondAlgCfg(flags):
8 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
9 from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBCfg
10 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
11
12 result=ComponentAccumulator()
13 result.merge(LArOnOffIdMappingCfg(flags))
14 result.merge(LArGMCfg(flags))
15
16 theADC2MeVCondAlg=CompFactory.LArADC2MeVCondAlg(LArADC2MeVKey = 'LArADC2MeV')
17
18 theADC2MeVCondAlg.NGains= 2 if flags.GeoModel.Run==LHCPeriod.Run4 and flags.IOVDb.UseCREST else 3
19
20 if flags.Input.isMC:
21 requiredConditions=["Ramp","DAC2uA","uA2MeV","MphysOverMcal","HVScaleCorr"]
22 theADC2MeVCondAlg.LAruA2MeVKey="LAruA2MeVSym"
23 theADC2MeVCondAlg.LArDAC2uAKey="LArDAC2uASym"
24 theADC2MeVCondAlg.LArRampKey="LArRampSym"
25 theADC2MeVCondAlg.LArMphysOverMcalKey="LArMphysOverMcalSym"
26 theADC2MeVCondAlg.LArHVScaleCorrKey="LArHVScaleCorr"
27 theADC2MeVCondAlg.UseFEBGainTresholds=False
28 else:
29 requiredConditions=["Ramp","DAC2uA","uA2MeV","MphysOverMcal","HVScaleCorr"]
30 from LArRecUtils.LArFebConfigCondAlgConfig import LArFebConfigCondAlgCfg
31 if 'COMP200' in flags.IOVDb.DatabaseInstance:
32 theADC2MeVCondAlg.LAruA2MeVKey="LAruA2MeVSym"
33 theADC2MeVCondAlg.LArDAC2uAKey="LArDAC2uASym"
34 result.merge(LArFebConfigCondAlgCfg(flags))
35
36 result.merge(LArElecCalibDBCfg(flags,requiredConditions))
37 result.addCondAlgo(theADC2MeVCondAlg,primary=True)
38 return result
39
40