Skip to content
Snippets Groups Projects
Commit c0824e06 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'master-protectMenuLoading' into 'master'

Trigger config loading - schema tracing and result reporting

See merge request !36313
parents 4d72505e 1e46c58e
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!36313Trigger config loading - schema tracing and result reporting
Showing
with 273 additions and 97 deletions
......@@ -51,7 +51,9 @@ namespace TrigConf {
* @param data Reference to the data container
*/
DataStructure(const ptree & data);
DataStructure(const std::string & name, const ptree & data);
DataStructure(ptree && data);
DataStructure(const std::string & name, ptree && data);
/** Destructor */
virtual ~DataStructure();
......
......@@ -25,6 +25,7 @@ namespace TrigConf {
* @param data The data containing the HLT chain configuration
*/
Chain(const boost::property_tree::ptree & data);
Chain(const std::string & name, const boost::property_tree::ptree & data);
/** Destructor */
virtual ~Chain();
......@@ -60,7 +61,7 @@ namespace TrigConf {
private:
void update() override;
void load();
};
}
......
......@@ -34,6 +34,11 @@ namespace TrigConf {
/** Destructor */
~HLTMenu();
// class name
virtual std::string className() const override {
return "HLTMenu";
}
/** Accessor to the number of HLT chains */
std::size_t size() const;
......@@ -67,6 +72,7 @@ namespace TrigConf {
private:
void update() override;
void load();
/** the supermasterkey */
unsigned int m_smk {0};
......
......@@ -37,6 +37,11 @@ namespace TrigConf {
/** Destructor */
~HLTPrescalesSet();
// class name
virtual std::string className() const override {
return "HLTPrescaleSet";
}
/** number of HLT prescales */
std::size_t size() const;
......
......@@ -40,6 +40,11 @@ namespace TrigConf {
/** Destructor */
virtual ~L1Menu();
// class name
virtual std::string className() const override {
return "L1Menu";
}
/** Accessor to the menu version */
unsigned int version() const;
......
......@@ -40,6 +40,11 @@ namespace TrigConf {
/** Destructor */
virtual ~L1PrescalesSet();
// class name
virtual std::string className() const override {
return "L1PrescaleSet";
}
/** number of L1 prescales */
std::size_t size() const;
......
......@@ -78,6 +78,7 @@ namespace TrigConf {
L1ThrExtraInfo_JETLegacy(const std::string & thrTypeName, const ptree & data) :
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_JETLegacy() = default;
virtual std::string className() const { return "L1ThrExtraInfo_JETLegacy"; }
unsigned int jetScale() const { return 1000 / resolutionMeV(); }
float ptMinToTopoLargeWindow() const { return m_ptMinToTopoLargeWindowMeV / 1000.0f; }
float ptMinToTopoSmallWindow() const { return m_ptMinToTopoSmallWindowMeV / 1000.0f; }
......@@ -99,6 +100,7 @@ namespace TrigConf {
L1ThrExtraInfo_XSLegacy(const std::string & thrTypeName, const ptree & data) :
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_XSLegacy() = default;
virtual std::string className() const { return "L1ThrExtraInfo_XSLegacy"; }
unsigned int xeMin() const { return m_xeMin; };
unsigned int xeMax() const { return m_xeMax; };
unsigned int teSqrtMin() const { return m_teSqrtMin; };
......@@ -126,6 +128,7 @@ namespace TrigConf {
L1ThrExtraInfo_eEMTAU(const std::string & thrTypeName, const ptree & data) :
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_eEMTAU() = default;
virtual std::string className() const { return "L1ThrExtraInfo_eEMTAU"; }
float ptMinToTopo() const { return m_ptMinToTopoMeV/1000.0f; }
unsigned int ptMinToTopoMeV() const { return m_ptMinToTopoMeV; }
unsigned int ptMinToTopoCounts() const { return energyInCounts( m_ptMinToTopoMeV, resolutionMeV() ); }
......@@ -145,6 +148,7 @@ namespace TrigConf {
L1ThrExtraInfo_jJ(const std::string & thrTypeName, const ptree & data) :
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_jJ() = default;
virtual std::string className() const { return "L1ThrExtraInfo_jJ"; }
float ptMinToTopoLarge(int eta = 0) const { return ptMinToTopoLargeMeV(eta) / 1000.0f; }
float ptMinToTopoSmall(int eta = 0) const { return ptMinToTopoSmallMeV(eta) / 1000.0f; }
unsigned int ptMinToTopoLargeMeV(int eta = 0) const { return m_ptMinToTopoLargeMeV.at(eta); }
......@@ -167,6 +171,7 @@ namespace TrigConf {
L1ThrExtraInfo_jTAU(const std::string & thrTypeName, const ptree & data) :
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_jTAU() = default;
virtual std::string className() const { return "L1ThrExtraInfo_jTAU"; }
unsigned int ptMinToTopo() const { return m_ptMinToTopo; }
private:
/** Update the internal members */
......@@ -181,6 +186,7 @@ namespace TrigConf {
L1ThrExtraInfo_gXE(const std::string & thrTypeName, const ptree & data) :
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_gXE() = default;
virtual std::string className() const { return "L1ThrExtraInfo_gXE"; }
private:
/** Update the internal members */
void load();
......@@ -193,6 +199,7 @@ namespace TrigConf {
L1ThrExtraInfo_MU(const std::string & thrTypeName, const ptree & data) :
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_MU() = default;
virtual std::string className() const { return "L1ThrExtraInfo_MU"; }
unsigned int rpcIdxForPt(unsigned int pt) const;
unsigned int tgcIdxForPt(unsigned int pt) const;
std::vector<unsigned int> knownRpcPtValues() const;
......
......@@ -19,6 +19,8 @@ namespace TrigConf {
L1Threshold_EM( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> m_extraInfo, const ptree & data) :
L1Threshold_Calo(name, type, m_extraInfo, data) { load(); }
virtual ~L1Threshold_EM() = default;
// class name
virtual std::string className() const override { return "L1Threshold_EM"; }
uint16_t isolationMask(int eta) const { return m_isolationMask.at(eta); }
void print(std::ostream & os = std::cout) const override;
protected:
......@@ -37,6 +39,7 @@ namespace TrigConf {
L1Threshold_TAU( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> m_extraInfo, const ptree & data) :
L1Threshold_Calo(name, type, m_extraInfo, data) { load(); }
virtual ~L1Threshold_TAU() = default;
virtual std::string className() const override { return "L1Threshold_TAU"; }
// access functions
uint16_t isolationMask() const { return m_isolationMask; }
protected:
......@@ -54,6 +57,7 @@ namespace TrigConf {
L1Threshold_JET( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> m_extraInfo, const ptree & data) :
L1Threshold_Calo(name, type, m_extraInfo, data) {};
virtual ~L1Threshold_JET() = default;
virtual std::string className() const override { return "L1Threshold_JET"; }
};
class L1Threshold_XE final : public L1Threshold_Calo {
......@@ -61,6 +65,7 @@ namespace TrigConf {
L1Threshold_XE( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> m_extraInfo, const ptree & data) :
L1Threshold_Calo(name, type, m_extraInfo, data) {};
virtual ~L1Threshold_XE() = default;
virtual std::string className() const override { return "L1Threshold_XE"; }
};
class L1Threshold_XS final : public L1Threshold_Calo {
......@@ -68,6 +73,7 @@ namespace TrigConf {
L1Threshold_XS( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> m_extraInfo, const ptree & data) :
L1Threshold_Calo(name, type, m_extraInfo, data) {};
virtual ~L1Threshold_XS() = default;
virtual std::string className() const override { return "L1Threshold_XS"; }
};
class L1Threshold_TE final : public L1Threshold_Calo {
......@@ -75,6 +81,7 @@ namespace TrigConf {
L1Threshold_TE( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> m_extraInfo, const ptree & data) :
L1Threshold_Calo(name, type, m_extraInfo, data) {};
virtual ~L1Threshold_TE() = default;
virtual std::string className() const override { return "L1Threshold_TE"; }
};
/************************************
......@@ -88,6 +95,7 @@ namespace TrigConf {
L1Threshold_NIM( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> m_extraInfo, const ptree & data) :
L1Threshold(name, type, m_extraInfo, data) {};
virtual ~L1Threshold_NIM() = default;
virtual std::string className() const override { return "L1Threshold_NIM"; }
};
class L1Threshold_internal final : public L1Threshold {
......@@ -95,6 +103,7 @@ namespace TrigConf {
L1Threshold_internal( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> m_extraInfo, const ptree & data) :
L1Threshold(name, type, m_extraInfo, data) {};
virtual ~L1Threshold_internal() = default;
virtual std::string className() const override { return "L1Threshold_internal"; }
};
/************************************
......@@ -107,6 +116,7 @@ namespace TrigConf {
L1Threshold_eEM( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> m_extraInfo, const ptree & data) :
L1Threshold_Calo(name, type, m_extraInfo, data) { load(); }
virtual ~L1Threshold_eEM() = default;
virtual std::string className() const override { return "L1Threshold_eEM"; }
// access functions
Isolation::WP reta() const { return m_reta; }
Isolation::WP rhad() const { return m_rhad; }
......@@ -129,6 +139,7 @@ namespace TrigConf {
L1Threshold_eTAU( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> m_extraInfo, const ptree & data) :
L1Threshold_Calo(name, type, m_extraInfo, data) { load(); }
virtual ~L1Threshold_eTAU() = default;
virtual std::string className() const override { return "L1Threshold_eTAU"; }
protected:
virtual void update() override {
L1Threshold_Calo::update();
......@@ -153,6 +164,7 @@ namespace TrigConf {
L1Threshold_MU( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> m_extraInfo, const ptree & data) :
L1Threshold(name, type, m_extraInfo, data) { load(); }
virtual ~L1Threshold_MU() = default;
virtual std::string className() const override { return "L1Threshold_MU"; }
float thrValue(int eta = 0) const override;
......
......@@ -89,14 +89,14 @@ namespace TrigConf {
const std::string & thresholdTypeName() const;
bool hasExtraInfo() const;
bool hasExtraInfo( const std::string & key = "") const;
unsigned int resolutionMeV() const {
return m_resolutionMeV;
}
protected:
virtual void upload() {
virtual void update() override {
load();
}
std::map<std::string, DataStructure> m_extraInfo{};
......
......@@ -28,6 +28,11 @@ namespace TrigConf {
/** Destructor */
~L1TopoOutput();
// class name
virtual std::string className() const override {
return "L1TopoOutput";
}
/** Accessor to the algorithm name */
const std::string & algName() const;
......
......@@ -12,8 +12,13 @@ TrigConf::DataStructure::DataStructure()
TrigConf::DataStructure::DataStructure(const ptree & data) :
DataStructure("",data)
{}
TrigConf::DataStructure::DataStructure(const std::string & name, const ptree & data) :
m_initialized(true),
m_dataPtr(&data)
m_dataPtr(&data),
m_name(name)
{}
......@@ -55,7 +60,8 @@ void
TrigConf::DataStructure::clear()
{
m_initialized = false;
update();
m_dataSPtr = nullptr;
m_dataPtr = nullptr;
}
......
......@@ -10,15 +10,28 @@ TrigConf::Chain::Chain()
TrigConf::Chain::Chain(const boost::property_tree::ptree & data)
: DataStructure(data)
{
update();
load();
}
TrigConf::Chain::Chain(const std::string & name, const boost::property_tree::ptree & data)
: DataStructure(name, data)
{
load();
}
void
TrigConf::Chain::update()
{
load();
}
void
TrigConf::Chain::load()
{
if(! isInitialized() || empty() ) {
return;
}
m_name = getAttribute("name", true, m_name);
}
TrigConf::Chain::~Chain()
......
......@@ -13,15 +13,20 @@ TrigConf::HLTMenu::HLTMenu()
TrigConf::HLTMenu::HLTMenu(const boost::property_tree::ptree & data)
: DataStructure(data)
{
update();
load();
}
TrigConf::HLTMenu::~HLTMenu()
{}
void
TrigConf::HLTMenu::update()
{
load();
}
void
TrigConf::HLTMenu::load()
{
if(! isInitialized() || empty() ) {
return;
......@@ -49,7 +54,7 @@ TrigConf::HLTMenu::setSMK(unsigned int smk) {
TrigConf::HLTMenu::const_iterator
TrigConf::HLTMenu::begin() const
{
return {data().get_child("chains"), 0, [](auto & x){auto chain = Chain(x.second); chain.setName(x.first); return chain; }};
return {data().get_child("chains"), 0, [](auto & x){auto chain = Chain(x.first, x.second); return chain; }};
}
TrigConf::HLTMenu::const_iterator
......@@ -64,12 +69,13 @@ std::vector<TrigConf::DataStructure>
TrigConf::HLTMenu::streams() const
{
std::vector<DataStructure> strlist;
const auto & streams = data().get_child("streams");
strlist.reserve(streams.size());
for( auto & strData : streams )
strlist.emplace_back( strData.second );
auto streams = data().get_child_optional("streams");
if(streams) {
strlist.reserve(streams->size());
for( auto & strData : *streams ) {
strlist.emplace_back( strData.second );
}
}
return strlist;
}
......@@ -94,7 +100,7 @@ void
TrigConf::HLTMenu::printMenu(bool full) const
{
cout << "HLT menu '" << name() << "'" << endl;
cout << "Streams: " << data().get_child("streams").size() << endl;
cout << "Streams: " << streams().size() << endl;
cout << "Chains: " << size() << endl;
if(full) {
int c(0);
......
......@@ -13,8 +13,7 @@ TrigConf::HLTPrescalesSet::HLTPrescalesSet(const boost::property_tree::ptree & d
update();
}
TrigConf::HLTPrescalesSet::~HLTPrescalesSet()
{}
TrigConf::HLTPrescalesSet::~HLTPrescalesSet() = default;
void
TrigConf::HLTPrescalesSet::update()
......
......@@ -25,87 +25,109 @@ TrigConf::L1Menu::update()
if(! isInitialized() || empty() ) {
return;
}
m_name = getAttribute("name");
// thresholds
for( const std::string & path : {"thresholds", "thresholds.legacyCalo" } ) {
for( auto & thrByType : data().get_child( path ) ) {
const std::string & thrType = thrByType.first;
if (thrType == "legacyCalo")
continue;
// first create the extraInfo object for this type of thresholds
auto extraInfo = m_thrExtraInfo.addExtraInfo(thrByType.first,thrByType.second);
auto & v = m_thresholdsByType[thrType] = std::vector<std::shared_ptr<TrigConf::L1Threshold>>();
if(thrType == "internal") {
for( auto & thr : data().get_child( path + ".internal.names") ) {
const std::string thrName = thr.second.data();
v.push_back( L1Threshold::createThreshold( thrName, thrType, extraInfo, thr.second ) );
try {
m_name = getAttribute("name");
// thresholds
for( const std::string & path : {"thresholds", "thresholds.legacyCalo" } ) {
for( auto & thrByType : data().get_child( path ) ) {
const std::string & thrType = thrByType.first;
if (thrType == "legacyCalo")
continue;
// first create the extraInfo object for this type of thresholds
auto extraInfo = m_thrExtraInfo.addExtraInfo(thrByType.first,thrByType.second);
auto & v = m_thresholdsByType[thrType] = std::vector<std::shared_ptr<TrigConf::L1Threshold>>();
if(thrType == "internal") {
for( auto & thr : data().get_child( path + ".internal.names") ) {
const std::string thrName = thr.second.data();
v.push_back( L1Threshold::createThreshold( thrName, thrType, extraInfo, thr.second ) );
}
} else {
for( auto & thr : data().get_child( path + "." + thrType + ".thresholds") ) {
const std::string thrName = thr.first;
v.push_back( L1Threshold::createThreshold( thrName, thrType, extraInfo, thr.second ) );
}
}
} else {
for( auto & thr : data().get_child( path + "." + thrType + ".thresholds") ) {
const std::string thrName = thr.first;
v.push_back( L1Threshold::createThreshold( thrName, thrType, extraInfo, thr.second ) );
for( auto & thr : v ) {
m_thresholdsByName[ thr->name() ] = thr;
}
}
for( auto & thr : v ) {
m_thresholdsByName[ thr->name() ] = thr;
}
}
}
// boards
for( auto & board : data().get_child( "boards" ) ) {
m_boards.emplace( std::piecewise_construct,
std::forward_as_tuple(board.first),
std::forward_as_tuple(board.first, board.second) );
catch(std::exception & ex) {
std::cerr << "ERROR: problem when building L1 menu structure (thresholds). " << ex.what() << std::endl;
throw;
}
// connectors
for( auto & conn : data().get_child( "connectors" ) ) {
auto res = m_connectors.emplace( std::piecewise_construct,
std::forward_as_tuple(conn.first),
std::forward_as_tuple(conn.first, conn.second) );
for( auto & tl : res.first->second.triggerLineNames() ) {
m_threshold2ConnectorName.emplace( std::piecewise_construct,
std::forward_as_tuple(tl),
std::forward_as_tuple(conn.first));
try {
// boards
for( auto & board : data().get_child( "boards" ) ) {
m_boards.emplace( std::piecewise_construct,
std::forward_as_tuple(board.first),
std::forward_as_tuple(board.first, board.second) );
}
}
catch(std::exception & ex) {
std::cerr << "ERROR: problem when building L1 menu structure (boards). " << ex.what() << std::endl;
throw;
}
// algorithms
for( const std::string & algoCategory : { "TOPO", "MULTTOPO", "MUTOPO", "R2TOPO" } ) {
auto & v = m_algorithmsByCategory[algoCategory] = std::vector<TrigConf::L1TopoAlgorithm>();
if(algoCategory == "MULTTOPO") {
for( auto & alg : data().get_child( "topoAlgorithms." + algoCategory + ".multiplicityAlgorithms" ) ) {
v.emplace_back( alg.first, L1TopoAlgorithm::AlgorithmType::MULTIPLICITY, algoCategory, alg.second );
}
} else {
for( L1TopoAlgorithm::AlgorithmType algoType : { L1TopoAlgorithm::AlgorithmType::DECISION, L1TopoAlgorithm::AlgorithmType::SORTING } ) {
std::string subpath = "topoAlgorithms." + algoCategory + (algoType==L1TopoAlgorithm::AlgorithmType::DECISION ? ".decisionAlgorithms" : ".sortingAlgorithms" );
for( auto & algorithm : data().get_child( subpath ) ) {
v.emplace_back( algorithm.first, algoType, algoCategory, algorithm.second );
}
try {
// connectors
for( auto & conn : data().get_child( "connectors" ) ) {
auto res = m_connectors.emplace( std::piecewise_construct,
std::forward_as_tuple(conn.first),
std::forward_as_tuple(conn.first, conn.second) );
for( auto & tl : res.first->second.triggerLineNames() ) {
m_threshold2ConnectorName.emplace( std::piecewise_construct,
std::forward_as_tuple(tl),
std::forward_as_tuple(conn.first));
}
}
for( auto & algo : v ) {
if( m_algorithmsByName[algoCategory].count(algo.name()) > 0 ) {
std::cerr << "ERROR : Topo algorithm with name " << algo.name() << " and of type " << algoCategory << " already exists" << std::endl;
throw std::runtime_error("Found duplicate topo algorithm name " + algo.name() + " of type " + algoCategory);
}
catch(std::exception & ex) {
std::cerr << "ERROR: problem when building L1 menu structure (connectors). " << ex.what() << std::endl;
throw;
}
try {
// algorithms
for( const std::string & algoCategory : { "TOPO", "MULTTOPO", "MUTOPO", "R2TOPO" } ) {
auto & v = m_algorithmsByCategory[algoCategory] = std::vector<TrigConf::L1TopoAlgorithm>();
if(algoCategory == "MULTTOPO") {
for( auto & alg : data().get_child( "topoAlgorithms." + algoCategory + ".multiplicityAlgorithms" ) ) {
v.emplace_back( alg.first, L1TopoAlgorithm::AlgorithmType::MULTIPLICITY, algoCategory, alg.second );
}
} else {
for( L1TopoAlgorithm::AlgorithmType algoType : { L1TopoAlgorithm::AlgorithmType::DECISION, L1TopoAlgorithm::AlgorithmType::SORTING } ) {
std::string subpath = "topoAlgorithms." + algoCategory + (algoType==L1TopoAlgorithm::AlgorithmType::DECISION ? ".decisionAlgorithms" : ".sortingAlgorithms" );
for( auto & algorithm : data().get_child( subpath ) ) {
v.emplace_back( algorithm.first, algoType, algoCategory, algorithm.second );
}
}
}
m_algorithmsByName[ algoCategory ][ algo.name() ] = & algo;
for( const std::string & output : algo.outputs() ) {
if( m_algorithmsByOutput[algoCategory].count(output) > 0 ) {
std::cerr << "ERROR : Topo algorithm output " << output << " already exists" << std::endl;
throw std::runtime_error("Found duplicate topo algorithm output " + output + " of type " + algoCategory);
for( auto & algo : v ) {
if( m_algorithmsByName[algoCategory].count(algo.name()) > 0 ) {
std::cerr << "ERROR : Topo algorithm with name " << algo.name() << " and of type " << algoCategory << " already exists" << std::endl;
throw std::runtime_error("Found duplicate topo algorithm name " + algo.name() + " of type " + algoCategory);
}
m_algorithmsByName[ algoCategory ][ algo.name() ] = & algo;
for( const std::string & output : algo.outputs() ) {
if( m_algorithmsByOutput[algoCategory].count(output) > 0 ) {
std::cerr << "ERROR : Topo algorithm output " << output << " already exists" << std::endl;
throw std::runtime_error("Found duplicate topo algorithm output " + output + " of type " + algoCategory);
}
m_algorithmsByOutput[algoCategory][output] = & algo;
}
m_algorithmsByOutput[algoCategory][output] = & algo;
}
}
}
catch(std::exception & ex) {
std::cerr << "ERROR: problem when building L1 menu structure (algorithms). " << ex.what() << std::endl;
throw;
}
}
unsigned int
......@@ -379,6 +401,12 @@ TrigConf::L1Menu::printMenu(bool full) const
{
cout << "L1 menu '" << name() << "'" << endl;
cout << "Items: " << size() << endl;
if(full) {
int c(0);
for(const L1Item & item : *this ) {
cout << " " << c++ << ": " << item.name() << endl;
}
}
cout << "Thresholds: " << thresholds().size() << "(of " << thresholdTypes().size() << " different types)" << endl;
if(full) {
int c(0);
......
......@@ -40,10 +40,16 @@ TrigConf::L1ThrExtraInfo::createExtraInfo(const std::string & thrTypeName, const
std::weak_ptr<TrigConf::L1ThrExtraInfoBase>
TrigConf::L1ThrExtraInfo::addExtraInfo(const std::string & thrTypeName, const boost::property_tree::ptree & data) {
if( auto extraInfo = L1ThrExtraInfo::createExtraInfo( thrTypeName, data) ) {
auto success = m_thrExtraInfo.emplace(thrTypeName, std::shared_ptr<TrigConf::L1ThrExtraInfoBase>(std::move(extraInfo)));
return std::weak_ptr<TrigConf::L1ThrExtraInfoBase>( success.first->second );
};
try {
if( auto extraInfo = L1ThrExtraInfo::createExtraInfo( thrTypeName, data) ) {
auto success = m_thrExtraInfo.emplace(thrTypeName, std::shared_ptr<TrigConf::L1ThrExtraInfoBase>(std::move(extraInfo)));
return std::weak_ptr<TrigConf::L1ThrExtraInfoBase>( success.first->second );
}
}
catch(std::exception & ex) {
std::cerr << "L1ThrExtraInfo::addExtraInfo: exception occured when building extra info for " << thrTypeName << std::endl;
throw;
}
return std::weak_ptr<TrigConf::L1ThrExtraInfoBase>( m_emptyInfo );
}
......@@ -153,13 +159,15 @@ TrigConf::L1ThrExtraInfo_EMTAULegacy::load()
void
TrigConf::L1ThrExtraInfo_XSLegacy::load()
{
auto sig = m_extraInfo["significance"];
m_xeMin = sig.getAttribute<unsigned int>("xeMin");
m_xeMax = sig.getAttribute<unsigned int>("xeMax");
m_teSqrtMin = sig.getAttribute<unsigned int>("teSqrtMin");
m_teSqrtMax = sig.getAttribute<unsigned int>("teSqrtMax");
m_xsSigmaScale = sig.getAttribute<unsigned int>("xsSigmaScale");
m_xsSigmaOffset = sig.getAttribute<unsigned int>("xsSigmaOffset");
if( hasExtraInfo("significance") ) {
auto & sig = m_extraInfo["significance"];
m_xeMin = sig.getAttribute<unsigned int>("xeMin");
m_xeMax = sig.getAttribute<unsigned int>("xeMax");
m_teSqrtMin = sig.getAttribute<unsigned int>("teSqrtMin");
m_teSqrtMax = sig.getAttribute<unsigned int>("teSqrtMax");
m_xsSigmaScale = sig.getAttribute<unsigned int>("xsSigmaScale");
m_xsSigmaOffset = sig.getAttribute<unsigned int>("xsSigmaOffset");
}
}
......@@ -213,9 +221,9 @@ TrigConf::L1ThrExtraInfo_eEMTAU::load()
auto wp = (y.first == "Loose") ? Isolation::WP::LOOSE : ( (y.first == "Medium") ? Isolation::WP::MEDIUM : Isolation::WP::TIGHT );
auto & iso = m_isolation.emplace(wp, string("eEM_WP_" + y.first)).first->second;
for(auto & c : y.second ) {
auto etamin = c.second.get_child("etamin").get_value<unsigned int>();
auto etamax = c.second.get_child("etamax").get_value<unsigned int>();
auto priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
iso.addRangeValue(Isolation(c.second), etamin, etamax, priority, /*symmetric=*/ false);
}
}
......
......@@ -149,9 +149,12 @@ TrigConf::L1ThrExtraInfoBase::thresholdTypeName() const
}
bool
TrigConf::L1ThrExtraInfoBase::hasExtraInfo() const
TrigConf::L1ThrExtraInfoBase::hasExtraInfo(const std::string & key) const
{
return m_extraInfo.size()>0;
if( key.empty() ) {
return m_extraInfo.size()>0;
}
return m_extraInfo.count(key)>0;
}
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGCONFIO_TRIGCONFIOEXCEPTIONS_H
#define TRIGCONFIO_TRIGCONFIOEXCEPTIONS_H
#include <exception>
#include <string>
namespace TrigConf {
class IOException : public std::exception {
public:
IOException(std::string msg);
virtual const char* what() const noexcept;
private:
const std::string m_msg;
};
class QueryException : public IOException {
public:
QueryException(std::string msg) : IOException(std::move(msg)) {}
};
class NoQueryException : public IOException {
public:
NoQueryException(std::string msg) : IOException(std::move(msg)) {}
};
class NoSMKException : public IOException {
public:
NoSMKException(std::string msg) : IOException(std::move(msg)) {}
};
class NoL1PSKException : public IOException {
public:
NoL1PSKException(std::string msg) : IOException(std::move(msg)) {}
};
class NoHLTPSKException : public IOException {
public:
NoHLTPSKException(std::string msg) : IOException(std::move(msg)) {}
};
class NoBGSKException : public IOException {
public:
NoBGSKException(std::string msg) : IOException(std::move(msg)) {}
};
class ParsingException : public IOException {
public:
ParsingException(std::string msg) : IOException(std::move(msg)) {}
};
}
#endif
......@@ -37,6 +37,8 @@ namespace TrigConf {
bool loadHLTPrescales ( unsigned int hltpsk,
HLTPrescalesSet & hltpss,
const std::string & outFileName = "") const;
private:
std::map<size_t, QueryDefinition> m_queries;
};
......
......@@ -18,6 +18,8 @@
#include "TrigConfIO/TrigDBLoader.h"
#include <map>
namespace TrigConf {
/**
......@@ -49,6 +51,8 @@ namespace TrigConf {
bool loadJobOptions ( unsigned int smk,
DataStructure & jobOptions,
const std::string & outFileName = "") const;
private:
std::map<size_t, QueryDefinition> m_queries;
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment