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 10 of file LArCalib_OFCPhysConfig.py.

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

◆ LArOFCPhysCfg()

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

Definition at line 124 of file LArCalib_OFCPhysConfig.py.

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

Variable Documentation

◆ AtlasVersion

python.LArCalib_OFCPhysConfig.AtlasVersion

Definition at line 218 of file LArCalib_OFCPhysConfig.py.

◆ BadChannelDB

python.LArCalib_OFCPhysConfig.BadChannelDB

Definition at line 210 of file LArCalib_OFCPhysConfig.py.

◆ BadChannelTag

python.LArCalib_OFCPhysConfig.BadChannelTag

Definition at line 212 of file LArCalib_OFCPhysConfig.py.

◆ cfg

python.LArCalib_OFCPhysConfig.cfg = MainServicesCfg(ConfigFlags)

Definition at line 225 of file LArCalib_OFCPhysConfig.py.

◆ ConfigFlags

python.LArCalib_OFCPhysConfig.ConfigFlags = initConfigFlags()

Definition at line 202 of file LArCalib_OFCPhysConfig.py.

◆ Database

python.LArCalib_OFCPhysConfig.Database

Definition at line 208 of file LArCalib_OFCPhysConfig.py.

◆ DatabaseInstance

python.LArCalib_OFCPhysConfig.DatabaseInstance

Definition at line 214 of file LArCalib_OFCPhysConfig.py.

◆ DBConnection

python.LArCalib_OFCPhysConfig.DBConnection

Definition at line 215 of file LArCalib_OFCPhysConfig.py.

◆ doAlign

python.LArCalib_OFCPhysConfig.doAlign

Definition at line 220 of file LArCalib_OFCPhysConfig.py.

◆ Files

python.LArCalib_OFCPhysConfig.Files

Definition at line 206 of file LArCalib_OFCPhysConfig.py.

◆ GlobalTag

python.LArCalib_OFCPhysConfig.GlobalTag

Definition at line 216 of file LArCalib_OFCPhysConfig.py.

◆ Ncoll

python.LArCalib_OFCPhysConfig.Ncoll

Definition at line 211 of file LArCalib_OFCPhysConfig.py.

◆ ROOTFile

python.LArCalib_OFCPhysConfig.ROOTFile

Definition at line 213 of file LArCalib_OFCPhysConfig.py.

◆ RunNumbers

python.LArCalib_OFCPhysConfig.RunNumbers

Definition at line 207 of file LArCalib_OFCPhysConfig.py.

◆ SubDet

python.LArCalib_OFCPhysConfig.SubDet

Definition at line 209 of file LArCalib_OFCPhysConfig.py.