ATLAS Offline Software
Loading...
Searching...
No Matches
python.LArCalib_OFCPhysConfig Namespace Reference

Functions

 _ofcAlg (flags, postfix, folderSuffix, nPhases, dPhases, nDelays, nColl)
 LArOFCPhysCfg (flags, loadPhysAC=True)

Variables

 ConfigFlags = initConfigFlags()
 Files
 RunNumbers
 Database
 SubDet
 BadChannelDB
 Ncoll
 BadChannelTag
 ROOTFile
 DatabaseInstance
 DBConnection
 GlobalTag
 AtlasVersion
 doAlign
 cfg = MainServicesCfg(ConfigFlags)

Function Documentation

◆ _ofcAlg()

python.LArCalib_OFCPhysConfig._ofcAlg ( flags,
postfix,
folderSuffix,
nPhases,
dPhases,
nDelays,
nColl )
protected

Definition at line 11 of file LArCalib_OFCPhysConfig.py.

11def _ofcAlg(flags,postfix,folderSuffix,nPhases,dPhases,nDelays,nColl):
12 result=ComponentAccumulator()
13 LArPhysOFCAlg = CompFactory.LArOFCAlg("LArOFCPhysAlg_"+postfix)
14 LArPhysOFCAlg.isSC = flags.LArCalib.isSC
15 LArPhysOFCAlg.ReadCaliWave = False
16 LArPhysOFCAlg.KeyList = [ "LArPhysWave" ]
17 LArPhysOFCAlg.Normalize = flags.LArCalib.OFC.Normalize
18 LArPhysOFCAlg.Verify = True
19 LArPhysOFCAlg.GroupingType = flags.LArCalib.GroupingType
20 LArPhysOFCAlg.Nphase = nPhases
21 LArPhysOFCAlg.Dphase = dPhases
22 LArPhysOFCAlg.Ndelay = nDelays
23 LArPhysOFCAlg.Nsample = flags.LArCalib.OFC.Nsamples
24 LArPhysOFCAlg.FillShape = True
25 LArPhysOFCAlg.TimeShift = False
26 LArPhysOFCAlg.AddTimeOffset = -1.0*12.0#TimeShiftGuardRegion
27 if not flags.LArCalib.isSC:
28 LArPhysOFCAlg.LArPhysWaveBinKey = "LArPhysWaveShift"
29 LArPhysOFCAlg.UseDelta = flags.LArCalib.OFC.useDelta
30 LArPhysOFCAlg.KeyOFC = "LArOFC_"+postfix
31 LArPhysOFCAlg.KeyShape = "LArShape_"+postfix
32 LArPhysOFCAlg.ComputeOFCPed = flags.LArCalib.OFC.usePed
33 #FIXME: we have to undertstand why this is needed:
34 if flags.LArCalib.isSC and flags.LArCalib.OFC.usePed:
35 LArPhysOFCAlg.ErrAmplitude = 0.1
36 LArPhysOFCAlg.ErrTime = 1.5
37
38 if flags.LArCalib.OFC.Nsamples==4 and not flags.LArCalib.isSC:
39 LArPhysOFCAlg.ReadDSPConfig = True
40 LArPhysOFCAlg.DSPConfigFolder = "/LAR/Configuration/DSPConfiguration"
41
42
43 LArPhysOFCAlg.DecoderTool = CompFactory.LArAutoCorrDecoderTool(UseAlwaysHighGain=flags.LArCalib.PhysACuseHG,
44 isSC = flags.LArCalib.isSC)
45
46 result.addEventAlgo(LArPhysOFCAlg)
47 if (nColl>0):
48 #create a copy to calculate pile-up OFCs
49 LArPhysOFCAlgMu=deepcopy(LArPhysOFCAlg)
50 LArPhysOFCAlgMu.name=LArPhysOFCAlg.name+"_mu"
51 LArPhysOFCAlgMu.KeyOFC = "LArOFC_"+postfix+"_mu"
52 LArPhysOFCAlg.KeyShape = "LArShape_"+postfix+"_mu"
53 LArPhysOFCAlgMu.DecoderTool = CompFactory.LArAutoCorrDecoderTool(DecodeMode=1,
54 UseAlwaysHighGain=flags.LArCalib.PhysACuseHG,
55 isSC = flags.LArCalib.isSC,
56 KeyAutoCorr="LArPhysAutoCorr")
57 result.addEventAlgo(LArPhysOFCAlgMu)
58
59
60 rootfile=flags.LArCalib.Output.ROOTFile
61 if rootfile != "":
62 bcKey = "LArBadChannelSC" if flags.LArCalib.isSC else "LArBadChannel"
63 OFC2Ntup=CompFactory.LArOFC2Ntuple("LArOFC2Ntuple_"+postfix)
64 OFC2Ntup.ContainerKey = "LArOFC_"+postfix
65 OFC2Ntup.NtupleName = "OFC_"+postfix
66 OFC2Ntup.AddFEBTempInfo = False
67 OFC2Ntup.AddCalib = True
68 OFC2Ntup.isSC = flags.LArCalib.isSC
69 OFC2Ntup.BadChanKey = bcKey
70 result.addEventAlgo(OFC2Ntup)
71
72 if (nColl>0):
73 OFC2NtupMu=CompFactory.LArOFC2Ntuple("LArOFC2Ntuple_"+postfix+"_mu")
74 OFC2NtupMu.ContainerKey = "LArOFC_"+postfix+"_mu"
75 OFC2NtupMu.NtupleName = "OFC_"+postfix+"_mu"
76 OFC2NtupMu.AddFEBTempInfo = False
77 OFC2NtupMu.AddCalib = True
78 OFC2NtupMu.isSC = flags.LArCalib.isSC
79 OFC2NtupMu.BadChanKey = bcKey
80 result.addEventAlgo(OFC2NtupMu)
81
82
83 Shape2Ntup=CompFactory.LArShape2Ntuple("LArShape2Ntuple_"+postfix)
84 Shape2Ntup.ContainerKey="LArShape_"+postfix
85 Shape2Ntup.NtupleName="SHAPE_"+postfix
86 Shape2Ntup.AddFEBTempInfo = False
87 Shape2Ntup.AddCalib = True
88 Shape2Ntup.isSC = flags.LArCalib.isSC
89 Shape2Ntup.BadChanKey = bcKey
90 result.addEventAlgo(Shape2Ntup)
91
92
93 objList=["LArOFCComplete#LArOFC_"+postfix+"#"+flags.LArCalib.OFCPhys.Folder+folderSuffix,
94 "LArShapeComplete#LArShape_"+postfix+"#"+flags.LArCalib.Shape.Folder+folderSuffix]
95
96 if flags.LArCalib.isSC:
97 FolderTagResolver._defaultSuffix="-UPD3-00"
98 rs=FolderTagResolver(dbname="sqlite://;schema=%s;dbname=CONDBR2"%flags.LArCalib.Input.Database)
99 OFCTag=rs.getFolderTag(flags.LArCalib.OFCPhys.Folder+folderSuffix)
100 ShapeTag=rs.getFolderTag(flags.LArCalib.Shape.Folder+folderSuffix)
101 tagList=[OFCTag,ShapeTag]
102
103 if nColl > 0:
104 objList+=["LArOFCComplete#LArOFC_"+postfix+"_mu#"+flags.LArCalib.OFCPhys.Folder+folderSuffix]
105 tagstr=rs.getFolderTag(flags.LArCalib.OFCPhys.Folder+folderSuffix)
106 tagpref=tagstr[0:tagstr.find(folderSuffix)+len(folderSuffix)]
107 tagpost=tagstr[tagstr.find(folderSuffix)+len(folderSuffix):]
108 nc=int(nColl)
109 OFCTagmu=f'{tagpref}-mu-{nc}{tagpost}'
110 tagList.append(OFCTagmu)
111 del rs #Close database
112
113 from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
114 result.merge(OutputConditionsAlgCfg(flags,name="OutCondAlg",
115 outputFile=flags.LArCalib.Output.POOLFile,
116 ObjectList=objList,
117 IOVTagList=tagList,
118 Run1=flags.LArCalib.IOVStart,
119 Run2=flags.LArCalib.IOVEnd
120 ))
121
122 return result
123
124

◆ LArOFCPhysCfg()

python.LArCalib_OFCPhysConfig.LArOFCPhysCfg ( flags,
loadPhysAC = True )

Definition at line 125 of file LArCalib_OFCPhysConfig.py.

125def LArOFCPhysCfg(flags,loadPhysAC=True):
126
127 #Get basic services and cond-algos
128 from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg,chanSelStr
129 result=LArCalibBaseCfg(flags)
130
131 nColl=flags.LArCalib.OFC.Ncoll
132 from LArCalibProcessing.utils import FolderTagResolver
133 FolderTagResolver._globalTag=flags.IOVDb.GlobalTag
134 if flags.LArCalib.isSC:
135 FolderTagResolver._defaultSuffix="-UPD3-00"
136 rs=FolderTagResolver(dbname="sqlite://;schema=%s;dbname=CONDBR2"%flags.LArCalib.Input.Database)
137 PhysWaveTag=rs.getFolderTag(flags.LArCalib.PhysWave.Folder)
138 AutoCorrTag=rs.getFolderTag(flags.LArCalib.AutoCorr.Folder)
139 PhysAutoCorrTag= rs.getFolderTag(flags.LArCalib.PhysAutoCorr.Folder)
140 if (nColl>0 and "mu" not in PhysAutoCorrTag):
141 #Insert mu in tag-name:
142 elems=PhysAutoCorrTag.split("-")
143 PhysAutoCorrTag="-".join([elems[0]+"_mu_%i"%nColl,]+elems[1:])
144 del elems
145
146 PhysCaliTdiffTag=rs.getFolderTag(flags.LArCalib.PhysCaliTdiff.Folder)
147 del rs #Close database
148
149 result.merge(addFolders(flags,flags.LArCalib.PhysWave.Folder,detDb=flags.LArCalib.Input.Database, tag=PhysWaveTag, modifiers=chanSelStr(flags)))
150 result.merge(addFolders(flags,flags.LArCalib.AutoCorr.Folder,detDb=flags.LArCalib.Input.Database, tag=AutoCorrTag, modifiers=chanSelStr(flags)))
151 if loadPhysAC:
152 result.merge(addFolders(flags,flags.LArCalib.PhysAutoCorr.Folder,detDb=flags.LArCalib.Input.Database, tag=PhysAutoCorrTag,modifiers=chanSelStr(flags)))
153
154
155
156 result.merge(addFolders(flags,"/LAR/ElecCalibOfl/OFCBin/PhysWaveShifts","LAR_OFL",tag="LARElecCalibOflOFCBinPhysWaveShifts-UPD3-00"))
157 result.merge(addFolders(flags,"/LAR/Configuration/DSPConfiguration","LAR_ONL"))
158
159 if (flags.LArCalib.OFC.UsePhysCalibTDiff):
160 result.merge(addFolders(flags,flags.LArCalib.PhysCaliTdiff.Folder,detDb="LAR_OFL", db="COMP200", tag=PhysCaliTdiffTag))
161
162
163 if flags.LArCalib.isSC:
164 result.merge(_ofcAlg(flags,"1ns","%isamples"%(flags.LArCalib.OFC.Nsamples),nPhases=50,dPhases=1,nDelays=24,nColl=nColl))
165 else:
166 result.merge(_ofcAlg(flags,"3ns","%isamples3bins17phases"%flags.LArCalib.OFC.Nsamples,nPhases=8,dPhases=3,nDelays=24,nColl=nColl))
167
168 #RegistrationSvc
169 result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False))
170 result.getService("IOVDbSvc").DBInstance=""
171
172 #Ntuple writing
173 rootfile=flags.LArCalib.Output.ROOTFile
174 if rootfile != "":
175 import os
176 if os.path.exists(rootfile):
177 os.remove(rootfile)
178 result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
179 result.setAppProperty("HistogramPersistency","ROOT")
180 pass # end if ROOT ntuple writing
181
182
183 #MC Event selector since we have no input data file
184 from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
185 result.merge(McEventSelectorCfg(flags,
186 RunNumber = flags.LArCalib.Input.RunNumbers[0],
187 EventsPerRun = 1,
188 FirstEvent = 1,
189 InitialTimeStamp = 0,
190 TimeStampInterval = 1))
191
192 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
193 result.merge(PerfMonMTSvcCfg(flags))
194
195 return result
196
197
198

Variable Documentation

◆ AtlasVersion

python.LArCalib_OFCPhysConfig.AtlasVersion

Definition at line 219 of file LArCalib_OFCPhysConfig.py.

◆ BadChannelDB

python.LArCalib_OFCPhysConfig.BadChannelDB

Definition at line 211 of file LArCalib_OFCPhysConfig.py.

◆ BadChannelTag

python.LArCalib_OFCPhysConfig.BadChannelTag

Definition at line 213 of file LArCalib_OFCPhysConfig.py.

◆ cfg

python.LArCalib_OFCPhysConfig.cfg = MainServicesCfg(ConfigFlags)

Definition at line 226 of file LArCalib_OFCPhysConfig.py.

◆ ConfigFlags

python.LArCalib_OFCPhysConfig.ConfigFlags = initConfigFlags()

Definition at line 203 of file LArCalib_OFCPhysConfig.py.

◆ Database

python.LArCalib_OFCPhysConfig.Database

Definition at line 209 of file LArCalib_OFCPhysConfig.py.

◆ DatabaseInstance

python.LArCalib_OFCPhysConfig.DatabaseInstance

Definition at line 215 of file LArCalib_OFCPhysConfig.py.

◆ DBConnection

python.LArCalib_OFCPhysConfig.DBConnection

Definition at line 216 of file LArCalib_OFCPhysConfig.py.

◆ doAlign

python.LArCalib_OFCPhysConfig.doAlign

Definition at line 221 of file LArCalib_OFCPhysConfig.py.

◆ Files

python.LArCalib_OFCPhysConfig.Files

Definition at line 207 of file LArCalib_OFCPhysConfig.py.

◆ GlobalTag

python.LArCalib_OFCPhysConfig.GlobalTag

Definition at line 217 of file LArCalib_OFCPhysConfig.py.

◆ Ncoll

python.LArCalib_OFCPhysConfig.Ncoll

Definition at line 212 of file LArCalib_OFCPhysConfig.py.

◆ ROOTFile

python.LArCalib_OFCPhysConfig.ROOTFile

Definition at line 214 of file LArCalib_OFCPhysConfig.py.

◆ RunNumbers

python.LArCalib_OFCPhysConfig.RunNumbers

Definition at line 208 of file LArCalib_OFCPhysConfig.py.

◆ SubDet

python.LArCalib_OFCPhysConfig.SubDet

Definition at line 210 of file LArCalib_OFCPhysConfig.py.