#include <CaloOnlineTools/HcalOnlineDb/interface/HcalO2OManager.h>
|
int | getListOfNewIovs (std::vector< uint32_t > &iovs, const std::vector< uint32_t > &omds_iovs, const std::vector< uint32_t > &orcon_iovs) |
|
void | getListOfNewIovs_test (void) |
|
int | getListOfOmdsIovs (std::vector< uint32_t > &out, std::string tagname) |
|
std::vector< std::string > | getListOfOmdsTags () |
|
int | getListOfPoolIovs (std::vector< uint32_t > &out, std::string tagname, std::string connect, std::string auth_path) |
|
std::vector< std::string > | getListOfPoolTags (std::string connect, std::string auth_path) |
|
int | getListOfUpdateIovs (std::vector< uint32_t > &_iovs, std::string _tag, std::string pool_connect_string, std::string pool_auth_path) |
|
| HcalO2OManager () |
|
virtual | ~HcalO2OManager () |
|
Description: Defines all logic of HCAL O2O transfers
Usage: <usage>
Definition at line 25 of file HcalO2OManager.h.
HcalO2OManager::HcalO2OManager |
( |
| ) |
|
HcalO2OManager::~HcalO2OManager |
( |
| ) |
|
|
virtual |
int HcalO2OManager::getListOfNewIovs |
( |
std::vector< uint32_t > & |
iovs, |
|
|
const std::vector< uint32_t > & |
omds_iovs, |
|
|
const std::vector< uint32_t > & |
orcon_iovs |
|
) |
| |
Definition at line 236 of file HcalO2OManager.cc.
References gather_cfg::cout, createfilelist::int, and mps_fire::result.
243 int _orcon_index_offset = 0;
244 if (omds_iovs.size() > 0 &&
245 orcon_iovs.size() > 0 &&
246 orcon_iovs[0] == 1 &&
248 std::cout << std::endl <<
"HcalO2OManager: First IOV in the OMDS tag is not 1," << std::endl;
249 std::cout <<
"HcalO2OManager: while it must be 1 in the offline tag." << std::endl;
250 std::cout <<
"HcalO2OManager: O2O will assume that IOV=1 in the offline tag" << std::endl;
251 std::cout <<
"HcalO2OManager: is filled with some safe default." << std::endl;
252 std::cout <<
"HcalO2OManager: IOV=1 will be ignored, and O2O will proceeed" << std::endl;
253 std::cout <<
"HcalO2OManager: as long as other inconsistencies are not detected." << std::endl << std::endl;
254 _orcon_index_offset = 1;
257 if (omds_iovs.size()+_orcon_index_offset < orcon_iovs.size()){
258 std::cout <<
"HcalO2OManager: too many IOVs in the Pool tag, cannot sync, exiting..." << std::endl;
263 unsigned int _index = 0;
265 bool enforce_strict_matching =
false;
267 for (std::vector<uint32_t>::const_iterator _iov = orcon_iovs.begin();
268 _iov != orcon_iovs.end();
270 _index = (
int)(_iov - orcon_iovs.begin());
279 if (_orcon_index_offset == 1 && _index == 0)
continue;
292 if (omds_iovs[_index-_orcon_index_offset] != orcon_iovs[_index]){
295 std::cout <<
"HcalO2OManager: existing IOVs do not match, cannot sync in the strict sense." << std::endl;
296 std::cout <<
"HcalO2OManager: mismatched pair is (OMDS/offline): " << omds_iovs[_index-_orcon_index_offset] <<
"/" << orcon_iovs[_index] << std::endl;
297 std::cout <<
"HcalO2OManager: In the strict sense, the SYNCHRONIZATION OF THIS TAG HAS FAILED!" << std::endl;
298 std::cout <<
"HcalO2OManager: As an interim solution, I will still copy to the offline tag" << std::endl;
299 std::cout <<
"HcalO2OManager: those IOV from the OMDS tag that are newer than the last IOV" << std::endl;
300 std::cout <<
"HcalO2OManager: currently in the offline tag. " << std::endl;
304 if (enforce_strict_matching){
321 uint32_t _lastOrconIov = orcon_iovs[orcon_iovs.size()-1];
323 for (;_index < omds_iovs.size();++_index){
325 uint32_t _aIov = omds_iovs[_index];
327 if (_index == 0 && _aIov > _lastOrconIov){
328 iovs.push_back(_aIov);
331 else if (omds_iovs[_index]>omds_iovs[_index-1] &&
332 _aIov > _lastOrconIov){
333 iovs.push_back(omds_iovs[_index]);
337 if (enforce_strict_matching){
void HcalO2OManager::getListOfNewIovs_test |
( |
void |
| ) |
|
Definition at line 199 of file HcalO2OManager.cc.
References popcon2dropbox::copy(), gather_cfg::cout, and MillePedeFileConverter_cfg::out.
200 std::vector<uint32_t> omds, orcon,
out;
202 orcon.push_back(100);
220 std::cout <<
"HcalO2OManager::getListOfNewIovs_test(): O2O is not possible" << std::endl;
223 std::cout <<
"HcalO2OManager::getListOfNewIovs_test(): O2O is not needed, the tag is up to date" << std::endl;
226 std::cout <<
"HcalO2OManager::getListOfNewIovs_test(): O2O is possible" << std::endl;
227 std::cout <<
"HcalO2OManager::getListOfNewIovs_test(): " << out.size() <<
" IOVs to be copied to ORCON" << std::endl;
230 std::ostream_iterator<uint32_t>(
std::cout,
"\n")
int getListOfNewIovs(std::vector< uint32_t > &iovs, const std::vector< uint32_t > &omds_iovs, const std::vector< uint32_t > &orcon_iovs)
int HcalO2OManager::getListOfOmdsIovs |
( |
std::vector< uint32_t > & |
out, |
|
|
std::string |
tagname |
|
) |
| |
std::vector< std::string > HcalO2OManager::getListOfOmdsTags |
( |
| ) |
|
Definition at line 127 of file HcalO2OManager.cc.
References lumiTag::alltags, MessageLogger_cfi::cerr, ConnectionManager::connect(), ConnectionManager::disconnect(), MillePedeFileConverter_cfg::e, ConnectionManager::getStatement(), AlCaHLTBitMon_QueryRunRegistry::string, and toolbox::toString().
128 std::vector<std::string>
alltags;
132 query +=
" channel_map_id,subdet,ieta,iphi,depth ";
134 query +=
" cms_hcl_hcal_cond.hcal_channels ";
136 query +=
" subdet='HB' or subdet='HE' or subdet='HF' or subdet='HO' ";
139 oracle::occi::Statement* stmt = conn.
getStatement(query);
148 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,::
toolbox::toString(
"Oracle exception : %s",e.getMessage().c_str()));
oracle::occi::Statement * getStatement(const std::string &query)
oracle::occi::SQLException SQLException
oracle::occi::ResultSet ResultSet
int HcalO2OManager::getListOfPoolIovs |
( |
std::vector< uint32_t > & |
out, |
|
|
std::string |
tagname, |
|
|
std::string |
connect, |
|
|
std::string |
auth_path |
|
) |
| |
std::vector< std::string > HcalO2OManager::getListOfPoolTags |
( |
std::string |
connect, |
|
|
std::string |
auth_path |
|
) |
| |
int HcalO2OManager::getListOfUpdateIovs |
( |
std::vector< uint32_t > & |
_iovs, |
|
|
std::string |
_tag, |
|
|
std::string |
pool_connect_string, |
|
|
std::string |
pool_auth_path |
|
) |
| |
Definition at line 357 of file HcalO2OManager.cc.
References gather_cfg::cout.
363 std::vector<uint32_t> omds_iovs;
364 std::vector<uint32_t> pool_iovs;
371 std::cout <<
"HcalO2OManager: O2O is not possible" << std::endl;
373 else if (n_iovs == 0){
374 std::cout <<
"HcalO2OManager: O2O is not needed, the tag is up to date" << std::endl;
377 edm::LogInfo(
"HcalO2OManager") <<
"These IOVs are to be updated:" << std::endl;
378 for (std::vector<uint32_t>::const_iterator iov = _iovs.begin();
381 std::cout <<
"O2O_IOV_LIST: " << *iov << std::endl;
int getListOfNewIovs(std::vector< uint32_t > &iovs, const std::vector< uint32_t > &omds_iovs, const std::vector< uint32_t > &orcon_iovs)
int getListOfPoolIovs(std::vector< uint32_t > &out, std::string tagname, std::string connect, std::string auth_path)
int getListOfOmdsIovs(std::vector< uint32_t > &out, std::string tagname)