TriggerDB loader of the HLT signatures.  
 More...
#include <HLTChainLoader.h>
TriggerDB loader of the HLT signatures. 
Definition at line 17 of file HLTChainLoader.h.
◆ HLTChainLoader()
  
  | 
        
          | TrigConf::HLTChainLoader::HLTChainLoader | ( | StorageMgr & | sm, |  
          |  |  | coral::ISessionProxy & | session |  
          |  | ) |  |  |  | inline | 
 
constructor 
- Parameters
- 
  
    | sm | reference to storage manager |  | session | reference to the database session |  
 
Definition at line 25 of file HLTChainLoader.h.
   26          DBLoader(
"HLTChainLoader", sm, session) {}
 
 
 
 
◆ ~HLTChainLoader()
  
  | 
        
          | virtual TrigConf::HLTChainLoader::~HLTChainLoader | ( |  | ) |  |  | overridevirtualdefault | 
 
 
◆ commitSession()
  
  | 
        
          | void TrigConf::DBLoader::commitSession | ( |  | ) |  |  | inherited | 
 
commit session if not already done 
Definition at line 45 of file DBLoader.cxx.
 
 
◆ getName()
  
  | 
        
          | const std::string & TrigConf::TrigConfMessaging::getName | ( |  | ) | const |  | inlineinherited | 
 
 
◆ isRun1()
  
  | 
        
          | bool TrigConf::DBLoader::isRun1 | ( |  | ) |  |  | inlineinherited | 
 
 
◆ isRun2()
  
  | 
        
          | bool DBLoader::isRun2 | ( |  | ) |  |  | inherited | 
 
 
◆ load()
  
  | 
        
          | bool TrigConf::HLTChainLoader::load | ( | HLTFrame & | frame | ) |  |  | virtual | 
 
Definition at line 22 of file HLTChainLoader.cxx.
   28    HLTChainList& 
chains = frame.theHLTChainList();
 
   39    catch( 
const coral::Exception& 
e ) {
 
   45    chains.setEFLowerChainCounter();
 
 
 
 
◆ loadChains()
      
        
          | void TrigConf::HLTChainLoader::loadChains | ( | HLTChainList & | chainlist | ) |  | 
      
 
Definition at line 52 of file HLTChainLoader.cxx.
   56    std::unique_ptr< coral::IQuery > 
q( 
m_session.nominalSchema().newQuery() );
 
   59    q->addToTableList ( 
"SUPER_MASTER_TABLE",    
"SM"    );
 
   60    q->addToTableList ( 
"HLT_MASTER_TABLE",      
"HM"    );
 
   61    q->addToTableList ( 
"HLT_TRIGGER_MENU",      
"TM"    );
 
   62    q->addToTableList ( 
"HLT_TM_TO_TC",          
"TM2TC" );
 
   63    q->addToTableList ( 
"HLT_TRIGGER_CHAIN",     
"TC"    );
 
   67    bindList.extend<
int>(
"smid");
 
   68    bindList[0].data<
int>() = (
int)
m_smk;
 
   70    string theCondition = 
"";
 
   71    theCondition += string( 
" SM.SMT_ID     = :smid");
 
   72    theCondition += string( 
" AND HM.HMT_ID = SM.SMT_HLT_MASTER_TABLE_ID"        );
 
   73    theCondition += string( 
" AND TM.HTM_ID = HM.HMT_TRIGGER_MENU_ID"            );
 
   74    theCondition += string( 
" AND TM.HTM_ID = TM2TC.HTM2TC_TRIGGER_MENU_ID "     );
 
   75    theCondition += string( 
" AND TC.HTC_ID = TM2TC.HTM2TC_TRIGGER_CHAIN_ID"     );
 
   77    q->setCondition( theCondition, bindList );
 
   81    attList.extend<
long>  ( 
"TC.HTC_ID"               );
 
   82    attList.extend<
string>( 
"TC.HTC_NAME"             );
 
   83    attList.extend<
string>( 
"TC.HTC_LOWER_CHAIN_NAME" );
 
   85       attList.extend<
string>( 
"TC.HTC_L2_OR_EF"         );
 
   86       attList.extend<
string>( 
"TC.HTC_RERUN_PRESCALE"   );
 
   88    attList.extend<
int>   ( 
"TC.HTC_CHAIN_COUNTER"    );
 
   89    attList.extend<
int>   ( 
"TC.HTC_VERSION"          );
 
   95       theOrder += 
"  TC.HTC_L2_OR_EF DESC, ";
 
   97    theOrder += 
" TC.HTC_CHAIN_COUNTER ASC";
 
   98    q->addToOrderList( theOrder );
 
  102    coral::ICursor& 
cursor = 
q->execute();
 
  107       long chainId                         = 
row[
"TC.HTC_ID"].data<
long>();
 
  108       int counter                          = 
row[
"TC.HTC_CHAIN_COUNTER"].data<
int>();  
 
  109       int version                          = 
row[
"TC.HTC_VERSION"].data<
int>();  
 
  111       string lower_chain_name              = 
rmtilde(
row[
"TC.HTC_LOWER_CHAIN_NAME"].data<string>());
 
  114       string level = 
"HLT";
 
  125          string rerunps_s = 
rmtilde(
row[
"TC.HTC_RERUN_PRESCALE"].data<string>());
 
  126          std::string_view rerunps_sv = rerunps_s;
 
  127          auto [
ptr, ec] = std::from_chars(rerunps_sv.data(), rerunps_sv.data() + rerunps_sv.size(), rerunps, std::chars_format::general);
 
  128          if (ec != std::errc()) {
 
  132             ch->set_rerun_prescale(rerunps);
 
  136       chainlist.addHLTChain(
ch);
 
  140    TRG_MSG_INFO(
"Loaded " << chainlist.size() << 
" chains");
 
 
 
 
◆ loadGroups()
      
        
          | void TrigConf::HLTChainLoader::loadGroups | ( | HLTChainList & | chainlist | ) |  | 
      
 
Definition at line 169 of file HLTChainLoader.cxx.
  171    std::unique_ptr< coral::IQuery > 
q( 
m_session.nominalSchema().newQuery() );
 
  172    string theCondition(
"");
 
  175    defineChainSubQuery( 
q.get(), theCondition, bindings, 
m_smk, output);
 
  177    q->addToTableList ( 
"HLT_TRIGGER_GROUP",     
"GR"    );
 
  179    theCondition += string( 
" AND GR.HTG_TRIGGER_CHAIN_ID = TM2TC.HTM2TC_TRIGGER_CHAIN_ID" );
 
  181    q->setCondition( theCondition, bindings );
 
  183    output.extend<
string>( 
"GR.HTG_NAME"   );
 
  188    coral::ICursor& 
cursor = 
q->execute();
 
  195       string grname                        = 
rmtilde(
row[
"GR.HTG_NAME"].data<string>());
 
  196       chainlist.chain(
name)->addGroup(grname);
 
 
 
 
◆ loadL1MasterKey()
  
  | 
        
          | bool TrigConf::DBLoader::loadL1MasterKey | ( | int | SuperMasterKey, |  
          |  |  | int & | Lvl1MasterKey |  
          |  | ) |  |  |  | inherited | 
 
get l1 master from super master 
Definition at line 128 of file DBLoader.cxx.
  132       unique_ptr< coral::IQuery > 
q( 
m_session.nominalSchema().tableHandle( 
"SUPER_MASTER_TABLE").newQuery() );
 
  133       q->setRowCacheSize( 5 );
 
  137       bindings.extend<
int>(
"smtid");
 
  138       bindings[0].data<
int>() = 
smk;
 
  139       q->setCondition( 
"SMT_ID = :smtid", bindings );
 
  143       attList.extend<
int>( 
"SMT_L1_MASTER_TABLE_ID" );
 
  146       coral::ICursor& 
cursor = 
q->execute();
 
  148          msg() << 
"DBLoader:           No such SuperMaster key exists " << 
smk << endl;
 
  149          throw runtime_error( 
"DBLoader:        SuperMasterKey not available" );
 
  153       Lvl1MasterKey = 
row[
"SMT_L1_MASTER_TABLE_ID"].data<
int>();
 
  157       msg() << 
"DBLoader:         C++ exception: " << 
e.what() << std::endl;
 
 
 
 
◆ loadL1MenuKey()
  
  | 
        
          | bool TrigConf::DBLoader::loadL1MenuKey | ( | int | SuperMasterKey, |  
          |  |  | int & | Lvl1MenuKey |  
          |  | ) |  |  |  | inherited | 
 
get l1 menu id from super master 
Definition at line 167 of file DBLoader.cxx.
  175       unique_ptr< coral::IQuery > 
q( 
m_session.nominalSchema().tableHandle( 
"L1_MASTER_TABLE").newQuery() );
 
  176       q->setRowCacheSize( 5 );
 
  180       bindings.extend<
int>(
"l1mtid");
 
  181       bindings[0].data<
int>() = l1Master;
 
  182       q->setCondition( 
"L1MT_ID = :l1mtid" , bindings );
 
  186       attList.extend<
int>( 
"L1MT_TRIGGER_MENU_ID" );
 
  187       q->defineOutput(attList);
 
  188       q->addToOutputList( 
"L1MT_TRIGGER_MENU_ID" );
 
  190       coral::ICursor& 
cursor = 
q->execute();
 
  192          msg() << 
"DBLoader >> No such L1 Master key exists " << l1Master << std::endl;
 
  193          throw std::runtime_error( 
"DBLoader >> L1MasterKey not available" );
 
  198       Lvl1MenuKey = 
row[
"L1MT_TRIGGER_MENU_ID"].data<
int>();
 
  204       msg() << 
"DBLoader >> Standard C++ exception: " << 
e.what() << std::endl;
 
 
 
 
◆ loadSchemaVersion()
  
  | 
        
          | std::tuple< unsigned int, unsigned int > DBLoader::loadSchemaVersion | ( |  | ) | const |  | privateinherited | 
 
get DB schema version and run number 
Definition at line 81 of file DBLoader.cxx.
   83    const static auto versions = [&]() -> std::tuple<unsigned int,unsigned int> {
 
   84       bool mySession = 
false;
 
   85       if ( ! 
m_session.transaction().isActive() ) {
 
   90       std::unique_ptr< coral::IQuery > 
q( 
m_session.nominalSchema().tableHandle( 
"TRIGGER_SCHEMA").newQuery() );
 
   91       q->setRowCacheSize( 1 );
 
   95       attList.extend<
int>( 
"TS_ID" );
 
   96       q->defineOutput(attList);
 
   97       q->addToOutputList( 
"TS_ID" );
 
   99       q->addToOrderList(
"TS_ID desc");
 
  100       coral::ICursor& 
cursor = 
q->execute();
 
  104          if ( mySession ) 
m_session.transaction().commit();
 
  105          throw std::runtime_error( 
"DBLoader::loadSchemaVersion() >> Table TRIGGER_SCHEMA is not filled" );
 
  113       const unsigned int run = 
m_session.nominalSchema().existsTable( 
"ACTIVE_MASTERS" ) ? 2 : 1;
 
  119       if ( mySession ) 
m_session.transaction().commit();
 
 
 
 
◆ loadSignatures()
      
        
          | void TrigConf::HLTChainLoader::loadSignatures | ( | HLTChainList & | chainlist | ) |  | 
      
 
Definition at line 294 of file HLTChainLoader.cxx.
  296    std::unique_ptr< coral::IQuery > 
q( 
m_session.nominalSchema().newQuery() );
 
  297    string theCondition(
"");
 
  300    defineChainSubQuery( 
q.get(), theCondition, bindings, 
m_smk, output);
 
  302    q->addToTableList ( 
"HLT_TC_TO_TS",          
"TC2TS" );
 
  303    q->addToTableList ( 
"HLT_TRIGGER_SIGNATURE", 
"TS"    );
 
  304    q->addToTableList ( 
"HLT_TS_TO_TE",          
"TS2TE" );
 
  305    q->addToTableList ( 
"HLT_TRIGGER_ELEMENT",   
"TE"    );
 
  308    theCondition += string( 
" AND TC2TS.HTC2TS_TRIGGER_CHAIN_ID = TC.HTC_ID" );
 
  309    theCondition += string( 
" AND TC2TS.HTC2TS_TRIGGER_SIGNATURE_ID = TS.HTS_ID" );
 
  310    theCondition += string( 
" AND TC2TS.HTC2TS_TRIGGER_SIGNATURE_ID = TS2TE.HTS2TE_TRIGGER_SIGNATURE_ID" );
 
  311    theCondition += string( 
" AND TE.HTE_ID = TS2TE.HTS2TE_TRIGGER_ELEMENT_ID" );
 
  312    theCondition += string( 
" AND TS2TE.HTS2TE_ELEMENT_COUNTER>=0" ); 
 
  314    output.extend<
int>( 
"TC2TS.HTC2TS_SIGNATURE_COUNTER" );
 
  315    output.extend<
int>( 
"TS2TE.HTS2TE_ELEMENT_COUNTER" );
 
  316    output.extend<
int>( 
"TS.HTS_LOGIC" );
 
  317    output.extend<
int>( 
"TE.HTE_ID" );
 
  318    output.extend<
string>( 
"TE.HTE_NAME" );
 
  321    q->setCondition( theCondition, bindings );
 
  325    q->addToOrderList( 
"TC.HTC_NAME" );
 
  326    q->addToOrderList( 
"TC2TS.HTC2TS_SIGNATURE_COUNTER" );
 
  327    q->addToOrderList( 
"TS2TE.HTS2TE_ELEMENT_COUNTER" );
 
  329    coral::ICursor& 
cursor = 
q->execute();
 
  337       string chainname    = 
rmtilde(
row[
"TC.HTC_NAME"].data<string>());
 
  338       vector<HLTSignature*>& sig_list = chainlist.chain(chainname)->signatureList();
 
  340       unsigned int sig_counter = (
unsigned int)
row[
"TC2TS.HTC2TS_SIGNATURE_COUNTER"].data<int>();
 
  341       if( sig_list.size() < sig_counter+1 )
 
  342          sig_list.resize( sig_counter+1, 0 );
 
  344       if( sig_list[sig_counter] == 0) {
 
  345          int logic = 
row[
"TS.HTS_LOGIC"].data<
int>();
 
  346          sig_list[sig_counter] = 
new HLTSignature(sig_counter, logic, std::vector<HLTTriggerElement*>());
 
  347          sig_list[sig_counter]->set_label( chainname + 
"_" + 
std::to_string(sig_counter) );
 
  350       HLTSignature* 
sig = sig_list[sig_counter];
 
  351       vector<HLTTriggerElement*>& te_list = 
sig->outputTEs();
 
  353       unsigned int te_counter  = (
unsigned int)
row[
"TS2TE.HTS2TE_ELEMENT_COUNTER"].data<int>();
 
  354       if( te_list.size() < te_counter+1 )
 
  355          te_list.resize( te_counter+1, 0 );
 
  357       if( te_list[te_counter] == 0) {
 
  358          int te_id = 
row[
"TE.HTE_ID"].data<
int>();
 
  359          string te_name = 
row[
"TE.HTE_NAME"].data<
string>(); 
 
  360          te_list[te_counter] = 
new HLTTriggerElement(te_id, te_name);
 
  372       vector<HLTSignature*>& 
s = 
ch->signatureList();
 
  373       s.erase(
remove(
s.begin(), 
s.end(), (HLTSignature*)0), 
s.end());
 
 
 
 
◆ loadStreams()
      
        
          | void TrigConf::HLTChainLoader::loadStreams | ( | HLTChainList & | chainlist | ) |  | 
      
 
Definition at line 244 of file HLTChainLoader.cxx.
  246    std::unique_ptr< coral::IQuery > 
q( 
m_session.nominalSchema().newQuery() );
 
  247    string theCondition(
"");
 
  250    defineChainSubQuery( 
q.get(), theCondition, bindings, 
m_smk, output);
 
  252    q->addToTableList ( 
"HLT_TC_TO_TR",          
"TC2TR" );
 
  253    q->addToTableList ( 
"HLT_TRIGGER_STREAM",    
"TR"    );
 
  255    theCondition += string( 
" AND TC2TR.HTC2TR_TRIGGER_CHAIN_ID = TC.HTC_ID" );
 
  256    theCondition += string( 
" AND TC2TR.HTC2TR_TRIGGER_STREAM_ID = TR.HTR_ID" );
 
  258    output.extend<
string>( 
"TC2TR.HTC2TR_TRIGGER_STREAM_PRESCALE");
 
  259    output.extend<
string>( 
"TR.HTR_NAME" );
 
  260    output.extend<
string>( 
"TR.HTR_TYPE" );
 
  261    output.extend<
int>( 
"TR.HTR_OBEYLB" );
 
  265    q->setCondition( theCondition, bindings );
 
  268    coral::ICursor& 
cursor = 
q->execute();
 
  274       string chainname    = 
rmtilde(
row[
"TC.HTC_NAME"].data<string>());
 
  275       string prescale_str = 
rmtilde(
row[
"TC2TR.HTC2TR_TRIGGER_STREAM_PRESCALE"].data<string>());
 
  276       string streamname   = 
rmtilde(
row[
"TR.HTR_NAME"].data<string>());
 
  278       bool obeyLB         = 
row[
"TR.HTR_OBEYLB"].data<
int>();
 
  280       std::string_view prescale_str_view = prescale_str;
 
  281       auto [
ptr, ec] = std::from_chars(prescale_str_view.data(), prescale_str_view.data() + prescale_str_view.size(), prescale);
 
  282       if (ec != std::errc()) {
 
  285       chainlist.chain(chainname)->addStream( 
new HLTStreamTag(streamname, 
type, obeyLB, prescale) );
 
 
 
 
◆ loadTypes()
      
        
          | void TrigConf::HLTChainLoader::loadTypes | ( | HLTChainList & | chainlist | ) |  | 
      
 
Definition at line 208 of file HLTChainLoader.cxx.
  210    std::unique_ptr< coral::IQuery > 
q( 
m_session.nominalSchema().newQuery() );
 
  211    string theCondition(
"");
 
  214    defineChainSubQuery( 
q.get(), theCondition, bindings, 
m_smk, output);
 
  216    q->addToTableList ( 
"HLT_TRIGGER_TYPE",   
"TT" );
 
  218    theCondition += string( 
" AND TT.HTT_TRIGGER_CHAIN_ID = TM2TC.HTM2TC_TRIGGER_CHAIN_ID" );
 
  220    q->setCondition( theCondition, bindings );
 
  222    output.extend<
int>( 
"TT.HTT_TYPEBIT" );
 
  227    coral::ICursor& 
cursor = 
q->execute();
 
  234       int    triggertype                   = 
row[
"TT.HTT_TYPEBIT"].data<
int>();
 
  235       chainlist.chain(
name)->triggerTypeList().push_back(
new HLTTriggerType(triggertype));
 
 
 
 
◆ msg() [1/2]
  
  | 
        
          | MsgStreamTC & TrigConf::TrigConfMessaging::msg | ( |  | ) | const |  | inlineinherited | 
 
The standard message stream. 
Returns a reference to the message stream May not be invoked before sysInitialize() has been invoked. 
Definition at line 86 of file TrigConfMessaging.h.
 
 
◆ msg() [2/2]
The standard message stream. 
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked. 
Definition at line 96 of file TrigConfMessaging.h.
 
 
◆ msgLvl()
Test the output level. 
- Parameters
- 
  
    | lvl | The message level to test against |  
 
- Returns
- boolean Indicting if messages at given level will be printed 
- Return values
- 
  
    | true | Messages at level "lvl" will be printed |  
 
Definition at line 75 of file TrigConfMessaging.h.
 
 
◆ outputLevel()
  
  | 
        
          | virtual MSGTC::Level TrigConf::DBLoader::outputLevel | ( |  | ) | const |  | inlineoverridevirtualinherited | 
 
 
◆ setLevel()
◆ setVerbose()
  
  | 
        
          | virtual void TrigConf::DBLoader::setVerbose | ( | int | v | ) |  |  | inlineoverridevirtualinherited | 
 
 
◆ startSession()
  
  | 
        
          | void TrigConf::DBLoader::startSession | ( |  | ) |  |  | inherited | 
 
start session if not already active 
Definition at line 35 of file DBLoader.cxx.
   37    if ( ! 
m_session.transaction().isActive() ) {
 
 
 
 
◆ triggerDBSchemaVersion()
  
  | 
        
          | unsigned int DBLoader::triggerDBSchemaVersion | ( |  | ) |  |  | inherited | 
 
 
◆ verbose()
  
  | 
        
          | virtual int TrigConf::DBLoader::verbose | ( |  | ) | const |  | inlineoverridevirtualinherited | 
 
 
◆ m_msg_tls
  
  | 
        
          | boost::thread_specific_ptr<MsgStreamTC> TrigConf::TrigConfMessaging::m_msg_tls |  | mutableprivateinherited | 
 
 
◆ m_name
  
  | 
        
          | std::string TrigConf::TrigConfMessaging::m_name |  | privateinherited | 
 
 
◆ m_schemaversion
  
  | 
        
          | unsigned int TrigConf::HLTChainLoader::m_schemaversion {0} |  | private | 
 
 
◆ m_session
  
  | 
        
          | coral::ISessionProxy& TrigConf::DBLoader::m_session |  | protectedinherited | 
 
CORAL interface to database session. 
Definition at line 68 of file DBLoader.h.
 
 
◆ m_sessionOwner
  
  | 
        
          | bool TrigConf::DBLoader::m_sessionOwner {false} |  | protectedinherited | 
 
remember if the loader started the session in the first place 
Definition at line 69 of file DBLoader.h.
 
 
◆ m_smk
  
  | 
        
          | unsigned int TrigConf::HLTChainLoader::m_smk {0} |  | private | 
 
 
◆ m_storageMgr
reference to the storage manager 
Definition at line 67 of file DBLoader.h.
 
 
◆ m_verbose
  
  | 
        
          | int TrigConf::DBLoader::m_verbose {1} |  | privateinherited | 
 
 
The documentation for this class was generated from the following files: