ATLAS Offline Software
Functions | Variables
python.LArCalib_OFCPhysConfig Namespace Reference

Functions

def _ofcAlg (flags, postfix, folderSuffix, nPhases, dPhases, nDelays, nColl)
 
def 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()

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

Definition at line 10 of file LArCalib_OFCPhysConfig.py.

10 def _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 
32  if flags.LArCalib.OFC.Nsamples==4 and not flags.LArCalib.isSC:
33  LArPhysOFCAlg.ReadDSPConfig = True
34  LArPhysOFCAlg.DSPConfigFolder = "/LAR/Configuration/DSPConfiguration"
35 
36 
37  LArPhysOFCAlg.DecoderTool = CompFactory.LArAutoCorrDecoderTool(UseAlwaysHighGain=flags.LArCalib.PhysACuseHG,
38  isSC = flags.LArCalib.isSC)
39 
40  result.addEventAlgo(LArPhysOFCAlg)
41  if (nColl>0):
42  #create a copy to calculate pile-up OFCs
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)
52 
53 
54  rootfile=flags.LArCalib.Output.ROOTFile
55  if 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)
65 
66  if (nColl>0):
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)
75 
76 
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)
85 
86 
87  objList=["LArOFCComplete#LArOFC_"+postfix+"#"+flags.LArCalib.OFCPhys.Folder+folderSuffix,
88  "LArShapeComplete#LArShape_"+postfix+"#"+flags.LArCalib.Shape.Folder+folderSuffix]
89 
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]
96 
97  if nColl > 0:
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):]
102  nc=int(nColl)
103  OFCTagmu=f'{tagpref}-mu-{nc}{tagpost}'
104  tagList.append(OFCTagmu)
105  del rs #Close database
106 
107  from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
108  result.merge(OutputConditionsAlgCfg(flags,name="OutCondAlg",
109  outputFile=flags.LArCalib.Output.POOLFile,
110  ObjectList=objList,
111  IOVTagList=tagList,
112  Run1=flags.LArCalib.IOVStart,
113  Run2=flags.LArCalib.IOVEnd
114  ))
115 
116  return result
117 
118 

◆ LArOFCPhysCfg()

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

Definition at line 119 of file LArCalib_OFCPhysConfig.py.

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

Variable Documentation

◆ AtlasVersion

python.LArCalib_OFCPhysConfig.AtlasVersion

Definition at line 213 of file LArCalib_OFCPhysConfig.py.

◆ BadChannelDB

python.LArCalib_OFCPhysConfig.BadChannelDB

Definition at line 205 of file LArCalib_OFCPhysConfig.py.

◆ BadChannelTag

python.LArCalib_OFCPhysConfig.BadChannelTag

Definition at line 207 of file LArCalib_OFCPhysConfig.py.

◆ cfg

python.LArCalib_OFCPhysConfig.cfg = MainServicesCfg(ConfigFlags)

Definition at line 220 of file LArCalib_OFCPhysConfig.py.

◆ ConfigFlags

python.LArCalib_OFCPhysConfig.ConfigFlags = initConfigFlags()

Definition at line 197 of file LArCalib_OFCPhysConfig.py.

◆ Database

python.LArCalib_OFCPhysConfig.Database

Definition at line 203 of file LArCalib_OFCPhysConfig.py.

◆ DatabaseInstance

python.LArCalib_OFCPhysConfig.DatabaseInstance

Definition at line 209 of file LArCalib_OFCPhysConfig.py.

◆ DBConnection

python.LArCalib_OFCPhysConfig.DBConnection

Definition at line 210 of file LArCalib_OFCPhysConfig.py.

◆ doAlign

python.LArCalib_OFCPhysConfig.doAlign

Definition at line 215 of file LArCalib_OFCPhysConfig.py.

◆ Files

python.LArCalib_OFCPhysConfig.Files

Definition at line 201 of file LArCalib_OFCPhysConfig.py.

◆ GlobalTag

python.LArCalib_OFCPhysConfig.GlobalTag

Definition at line 211 of file LArCalib_OFCPhysConfig.py.

◆ Ncoll

python.LArCalib_OFCPhysConfig.Ncoll

Definition at line 206 of file LArCalib_OFCPhysConfig.py.

◆ ROOTFile

python.LArCalib_OFCPhysConfig.ROOTFile

Definition at line 208 of file LArCalib_OFCPhysConfig.py.

◆ RunNumbers

python.LArCalib_OFCPhysConfig.RunNumbers

Definition at line 202 of file LArCalib_OFCPhysConfig.py.

◆ SubDet

python.LArCalib_OFCPhysConfig.SubDet

Definition at line 204 of file LArCalib_OFCPhysConfig.py.

python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
OutputConditionsAlgConfig.OutputConditionsAlgCfg
def OutputConditionsAlgCfg(flags, name="OutputConditionsAlg", outputFile='condobjs.root', **kwargs)
Definition: OutputConditionsAlgConfig.py:5
python.LArCalib_OFCPhysConfig._ofcAlg
def _ofcAlg(flags, postfix, folderSuffix, nPhases, dPhases, nDelays, nColl)
Definition: LArCalib_OFCPhysConfig.py:10
python.PerfMonCompsConfig.PerfMonMTSvcCfg
def PerfMonMTSvcCfg(flags, **kwargs)
A minimal new-style configuration for PerfMonMTSvc.
Definition: PerfMonCompsConfig.py:10
python.LArCalibBaseConfig.chanSelStr
def chanSelStr(flags)
Definition: LArCalibBaseConfig.py:33
python.McEventSelectorConfig.McEventSelectorCfg
def McEventSelectorCfg(flags, **kwargs)
Definition: McEventSelectorConfig.py:5
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.LArCalib_OFCPhysConfig.LArOFCPhysCfg
def LArOFCPhysCfg(flags, loadPhysAC=True)
Definition: LArCalib_OFCPhysConfig.py:119
python.LArCalibBaseConfig.LArCalibBaseCfg
def LArCalibBaseCfg(flags)
Definition: LArCalibBaseConfig.py:5