10 from LArCalibProcessing.LArCalibBaseConfig
import LArCalibBaseCfg,chanSelStr
13 from IOVDbSvc.IOVDbSvcConfig
import addFolders
16 if flags.LArCalib.isSC:
17 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBMCSCCfg
21 result.merge(
addFolders(flags,
"/LAR/ElecCalibMC/Shape",detDb=
"LAR_OFL", db=
"OFLP200",tag=
"LARElecCalibMCShapeLArPileupShape-RUN2-2018",className=
"LArShape32MC",modifiers=
"<key>LArShapeMC</key>"))
22 result.merge(
addFolders(flags,
"/LAR/ElecCalibMC/fSampl",detDb=
"LAR_OFL", db=
"OFLP200",tag=
"LARElecCalibMCfSampl-G4101-20371-FTFP_BERT_BIRK_v2",className=
"LArfSamplMC"))
23 result.merge(
addFolders(flags,
"/LAR/ElecCalibMC/MinBias",detDb=
"LAR_OFL", db=
"OFLP200",tag=
"LARElecCalibMCMinBias-mc16-Epos-A3-s3687",className=
"LArMinBiasMC"))
25 result.addCondAlgo(CompFactory.LArMCSymCondAlg())
27 LArShapeSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArShape32MC, LArShape32Sym>")
28 result.addCondAlgo(
LArShapeSymAlg(ReadKey=
"LArShapeMC",WriteKey=
"LArShapeSym"))
30 LArfSamplSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArfSamplMC, LArfSamplSym>")
31 result.addCondAlgo(
LArfSamplSymAlg(ReadKey=
"LArfSampl", WriteKey=
"LArfSamplSym"))
33 LArMinBiasSymAlg = CompFactory.getComp(
"LArSymConditionsAlg<LArMinBiasMC, LArMinBiasSym>")
34 result.addCondAlgo(
LArMinBiasSymAlg(ReadKey=
"LArMinBias",WriteKey=
"LArMinBiasSym"))
36 from LArCalibProcessing.utils
import FolderTagResolver
37 FolderTagResolver._globalTag=flags.IOVDb.GlobalTag
38 if flags.LArCalib.isSC:
39 FolderTagResolver._defaultSuffix=
"-UPD3-00"
40 rs=FolderTagResolver(dbname=
"sqlite://;schema=%s;dbname=CONDBR2"%flags.LArCalib.Input.Database)
41 AutoCorrTag=rs.getFolderTag(flags.LArCalib.AutoCorr.Folder)
44 PedestalTag=rs.getFolderTag(flags.LArCalib.Pedestal.Folder)
45 RampTag=rs.getFolderTag(flags.LArCalib.Ramp.Folder)
46 MpMcTag=rs.getFolderTag(flags.LArCalib.MphysOverMcal.Folder)
47 rsac=FolderTagResolver(dbname=
"COOLOFL_LAR/CONDBR2")
48 PhysAutoCorrTag= rsac.getFolderTag(flags.LArCalib.PhysAutoCorr.Folder)
49 nColl=flags.LArCalib.OFC.Ncoll
50 if (nColl>0
and "mu" not in PhysAutoCorrTag):
52 elems=PhysAutoCorrTag.split(
"-")
53 PhysAutoCorrTag=
"-".
join([elems[0]+
"_mu_%i"%nColl,]+elems[1:])
58 result.merge(
addFolders(flags,flags.LArCalib.AutoCorr.Folder,detDb=flags.LArCalib.Input.Database, tag=AutoCorrTag, modifiers=
chanSelStr(flags)+
"<key>LArAutoCorr</key>",
59 className=
"LArAutoCorrComplete"))
62 result.merge(
addFolders(flags,flags.LArCalib.Pedestal.Folder,detDb=flags.LArCalib.Input.Database, tag=PedestalTag, modifiers=
chanSelStr(flags)+
"<key>LArPedestal</key>",
63 className=
"LArPedestalComplete"))
64 result.merge(
addFolders(flags,flags.LArCalib.Ramp.Folder,detDb=flags.LArCalib.Input.Database, tag=RampTag, modifiers=
chanSelStr(flags),
65 className=
"LArRampComplete"))
66 result.merge(
addFolders(flags,flags.LArCalib.MphysOverMcal.Folder,detDb=flags.LArCalib.Input.Database, tag=MpMcTag, modifiers=
chanSelStr(flags),
67 className=
"LArMphysOverMcalComplete"))
71 if flags.LArCalib.isSC:
72 requiredConditions=[
"DAC2uA",
"HVScaleCorr"]
76 requiredConditions=[
"DAC2uA",
"uA2MeV",
"HVScaleCorr"]
77 if flags.LArCalib.isSC:
78 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBSCCfg
80 mapKey=
"LArOnOffIdMapSC"
81 bcKey =
"LArBadChannelSC"
83 DACKey =
"LArDAC2uASC"
84 HVKey =
"LArHVScaleCorrSC"
86 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBCfg
88 mapKey=
"LArOnOffIdMap"
89 bcKey =
"LArBadChannel"
92 HVKey =
"LArHVScaleCorr"
94 result.addCondAlgo(CompFactory.LArADC2MeVCondAlg(UseFEBGainTresholds=
False,LArOnOffIdMappingKey=mapKey,CompleteDetector=
False,LAruA2MeVKey=uAKey,LArDAC2uAKey=DACKey,LArHVScaleCorrKey=HVKey,isSuperCell=flags.LArCalib.isSC))
96 theLArAutoCorrTotalCondAlg=CompFactory.LArAutoCorrTotalCondAlg()
97 theLArAutoCorrTotalCondAlg.Nsamples=flags.LArCalib.OFC.Nsamples
99 theLArAutoCorrTotalCondAlg.deltaBunch=
int(flags.Beam.BunchSpacing/( 25.*ns)+0.5)
100 theLArAutoCorrTotalCondAlg.isSuperCell=flags.LArCalib.isSC
101 theLArAutoCorrTotalCondAlg.isMC=
False
102 theLArAutoCorrTotalCondAlg.LArAutoCorrObjKey=
"LArAutoCorr"
103 theLArAutoCorrTotalCondAlg.LArAutoCorrTotalObjKey=
"LArPhysAutoCorr"
104 theLArAutoCorrTotalCondAlg.LArOnOffIdMappingObjKey=mapKey
105 theLArAutoCorrTotalCondAlg.LArPedestalObjKey=
"LArPedestal"
106 if flags.LArCalib.isSC:
107 theLArAutoCorrTotalCondAlg.LArShapeObjKey =
"LArShapeSC"
108 theLArAutoCorrTotalCondAlg.LArfSamplObjKey =
"LArfSamplSC"
109 theLArAutoCorrTotalCondAlg.LArMinBiasObjKey =
"LArMinBiasSC"
111 result.addCondAlgo(theLArAutoCorrTotalCondAlg)
113 result.addEventAlgo(CompFactory.LArAutoCorrAlgToDB(GroupingType=flags.LArCalib.GroupingType,
114 NMinbias=nColl,isSC=flags.LArCalib.isSC))
118 rootfile=flags.LArCalib.Output.ROOTFile
120 result.addEventAlgo(CompFactory.LArAutoCorr2Ntuple(ContainerKey=
"LArPhysAutoCorr",OffId=
True,isSC=flags.LArCalib.isSC,
121 BadChanKey=bcKey, AddCalib=
True))
123 if os.path.exists(rootfile):
125 result.addService(CompFactory.NTupleSvc(Output = [
"FILE1 DATAFILE='"+rootfile+
"' OPT='NEW'" ]))
126 result.setAppProperty(
"HistogramPersistency",
"ROOT")
131 from RegistrationServices.OutputConditionsAlgConfig
import OutputConditionsAlgCfg
133 outputFile=flags.LArCalib.Output.POOLFile,
134 ObjectList=[
"LArAutoCorrComplete#LArPhysAutoCorr#"+flags.LArCalib.PhysAutoCorr.Folder,],
135 IOVTagList=[PhysAutoCorrTag,],
136 Run1=flags.LArCalib.IOVStart,
137 Run2=flags.LArCalib.IOVEnd
142 result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders =
False))
143 result.getService(
"IOVDbSvc").DBInstance=
""
147 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
149 RunNumber = flags.LArCalib.Input.RunNumbers[0],
152 InitialTimeStamp = 0,
153 TimeStampInterval = 1))
156 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg