|
| 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 801 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 808 of file TileCalibTools.py.
808 def __init__(self, db, folder, tag=""):
811 - db : db should be an open database connection
812 - folder: full folder path
813 - tag : The folder tag, e.g. \"000-00\"
816 TileCalibLogger.__init__(self,
"TileBlobReader")
821 self.__folder = self.__db.getFolder(folder)
822 except Exception
as e:
823 self.log().critical( e )
827 validFolderTypes = (
"run-lumi",
"time")
830 if self.__folderType
not in validFolderTypes:
831 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 1131 of file TileCalibTools.py.
1131 def folderIsMultiVersion(self):
1133 Returns true if MultiVersion folder is connected
1135 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 1065 of file TileCalibTools.py.
1065 def getBlobsWithinRange(self, ros, drawer, point1inTime=(0,0), point2inTime=(2147483647,4294967295)):
1067 Returns all blob objects for the given ROS and drawer, within given validity range -- default: [0-Infty)
1068 Note: the blobs don't contain validity range info. Check method getDBobjsWithinRange()
1074 print (
"Validity keys range is %s - %s" % (validityKey1, validityKey2))
1075 self.log().
debug(
"Validity key range is %s - %s", validityKey1,validityKey2)
1077 objs = self.getDBobjsWithinRange(self, ros, drawer, point1inTime, point2inTime)
1082 while objs.goToNext():
1083 obj=objs.currentRef()
1084 sinceCool=obj.since()
1085 if sinceCool < validityKey1:
1086 sinceCool = validityKey1
1087 untilCool=obj.until()
1088 blob = obj.payload()[0]
1089 print (
"[%d,%d)-[%d,%d) - %s" % ((sinceCool>>32),(sinceCool&0xFFFFFFFF),(untilCool>>32),(untilCool&0xFFFFFFFF),blob))
1090 self.log().
debug(
"blob size: %d", blob.size())
1093 while blob.size()==0:
1095 if ros==0
and drawer==0:
1096 raise Exception(
'No default available')
1098 ros,drawer = self.getDefault(ros,drawer)
1100 obj = self.__folder.findObject(sinceCool, chanNum, self.__tag)
1101 blob = obj.payload()[0]
1102 self.log().
debug(
"blob size: 0 --> default: %d", blob.size())
1105 self.__objDict[sinceCool] = obj
1111 if typeName==
'TileCalibDrawerFlt':
1113 self.log().
debug(
"typeName = Flt " )
1114 elif typeName==
'TileCalibDrawerInt':
1116 self.log().
debug(
"typeName = Int " )
1117 elif typeName==
'TileCalibDrawerBch':
1119 self.log().
debug(
"typeName = Bch " )
1120 elif typeName==
'TileCalibDrawerOfc':
1122 self.log().
debug(
"typeName = Ofc " )
1124 raise Exception(
"Invalid blob type requested: %s" % typeName )
1126 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 841 of file TileCalibTools.py.
841 def getComment(self, pointInTime, split=False):
843 Returns the general comment (default if none is set)
848 obj = self.__folder.findObject(validityKey, chanNum, self.__tag)
849 self.log().
debug(
"getComment:Fetching from DB: %s", obj)
850 blob = obj.payload()[0]
853 return (cmt.getAuthor(),cmt.getComment(),cmt.getDate())
855 return cmt.getFullComment()
857 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 1021 of file TileCalibTools.py.
1021 def getDBobjsWithinRange(self, ros, drawer, point1inTime=(0,0), point2inTime=(2147483647,4294967295), printError=
True):
1023 Returns all DB objects for the given ROS and drawer, within given validity range -- default: [0-Infty)
1024 Check getBlobsWithinRange for an example on how to loop over objects and check validity ranges.
1031 self.log().
debug(
"Validity key range is %s - %s", validityKey1,validityKey2)
1036 dbChanSel = cool.ChannelSelection(dbChanNum)
1038 objs = self.__folder.browseObjects(validityKey1,validityKey2,dbChanSel,self.__tag)
1039 except Exception
as e:
1041 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 860 of file TileCalibTools.py.
860 def getDefault(self, ros, drawer):
862 Returns a default drawer number (among first 20 COOL channels) for any drawer in any partition
865 if drawer<=4
or drawer==12
or drawer>=20:
871 elif ros==1
or ros==2:
874 OffsetEBA = [ 0, 0, 0, 0, 0, 0, 3, 2,
875 0, 0, 0, 0, 7, 6, 5, 7,
876 7, 6, 6, 7, 0, 0, 0, 2,
877 3, 0, 0, 0, 0, 0, 0, 0,
878 0, 0, 0, 0, 0, 0, 1, 1,
879 1, 1, 2, 3, 0, 0, 0, 0,
880 0, 0, 0, 0, 3, 2, 1, 1,
881 1, 1, 0, 0, 0, 0, 0, 0]
882 drawer1 = 12 + OffsetEBA[drawer]
884 OffsetEBC = [ 0, 0, 0, 0, 0, 0, 3, 2,
885 0, 0, 0, 0, 7, 6, 6, 7,
886 7, 5, 6, 7, 0, 0, 0, 2,
887 3, 0, 0, 3, 4, 0, 3, 4,
888 0, 4, 3, 0, 4, 3, 1, 1,
889 1, 1, 2, 3, 0, 0, 0, 0,
890 0, 0, 0, 0, 3, 2, 1, 1,
891 1, 1, 0, 0, 0, 0, 0, 0]
892 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 961 of file TileCalibTools.py.
961 def getDefaultDrawer(self, ros, drawer, pointInTime, printError=True):
963 Returns a TileCalibDrawer object for the given ROS and drawer.
967 self.log().
debug(
"Validity key is %s", validityKey)
971 key = (ros,drawer,validityKey)
972 obj = self.__objDict.
get(key)
976 obj = self.__folder.findObject(validityKey, chanNum, self.__tag)
977 self.log().
debug(
"Fetching from DB: %s", obj)
978 blob = obj.payload()[0]
979 self.log().
debug(
"blob size: %d", blob.size())
981 while blob.size()==0:
983 if ros==0
and drawer==0:
984 raise Exception(
'No default available')
986 ros,drawer = self.getDefault(ros,drawer)
988 obj = self.__folder.findObject(validityKey, chanNum, self.__tag)
989 blob = obj.payload()[0]
991 self.__objDict[key] = obj
993 blob = obj.payload()[0]
994 self.log().
debug(
"blob size: %d", blob.size())
1000 if typeName==
'TileCalibDrawerFlt':
1002 self.log().
debug(
"typeName = Flt " )
1003 elif typeName==
'TileCalibDrawerInt':
1005 self.log().
debug(
"typeName = Int " )
1006 elif typeName==
'TileCalibDrawerBch':
1008 self.log().
debug(
"typeName = Bch " )
1009 elif typeName==
'TileCalibDrawerOfc':
1011 self.log().
debug(
"typeName = Ofc " )
1013 raise Exception(
"Invalid blob type requested: %s" % typeName )
1015 except Exception
as e:
1017 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 899 of file TileCalibTools.py.
899 def getDrawer(self, ros, drawer, pointInTime, printError=True, useDefault=True):
901 Returns a TileCalibDrawer object for the given ROS and drawer.
905 self.log().
debug(
"Validity key is %s", validityKey)
909 key = (ros,drawer,validityKey)
910 obj = self.__objDict.
get(key)
914 obj = self.__folder.findObject(validityKey, chanNum, self.__tag)
915 self.log().
debug(
"Fetching from DB: %s", obj)
916 blob = obj.payload()[0]
917 self.log().
debug(
"blob size: %d", blob.size())
919 if not useDefault
and blob.size()==0:
921 while blob.size()==0:
923 if ros==0
and drawer==0:
924 raise Exception(
'No default available')
926 ros,drawer = self.getDefault(ros,drawer)
928 obj = self.__folder.findObject(validityKey, chanNum, self.__tag)
929 blob = obj.payload()[0]
931 self.__objDict[key] = obj
933 blob = obj.payload()[0]
934 self.log().
debug(
"blob size: %d", blob.size())
940 if typeName==
'TileCalibDrawerFlt':
942 self.log().
debug(
"typeName = Flt " )
943 elif typeName==
'TileCalibDrawerInt':
945 self.log().
debug(
"typeName = Int " )
946 elif typeName==
'TileCalibDrawerBch':
948 self.log().
debug(
"typeName = Bch " )
949 elif typeName==
'TileCalibDrawerOfc':
951 self.log().
debug(
"typeName = Ofc " )
953 raise Exception(
"Invalid blob type requested: %s" % typeName )
955 except Exception
as e:
957 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 1046 of file TileCalibTools.py.
1046 def getIOVsWithinRange(self, ros, drawer, point1inTime=(0,0), point2inTime=(2147483647,4294967295), printError=
True):
1048 Returns list of IOVS for the given ROS and drawer, within given validity range -- default: [0-Infty)
1051 dbobjs = self.getDBobjsWithinRange(ros,drawer,point1inTime, point2inTime, printError)
1052 if (dbobjs
is None):
1053 log.warning(
"Warning: can not read IOVs for ros %d drawer %d from input DB file", ros,drawer )
1055 while dbobjs.goToNext():
1056 obj = dbobjs.currentRef()
1057 objsince = obj.since()
1058 sinceRun = objsince >> 32
1059 sinceLum = objsince & 0xFFFFFFFF
1060 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.