Other api/dybdbi/gdcspmthv

Previous topic

DybDbi.GDcsAdTemp

Next topic

DybPython

This Page

Daya Bay Links

Content Skeleton

DybDbi.GDcsPmtHv

class DybDbi.GDcsPmtHv(int Ladder, int Column, int Ring, float Voltage, int Pw)

Bases: DybDbi.DbiTableRow

PMT High Voltage monitoring table:

mysql> describe DcsPmtHv  ;
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| SEQNO       | int(11)      | NO   | PRI |         |                | 
| ROW_COUNTER | int(11)      | NO   | PRI | NULL    | auto_increment | 
| ladder      | tinyint(4)   | YES  |     | NULL    |                | 
| col         | tinyint(4)   | YES  |     | NULL    |                | 
| ring        | tinyint(4)   | YES  |     | NULL    |                | 
| voltage     | decimal(6,2) | YES  |     | NULL    |                | 
| pw          | tinyint(4)   | YES  |     | NULL    |                | 
+-------------+--------------+------+-----+---------+----------------+
7 rows in set (0.07 sec)

GDcsPmtHv::GDcsPmtHv() GDcsPmtHv::GDcsPmtHv(const GDcsPmtHv& from) GDcsPmtHv::GDcsPmtHv(int Ladder, int Column, int Ring, float Voltage, int Pw)

AssignTimeGate

static void GDcsPmtHv::AssignTimeGate(Int_t seconds, char* alternateName = 0)

Cache

static DbiCache* GDcsPmtHv::Cache(char* alternateName = 0)

CanL2Cache

bool GDcsPmtHv::CanL2Cache()

Close

static void GDcsPmtHv::Close(char* filepath = 0l)

Compare

bool GDcsPmtHv::Compare(const GDcsPmtHv& that)

classmethod Create(*args, **kwargs)

Provide pythonic instance creation classmethod:

i = GTableName.Create( AttributeName=100. , ... ) 
CreateTableRow

DbiTableRow* GDcsPmtHv::CreateTableRow()

CurrentTimeGate

static int GDcsPmtHv::CurrentTimeGate(char* alternateName = 0)

DoubleValueForKey

double GDcsPmtHv::DoubleValueForKey(char* key, double defval = -0x00000000000000001)

Fill

void GDcsPmtHv::Fill(DbiResultSet& rs, DbiValidityRec* vrec)

FloatValueForKey

float GDcsPmtHv::FloatValueForKey(char* key, float defval = -0x00000000000000001)

GetColumn

int GDcsPmtHv::GetColumn()

GetDatabaseLayout

std::string GDcsPmtHv::GetDatabaseLayout()

GetDigest

std::string GDcsPmtHv::GetDigest()

GetFields

std::string GDcsPmtHv::GetFields()

GetLadder

int GDcsPmtHv::GetLadder()

GetPw

int GDcsPmtHv::GetPw()

GetRing

int GDcsPmtHv::GetRing()

GetTableDescr

static std::string GDcsPmtHv::GetTableDescr(char* alternateName = 0)

GetTableProxy

static DbiTableProxy& GDcsPmtHv::GetTableProxy(char* alternateName = 0)

GetValues

std::string GDcsPmtHv::GetValues()

GetVoltage

float GDcsPmtHv::GetVoltage()

IntValueForKey

int GDcsPmtHv::IntValueForKey(char* key, int defval = -0x00000000000000001)

IsA

TClass* GDcsPmtHv::IsA()

Rpt

static DbiRpt<GDcsPmtHv>* GDcsPmtHv::Rpt(char* ctx = GDcsPmtHv::MetaRctx)

Save

void GDcsPmtHv::Save()

SetColumn

void GDcsPmtHv::SetColumn(int Column)

SetLadder

void GDcsPmtHv::SetLadder(int Ladder)

SetPw

void GDcsPmtHv::SetPw(int Pw)

SetRing

void GDcsPmtHv::SetRing(int Ring)

SetVoltage

void GDcsPmtHv::SetVoltage(float Voltage)

ShowMembers

void GDcsPmtHv::ShowMembers(TMemberInspector&, char*)

SpecKeys

static TList* GDcsPmtHv::SpecKeys()

SpecList

static TList* GDcsPmtHv::SpecList()

SpecMap

static TMap* GDcsPmtHv::SpecMap()

Store

void GDcsPmtHv::Store(DbiOutRowStream& ors, DbiValidityRec* vrec)

Wrt

static DbiWrt<GDcsPmtHv>* GDcsPmtHv::Wrt(char* ctx = GDcsPmtHv::MetaWctx)

aggregateno

int DbiTableRow::GetAggregateNo()

column

int GDcsPmtHv::GetColumn()

classmethod csv_check(path, **kwargs)

Check the validity of CSV file and correspondence with CSV fields and DBI attributes:

from DybDbi import GCalibPmtSpec
GCalibPmtSpec.csv_check( "$DBWRITERROOT/share/DYB_%s_AD1.txt" % "SAB", afterPulse="AfterPulseProb", sigmaSpe="SigmaSpeHigh", prePulse="PrePulseProb", description="Describ" ) 

Manual mapping is required if field names do not match DBI attribute names (primitive case insensitive auto mapping is applied to avoid the need for tedious full mapping).

classmethod csv_compare(path, **kwargs)

compare entries in CSV file with those found in DB

classmethod csv_export(path, **kwargs)

Export the result of a default context DBI query as a CSV file

Parameters:
  • path – path of output file
  • fieldnames – optionally specifiy the field order with a list of fieldnames

Note

make the output more human readable with regular column widths

classmethod csv_import(path, **kwargs)

Import CSV file into Database Using default writer context for now

ContextRange::ContextRange(const int siteMask, const int simMask, const TimeStamp& tstart, const TimeStamp& tend)

ql> select * from CalibPmtSpecVld ; +——-+———————+———————+———-+———+———+——+————-+———————+———————+ | SEQNO | TIMESTART | TIMEEND | SITEMASK | SIMMASK | SUBSITE | TASK | AGGREGATENO | VERSIONDATE | INSERTDATE | +——-+———————+———————+———-+———+———+——+————-+———————+———————+ | 26 | 2011-01-22 08:15:17 | 2020-12-30 16:00:00 | 127 | 1 | 0 | 0 | -1 | 2011-01-22 08:15:17 | 2011-02-25 08:10:15 | | 18 | 2010-06-21 07:49:24 | 2038-01-19 03:14:07 | 32 | 1 | 1 | 0 | -1 | 2010-06-21 15:50:24 | 2010-07-19 12:49:29 |

HMM... Better to make this a classmethod on the writer rather than the Row class... OR do not shrinkwrap .. just leave as example
databaselayout

std::string GDcsPmtHv::GetDatabaseLayout()

digest

std::string GDcsPmtHv::GetDigest()

extracondition

std::string DbiTableRow::GetExtraCondition()

fields

std::string GDcsPmtHv::GetFields()

ladder

int GDcsPmtHv::GetLadder()

name

std::string GDcsPmtHv::name()

pw

int GDcsPmtHv::GetPw()

ring

int GDcsPmtHv::GetRing()

tabledescr

static std::string GDcsPmtHv::GetTableDescr(char* alternateName = 0)

tableproxy

static DbiTableProxy& GDcsPmtHv::GetTableProxy(char* alternateName = 0)

values

std::string GDcsPmtHv::GetValues()

voltage

float GDcsPmtHv::GetVoltage()