BeamSpotContainer for beam spot information stored in online CSV files
Definition at line 1218 of file BeamSpotData.py.
◆ __init__()
def python.BeamSpotData.BeamSpotCSV.__init__ |
( |
|
self, |
|
|
|
filename = '/afs/cern.ch/user/a/atlidbs/data/69OnlineBeamspots.csv' , |
|
|
|
delim = ',' |
|
) |
| |
Definition at line 1221 of file BeamSpotData.py.
1221 def __init__(self, filename='/afs/cern.ch/user/a/atlidbs/data/69OnlineBeamspots.csv', delim=','):
1222 BeamSpotContainer.__init__(self)
1223 self.csvFile =
open(filename,
'rb')
1224 self.csvReader = csv.DictReader(self.csvFile, delimiter=delim)
◆ __del__()
def python.BeamSpotData.BeamSpotCSV.__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.BeamSpotCSV.allData |
( |
|
self | ) |
|
Default generator to iterate over all data. Must be overridden by derived classes.
Reimplemented from python.BeamSpotData.BeamSpotContainer.
Definition at line 1229 of file BeamSpotData.py.
1231 for row
in self.csvReader:
1233 bs = BeamSpotValue()
1235 bs.run =
int(row[
'run'])
1236 bs.lbStart =
int(row[
'firstLBN'])
1237 bs.lbEnd =
int(row[
'lastLBN'])
1238 bs.posX =
float(row[
'posX'])
1239 bs.posY =
float(row[
'posY'])
1240 bs.posZ =
float(row[
'posZ'])
1241 bs.sigmaX =
float(row[
'sigmaX'])
1242 bs.sigmaY =
float(row[
'sigmaY'])
1243 bs.sigmaZ =
float(row[
'sigmaZ'])
1244 bs.tiltX =
float(row[
'tiltX'])
1245 bs.tiltY =
float(row[
'tiltY'])
1246 bs.status =
int(row[
'status'])
1248 bs.posXErr =
float(row[
'posXE'])
1249 bs.posYErr =
float(row[
'posYE'])
1250 bs.posZErr =
float(row[
'posZE'])
1251 bs.sigmaXErr =
float(row[
'sigmaXE'])
1252 bs.sigmaYErr =
float(row[
'sigmaYE'])
1253 bs.sigmaZErr =
float(row[
'sigmaZE'])
1254 bs.tiltXErr =
float(row[
'tiltXE'])
1255 bs.tiltYErr =
float(row[
'tiltYE'])
◆ 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.BeamSpotCSV.summary |
( |
|
self | ) |
|
◆ acqFlag
python.BeamSpotData.BeamSpotContainer.acqFlag |
|
inherited |
◆ bcidMax
python.BeamSpotData.BeamSpotContainer.bcidMax |
|
inherited |
◆ bcidMin
python.BeamSpotData.BeamSpotContainer.bcidMin |
|
inherited |
◆ csvFile
python.BeamSpotData.BeamSpotCSV.csvFile |
◆ csvReader
python.BeamSpotData.BeamSpotCSV.csvReader |
◆ fillMax
python.BeamSpotData.BeamSpotContainer.fillMax |
|
inherited |
◆ fillMin
python.BeamSpotData.BeamSpotContainer.fillMin |
|
inherited |
◆ 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 |
◆ timeMax
python.BeamSpotData.BeamSpotContainer.timeMax |
|
inherited |
◆ timeMin
python.BeamSpotData.BeamSpotContainer.timeMin |
|
inherited |
The documentation for this class was generated from the following file: