table writing macros rhicfCrossTalk and error message
Updated on Fri, 2022-11-25 00:35. Originally created by slee5 on 2022-11-25 00:25.
int write_rhicfCrossTalk()
{
// if you want to use root.exe instead of root4star, uncomment block below:
gSystem->AddDynamicPath("/usr/lib/mysql");
gSystem->AddDynamicPath("/usr/lib64/mysql");
gSystem->AddDynamicPath("$OPTSTAR/lib/mysql/");
gSystem->Load("libmysqlclient");
// Load all required libraries
gROOT->Macro("LoadLogger.C");
gSystem->Load("St_base.so");
gSystem->Load("libStDb_Tables.so");
gSystem->Load("StDbLib.so");
gSystem->Setenv("DB_ACCESS_MODE","write");
// Initialize db manager
StDbManager* mgr = StDbManager::Instance();
StDbConfigNode* node = mgr->initConfig("Calibrations_rhicf");
StDbTable* dbtable = node->addDbTable("rhicfCrossTalk");
TString storeTime = "2022-11-24 21:59:04"; // beginTime timestamp in MySQL format: "YYYY-MM-DD HH:mm:ss"
mgr->setStoreTime(storeTime.Data());
// Create your c-struct
rhicfCrossTalk_st table;
// Fill structure with data
auto fileCrossTalkTable = new TFile("/star/u/slee5/develop_RHICf/StDb/tables/20141215_XtalkMatrixTemplate.root", "read");
TMatrixD* crossTalkMatrix;
char name[256];
sprintf(name,"Matrix_MAPMT%d", 0);
crossTalkMatrix = (TMatrixD*)fileCrossTalkTable->Get(name);
int idx = 0;
for(int i=0; i<60; i++){
int jStart = (i < 20) ? 0 : 20;
for(int j = jStart; j <= i; j++){
table.crossTalk[idx] = TMatrixDRow(*crossTalkMatrix, i)[j];
idx++;
}
}
// Store data to the StDbTable
dbtable->SetTable((char*)&table, 1);
// uncomment next line to set "sim" flavor. "ofl" flavor is set by default, no need to set it.
// dbtable->setFlavor("sim");
// Store table to database
mgr->storeDbTable(dbtable);
}
ERROR message:
STAR] slee5@rcas6015:~/Dev/upload$ root4star write_rhicfCrossTalk.C
*******************************************
* *
* W E L C O M E to R O O T *
* *
* Version 5.34/38 12 March 2018 *
* *
* You are welcome to visit our Web site *
* http://root.cern.ch *
* *
*******************************************
ROOT 5.34/38 (v5-34-38@v5-34-38, Mar 12 2018, 15:49:39 on linux)
CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
*** Float Point Exception is OFF ***
*** Start at Date : Fri Nov 25 00:12:22 2022
QAInfo:You are using STAR_LEVEL : dev, ROOT_LEVEL : 5.34.38 and node : rcas6015.rcf.bnl.gov
root4star [0]
Processing write_rhicfCrossTalk.C...
BFC:INFO - StDbManagerImpl::lookUpServers(): config file name is /afs/rhic.bnl.gov/star/packages/conf/dbLoadBalancerLocalConfig_BNL.xml
There is no 1 /star/u/slee5/dbServers.xml
looking at 2 /afs/rhic.bnl.gov/star/packages/DEV/StDb/servers/dbServers.xml
DB OVERRIDE default user with: slee5
*** Info line=713 *** StDbManagerImpl::lookUpServer()
******** Order of Files searched for dbServers *********
3. /afs/rhic.bnl.gov/star/packages/DEV/StDb/servers/dbServers.xml
********************************************************
StHyperCacheManager: reading cache config from /afs/rhic.bnl.gov/star/packages/conf/hyperconfig.json
BFC:INFO - MysqlDb::Connect: Load balancer took 0 ms, will use robinson.star.bnl.gov:3306
*** Info line=450 *** MysqlDb::reConnect()
Cannot connect to robinson.star.bnl.gov:3306, database server is busy or unreachable.
Returned error =Access denied for user 'slee5'@'rcas6015.rcf.bnl.gov' (using password: NO).
Will re-try with timeout set at
==> 2 seconds <==
BFC:INFO - MysqlDb::Connect: Load balancer took 0 ms, will use robinson.star.bnl.gov:3306
*** Info line=450 *** MysqlDb::reConnect()
Cannot connect to robinson.star.bnl.gov:3306, database server is busy or unreachable.
Returned error =Access denied for user 'slee5'@'rcas6015.rcf.bnl.gov' (using password: NO).
Will re-try with timeout set at
==> 4 seconds <==
BFC:INFO - MysqlDb::Connect: Load balancer took 0 ms, will use robinson.star.bnl.gov:3306
*** Info line=450 *** MysqlDb::reConnect()
Cannot connect to robinson.star.bnl.gov:3306, database server is busy or unreachable.
Returned error =Access denied for user 'slee5'@'rcas6015.rcf.bnl.gov' (using password: NO).
Will re-try with timeout set at
..
..
..
..
==> 512 seconds <==
BFC:INFO - MysqlDb::Connect: Load balancer took 0 ms, will use robinson.star.bnl.gov:3306
*** Info line=450 *** MysqlDb::reConnect()
Cannot connect to robinson.star.bnl.gov:3306, database server is busy or unreachable.
Returned error =Access denied for user 'slee5'@'rcas6015.rcf.bnl.gov' (using password: NO).
Will re-try with timeout set at
==> 1024 seconds <==
*** Info line=533 *** MysqlDb::Connect(host,user,pw,database,port)
Making Connection to DataBase = Calibrations_rhicf On Host = robinson.star.bnl.gov:3306 MySQL returned error Access denied for user 'slee5'@'rcas6015.rcf.bnl.gov' (using password: NO)
*** Error line=1329 *** StDbManagerImpl::storeDbTable(StDbTable*)
Cannot store withou timestamp
(int)0
»
- slee5's blog
- Login or register to post comments