|
static bool | getCoolDB (const std::string &coolst, cool::IDatabasePtr &dbPtr) |
|
static void | readMap (const std::string &configfile) |
|
static cool::IFolderPtr | getFolder (const std::string &folder, const cool::IRecordSpecification &atrspec) |
|
Definition at line 33 of file DCSTxtToCool.cxx.
◆ DPMap
◆ DCSTxtToCool()
DCSTxtToCool::DCSTxtToCool |
( |
const std::string & |
cooldb, |
|
|
const std::string & |
configfile, |
|
|
const std::string & |
datafile, |
|
|
const int |
offset |
|
) |
| |
Definition at line 66 of file DCSTxtToCool.cxx.
71 std::cout <<
"Read data into COOL db: " <<
m_coolstr << std::endl;
72 std::cout <<
"Datapoint configuration file: " <<
m_configfile << std::endl;
73 std::cout <<
"Data file: " <<
m_datafile << std::endl;
74 std::cout <<
"Time offset " <<
m_timeoffset <<
" hours" << std::endl;
◆ beginDataPoint()
void DCSTxtToCool::beginDataPoint |
( |
const std::string & |
folder | ) |
|
|
private |
Definition at line 129 of file DCSTxtToCool.cxx.
132 while (datap.substr(datap.size()-1,1)==
"\r")
135 std::cout <<
"Begin processing datapoint " << datap << std::endl;
136 std::string key0=
m_dpmap.begin()->first;
137 DPMap::const_iterator fitr=
m_dpmap.find(datap);
141 std::cout <<
"Associated datapoint to folder " <<
m_dpinfo->
folder() <<
149 std::cout <<
"No valid folder to store data: " <<
e.what()
154 std::cout <<
"ERROR: No mapping defined for datapoint " << datap <<
◆ execute()
int DCSTxtToCool::execute |
( |
| ) |
|
Definition at line 77 of file DCSTxtToCool.cxx.
80 std::cout <<
"COOL database opened" << std::endl;
82 std::cout <<
"Database open fails" << std::endl;
90 std::vector<char>
buffer(999);
96 if (sline.substr(0,3)==
"200") {
98 std::string sdate,
stime;
100 std::istringstream sbuf(&
buffer[0]);
104 year=
atoi(sdate.substr(0,4).c_str());
106 month=
atoi(sdate.substr(5,2).c_str())-1;
107 day=
atoi(sdate.substr(8,2).c_str());
114 seal::TimeSpan tofs=seal::TimeSpan(3600*
m_timeoffset,0);
117 }
else if (sline.size()>2) {
125 std::cout <<
"Read total of " << nobj <<
" lines from data file" << std::endl;
◆ flushBuffer()
void DCSTxtToCool::flushBuffer |
( |
| ) |
|
|
private |
Definition at line 174 of file DCSTxtToCool.cxx.
178 std::cout <<
"Attempt to write " <<
m_ndata <<
" data points but no folder"
182 std::cout <<
"Write " <<
m_ndata <<
" values [" <<
191 std::cout <<
"Bulk insertion failed for folder " <<
193 ", reason: " <<
e.what() << std::endl;
◆ getCoolDB()
bool DCSTxtToCool::getCoolDB |
( |
const std::string & |
coolst, |
|
|
cool::IDatabasePtr & |
dbPtr |
|
) |
| |
|
staticprivate |
Definition at line 201 of file DCSTxtToCool.cxx.
203 std::cout <<
"Attempt to open COOL database with connection string: "
204 << coolstr << std::endl;
205 cool::IDatabaseSvc&
dbSvc=cool::DatabaseSvcFactory::databaseService();
207 dbPtr=
dbSvc.openDatabase(coolstr,
false);
211 std::cout <<
"COOL exception caught: " <<
e.what() << std::endl;
212 std::cout <<
"Try to create new conditions DB" << std::endl;
214 dbPtr=
dbSvc.createDatabase(coolstr);
215 std::cout <<
"Creation succeeded" << std::endl;
219 std::cout <<
"Creation failed" << std::endl;
◆ getFolder()
cool::IFolderPtr DCSTxtToCool::getFolder |
( |
const std::string & |
folder, |
|
|
const cool::IRecordSpecification & |
atrspec |
|
) |
| |
|
staticprivate |
Definition at line 265 of file DCSTxtToCool.cxx.
268 std::cout <<
"Folder " <<
folder <<
" already exists in database"
272 std::cout <<
"Folder " <<
folder <<
" not found - try to create it" <<
280 std::string
desc=
"dummy";
281 if (
nchan==1)
desc=
"<timeStamp>time</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"40774348\" /></addrHeader><typeName>AthenaAttributeList</typeName>";
282 if (
nchan>1)
desc=
"<timeStamp>time</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>";
283 std::cout <<
"Folder description string set to: " <<
desc << std::endl;
284 cool::IFolderPtr folderptr=
m_coolDb->createFolder(
folder,cool::FolderSpecification(cool::FolderVersioning::SINGLE_VERSION,atrspec),
desc,
true);
◆ readMap()
void DCSTxtToCool::readMap |
( |
const std::string & |
configfile | ) |
|
|
staticprivate |
Definition at line 226 of file DCSTxtToCool.cxx.
227 std::cout <<
"Read configuration from file: " << configfile << std::endl;
232 infile.open(configfile.c_str());
238 cool::RecordSpecification atrspec;
239 atrspec.extend(
column,cool::StorageType::Float);
241 m_dpmap.insert(std::pair<std::string,DataPointInfo*>(dpname,dptr));
256 std::cout <<
"Read " << nobj <<
" lines from file, giving " <<
257 m_dpmap.size() <<
" datapoint mappings " << std::endl;
258 std::cout <<
"Total of " <<
m_folderlist.size() <<
" COOL folders used" <<
261 std::cout <<
"Folder " <<
m_folderlist[
i] <<
" channel count " <<
◆ storeDataPoint()
void DCSTxtToCool::storeDataPoint |
( |
cool::ValidityKey |
since, |
|
|
float |
value |
|
) |
| |
|
private |
◆ m_configfile
std::string DCSTxtToCool::m_configfile |
|
private |
◆ m_coolDb
cool::IDatabasePtr DCSTxtToCool::m_coolDb |
|
private |
◆ m_coolstr
std::string DCSTxtToCool::m_coolstr |
|
private |
◆ m_datafile
std::string DCSTxtToCool::m_datafile |
|
private |
◆ m_datap
std::string DCSTxtToCool::m_datap |
|
private |
◆ m_dpinfo
◆ m_dpmap
DPMap DCSTxtToCool::m_dpmap {} |
|
private |
◆ m_folderchan
std::vector<int> DCSTxtToCool::m_folderchan {} |
|
private |
◆ m_folderlist
std::vector<std::string> DCSTxtToCool::m_folderlist {} |
|
private |
◆ m_folderp
cool::IFolderPtr DCSTxtToCool::m_folderp |
|
private |
◆ m_ndata
int DCSTxtToCool::m_ndata |
|
private |
◆ m_timeoffset
int DCSTxtToCool::m_timeoffset |
|
private |
◆ m_vkmax
cool::ValidityKey DCSTxtToCool::m_vkmax |
|
private |
◆ m_vkmin
cool::ValidityKey DCSTxtToCool::m_vkmin |
|
private |
The documentation for this class was generated from the following file: