Commit 1bb41d9d authored by Joerg Stelzer's avatar Joerg Stelzer Committed by Graeme Stewart
Browse files

src/DSConfigSvc.cxx: sets EM energy scale correctly to 2 for run 2 data (TrigConfigSvc-01-01-51)

	* src/DSConfigSvc.cxx: sets EM energy scale correctly to 2 for run 2 data
	and MC
	* TrigConfigSvc-01-01-51

2015-06-12  Frank Winklmeier  <fwinkl@cern>
	* python/TrigConfigSvcUtils.py: Fix getL1Prescales to also handle Run-2 style prescales
	* TrigConfigSvc-01-01-50

2015-06-02 Ricardo Abreu
	* do not warn about property mismatch for THistSvc (ATR-11372)
	* TrigConfigSvc-01-01-49

2015-04-15 Ricardo Abreu
	* access db config only when configuring from the DB
	* TrigConfigSvc-01-01-48

2015-04-15 Ricardo Abreu
	* Handle Run 2 DB config format (for ATR-10823)
	* TrigConfigSvc-01-01-47

...
(Long ChangeLog diff - truncated)
parent b5aea748
......@@ -39,7 +39,7 @@ namespace TrigConf {
int m_dbSMKey { 0 };
int m_dbLVL1PSKey { 0 };
int m_dbHLTPSKey { 0 };
std::string m_dbHLTPSKeySet { "" };
std::string m_dbHLTPSKeySet { "[]" };
BooleanProperty m_useFrontier { false };
int m_printMenuLevel { 1 };
std::unique_ptr<TrigDBConnectionConfig> m_dbconfig;
......
......@@ -308,7 +308,7 @@ def getUsedTables(output, condition, schemaname, tables):
def isRun2(cursor,schemaname):
import cx_Oracle
if type(cursor.connection)!=cx_Oracle.Connection:
if not hasattr(cursor,'connection') or type(cursor.connection)!=cx_Oracle.Connection:
log.warning('Detection of DB schema only supported for Oracle. Will assume run-2')
return True
......@@ -670,20 +670,28 @@ def getStreams(connection, smk):
def getL1Prescales(connection, l1prescalekey):
cursor,schemaname = getTriggerDBCursor(connection)
isrun2 = isRun2(cursor,schemaname)
maxitems = 512 if isrun2 else 256
tables = { 'L' : 'L1_PRESCALE_SET' }
output = ['L.L1PS_NAME'] + ['L.L1PS_VAL%i' % i for i in xrange(1,257)]
output = ['L.L1PS_NAME'] + ['L.L1PS_VAL%i' % i for i in xrange(1,maxitems+1)]
condition = [ "L.L1PS_ID = '%i'" % l1prescalekey ]
res = executeQuery(cursor, output, condition, schemaname, tables)
name,prescales = res[0][0], res[0][1:257]
name,prescales = res[0][0], res[0][1:maxitems+1]
if isrun2: prescales = map(getPrescaleFromCut, prescales)
return (name,prescales)
def getPrescaleFromCut(cut):
"""Convert (run-2) prescale cuts into prescale value"""
sign = -1 if cut<0 else 1
ucut = abs(cut)
return (sign*0xFFFFFF ) / float( 0x1000000 - ucut );
def queryHLTPrescaleTable(connection,psk):
"""returns content of prescale set table and prescale table for a
given HLT prescale key
......
......@@ -64,12 +64,15 @@ ConfigSvcBase::initialize() {
if (s == "oracle") { dbtype = TrigDBConnectionConfig::Oracle; }
else if (s == "mysql") { dbtype = TrigDBConnectionConfig::MySQL; }
else if (s == "sqlite") { dbtype = TrigDBConnectionConfig::SQLite; }
m_dbconfig = std::unique_ptr<TrigDBConnectionConfig>{
new TrigDBConnectionConfig( dbtype,
m_dbServer,
m_dbSMKey,
m_dbHLTPSKey)
};
TrigDBConnectionConfig * tmpptr{nullptr};
if(m_dbHLTPSKey)
tmpptr = new TrigDBConnectionConfig(dbtype, m_dbServer, m_dbSMKey,
m_dbHLTPSKey);
else
tmpptr = new TrigDBConnectionConfig(dbtype, m_dbServer, m_dbSMKey,
m_dbHLTPSKeySet);
m_dbconfig = std::unique_ptr<TrigDBConnectionConfig>{std::move(tmpptr)};
m_dbconfig->m_useFrontier = m_useFrontier;
}
......
......@@ -2,7 +2,7 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: DSConfigSvc.cxx 645890 2015-02-11 00:40:56Z stelzer $
// $Id: DSConfigSvc.cxx 677827 2015-06-24 07:52:56Z stelzer $
#include "GaudiKernel/IIncidentSvc.h"
#include "GaudiKernel/Incident.h"
......@@ -569,6 +569,10 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) {
m_ctpConfig.setL1Version(isRun2 ? 1 : 0);
L1DataDef::setMaxThresholdsFromL1Version( m_ctpConfig.l1Version() );
ATH_MSG_INFO( " Determined format " << (isRun2 ? "Run 2" : "Run 1") );
float emEnergyScale = isRun2 ? 2 : 1;
const_cast<CaloInfo&>(m_ctpConfig.menu().caloInfo()).setGlobalEmScale( emEnergyScale );
ATH_MSG_INFO( " Setting EM energy scale to " << emEnergyScale );
for(TriggerThreshold * thr : tmpThrVector) {
......
......@@ -46,12 +46,6 @@
using namespace std;
using namespace TrigConf;
bool hasLBPSKList(const string & dbHLTPSKeySet) {
return (dbHLTPSKeySet != "" && dbHLTPSKeySet != "[]"); // empty list can be "" or "[]" (change comes with the new DBConnection class)
}
HLTConfigSvc::HLTConfigSvc( const string& name, ISvcLocator* pSvcLocator ) :
base_class(name, pSvcLocator),
m_eventStore(0),
......@@ -138,22 +132,21 @@ HLTConfigSvc::initialize() {
ATH_MSG_INFO(" Run merged HLT = " << m_setMergedHLT);
if( m_dbHLTPSKey!=0 && hasLBPSKList(m_dbHLTPSKeySet) )
if( fromDB() && m_dbHLTPSKey!=0 && !m_dbconfig->m_hltkeys.empty() )
ATH_MSG_WARNING("DBHLTPSKey and DBHLTPSKeySet both specified, the DBHLTPSKeySet will be ignored");
// Read the HLT configuration
m_HLTFrame.setMergedHLT( m_setMergedHLT );
m_HLTFrame.setSMK( m_dbSMKey );
if( m_dbHLTPSKey > 0) {
m_HLTFrame.thePrescaleSetCollection().set_prescale_key_to_load( m_dbHLTPSKey );
} else if( hasLBPSKList(m_dbHLTPSKeySet) ) {
// LB1uPSK1cLB2uPSK2..., meaning from LB1 use PSK1, change at LB2 use PSK2, ...
vector<pair<unsigned int, unsigned int> > all_lbnpsk;
for( const string& lbupsk: split( m_dbHLTPSKeySet, "c") ) {
auto lbpsk = split(lbupsk, "u" );
all_lbnpsk.push_back(std::make_pair<unsigned int, unsigned int>(atoi(lbpsk[0].c_str()),atoi(lbpsk[1].c_str())) );
}
m_HLTFrame.thePrescaleSetCollection().set_prescale_keys_to_load( all_lbnpsk );
if(fromDB())
{
m_HLTFrame.setSMK( m_dbSMKey );
if(m_dbHLTPSKey) {
m_HLTFrame.thePrescaleSetCollection().set_prescale_key_to_load(
m_dbHLTPSKey);
} else {
m_HLTFrame.thePrescaleSetCollection().set_prescale_keys_to_load(
m_dbconfig->m_hltkeys);
}
}
CHECK(initStorageMgr());
......@@ -232,13 +225,8 @@ TrigConf::HLTConfigSvc::start() {
if( ! fromDB() ) // xml config
return StatusCode::SUCCESS;
// if the m_dbHLTPSKeySet is set then we don't need to load any
// prescales
if( hasLBPSKList(m_dbHLTPSKeySet) )
return StatusCode::SUCCESS;
// also load the prescale set for the initial HLT PSK into the PrescaleSetCollection
if(m_dbHLTPSKey>0) {
if(m_dbHLTPSKey) {
ATH_MSG_INFO("Loading PrescaleSet for initial HLT PSK: " << m_dbHLTPSKey);
......@@ -379,7 +367,7 @@ TrigConf::HLTConfigSvc::updatePrescaleSets(uint requestcount) {
return StatusCode::SUCCESS;
}
if( hasLBPSKList(m_dbHLTPSKeySet) ) {
if( !m_dbconfig->m_hltkeys.empty() ) {
ATH_MSG_WARNING("Has list of [(lb1,psk1), (lb2,psk2),...] defined!");
return StatusCode::SUCCESS;
}
......
......@@ -312,7 +312,8 @@ TrigConf::HLTJobOptionsSvc::setMyProperties( const std::string& client, IPropert
}
// check if the DB and the client agree in size
if( propertiesFromDBSorted.size() != propertiesFromDB->size() ) {
if( propertiesFromDBSorted.size() != propertiesFromDB->size() &&
client != "THistSvc") {
//find the properties that differ between the two lists
std::vector<const Property*> propertiesFromDBDiffer;
for( const Property * dbProp : *propertiesFromDB ) {
......@@ -327,11 +328,11 @@ TrigConf::HLTJobOptionsSvc::setMyProperties( const std::string& client, IPropert
propertiesFromDBDiffer.push_back(dbProp);
}
}
ATH_MSG_WARNING( client << " asks for " << propertiesFromDBSorted.size() << " properties while the database knows about "
ATH_MSG_ERROR( client << " asks for " << propertiesFromDBSorted.size() << " properties while the database knows about "
<< propertiesFromDB->size() << ", properties that differ are: ");
for(const Property* differ : propertiesFromDBDiffer )
ATH_MSG_WARNING( " " << differ->name() );
ATH_MSG_ERROR( " " << differ->name() );
}
......
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