Commit dd130ff6 authored by Catrin Bernius's avatar Catrin Bernius Committed by Graeme Stewart
Browse files

ATR-10063: Temporarily commented out the ThrSeqMismatch test in...

ATR-10063: Temporarily commented out the ThrSeqMismatch test in ConfigurationCheck.cxx (TrigConfStorage-03-00-83)

	* Temporarily commented out the ThrSeqMismatch test in ConfigurationCheck.cxx (ATR-10063)
	* TrigConfStorage-03-00-83

2015-02-11 Michael Rammensee <mrammens@cern.ch>
        * src/ReplicaSorter.cxx: fix regex logic in replica sorter ATR-10091
	* TrigConfStorage-03-00-82

2015-02-11 Joerg Stelzer
	* fix JetWeights issue when reading from COOL
	* TrigConfStorage-03-00-81

2015-02-05 Joerg Stelzer
	* fix problem when loading L1 menu where CTP files are absent
	* TrigConfStorage-03-00-80
parent 07c1acb6
......@@ -127,7 +127,7 @@ bool TrigConf::CTPConfigLoader::load(CTPConfig& ctpcTarget) {
commitSession();
throw std::runtime_error( "CTPConfigLoader >> CTPConfig not available" );
}
const coral::AttributeList& row = cursor.currentRow();
long filesid = row["L1TM_CTP_FILES_ID"].data<long>();
long smxid = row["L1TM_CTP_SMX_ID"].data<long>();
......@@ -140,7 +140,6 @@ bool TrigConf::CTPConfigLoader::load(CTPConfig& ctpcTarget) {
files->setLoadCtpcoreFiles( ctpcTarget.loadCtpcoreFiles() );
files->setLoadCtpinFiles( ctpcTarget.loadCtpinFiles() );
files->setLoadCtpmonFiles( ctpcTarget.loadCtpmonFiles() );
try {
CTPFilesLoader& ctpfilesldr =
dynamic_cast<CTPFilesLoader&>(m_storageMgr.ctpFilesLoader());
......@@ -160,27 +159,30 @@ bool TrigConf::CTPConfigLoader::load(CTPConfig& ctpcTarget) {
}
} else {
TRG_MSG_ERROR("Error loading CTP files, no files pointed to by the menu. CTP files id = " << filesid << ", SMX files id = " << smxid);
}
}
CTPFiles * files = ctpcTarget.ctpfiles();
if( files != nullptr ) {
TRG_MSG_INFO("Loaded CTPfiles. CAM size=" << files->ctpcoreCAM().size() << ", LUT size=" << files->ctpcoreCAM().size());
}
//load the priorityset
try {
PrioritySetLoader& prsldr = dynamic_cast<PrioritySetLoader&>(m_storageMgr.prioritySetLoader());
PrioritySet prs;
prs.setLvl1MasterTableId(ctpcTarget.lvl1MasterTableId());
if ( !prsldr.load( prs ) ) {
TRG_MSG_ERROR("Can't load PrioritySet " << prs.lvl1MasterTableId());
if(isRun1()) {
try {
PrioritySetLoader& prsldr = dynamic_cast<PrioritySetLoader&>(m_storageMgr.prioritySetLoader());
PrioritySet prs;
prs.setLvl1MasterTableId(ctpcTarget.lvl1MasterTableId());
if ( !prsldr.load( prs ) ) {
TRG_MSG_ERROR("Can't load PrioritySet " << prs.lvl1MasterTableId());
commitSession();
throw std::runtime_error( "CTPConfigLoader: Error loading PrioritySet" );
}
ctpcTarget.setPrioritySet(prs);
} catch (std::bad_cast& ex) {
TRG_MSG_ERROR("Caught exception in CTPConfigLoader : " << ex.what() );
commitSession();
throw std::runtime_error( "CTPConfigLoader: Error loading PrioritySet" );
throw std::runtime_error( "CTPConfigLoader: Error casting PrioritySetLoader" );
}
ctpcTarget.setPrioritySet(prs);
} catch (std::bad_cast& ex) {
TRG_MSG_ERROR("Caught exception in CTPConfigLoader : " << ex.what() );
commitSession();
throw std::runtime_error( "CTPConfigLoader: Error casting PrioritySetLoader" );
}
} else {
TRG_MSG_INFO("No loading of CTPFiles");
......@@ -188,7 +190,6 @@ bool TrigConf::CTPConfigLoader::load(CTPConfig& ctpcTarget) {
// now load the data
{
MenuLoader& mldr = dynamic_cast<MenuLoader&>(m_storageMgr.menuLoader());
......
......@@ -487,6 +487,7 @@ void TrigConf::CTPFilesLoader::parseHexString(std::vector<u_int>& vec,const std:
}
} else {
TRG_MSG_INFO("DB File content is 0, which is expected for MC, Reprocessing, and ATN databases");
return;
}
for(u_int i=0; i < vec.size(); ++i) {
......
......@@ -1691,7 +1691,7 @@ ConfigurationCheck::ConfigurationCheck(TrigConf::CTPConfig* ctp, TrigConf::HLTFr
//m_tests.push_back(new CrossLevelAlgSeeding());
//m_tests.push_back(new FJBJThresholdSymetric());
m_tests.push_back(new FJBJThrsholdsUsedInPairs());
m_tests.push_back(new ThrSeqMismatch());
//m_tests.push_back(new ThrSeqMismatch()); //CB temp commented out (ATR-10063)
m_tests.push_back(new CoherentPrescales());
m_tests.push_back(new L1CaloThrDef());
//m_tests.push_back(new L1CaloThrOrder()); //CB 23.05.2014: disabled for now, need to check with L1Calo about eta items order
......
......@@ -119,7 +119,7 @@ TrigConf::MasterTableLoader::load(CTPConfig& ctpc) {
try {
CTPConfigLoader& ctpLoader =
dynamic_cast<CTPConfigLoader&>(m_storageMgr.ctpConfigLoader());
ctpLoader.setVerbose(DBLoader::verbose());
ctpLoader.setLevel(outputLevel());
try {
return ctpLoader.load(ctpc);
} catch ( const std::exception& e ) {
......@@ -149,7 +149,7 @@ TrigConf::MasterTableLoader::load(Muctpi& m) {
}
try {
MuctpiLoader& muctpiLoader = dynamic_cast<MuctpiLoader&>( m_storageMgr.muctpiLoader() );
muctpiLoader.setVerbose(DBLoader::verbose());
muctpiLoader.setLevel(outputLevel());
return muctpiLoader.load(m);
} catch (std::bad_cast& ex) {
msg() << "Caught exception in MasterTableLoader : "
......@@ -161,7 +161,7 @@ TrigConf::MasterTableLoader::load(Muctpi& m) {
bool TrigConf::MasterTableLoader::load(TXC::L1TopoMenu& l1topo){
try {
L1TopoMenuLoader& l1topoLoader = dynamic_cast<L1TopoMenuLoader&>(m_storageMgr.l1topoMenuLoader());
l1topoLoader.setVerbose(DBLoader::verbose());
l1topoLoader.setLevel(outputLevel());
return l1topoLoader.load(l1topo);
} catch (std::exception& ex) {
msg() << "Caught exception in MasterTableLoader : "
......
......@@ -32,7 +32,9 @@ TrigConf::ReplicaSorter::sort(std::vector<const coral::IDatabaseServiceDescripti
// do not use SQLite files
if (conn.find("sqlite_file")==std::string::npos) {
// extract the server name (assuming URLs "techno://server/schema")
std::string::size_type ipos1=conn.find("://");
// example of current conn naming scheme: coral://127.0.0.1:3320/&oracle://ATLAS_CONFIG/ATLAS_CONF_TRIGGER_REPR
std::string::size_type ipos0=conn.find("&");
std::string::size_type ipos1=conn.find("://",ipos0+1);
std::string::size_type ipos2=conn.find("/",ipos1+3);
if (ipos1!=std::string::npos && ipos2!=std::string::npos) {
const std::string server=conn.substr(ipos1+3,ipos2-ipos1-3);
......@@ -64,9 +66,11 @@ TrigConf::ReplicaSorter::readConfig() {
m_hostname="";
const char* chost=getenv("ATLAS_CONDDB");
if (chost) m_hostname=chost;
std::cout << "JOERG 1 " << m_hostname << std::endl;
if (m_hostname.empty()) {
const char* chost=getenv("HOSTNAME");
if (chost) m_hostname=chost;
std::cout << "JOERG 2 " << m_hostname << " " << chost << std::endl;
// check if the returned host has a .
if (m_hostname.find(".")==std::string::npos) {
m_hostname="unknown";
......@@ -75,7 +79,9 @@ TrigConf::ReplicaSorter::readConfig() {
infile.open("hostnamelookup.tmp");
if (infile) {
infile >> m_hostname;
std::cout << "JOERG 3 " << m_hostname << std::endl;
} else {
std::cout << "JOERG 4 " << m_hostname << std::endl;
m_hostname="unknown";
}
}
......@@ -143,6 +149,7 @@ TrigConf::ReplicaSorter::readConfig() {
std::string::size_type hlen=m_hostname.size();
if (hlen>=len && *itr==m_hostname.substr(hlen-len,len)) {
if (len>bestlen) {
atCERN=true;
useit=true;
bestlen=len;
}
......
......@@ -48,7 +48,9 @@ TrigConf::StorageMgr::StorageMgr( const std::string& cs,
, m_user( user )
, m_password( pass )
, m_ostream( o )
{}
{
cout << "LLLLLLLLLL SM " << sizeof(*this) << endl;
}
TrigConf::StorageMgr::StorageMgr( const std::string& type,
const std::string& server,
......
......@@ -552,7 +552,7 @@ TrigConfCoolL1PayloadConverters::readLvl1BGDesc(const coral::AttributeList & al)
throw runtime_error("Read BLOB for ItemToBunchGroupMap of unexpected size!");
const unsigned char* p = static_cast<const unsigned char*>(blob.startingAddress());
for (size_t i = 0; i < blob.size(); ++i,++p) {
for (long i = 0; i < blob.size(); ++i,++p) {
unsigned char mask = (*p);
codes.insert( make_pair(i,mask) );
}
......
......@@ -748,12 +748,16 @@ TrigConf::TrigConfCoolWriter::writeL1MenuPayload( ValidityRange vr,
lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadThr, thrChannel++);
}
m_ostream << "Writing (to buffer) LVL1 threshold 'JetWeights':";
const std::vector<int>& jetweights = lvl1Menu.caloInfo().jetWeights();
std::copy(jetweights.begin(), jetweights.end(), std::ostream_iterator<int>(m_ostream, ", "));
m_ostream << endl;
Record payloadJW = TrigConfCoolL1PayloadConverters::createLvl1JetWeightPayload( lvl1ThresholdFolder, lvl1Menu.caloInfo().jetWeights() );
lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadJW, thrChannel++);
// TODO
if( lvl1Menu.thresholdConfig().l1Version() == 0 ) {
m_ostream << "Writing (to buffer) LVL1 threshold 'JetWeights':";
const std::vector<int>& jetweights = lvl1Menu.caloInfo().jetWeights();
std::copy(jetweights.begin(), jetweights.end(), std::ostream_iterator<int>(m_ostream, ", "));
m_ostream << endl;
Record payloadJW = TrigConfCoolL1PayloadConverters::createLvl1JetWeightPayload( lvl1ThresholdFolder, lvl1Menu.caloInfo().jetWeights() );
lvl1ThresholdFolder->storeObject(vr.since(), vr.until(), payloadJW, thrChannel++);
}
m_ostream << "Writing (to buffer) LVL1 threshold 'MET Significance parameters':";
lvl1Menu.caloInfo().metSigParam().print();
......@@ -1272,9 +1276,6 @@ TrigConfCoolWriter::readL1Payload( unsigned int run,
*/
readL1Menu( run, ctpc );
}
void
......@@ -1440,7 +1441,6 @@ TrigConfCoolWriter::readL1Menu(unsigned int run, CTPConfig & ctpc)
Menu & menu = ctpc.menu();
// thresholds
vector<TriggerThreshold*> thrs;
readL1Thresholds(run, thrs);
......@@ -1475,11 +1475,14 @@ TrigConfCoolWriter::readL1Menu(unsigned int run, CTPConfig & ctpc)
readL1ItemDef(run, items, thrs);
CaloInfo ci;
for(TriggerThreshold* thr: thrs) {
if ( thr->name()=="JetWeights" ) {
for ( const string& weights : split( thr->cableName(),",") )
ci.addJetWeight( boost::lexical_cast<int, string>(weights) );
if(!isRun2) {
for ( const string& weights : split( thr->cableName(),",") )
ci.addJetWeight( boost::lexical_cast<int, string>(weights) );
}
}
else if ( thr->name()=="METSigParams" ) {
vector<string> metvals = split( thr->cableName(),",");
......@@ -1496,7 +1499,6 @@ TrigConfCoolWriter::readL1Menu(unsigned int run, CTPConfig & ctpc)
// trigger thresholds sorted by type
menu.thresholdConfig().addTriggerThreshold(thr);
}
}
menu.setCaloInfo(ci);
......
......@@ -422,7 +422,7 @@ int main( int argc, char* argv[] ) {
if(sm->hasLVL1()) {
ctpc = new CTPConfig();
log << "Retrieving Lvl1 CTP configuration from " << sm->m_xmlL1File << lineend;
DBLoader::setEnv(DBLoader::CTP);
// DBLoader::setEnv(DBLoader::CTP);
sm->masterTableLoader().setLevel(gConfig.outputlevel);
sm->masterTableLoader().load(*ctpc);
sm->masterTableLoader().load(ctpc->muCTPi());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment