Commit 1366d11b authored by Joerg Stelzer's avatar Joerg Stelzer Committed by Graeme Stewart
Browse files

Fix HLTPrescalesSetLoader (ATR-10158) (TrigConfStorage-03-00-91)

	* Fix HLTPrescalesSetLoader (ATR-10158)
	* TrigConfStorage-03-00-91

2015-02-24 Joerg Stelzer
	* Add topo_start_from to DBloader
	* TrigConfStorage-03-00-90

2015-02-22 Joerg Stelzer
	* Update COOLFix application and add PIT mapping folder
	* TrigConfStorage-03-00-89

2015-02-22 Joerg Stelzer
	* Fix reading from cool for neighbouring runs
	* TrigConfStorage-03-00-88

2015-02-19  Werner Wiedenmann  <Werner.Wiedenmann@cern.ch>

	* TrigConfStorage-03-00-87
	* src/ReplicaSorter.cxx: remove printout statements (JIRA ATR-10212)
	* src/ReplicaSorter.cxx: use gethostname (JIRA ATR-10222)
...
(Long ChangeLog diff - truncated)
parent f630b858
......@@ -373,7 +373,7 @@ namespace TrigConf {
bool HLTPrescaleFolderExists();
void clearWriteFolder() { m_writeFolderList.clear(); }
private:
friend class AutoDBOpen;
......
......@@ -2,7 +2,6 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
* Menu consistency checks
*/
......@@ -1666,6 +1665,39 @@ public:
};
// Check L1 name < 400 character
class L1SeedLenghtTest : public TrigConfTest {
public:
L1SeedLenghtTest()
: TrigConfTest("Testing the lenght of the L1 Seed"),
m_chains("")
{}
virtual void execute(const Exc_t&) {
if ( ! m_hlt ) return;
std::set<std::string> l2Chains;
std::set<std::string> l1items;
for(const HLTChain* ch : m_hlt->getHLTChainList()) {
const std::string& lcn = ch->lower_chain_name();
if ( lcn == "" ) continue; // unseeded chains are fine
if (lcn.size()> 4000.){
m_chains += ch->chain_name() + ", ";
}
if(m_chains.size()!=0)
m_error = "The following chains have a L1 Item that is too long: " + m_chains;
}
}
private:
std::string m_chains;
};
// set of tests
ConfigurationCheck::ConfigurationCheck(TrigConf::CTPConfig* ctp, TrigConf::HLTFrame* hlt) {
m_tests.push_back(new NumberOfCTPItemsTest());
......@@ -1697,6 +1729,7 @@ ConfigurationCheck::ConfigurationCheck(TrigConf::CTPConfig* ctp, TrigConf::HLTFr
//m_tests.push_back(new L1CaloThrOrder()); //CB 23.05.2014: disabled for now, need to check with L1Calo about eta items order
m_tests.push_back(new OverlappingThrValues());
m_tests.push_back(new L1SeedLenghtTest());
//m_tests.push_back(new SignaturesConnectedTest());
......
......@@ -4,6 +4,11 @@
#include "./DBHelper.h"
#include <iostream>
#include "RelationalAccess/IColumn.h"
#include "RelationalAccess/ITableDescription.h"
void
TrigConf::fillQuery(coral::IQuery *q, coral::AttributeList& attList) {
q->defineOutput(attList);
......@@ -11,3 +16,12 @@ TrigConf::fillQuery(coral::IQuery *q, coral::AttributeList& attList) {
q->addToOutputList(attr->specification().name());
}
void
TrigConf::printTable(const coral::ITable & table) {
const coral::ITableDescription & desc = table.description();
for(int i=0; i<desc.numberOfColumns(); ++i) {
const coral::IColumn & col = desc.columnDescription(i);
std::cout << " " << col.name() << std::endl;
}
}
......@@ -18,6 +18,8 @@
#include "boost/foreach.hpp"
#include "boost/lexical_cast.hpp"
#include "RelationalAccess/ITable.h"
#include <string>
namespace TrigConf {
......@@ -26,6 +28,7 @@ namespace TrigConf {
inline std::string rmtilde(const std::string & input) { return input=="~" ? "" : input; }
void printTable(const coral::ITable & teTable);
}
......
......@@ -22,6 +22,7 @@
#include "RelationalAccess/IQuery.h"
#include <iostream>
#include <iomanip>
#include <sstream>
using namespace std;
......@@ -57,24 +58,23 @@ TrigConf::HLTFrameLoader::load( HLTFrame& frame ) {
// prescale set collection
bool all_connected(true);
cout << "Requested to load prescale sets: " << endl;
TRG_MSG_INFO("Requested to load prescale sets: ");
for( lbnpsk_t lbnpsk: reqested_prescale_keys) {
unsigned int psk = lbnpsk.second;
bool is_connected = psk!=0 && connected_psk.find(psk)!=connected_psk.end();
cout << " lb " << lbnpsk.first << ": " << lbnpsk.second;
TRG_MSG_INFO("LB " << setw(3) << right << lbnpsk.first << " : " << lbnpsk.second);
if(!is_connected) {
cout << " (ERROR prescale key " << lbnpsk.second << " is not connected to SMK)";
TRG_MSG_ERROR("prescale key " << lbnpsk.second << " is not connected to SMK");
all_connected = false;
}
cout << endl;
}
if(all_connected) {
frame.thePrescaleSetCollection().set_prescale_keys_to_load( reqested_prescale_keys );
HLTPrescaleSetCollectionLoader pssldr(m_storageMgr, m_session);
pssldr.setVerbose(verbose());
pssldr.setLevel(outputLevel());
//pssldr.setLevel(MSGTC::DEBUG);
pssldr.load(frame.thePrescaleSetCollection());
......
......@@ -102,6 +102,7 @@ bool
TrigConf::HLTPrescaleSetCollectionLoader::load( HLTPrescaleSetCollection& psc ) {
IHLTPrescaleSetLoader& pssloader = m_storageMgr.hltPrescaleSetLoader();
pssloader.setLevel(outputLevel());
bool loadsuccess = true;
......
......@@ -20,6 +20,7 @@
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <memory>
......@@ -66,6 +67,8 @@ TrigConf::HLTPrescaleSetLoader::load( HLTPrescaleSet& hltpss ) {
q->addToTableList ( "HLT_PRESCALE_SET", "PS" );
q->addToTableList ( "HLT_PRESCALE", "PR" );
//printTable(m_session.nominalSchema().tableHandle( "HLT_PRESCALE"));
//Bind list
coral::AttributeList bindList;
bindList.extend<int>("psid");
......@@ -87,6 +90,7 @@ TrigConf::HLTPrescaleSetLoader::load( HLTPrescaleSet& hltpss ) {
} else {
attList.extend<float> ( "PR.HPR_VALUE" );
attList.extend<string> ( "PR.HPR_TYPE" );
attList.extend<string> ( "PR.HPR_CONDITION" );
}
attList.extend<int> ( "PR.HPR_CHAIN_COUNTER" );
......@@ -128,47 +132,61 @@ TrigConf::HLTPrescaleSetLoader::load( HLTPrescaleSet& hltpss ) {
int counter = row["PR.HPR_CHAIN_COUNTER"].data<int>();
// this is faster than boost::lexical_cast string->float:
float ps(-999);
float pt(-999);
if(isRun1()) {
float ps(-999);
float pt(-999);
std::string prescaleStr = row["PR.HPR_PRESCALE"].data<string>();
if(prescaleStr=="-0" || prescaleStr=="na" ) prescaleStr = "-1";
if (!convert(prescaleStr, ps)) {
msg() << "Could not convert prescale string '" << prescaleStr << "' of chain "
<< counter << " to float" << std::endl;
TRG_MSG_WARNING("Could not convert prescale string '" << prescaleStr << "' of chain " << counter << " to float");
}
std::string passThroughStr = row["PR.HPR_PASS_THROUGH_RATE"].data<string>();
if (!convert(passThroughStr, pt)) {
msg() << "Could not convert passthrough string '" << passThroughStr << "' of chain "
<< counter << " to float" << std::endl;
}
TRG_MSG_WARNING("Could not convert passthrough string '" << passThroughStr << "' of chain " << counter << " to float");
}
if(level=="L2" || level=="l2" || level=="EF" || level=="ef" || level=="hlt" || level=="HLT" || level=="") {
hltpss.thePrescale( counter, str2lvl(level) )
.setPrescale(ps)
.setPassThrough(pt);
} else {
std::string streamnametype(level);
// sanity check: stream name and type are separated by ':'
if(streamnametype.rfind(':')==std::string::npos)
streamnametype += ":" + streamnametype;
}
} else {
// RUN 2
float value = row["PR.HPR_VALUE"].data<float>();
string pstype = row["PR.HPR_TYPE"].data<string>();
string pscondition = row["PR.HPR_CONDITION"].data<string>();
//cout << setw(4) << right << counter << " : " << pstype << " (" << pscondition << ") => " << value << endl;
auto& thePS = hltpss.thePrescale( counter, str2lvl("HLT") );
if(pstype=="Prescale") {
ps = value;
thePS.setPrescale(value);
} else if (pstype=="Pass_Through") {
pt = value;
} else if (pstype=="Rerun") {
//float psrr = value; // TODO
}
}
if(level=="L2" || level=="l2" || level=="EF" || level=="ef" || level=="hlt" || level=="HLT" || level=="") {
hltpss.thePrescale( counter, str2lvl(level) )
.setPrescale(ps)
.setPassThrough(pt);
} else {
std::string streamnametype(level);
// sanity check: stream name and type are separated by ':'
if(streamnametype.rfind(':')==std::string::npos)
streamnametype += ":" + streamnametype;
thePS.setPassThrough(value);
} else if (pstype=="ReRun") {
if(pscondition=="0") pscondition="";
thePS.setRerunPrescale(pscondition,value);
} else if (pstype=="Stream") {
// pscontition : stream name
thePS.setStreamPrescale(pscondition,value);
} else {
TRG_MSG_WARNING("Could not interpret this entry in the prescale set table: counter " << counter << " : " << pstype << " (" << pscondition << ") => " << value);
}
}
}
TRG_MSG_INFO("Loaded " << hltpss.size(L2) << " L2 prescales and " << hltpss.size(EF) << " EF prescales.");
if(isRun1()) {
TRG_MSG_INFO("Loaded " << hltpss.size(L2) << " L2 prescales and " << hltpss.size(EF) << " EF prescales.");
} else {
TRG_MSG_INFO("Loaded " << hltpss.size() << " HLT prescales");
}
commitSession();
}
catch (const coral::SchemaException& e) {
......
......@@ -4,6 +4,9 @@
#include "./HLTSequenceLoader.h"
#include "RelationalAccess/IColumn.h"
#include "RelationalAccess/ITableDescription.h"
#include "TrigConfHLTData/HLTFrame.h"
#include "TrigConfHLTData/HLTSequenceList.h"
#include "TrigConfHLTData/HLTTriggerElement.h"
......@@ -40,6 +43,23 @@ TrigConf::HLTSequenceLoader::loadSequences( HLTSequenceList& seqlist ) {
TRG_MSG_INFO("Start loading sequences with SMK " << m_smk);
coral::ITable & teTable = m_session.nominalSchema().tableHandle( "HLT_TRIGGER_ELEMENT");
const coral::ITableDescription & desc = teTable.description();
bool hasTopoStartsFrom = false;
try {
desc.columnDescription("HTE_TOPO_START_FROM");
hasTopoStartsFrom = true;
}
catch(coral::InvalidColumnNameException & ex) { }
// for(int i=0; i<desc.numberOfColumns(); ++i) {
// const coral::IColumn & col = desc.columnDescription(i);
// cout << " " << col.name() << endl;
// }
TRG_MSG_INFO("Found HTE_TOPO_START_FROM : " << (hasTopoStartsFrom ? "true" : "false") );
unique_ptr< coral::IQuery > q( m_session.nominalSchema().newQuery() );
q->addToTableList ( "SUPER_MASTER_TABLE" , "SM");
......@@ -74,6 +94,8 @@ TrigConf::HLTSequenceLoader::loadSequences( HLTSequenceList& seqlist ) {
coral::AttributeList attList;
attList.extend<int> ( "TE.HTE_ID" );
attList.extend<string>( "TE.HTE_NAME" );
if(hasTopoStartsFrom)
attList.extend<string>( "TE.HTE_TOPO_START_FROM" );
attList.extend<string>( "CP.HCP_NAME" );
attList.extend<string>( "CP.HCP_ALIAS" );
attList.extend<int> ( "TE2CP.HTE2CP_ALGORITHM_COUNTER" );
......@@ -89,12 +111,12 @@ TrigConf::HLTSequenceLoader::loadSequences( HLTSequenceList& seqlist ) {
q->setDistinct();
coral::ICursor& cursor = q->execute();
TRG_MSG_DEBUG("Query SELECT "
<< "TE.HTE_ID, TE.HTE_NAME, CP.HCP_NAME, CP.HCP_ALIAS, TE2CP.HTE2CP_ALGORITHM_COUNTER, TE2TE.HTE2TE_TE_INP_ID, TE2TE.HTE2TE_TE_INP_TYPE, TE2TE.HTE2TE_TE_COUNTER"
<< " FROM "
<< "SUPER_MASTER_TABLE SM, HLT_MASTER_TABLE HM, HLT_TM_TO_TC M2C, HLT_TC_TO_TS TC2TS,HLT_TS_TO_TE S2TE, HLT_TRIGGER_ELEMENT TE, HLT_TE_TO_CP TE2CP, HLT_TE_TO_TE TE2TE, HLT_COMPONENT CP"
<< " WHERE "
<< theCondition << ";");
// TRG_MSG_DEBUG("Query SELECT "
// << "TE.HTE_ID, TE.HTE_NAME, CP.HCP_NAME, CP.HCP_ALIAS, TE2CP.HTE2CP_ALGORITHM_COUNTER, TE2TE.HTE2TE_TE_INP_ID, TE2TE.HTE2TE_TE_INP_TYPE, TE2TE.HTE2TE_TE_COUNTER"
// << " FROM "
// << "SUPER_MASTER_TABLE SM, HLT_MASTER_TABLE HM, HLT_TM_TO_TC M2C, HLT_TC_TO_TS TC2TS,HLT_TS_TO_TE S2TE, HLT_TRIGGER_ELEMENT TE, HLT_TE_TO_CP TE2CP, HLT_TE_TO_TE TE2TE, HLT_COMPONENT CP"
// << " WHERE "
// << theCondition << ";");
while ( cursor.next() ) {
const coral::AttributeList& row = cursor.currentRow();
......@@ -103,6 +125,11 @@ TrigConf::HLTSequenceLoader::loadSequences( HLTSequenceList& seqlist ) {
if(seq==0) {
seq = new HLTSequence( vector<HLTTriggerElement*>(), new HLTTriggerElement(te_name), vector<string>() );
seqlist.addHLTSequence(seq);
if(hasTopoStartsFrom) {
string topo_start_from = rmtilde(row["TE.HTE_TOPO_START_FROM"].data<string>());
if( topo_start_from != "")
seq->set_topoStartTE(new HLTTriggerElement(topo_start_from));
}
}
......
......@@ -43,7 +43,7 @@ bool TrigConf::L1TopoMenuLoader::load( TXC::L1TopoMenu& tcaTarget ) {
bool TrigConf::L1TopoMenuLoader::loadTopoAlgos( TXC::L1TopoMenu& tcaTarget) {
TRG_MSG_DEBUG("Calling loadTopoAlgos");
TRG_MSG_VERBOSE("Calling loadTopoAlgos");
try {
startSession();
......@@ -72,7 +72,7 @@ bool TrigConf::L1TopoMenuLoader::loadTopoAlgos( TXC::L1TopoMenu& tcaTarget) {
coral::AttributeList attList0;
attList0.extend<int>( "TMT.TMT_TRIGGER_MENU_ID" );
attList0.extend<int>( "TMT.TMT_VERSION" );
attList0.extend<long>( "TMT.TMT_VERSION" );
attList0.extend<string>( "TTM.TTM_NAME" );
attList0.extend<int>( "TTM.TTM_VERSION" );
attList0.extend<int>( "TTM.TTM_CTPLINK_ID" );
......@@ -85,7 +85,7 @@ bool TrigConf::L1TopoMenuLoader::loadTopoAlgos( TXC::L1TopoMenu& tcaTarget) {
attList0.extend<int>( "TA.TA_ALGO_ID" );
query0->defineOutput(attList0);
fillQuery(query0.get(), attList0);
TRG_MSG_DEBUG("Executing loadTopoAlgos query ");
TRG_MSG_VERBOSE("Executing loadTopoAlgos query ");
coral::ICursor& cursor0 = query0->execute();
int ctplinkid = 0;
......@@ -128,7 +128,7 @@ bool TrigConf::L1TopoMenuLoader::loadTopoAlgos( TXC::L1TopoMenu& tcaTarget) {
bool TrigConf::L1TopoMenuLoader::loadAlgInput( TXC::L1TopoConfigAlg& tcaTarget, const int& ta_id ) {
try {
TRG_MSG_DEBUG("Calling loadAlgInput");
TRG_MSG_VERBOSE("Calling loadAlgInput");
startSession();
unique_ptr<coral::IQuery> query0(m_session.nominalSchema().newQuery());
......@@ -169,7 +169,7 @@ bool TrigConf::L1TopoMenuLoader::loadAlgInput( TXC::L1TopoConfigAlg& tcaTarget,
bool TrigConf::L1TopoMenuLoader::loadAlgRegister( TXC::L1TopoConfigAlg& tcaTarget, const int& ta_id ) {
try {
TRG_MSG_DEBUG("Calling loadAlgRegister");
TRG_MSG_VERBOSE("Calling loadAlgRegister");
startSession();
unique_ptr<coral::IQuery> query0(m_session.nominalSchema().newQuery());
......@@ -187,7 +187,7 @@ bool TrigConf::L1TopoMenuLoader::loadAlgRegister( TXC::L1TopoConfigAlg& tcaTarge
coral::AttributeList attList0;
attList0.extend<string>( "TP.TP_NAME" );
attList0.extend<int>( "TP.TP_VALUE" );
attList0.extend<long>( "TP.TP_VALUE" );
attList0.extend<int>( "TP.TP_POSITION" );
attList0.extend<int>( "TP.TP_SELECTION" );
query0->defineOutput(attList0);
......@@ -198,7 +198,7 @@ bool TrigConf::L1TopoMenuLoader::loadAlgRegister( TXC::L1TopoConfigAlg& tcaTarge
const coral::AttributeList& row0 = cursor0.currentRow();
//std::cout << "loadAlgRegister my row " << row0 << std::endl;
string tp_name = row0["TP.TP_NAME"].data<string>();
int tp_value = row0["TP.TP_VALUE"].data<int>();
long tp_value = row0["TP.TP_VALUE"].data<long>();
int tp_pos = row0["TP.TP_POSITION"].data<int>();
int tp_sel = row0["TP.TP_SELECTION"].data<int>();
tcaTarget.addParameter(tp_name,to_string(tp_value),tp_pos, tp_sel);
......@@ -212,7 +212,7 @@ bool TrigConf::L1TopoMenuLoader::loadAlgRegister( TXC::L1TopoConfigAlg& tcaTarge
bool TrigConf::L1TopoMenuLoader::loadAlgOutput( TXC::L1TopoConfigAlg& tcaTarget, const int& ta_id, const int& ta_bits ) {
try {
TRG_MSG_DEBUG("Calling loadAlgOutput");
TRG_MSG_VERBOSE("Calling loadAlgOutput");
startSession();
unique_ptr<coral::IQuery> query0(m_session.nominalSchema().newQuery());
query0->addToTableList("TA_TO_TO","TA2TO");
......@@ -254,7 +254,7 @@ bool TrigConf::L1TopoMenuLoader::loadAlgOutput( TXC::L1TopoConfigAlg& tcaTarget,
bool TrigConf::L1TopoMenuLoader::loadAlgFixed( TXC::L1TopoConfigAlg& tcaTarget, const int& ta_id ) {
try {
TRG_MSG_DEBUG("Calling loadAlgFixed");
TRG_MSG_VERBOSE("Calling loadAlgFixed");
startSession();
unique_ptr<coral::IQuery> query0(m_session.nominalSchema().newQuery());
......@@ -293,7 +293,7 @@ bool TrigConf::L1TopoMenuLoader::loadAlgFixed( TXC::L1TopoConfigAlg& tcaTarget,
bool TrigConf::L1TopoMenuLoader::loadOutputList( TXC::L1TopoMenu& tcaTarget, const int& ctplinkid) {
try {
TRG_MSG_DEBUG("Calling loadOutputList");
TRG_MSG_VERBOSE("Calling loadOutputList");
startSession();
unique_ptr<coral::IQuery> query0(m_session.nominalSchema().newQuery());
......@@ -346,7 +346,7 @@ bool TrigConf::L1TopoMenuLoader::loadOutputList( TXC::L1TopoMenu& tcaTarget, con
bool TrigConf::L1TopoMenuLoader::loadTopoConfig( TXC::L1TopoMenu& tcaTarget) {
try {
TRG_MSG_DEBUG("Calling loadTopoConfig");
TRG_MSG_VERBOSE("Calling loadTopoConfig");
startSession();
unique_ptr<coral::IQuery> query0(m_session.nominalSchema().newQuery());
......
......@@ -360,12 +360,12 @@ TrigConf::MenuLoader::loadMonitoring(TrigConf::Menu& menu) {
***************************************/
void
TrigConf::MenuLoader::loadThresholds(TrigConf::Menu& menu) {
if(verbose())
msg() << "MenuLoader: Start loading thresholds" << endl;
TRG_MSG_INFO("Loading thresholds");
ThresholdConfigLoader* thrldr = new ThresholdConfigLoader(m_storageMgr, m_session);
thrldr->setLevel(outputLevel());
if ( !thrldr->load( menu.thresholdConfig() ) ) {
msg() << "MenuLoader: Error loading ThresholdConfig " << menu.thresholdConfig().id() << endl;
TRG_MSG_ERROR("Error loading ThresholdConfig " << menu.thresholdConfig().id());
throw runtime_error( "MenuLoader: Error loading ThresholdConfig " );
}
......@@ -500,6 +500,7 @@ TrigConf::MenuLoader::loadCaloInfo(TrigConf::Menu& menu) {
// load the CaloInfo
TrigConf::CaloInfo ci;
ci.setSMK(menu.smk());
m_storageMgr.caloInfoLoader().setLevel(outputLevel());
m_storageMgr.caloInfoLoader().load(ci);
menu.setCaloInfo(ci);
}
......
......@@ -10,6 +10,8 @@
#include <fstream>
#include <map>
#include <cstring>
#include <climits>
#include <unistd.h>
#include "RelationalAccess/IDatabaseServiceDescription.h"
#include "ReplicaSorter.h"
......@@ -18,7 +20,7 @@ using namespace std;
TrigConf::ReplicaSorter::ReplicaSorter() :
m_frontiergen(false)
{
cout << "ReplicaSorter constructor" << endl;
std::cout << "ReplicaSorter constructor" << std::endl;
readConfig();
}
......@@ -66,24 +68,16 @@ 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";
system("hostname --fqdn > hostnamelookup.tmp");
std::ifstream infile;
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";
}
char cstr_host[HOST_NAME_MAX];
if (gethostname(cstr_host, sizeof(cstr_host))==0) {
m_hostname=std::string(cstr_host);
}
}
}
std::cout << "Using machine hostname " << m_hostname << " for DB replica resolution" << std::endl;
......
......@@ -48,9 +48,7 @@ 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,
......
......@@ -452,6 +452,7 @@ TrigConf::ThresholdConfigLoader::loadCaloInfo( ThresholdConfig& thrConfig, long
startSession();
CaloInfoLoader& cildr = dynamic_cast<CaloInfoLoader&>
((dynamic_cast<StorageMgr&>(m_storageMgr)).caloInfoLoader());
cildr.setLevel(outputLevel());
CaloInfo ci;
ci.setId(caloInfoId);
if ( !cildr.load( ci )) {
......
......@@ -342,7 +342,7 @@ TrigConf::TrigConfCoolWriter::writeHLTPayload( ValidityRange vr,
confkeyFolder->storeObject(vr.since(), vr.until(), payload, 0);
}
catch(exception & e) {
m_ostream << "<writeRunPayload> caught and re-throw exception: " << e.what() << endl
m_ostream << "<writeHLTPayload> caught and re-throw exception: " << e.what() << endl
<< "WARNING: Failed to write configuration keys to COOL" << endl;
throw;
}
......@@ -724,22 +724,24 @@ TrigConf::TrigConfCoolWriter::writeL1MenuPayload( ValidityRange vr,
AutoDBOpen db(this, READ_WRITE);
TrigConfCoolFolderSpec::createFolderStructure(m_dbPtr); // just in case
rangeInfo("LVL1 menu", vr.since(), vr.until());
// writing the Lvl1 menu
try {
// get the folders for the menu, itemDef, and thresholds
cool::IFolderPtr lvl1MenuFolder = TrigConfCoolFolderSpec::getLvl1MenuFolder(m_dbPtr);
cool::IFolderPtr lvl1ItemDefFolder = TrigConfCoolFolderSpec::getLvl1ItemDefFolder(m_dbPtr);
cool::IFolderPtr lvl1ThresholdFolder = TrigConfCoolFolderSpec::getLvl1ThresholdFolder(m_dbPtr);
if( shouldFolderBeUpdated("/TRIGGER/LVL1/Thresholds") &&
lvl1Menu.thresholdConfig().thresholdVector().size()>0 ) { // if there are no thresholds we don't want to write anything (METsig, JETWeights)
// get the folders for the menu, itemDef, and thresholds
cool::IFolderPtr lvl1ThresholdFolder = TrigConfCoolFolderSpec::getLvl1ThresholdFolder(m_dbPtr);
if( shouldFolderBeUpdated("/TRIGGER/LVL1/Thresholds") ) {
rangeInfo("LVL1 thresholds", vr.since(), vr.until());
// first, parse the threshold list and write to threshold folder
const std::vector<TrigConf::TriggerThreshold*> & lvl1Thrs = lvl1Menu.thresholdConfig().thresholdVector();
std::vector<TrigConf::TriggerThreshold*>::const_iterator thrIt = lvl1Thrs.begin();
// use buffer to speed up COOL writing
lvl1ThresholdFolder->setupStorageBuffer();
// go through the thresholds, channels assigned in the order (0..#thr-1)
cool::ChannelId thrChannel = 0;
// JOERG set back to 0 when done with the fixing
cool::ChannelId thrChannel = 2;
for(;thrIt != lvl1Thrs.end(); thrIt++) {
Record payloadThr = TrigConfCoolL1PayloadConverters::createLvl1ThresholdPayload( lvl1ThresholdFolder, **thrIt );
m_ostream << "Writing (to buffer) LVL1 threshold " << (*thrIt)->name()
......@@ -774,11 +776,27 @@ TrigConf::TrigConfCoolWriter::writeL1MenuPayload( ValidityRange vr,
<< "warning will be ignored, job will continue" << endl;
}
}
} catch( cool::Exception & e) {
m_ostream << "Caught cool::Exception: " << e.what() << endl;
m_ostream << "Failed to write LVL1 menu to COOL" << endl;
throw;
} catch(std::exception & e) {