10 def _ofcAlg(flags,postfix,folderSuffix,nPhases,dPhases,nDelays,nColl):
12 LArPhysOFCAlg = CompFactory.LArOFCAlg(
"LArOFCPhysAlg_"+postfix)
13 LArPhysOFCAlg.isSC = flags.LArCalib.isSC
14 LArPhysOFCAlg.ReadCaliWave =
False
15 LArPhysOFCAlg.KeyList = [
"LArPhysWave" ]
16 LArPhysOFCAlg.Normalize = flags.LArCalib.OFC.Normalize
17 LArPhysOFCAlg.Verify =
True
18 LArPhysOFCAlg.GroupingType = flags.LArCalib.GroupingType
19 LArPhysOFCAlg.Nphase = nPhases
20 LArPhysOFCAlg.Dphase = dPhases
21 LArPhysOFCAlg.Ndelay = nDelays
22 LArPhysOFCAlg.Nsample = flags.LArCalib.OFC.Nsamples
23 LArPhysOFCAlg.FillShape =
True
24 LArPhysOFCAlg.TimeShift =
False
25 LArPhysOFCAlg.AddTimeOffset = -1.0*12.0
26 if not flags.LArCalib.isSC:
27 LArPhysOFCAlg.LArPhysWaveBinKey =
"LArPhysWaveShift"
28 LArPhysOFCAlg.UseDelta = flags.LArCalib.OFC.useDelta
29 LArPhysOFCAlg.KeyOFC =
"LArOFC_"+postfix
30 LArPhysOFCAlg.KeyShape =
"LArShape_"+postfix
32 if flags.LArCalib.OFC.Nsamples==4
and not flags.LArCalib.isSC:
33 LArPhysOFCAlg.ReadDSPConfig =
True
34 LArPhysOFCAlg.DSPConfigFolder =
"/LAR/Configuration/DSPConfiguration"
37 LArPhysOFCAlg.DecoderTool = CompFactory.LArAutoCorrDecoderTool(UseAlwaysHighGain=flags.LArCalib.PhysACuseHG,
38 isSC = flags.LArCalib.isSC)
40 result.addEventAlgo(LArPhysOFCAlg)
43 LArPhysOFCAlgMu=deepcopy(LArPhysOFCAlg)
44 LArPhysOFCAlgMu.name=LArPhysOFCAlg.name+
"_mu"
45 LArPhysOFCAlgMu.KeyOFC =
"LArOFC_"+postfix+
"_mu"
46 LArPhysOFCAlg.KeyShape =
"LArShape_"+postfix+
"_mu"
47 LArPhysOFCAlgMu.DecoderTool = CompFactory.LArAutoCorrDecoderTool(DecodeMode=1,
48 UseAlwaysHighGain=flags.LArCalib.PhysACuseHG,
49 isSC = flags.LArCalib.isSC,
50 KeyAutoCorr=
"LArPhysAutoCorr")
51 result.addEventAlgo(LArPhysOFCAlgMu)
54 rootfile=flags.LArCalib.Output.ROOTFile
56 bcKey =
"LArBadChannelSC" if flags.LArCalib.isSC
else "LArBadChannel"
57 OFC2Ntup=CompFactory.LArOFC2Ntuple(
"LArOFC2Ntuple_"+postfix)
58 OFC2Ntup.ContainerKey =
"LArOFC_"+postfix
59 OFC2Ntup.NtupleName =
"OFC_"+postfix
60 OFC2Ntup.AddFEBTempInfo =
False
61 OFC2Ntup.AddCalib =
True
62 OFC2Ntup.isSC = flags.LArCalib.isSC
63 OFC2Ntup.BadChanKey = bcKey
64 result.addEventAlgo(OFC2Ntup)
67 OFC2NtupMu=CompFactory.LArOFC2Ntuple(
"LArOFC2Ntuple_"+postfix+
"_mu")
68 OFC2NtupMu.ContainerKey =
"LArOFC_"+postfix+
"_mu"
69 OFC2NtupMu.NtupleName =
"OFC_"+postfix+
"_mu"
70 OFC2NtupMu.AddFEBTempInfo =
False
71 OFC2NtupMu.AddCalib =
True
72 OFC2NtupMu.isSC = flags.LArCalib.isSC
73 OFC2NtupMu.BadChanKey = bcKey
74 result.addEventAlgo(OFC2NtupMu)
77 Shape2Ntup=CompFactory.LArShape2Ntuple(
"LArShape2Ntuple_"+postfix)
78 Shape2Ntup.ContainerKey=
"LArShape_"+postfix
79 Shape2Ntup.NtupleName=
"SHAPE_"+postfix
80 Shape2Ntup.AddFEBTempInfo =
False
81 Shape2Ntup.AddCalib =
True
82 Shape2Ntup.isSC = flags.LArCalib.isSC
83 Shape2Ntup.BadChanKey = bcKey
84 result.addEventAlgo(Shape2Ntup)
87 objList=[
"LArOFCComplete#LArOFC_"+postfix+
"#"+flags.LArCalib.OFCPhys.Folder+folderSuffix,
88 "LArShapeComplete#LArShape_"+postfix+
"#"+flags.LArCalib.Shape.Folder+folderSuffix]
90 if flags.LArCalib.isSC:
91 FolderTagResolver._defaultSuffix=
"-UPD3-00"
92 rs=FolderTagResolver(dbname=
"sqlite://;schema=%s;dbname=CONDBR2"%flags.LArCalib.Input.Database)
93 OFCTag=rs.getFolderTag(flags.LArCalib.OFCPhys.Folder+folderSuffix)
94 ShapeTag=rs.getFolderTag(flags.LArCalib.Shape.Folder+folderSuffix)
95 tagList=[OFCTag,ShapeTag]
98 objList+=[
"LArOFCComplete#LArOFC_"+postfix+
"_mu#"+flags.LArCalib.OFCPhys.Folder+folderSuffix]
99 tagstr=rs.getFolderTag(flags.LArCalib.OFCPhys.Folder+folderSuffix)
100 tagpref=tagstr[0:tagstr.find(folderSuffix)+len(folderSuffix)]
101 tagpost=tagstr[tagstr.find(folderSuffix)+len(folderSuffix):]
103 OFCTagmu=f
'{tagpref}-mu-{nc}{tagpost}'
104 tagList.append(OFCTagmu)
107 from RegistrationServices.OutputConditionsAlgConfig
import OutputConditionsAlgCfg
109 outputFile=flags.LArCalib.Output.POOLFile,
112 Run1=flags.LArCalib.IOVStart,
113 Run2=flags.LArCalib.IOVEnd