|
def | __init__ (self, db, folder, tag="") |
|
def | getComment (self, pointInTime, split=False) |
|
def | getDefault (self, ros, drawer) |
|
def | getDrawer (self, ros, drawer, pointInTime, printError=True, useDefault=True) |
|
def | getDefaultDrawer (self, ros, drawer, pointInTime, printError=True) |
|
def | getDBobjsWithinRange (self, ros, drawer, point1inTime=(0, 0), point2inTime=(2147483647, 4294967295), printError=True) |
|
def | getIOVsWithinRange (self, ros, drawer, point1inTime=(0, 0), point2inTime=(2147483647, 4294967295), printError=True) |
|
def | getBlobsWithinRange (self, ros, drawer, point1inTime=(0, 0), point2inTime=(2147483647, 4294967295)) |
|
def | folderIsMultiVersion (self) |
|
TileCalibBlobReader is a helper class, managing the details of COOL interactions for
the user of TileCalibBlobs.
Definition at line 753 of file TileCalibTools.py.
◆ __init__()
def python.TileCalibTools.TileBlobReader.__init__ |
( |
|
self, |
|
|
|
db, |
|
|
|
folder, |
|
|
|
tag = "" |
|
) |
| |
Input:
- db : db should be an open database connection
- folder: full folder path
- tag : The folder tag, e.g. \"000-00\"
Definition at line 760 of file TileCalibTools.py.
760 def __init__(self, db, folder, tag=""):
763 - db : db should be an open database connection
764 - folder: full folder path
765 - tag : The folder tag, e.g. \"000-00\"
768 TileCalibLogger.__init__(self,
"TileBlobReader")
773 self.__folder = self.__db.getFolder(folder)
774 except Exception
as e:
775 self.log().critical( e )
779 validFolderTypes = (
"run-lumi",
"time")
782 if self.__folderType
not in validFolderTypes:
783 raise Exception(
"Invalid folder type found: \'%s\'" % self.__folderType)
◆ folderIsMultiVersion()
def python.TileCalibTools.TileBlobReader.folderIsMultiVersion |
( |
|
self | ) |
|
Returns true if MultiVersion folder is connected
Definition at line 1083 of file TileCalibTools.py.
1083 def folderIsMultiVersion(self):
1085 Returns true if MultiVersion folder is connected
1087 if self.__folder.versioningMode()==cool.FolderVersioning.MULTI_VERSION:
◆ getBlobsWithinRange()
def python.TileCalibTools.TileBlobReader.getBlobsWithinRange |
( |
|
self, |
|
|
|
ros, |
|
|
|
drawer, |
|
|
|
point1inTime = (0,0) , |
|
|
|
point2inTime = (2147483647,4294967295) |
|
) |
| |
Returns all blob objects for the given ROS and drawer, within given validity range -- default: [0-Infty)
Note: the blobs don't contain validity range info. Check method getDBobjsWithinRange()
Definition at line 1017 of file TileCalibTools.py.
1017 def getBlobsWithinRange(self, ros, drawer, point1inTime=(0,0), point2inTime=(2147483647,4294967295)):
1019 Returns all blob objects for the given ROS and drawer, within given validity range -- default: [0-Infty)
1020 Note: the blobs don't contain validity range info. Check method getDBobjsWithinRange()
1026 print (
"Validity keys range is %s - %s" % (validityKey1, validityKey2))
1027 self.log().
debug(
"Validity key range is %s - %s", validityKey1,validityKey2)
1029 objs = self.getDBobjsWithinRange(self, ros, drawer, point1inTime, point2inTime)
1034 while objs.goToNext():
1035 obj=objs.currentRef()
1036 sinceCool=obj.since()
1037 if sinceCool < validityKey1:
1038 sinceCool = validityKey1
1039 untilCool=obj.until()
1040 blob = obj.payload()[0]
1041 print (
"[%d,%d)-[%d,%d) - %s" % ((sinceCool>>32),(sinceCool&0xFFFFFFFF),(untilCool>>32),(untilCool&0xFFFFFFFF),blob))
1042 self.log().
debug(
"blob size: %d", blob.size())
1045 while blob.size()==0:
1047 if ros==0
and drawer==0:
1048 raise Exception(
'No default available')
1050 ros,drawer = self.getDefault(ros,drawer)
1052 obj = self.__folder.findObject(sinceCool, chanNum, self.__tag)
1053 blob = obj.payload()[0]
1054 self.log().
debug(
"blob size: 0 --> default: %d", blob.size())
1057 self.__objDict[sinceCool] = obj
1063 if typeName==
'TileCalibDrawerFlt':
1065 self.log().
debug(
"typeName = Flt " )
1066 elif typeName==
'TileCalibDrawerInt':
1068 self.log().
debug(
"typeName = Int " )
1069 elif typeName==
'TileCalibDrawerBch':
1071 self.log().
debug(
"typeName = Bch " )
1072 elif typeName==
'TileCalibDrawerOfc':
1074 self.log().
debug(
"typeName = Ofc " )
1076 raise Exception(
"Invalid blob type requested: %s" % typeName )
1078 blobs.append( calibDrawer )
◆ getComment()
def python.TileCalibTools.TileBlobReader.getComment |
( |
|
self, |
|
|
|
pointInTime, |
|
|
|
split = False |
|
) |
| |
Returns the general comment (default if none is set)
Definition at line 793 of file TileCalibTools.py.
793 def getComment(self, pointInTime, split=False):
795 Returns the general comment (default if none is set)
800 obj = self.__folder.findObject(validityKey, chanNum, self.__tag)
801 self.log().
debug(
"getComment:Fetching from DB: %s", obj)
802 blob = obj.payload()[0]
805 return (cmt.getAuthor(),cmt.getComment(),cmt.getDate())
807 return cmt.getFullComment()
809 return "<no comment found>"
◆ getDBobjsWithinRange()
def python.TileCalibTools.TileBlobReader.getDBobjsWithinRange |
( |
|
self, |
|
|
|
ros, |
|
|
|
drawer, |
|
|
|
point1inTime = (0,0) , |
|
|
|
point2inTime = (2147483647,4294967295) , |
|
|
|
printError = True |
|
) |
| |
Returns all DB objects for the given ROS and drawer, within given validity range -- default: [0-Infty)
Check getBlobsWithinRange for an example on how to loop over objects and check validity ranges.
Definition at line 973 of file TileCalibTools.py.
973 def getDBobjsWithinRange(self, ros, drawer, point1inTime=(0,0), point2inTime=(2147483647,4294967295), printError=
True):
975 Returns all DB objects for the given ROS and drawer, within given validity range -- default: [0-Infty)
976 Check getBlobsWithinRange for an example on how to loop over objects and check validity ranges.
983 self.log().
debug(
"Validity key range is %s - %s", validityKey1,validityKey2)
988 dbChanSel = cool.ChannelSelection(dbChanNum)
990 objs = self.__folder.browseObjects(validityKey1,validityKey2,dbChanSel,self.__tag)
991 except Exception
as e:
993 self.log().
error(
"TileCalibTools.getDBobjsWithinRange(): Fetching of ros=%i, drawer=%i failed with exception %s", ros,drawer,e)
◆ getDefault()
def python.TileCalibTools.TileBlobReader.getDefault |
( |
|
self, |
|
|
|
ros, |
|
|
|
drawer |
|
) |
| |
Returns a default drawer number (among first 20 COOL channels) for any drawer in any partition
Definition at line 812 of file TileCalibTools.py.
812 def getDefault(self, ros, drawer):
814 Returns a default drawer number (among first 20 COOL channels) for any drawer in any partition
817 if drawer<=4
or drawer==12
or drawer>=20:
823 elif ros==1
or ros==2:
826 OffsetEBA = [ 0, 0, 0, 0, 0, 0, 3, 2,
827 0, 0, 0, 0, 7, 6, 5, 7,
828 7, 6, 6, 7, 0, 0, 0, 2,
829 3, 0, 0, 0, 0, 0, 0, 0,
830 0, 0, 0, 0, 0, 0, 1, 1,
831 1, 1, 2, 3, 0, 0, 0, 0,
832 0, 0, 0, 0, 3, 2, 1, 1,
833 1, 1, 0, 0, 0, 0, 0, 0]
834 drawer1 = 12 + OffsetEBA[drawer]
836 OffsetEBC = [ 0, 0, 0, 0, 0, 0, 3, 2,
837 0, 0, 0, 0, 7, 6, 6, 7,
838 7, 5, 6, 7, 0, 0, 0, 2,
839 3, 0, 0, 3, 4, 0, 3, 4,
840 0, 4, 3, 0, 4, 3, 1, 1,
841 1, 1, 2, 3, 0, 0, 0, 0,
842 0, 0, 0, 0, 3, 2, 1, 1,
843 1, 1, 0, 0, 0, 0, 0, 0]
844 drawer1 = 12 + OffsetEBC[drawer]
◆ getDefaultDrawer()
def python.TileCalibTools.TileBlobReader.getDefaultDrawer |
( |
|
self, |
|
|
|
ros, |
|
|
|
drawer, |
|
|
|
pointInTime, |
|
|
|
printError = True |
|
) |
| |
Returns a TileCalibDrawer object for the given ROS and drawer.
Definition at line 913 of file TileCalibTools.py.
913 def getDefaultDrawer(self, ros, drawer, pointInTime, printError=True):
915 Returns a TileCalibDrawer object for the given ROS and drawer.
919 self.log().
debug(
"Validity key is %s", validityKey)
923 key = (ros,drawer,validityKey)
924 obj = self.__objDict.
get(key)
928 obj = self.__folder.findObject(validityKey, chanNum, self.__tag)
929 self.log().
debug(
"Fetching from DB: %s", obj)
930 blob = obj.payload()[0]
931 self.log().
debug(
"blob size: %d", blob.size())
933 while blob.size()==0:
935 if ros==0
and drawer==0:
936 raise Exception(
'No default available')
938 ros,drawer = self.getDefault(ros,drawer)
940 obj = self.__folder.findObject(validityKey, chanNum, self.__tag)
941 blob = obj.payload()[0]
943 self.__objDict[key] = obj
945 blob = obj.payload()[0]
946 self.log().
debug(
"blob size: %d", blob.size())
952 if typeName==
'TileCalibDrawerFlt':
954 self.log().
debug(
"typeName = Flt " )
955 elif typeName==
'TileCalibDrawerInt':
957 self.log().
debug(
"typeName = Int " )
958 elif typeName==
'TileCalibDrawerBch':
960 self.log().
debug(
"typeName = Bch " )
961 elif typeName==
'TileCalibDrawerOfc':
963 self.log().
debug(
"typeName = Ofc " )
965 raise Exception(
"Invalid blob type requested: %s" % typeName )
967 except Exception
as e:
969 self.log().
error(
"TileCalibTools.getDefaultDrawer(): Fetching of ros=%i, drawer=%i failed with exception %s", ros,drawer,e)
◆ getDrawer()
def python.TileCalibTools.TileBlobReader.getDrawer |
( |
|
self, |
|
|
|
ros, |
|
|
|
drawer, |
|
|
|
pointInTime, |
|
|
|
printError = True , |
|
|
|
useDefault = True |
|
) |
| |
Returns a TileCalibDrawer object for the given ROS and drawer.
Definition at line 851 of file TileCalibTools.py.
851 def getDrawer(self, ros, drawer, pointInTime, printError=True, useDefault=True):
853 Returns a TileCalibDrawer object for the given ROS and drawer.
857 self.log().
debug(
"Validity key is %s", validityKey)
861 key = (ros,drawer,validityKey)
862 obj = self.__objDict.
get(key)
866 obj = self.__folder.findObject(validityKey, chanNum, self.__tag)
867 self.log().
debug(
"Fetching from DB: %s", obj)
868 blob = obj.payload()[0]
869 self.log().
debug(
"blob size: %d", blob.size())
871 if not useDefault
and blob.size()==0:
873 while blob.size()==0:
875 if ros==0
and drawer==0:
876 raise Exception(
'No default available')
878 ros,drawer = self.getDefault(ros,drawer)
880 obj = self.__folder.findObject(validityKey, chanNum, self.__tag)
881 blob = obj.payload()[0]
883 self.__objDict[key] = obj
885 blob = obj.payload()[0]
886 self.log().
debug(
"blob size: %d", blob.size())
892 if typeName==
'TileCalibDrawerFlt':
894 self.log().
debug(
"typeName = Flt " )
895 elif typeName==
'TileCalibDrawerInt':
897 self.log().
debug(
"typeName = Int " )
898 elif typeName==
'TileCalibDrawerBch':
900 self.log().
debug(
"typeName = Bch " )
901 elif typeName==
'TileCalibDrawerOfc':
903 self.log().
debug(
"typeName = Ofc " )
905 raise Exception(
"Invalid blob type requested: %s" % typeName )
907 except Exception
as e:
909 self.log().
error(
"TileCalibTools.getDrawer(): Fetching of ros=%i, drawer=%i failed with exception %s", ros,drawer,e)
◆ getIOVsWithinRange()
def python.TileCalibTools.TileBlobReader.getIOVsWithinRange |
( |
|
self, |
|
|
|
ros, |
|
|
|
drawer, |
|
|
|
point1inTime = (0,0) , |
|
|
|
point2inTime = (2147483647,4294967295) , |
|
|
|
printError = True |
|
) |
| |
Returns list of IOVS for the given ROS and drawer, within given validity range -- default: [0-Infty)
Definition at line 998 of file TileCalibTools.py.
998 def getIOVsWithinRange(self, ros, drawer, point1inTime=(0,0), point2inTime=(2147483647,4294967295), printError=
True):
1000 Returns list of IOVS for the given ROS and drawer, within given validity range -- default: [0-Infty)
1003 dbobjs = self.getDBobjsWithinRange(ros,drawer,point1inTime, point2inTime, printError)
1004 if (dbobjs
is None):
1005 log.warning(
"Warning: can not read IOVs for ros %d drawer %d from input DB file", ros,drawer )
1007 while dbobjs.goToNext():
1008 obj = dbobjs.currentRef()
1009 objsince = obj.since()
1010 sinceRun = objsince >> 32
1011 sinceLum = objsince & 0xFFFFFFFF
1012 since = (sinceRun, sinceLum)
◆ __db
python.TileCalibTools.TileBlobReader.__db |
|
private |
◆ __folder
python.TileCalibTools.TileBlobReader.__folder |
|
private |
◆ __folderType
python.TileCalibTools.TileBlobReader.__folderType |
|
private |
◆ __objDict
python.TileCalibTools.TileBlobReader.__objDict |
|
private |
◆ __tag
python.TileCalibTools.TileBlobReader.__tag |
|
private |
The documentation for this class was generated from the following file:
static TileCalibDrawerOfc * getInstance(coral::Blob &blob, uint16_t objVersion, uint32_t nSamples, int32_t nPhases, uint16_t nChans, uint16_t nGains, const std::string &author="", const std::string &comment="", uint64_t timeStamp=0)
Returns a pointer to a non-const TileCalibDrawerOfc.