BeamSpotContainer for beam spot information stored in COOL.
Definition at line 1128 of file BeamSpotData.py.
◆ __init__()
def python.BeamSpotData.BeamSpotCOOL.__init__ |
( |
|
self, |
|
|
|
tag, |
|
|
|
database = 'COOLOFL_INDET/CONDBR2' , |
|
|
|
folder = '/Indet/Beampos' , |
|
|
|
fullCorrelations = False |
|
) |
| |
Definition at line 1131 of file BeamSpotData.py.
1131 def __init__(self, tag, database='COOLOFL_INDET/CONDBR2', folder='/Indet/Beampos', fullCorrelations=False):
1132 BeamSpotContainer.__init__(self)
1133 self.database = database
1135 self.folder = folder
1136 from CoolConvUtilities
import AtlCoolLib
1137 self.cooldb = AtlCoolLib.indirectOpen(database,
True,
True)
◆ __del__()
def python.BeamSpotData.BeamSpotCOOL.__del__ |
( |
|
self | ) |
|
◆ __iter__()
def python.BeamSpotData.BeamSpotContainer.__iter__ |
( |
|
self | ) |
|
|
inherited |
Iterator to iterate over selected elements in the container.
Definition at line 792 of file BeamSpotData.py.
793 """Iterator to iterate over selected elements in the container."""
794 self.iter = self.selectedData()
◆ __next__()
def python.BeamSpotData.BeamSpotContainer.__next__ |
( |
|
self | ) |
|
|
inherited |
Return next selected element in the container.
Definition at line 801 of file BeamSpotData.py.
802 """Return next selected element in the container."""
◆ allData()
def python.BeamSpotData.BeamSpotCOOL.allData |
( |
|
self | ) |
|
Default generator to iterate over all data. Must be overridden by derived classes.
Reimplemented from python.BeamSpotData.BeamSpotContainer.
Definition at line 1142 of file BeamSpotData.py.
1143 from PyCool
import cool
1145 folder = self.cooldb.getFolder(self.folder)
1147 iov1 = self.runMin << 32
1148 iov2 = (self.runMax+1) << 32
1149 if (iov2>cool.ValidityKeyMax):
1150 iov2=cool.ValidityKeyMax
1152 itr = folder.browseObjects(iov1, iov2, cool.ChannelSelection.all(), self.tag)
1154 while itr.goToNext():
1156 obj = itr.currentRef()
1159 runBegin = since >> 32
1160 lumiBegin = since & 0xFFFFFFFF
1163 lumiUntil = until & 0xFFFFFFFF
1165 bs = BeamSpotValue()
1166 bs.run =
int(runBegin)
1167 bs.lbStart =
int(lumiBegin)
1168 bs.lbEnd =
int(lumiUntil)
1169 bs.posX =
float(obj.payloadValue(
'posX'))
1170 bs.posY =
float(obj.payloadValue(
'posY'))
1171 bs.posZ =
float(obj.payloadValue(
'posZ'))
1172 bs.sigmaX =
float(obj.payloadValue(
'sigmaX'))
1173 bs.sigmaY =
float(obj.payloadValue(
'sigmaY'))
1174 bs.sigmaZ =
float(obj.payloadValue(
'sigmaZ'))
1175 bs.tiltX =
float(obj.payloadValue(
'tiltX'))
1176 bs.tiltY =
float(obj.payloadValue(
'tiltY'))
1177 bs.status =
int(obj.payloadValue(
'status'))
1178 bs.posXErr =
float(obj.payloadValue(
'posXErr'))
1179 bs.posYErr =
float(obj.payloadValue(
'posYErr'))
1180 bs.posZErr =
float(obj.payloadValue(
'posZErr'))
1181 bs.sigmaXErr =
float(obj.payloadValue(
'sigmaXErr'))
1182 bs.sigmaYErr =
float(obj.payloadValue(
'sigmaYErr'))
1183 bs.sigmaZErr =
float(obj.payloadValue(
'sigmaZErr'))
1184 bs.tiltXErr =
float(obj.payloadValue(
'tiltXErr'))
1185 bs.tiltYErr =
float(obj.payloadValue(
'tiltYErr'))
1188 sigmaXYtmp =
float(obj.payloadValue(
'sigmaXY'))
1189 sigmaXtmp =
float(obj.payloadValue(
'sigmaX'))
1190 sigmaYtmp =
float(obj.payloadValue(
'sigmaY'))
1191 sigmaXYErrtmp =
float(obj.payloadValue(
'sigmaXYErr'))
1192 sigmaXErrtmp =
float(obj.payloadValue(
'sigmaXErr'))
1193 sigmaYErrtmp =
float(obj.payloadValue(
'sigmaYErr'))
1196 rhoXYtmp = sigmaXYtmp / sigmaXtmp / sigmaYtmp
1202 sumtmp = sigmaXYErrtmp * sigmaXYErrtmp / sigmaXYtmp / sigmaXYtmp
1203 sumtmp += sigmaXErrtmp * sigmaXErrtmp / sigmaXtmp / sigmaXtmp
1204 sumtmp += sigmaYErrtmp * sigmaYErrtmp / sigmaYtmp / sigmaYtmp
1205 rhoXYErrtmp = sqrt(rhoXYtmp * rhoXYtmp * sumtmp)
1209 bs.rhoXYErr = rhoXYErrtmp
◆ cutSummary()
def python.BeamSpotData.BeamSpotContainer.cutSummary |
( |
|
self | ) |
|
|
inherited |
Get summary of cuts made when looping over selected data.
Definition at line 894 of file BeamSpotData.py.
894 def cutSummary(self):
895 """Get summary of cuts made when looping over selected data."""
897 s +=
' run %7i ... %7i\n' % (self.runMin,self.runMax)
898 s +=
' runList %7s\n' %
str(self.runList)
899 s +=
' runListExcluded %7s\n' %
str(self.runListExclude)
900 s +=
' fill %7i ... %7i\n' % (self.fillMin,self.fillMax)
901 s +=
' bcid %7i ... %7i\n' % (self.bcidMin,self.bcidMax)
902 s +=
' LB %7i ... %7i\n' % (self.lbMin,self.lbMax)
903 s +=
' fit status %7s\n' %
str(self.statusList)
904 s +=
' %s - %s' % (time.strftime(
'%a %b %d %X %Z %Y',time.localtime(self.timeMin)),
905 time.strftime(
'%a %b %d %X %Z %Y',time.localtime(self.timeMax)))
906 s +=
' acquisition flag %7s' % self.acqFlag
908 s +=
' GRL %s\n' % self.grl
913 ROOT.gROOT.ProcessLine(BeamSpotValue(fullCorrelations=
True,addScanVars=
True).getROOTStruct())
◆ getDataCache()
def python.BeamSpotData.BeamSpotContainer.getDataCache |
( |
|
self | ) |
|
|
inherited |
Get a cache of all data in the form of a dict of runs, where each element
is a dict with a BeamSpotValue for each individual lumi blocks.
Definition at line 874 of file BeamSpotData.py.
874 def getDataCache(self):
875 """Get a cache of all data in the form of a dict of runs, where each element
876 is a dict with a BeamSpotValue for each individual lumi blocks."""
882 if b.lbEnd-b.lbStart > 500:
883 print (
'WARNING: Cannot cache LB range %i ... %i for run %i' % (b.lbStart,b.lbEnd,r))
885 for i
in range(b.lbStart,b.lbEnd+1):
886 if b.status
in self.statusList
or not self.statusList:
◆ initStatistics()
def python.BeamSpotData.BeamSpotContainer.initStatistics |
( |
|
self | ) |
|
|
inherited |
Definition at line 776 of file BeamSpotData.py.
776 def initStatistics(self):
779 self.selRunMin = 9999999
781 self.selFillMin = 9999999
783 self.selBcidMin = 9999999
785 self.selTimeMin = 2000000000
◆ next()
def python.BeamSpotData.BeamSpotContainer.next |
( |
|
self | ) |
|
|
inherited |
Return next selected element in the container.
Definition at line 797 of file BeamSpotData.py.
798 """Return next selected element in the container."""
799 return next(self.iter)
◆ selectedData()
def python.BeamSpotData.BeamSpotContainer.selectedData |
( |
|
self | ) |
|
|
inherited |
Generator to iterate over selected elements in the container.
Definition at line 809 of file BeamSpotData.py.
809 def selectedData(self):
810 """Generator to iterate over selected elements in the container."""
811 self.initStatistics()
813 self.previousGRLIndex = 0
815 for b
in self.allData():
817 if b.run<self.runMin:
continue
818 if b.run>self.runMax:
continue
819 if self.runList
and b.run
not in self.runList:
continue
820 if self.runListExclude
and b.run
in self.runListExclude:
continue
821 if b.fill<self.fillMin:
continue
822 if b.fill>self.fillMax:
continue
823 if b.bcid<self.bcidMin:
continue
824 if b.bcid>self.bcidMax:
continue
825 if b.lbStart<self.lbMin:
continue
826 if b.lbEnd-1>self.lbMax:
continue
827 if b.timeStart<self.timeMin:
continue
828 if b.timeEnd>self.timeMax:
continue
829 if self.statusList
and b.status
not in self.statusList:
continue
834 from DQUtils.sugar
import RANGEIOV_VAL, RunLumi
835 from DQUtils
import IOVSet
838 if self.grlIOVs
is None:
839 self.grlIOVs = IOVSet.from_grl(self.grl)
841 idx = self.previousGRLIndex
847 for i, iov
in enumerate(self.grlIOVs[idx:]):
848 if (test_iov.since >= iov.since
and test_iov.until <= iov.until):
849 self.previousGRLIndex = idx + i
857 self.selRunMin =
min(self.selRunMin,b.run)
858 self.selRunMax =
max(self.selRunMax,b.run)
859 self.selFillMin =
min(self.selFillMin,b.fill)
860 self.selFillMax =
max(self.selFillMax,b.fill)
861 self.selBcidMin =
min(self.selBcidMin,b.bcid)
862 self.selBcidMax =
max(self.selBcidMax,b.bcid)
863 self.selTimeMin =
min(self.selTimeMin,b.timeStart)
864 self.selTimeMax =
max(self.selTimeMax,b.timeEnd)
866 print (
'\n%i entries selected out of total of %i entries in ntuple:' % (self.nSel,self.nTot))
867 print (
'... runs %6i - %6i' % (self.selRunMin,self.selRunMax))
868 print (
'... fills %6i - %6i' % (self.selFillMin,self.selFillMax))
869 print (
'... bcids %6i - %6i' % (self.selBcidMin,self.selBcidMax))
870 print (
'... %s - %s' % (time.strftime(
'%a %b %d %X %Z %Y',time.localtime(self.selTimeMin)),
871 time.strftime(
'%a %b %d %X %Z %Y',time.localtime(self.selTimeMax))))
◆ summary()
def python.BeamSpotData.BeamSpotCOOL.summary |
( |
|
self | ) |
|
Get one-line info of Ntuple. Should be overridden by derived classes.
Reimplemented from python.BeamSpotData.BeamSpotContainer.
Definition at line 1213 of file BeamSpotData.py.
1214 s =
'COOL database %s, tag %s:\n' % (self.database,self.tag)
1215 s +=
' %s ntuple, COOL folder %s\n' % (self.__class__.__name__,self.folder)
◆ acqFlag
python.BeamSpotData.BeamSpotContainer.acqFlag |
|
inherited |
◆ bcidMax
python.BeamSpotData.BeamSpotContainer.bcidMax |
|
inherited |
◆ bcidMin
python.BeamSpotData.BeamSpotContainer.bcidMin |
|
inherited |
◆ cooldb
python.BeamSpotData.BeamSpotCOOL.cooldb |
◆ database
python.BeamSpotData.BeamSpotCOOL.database |
◆ fillMax
python.BeamSpotData.BeamSpotContainer.fillMax |
|
inherited |
◆ fillMin
python.BeamSpotData.BeamSpotContainer.fillMin |
|
inherited |
◆ folder
python.BeamSpotData.BeamSpotCOOL.folder |
◆ grl
python.BeamSpotData.BeamSpotContainer.grl |
|
inherited |
◆ grlIOVs
python.BeamSpotData.BeamSpotContainer.grlIOVs |
|
inherited |
◆ iter
python.BeamSpotData.BeamSpotContainer.iter |
|
inherited |
◆ lbMax
python.BeamSpotData.BeamSpotContainer.lbMax |
|
inherited |
◆ lbMin
python.BeamSpotData.BeamSpotContainer.lbMin |
|
inherited |
◆ nSel
python.BeamSpotData.BeamSpotContainer.nSel |
|
inherited |
◆ nTot
python.BeamSpotData.BeamSpotContainer.nTot |
|
inherited |
◆ previousGRLIndex
python.BeamSpotData.BeamSpotContainer.previousGRLIndex |
|
inherited |
◆ runList
python.BeamSpotData.BeamSpotContainer.runList |
|
inherited |
◆ runListExclude
python.BeamSpotData.BeamSpotContainer.runListExclude |
|
inherited |
◆ runMax
python.BeamSpotData.BeamSpotContainer.runMax |
|
inherited |
◆ runMin
python.BeamSpotData.BeamSpotContainer.runMin |
|
inherited |
◆ selBcidMax
python.BeamSpotData.BeamSpotContainer.selBcidMax |
|
inherited |
◆ selBcidMin
python.BeamSpotData.BeamSpotContainer.selBcidMin |
|
inherited |
◆ selFillMax
python.BeamSpotData.BeamSpotContainer.selFillMax |
|
inherited |
◆ selFillMin
python.BeamSpotData.BeamSpotContainer.selFillMin |
|
inherited |
◆ selRunMax
python.BeamSpotData.BeamSpotContainer.selRunMax |
|
inherited |
◆ selRunMin
python.BeamSpotData.BeamSpotContainer.selRunMin |
|
inherited |
◆ selTimeMax
python.BeamSpotData.BeamSpotContainer.selTimeMax |
|
inherited |
◆ selTimeMin
python.BeamSpotData.BeamSpotContainer.selTimeMin |
|
inherited |
◆ statusList
python.BeamSpotData.BeamSpotContainer.statusList |
|
inherited |
◆ tag
python.BeamSpotData.BeamSpotCOOL.tag |
◆ timeMax
python.BeamSpotData.BeamSpotContainer.timeMax |
|
inherited |
◆ timeMin
python.BeamSpotData.BeamSpotContainer.timeMin |
|
inherited |
The documentation for this class was generated from the following file: