Commit 4e6f4079 authored by Daniele Zanzi's avatar Daniele Zanzi Committed by Frank Winklmeier
Browse files

further work on L1 configuration (ATR-21235, ATR-23596)

parent 62611340
......@@ -51,7 +51,7 @@ if( NOT XAOD_ANALYSIS )
atlas_add_test( TestDoubleMenuLoad SOURCES test/doubleLoad.cxx
INCLUDE_DIRS ${CORAL_INCLUDE_DIRS}
LINK_LIBRARIES ${CORAL_LIBRARIES} TrigConfData TrigConfIO
ENVIRONMENT "CLArgs=TRIGGERDBDEV1_I8 99 497 487 4"
ENVIRONMENT "CLArgs=TRIGGERDBDEV1_I8 104 499 490 4"
PRE_EXEC_SCRIPT "rm -f *1.json *2.json NoDBConnection.txt"
POST_EXEC_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/share/doubleTestComp.py )
endif()
......@@ -210,20 +210,32 @@ namespace TrigConf {
virtual std::string className() const { return "L1ThrExtraInfo_jEM"; }
const WorkingPoints_jEM & isolation(TrigConf::Selection::WP wp, int eta) const { return m_isolation.at(wp).at(eta); }
const ValueWithEtaDependence<WorkingPoints_jEM> & isolation(TrigConf::Selection::WP wp) const { return m_isolation.at(wp); }
float ptMinToTopo(int eta = 0) const { return ptMinToTopoMeV(eta) / 1000.0; }
unsigned int ptMinToTopoMeV(int eta = 0) const { return m_ptMinToTopoMeV.at(eta); }
unsigned int ptMinToTopoCounts(int eta = 0) const { return energyInCounts( ptMinToTopoMeV(eta), resolutionMeV() ); }
const ValueWithEtaDependence<int> & ptMinToTopoEtaMeV() const { return m_ptMinToTopoMeV; }
float ptMinxTOB(int eta = 0) const { return ptMinxTOBMeV(eta) / 1000.0; }
unsigned int ptMinxTOBMeV(int eta = 0) const { return m_ptMinxTOBMeV.at(eta); }
unsigned int ptMinxTOBCounts(int eta = 0) const { return energyInCounts( ptMinxTOBMeV(eta), resolutionMeV() ); }
const ValueWithEtaDependence<int> & ptMinxTOBEtaMeV() const { return m_ptMinxTOBMeV; }
float ptMinToTopo(std::string module) const { return ptMinToTopoMeV(module)/ 1000.0; }
unsigned int ptMinToTopoCounts(std::string module) const { return energyInCounts(ptMinToTopoMeV(module), resolutionMeV()); }
unsigned int ptMinToTopoMeV(std::string module) const {
if(module=="1C" || module=="1A") return m_ptMinToTopoMeV1;
if(module=="2C" || module=="2A") return m_ptMinToTopoMeV2;
if(module=="3C" || module=="3A") return m_ptMinToTopoMeV3;
throw std::runtime_error("L1ThrExtraInfo: Module" + module + " not recongnised");
}
float ptMinxTOB(std::string module) const { return ptMinxTOBMeV(module)/ 1000.0; }
unsigned int ptMinxTOBCounts(std::string module) const { return energyInCounts(ptMinxTOBMeV(module), resolutionMeV()); }
unsigned int ptMinxTOBMeV(std::string module) const {
if(module=="1C" || module=="1A") return m_ptMinxTOBMeV1;
if(module=="2C" || module=="2A") return m_ptMinxTOBMeV2;
if(module=="3C" || module=="3A") return m_ptMinxTOBMeV3;
throw std::runtime_error("L1ThrExtraInfo: Module" + module + " not recongnised");
}
private:
/** Update the internal members */
void load();
/** jEM specific data */
ValueWithEtaDependence<int> m_ptMinToTopoMeV{"jEMptMinTopo"};
ValueWithEtaDependence<int> m_ptMinxTOBMeV{"jEMptMinxTOB"};
unsigned int m_ptMinToTopoMeV1{0};
unsigned int m_ptMinToTopoMeV2{0};
unsigned int m_ptMinToTopoMeV3{0};
unsigned int m_ptMinxTOBMeV1{0};
unsigned int m_ptMinxTOBMeV2{0};
unsigned int m_ptMinxTOBMeV3{0};
std::map<TrigConf::Selection::WP, ValueWithEtaDependence<WorkingPoints_jEM>> m_isolation{};
};
std::ostream & operator<<(std::ostream & os, const TrigConf::L1ThrExtraInfo_jEM::WorkingPoints_jEM & iso);
......@@ -234,17 +246,17 @@ namespace TrigConf {
public:
WorkingPoints_eTAU( const boost::property_tree::ptree & );
bool isDefined() const { return m_isDefined; }
int isoConeRel_fw() const { return m_isoConeRel_fw; }
float isoConeRel_d() const { return m_isoConeRel_d; }
int fEM_fw() const { return m_fEM_fw; }
float fEM_d() const { return m_fEM_d; }
int rCore_fw() const { return m_rCore_fw; }
float rCore_d() const { return m_rCore_d; }
int rHad_fw() const { return m_rHad_fw; }
float rHad_d() const { return m_rHad_d; }
unsigned int maxEt() const { return m_maxEt; }
private:
bool m_isDefined { false };
int m_isoConeRel_fw {0};
int m_fEM_fw {0};
float m_isoConeRel_d { 0 };
float m_fEM_d { 0 };
int m_rCore_fw {0};
int m_rHad_fw {0};
float m_rCore_d { 0 };
float m_rHad_d { 0 };
unsigned int m_maxEt { 0 };
};
L1ThrExtraInfo_eTAU(const std::string & thrTypeName, const ptree & data) :
......@@ -284,22 +296,34 @@ namespace TrigConf {
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_jTAU() = default;
virtual std::string className() const { return "L1ThrExtraInfo_jTAU"; }
float ptMinToTopo(int eta = 0) const { return ptMinToTopoMeV(eta) / 1000.0; }
unsigned int ptMinToTopoMeV(int eta = 0) const { return m_ptMinToTopoMeV.at(eta); }
unsigned int ptMinToTopoCounts(int eta = 0) const { return energyInCounts( ptMinToTopoMeV(eta), resolutionMeV() ); }
const ValueWithEtaDependence<int> & ptMinToTopoEtaMeV() const { return m_ptMinToTopoMeV; }
float ptMinxTOB(int eta = 0) const { return ptMinxTOBMeV(eta) / 1000.0; }
unsigned int ptMinxTOBMeV(int eta = 0) const { return m_ptMinxTOBMeV.at(eta); }
unsigned int ptMinxTOBCounts(int eta = 0) const { return energyInCounts( ptMinxTOBMeV(eta), resolutionMeV() ); }
const ValueWithEtaDependence<int> & ptMinxTOBEtaMeV() const { return m_ptMinxTOBMeV; }
const WorkingPoints_jTAU & isolation(TrigConf::Selection::WP wp, int eta) const { return m_isolation.at(wp).at(eta); }
const ValueWithEtaDependence<WorkingPoints_jTAU> & isolation(TrigConf::Selection::WP wp) const { return m_isolation.at(wp); }
float ptMinToTopo(std::string module) const { return ptMinToTopoMeV(module)/ 1000.0; }
unsigned int ptMinToTopoCounts(std::string module) const { return energyInCounts(ptMinToTopoMeV(module), resolutionMeV()); }
unsigned int ptMinToTopoMeV(std::string module) const {
if(module=="1C" || module=="1A") return m_ptMinToTopoMeV1;
if(module=="2C" || module=="2A") return m_ptMinToTopoMeV2;
if(module=="3C" || module=="3A") return m_ptMinToTopoMeV3;
throw std::runtime_error("L1ThrExtraInfo: Module" + module + " not recongnised");
}
float ptMinxTOB(std::string module) const { return ptMinxTOBMeV(module)/ 1000.0; }
unsigned int ptMinxTOBCounts(std::string module) const { return energyInCounts(ptMinxTOBMeV(module), resolutionMeV()); }
unsigned int ptMinxTOBMeV(std::string module) const {
if(module=="1C" || module=="1A") return m_ptMinxTOBMeV1;
if(module=="2C" || module=="2A") return m_ptMinxTOBMeV2;
if(module=="3C" || module=="3A") return m_ptMinxTOBMeV3;
throw std::runtime_error("L1ThrExtraInfo: Module" + module + " not recongnised");
}
private:
/** Update the internal members */
void load();
/** jTAU specific data */
ValueWithEtaDependence<int> m_ptMinToTopoMeV{"jTAUptMinTopo"};
ValueWithEtaDependence<int> m_ptMinxTOBMeV{"jTAUptMinxTOB"};
unsigned int m_ptMinToTopoMeV1{0};
unsigned int m_ptMinToTopoMeV2{0};
unsigned int m_ptMinToTopoMeV3{0};
unsigned int m_ptMinxTOBMeV1{0};
unsigned int m_ptMinxTOBMeV2{0};
unsigned int m_ptMinxTOBMeV3{0};
std::map<TrigConf::Selection::WP, ValueWithEtaDependence<WorkingPoints_jTAU>> m_isolation{};
};
std::ostream & operator<<(std::ostream & os, const TrigConf::L1ThrExtraInfo_jTAU::WorkingPoints_jTAU & iso);
......@@ -337,20 +361,32 @@ namespace TrigConf {
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_jJ() = default;
virtual std::string className() const { return "L1ThrExtraInfo_jJ"; }
float ptMinToTopo(int eta = 0) const { return ptMinToTopoMeV(eta) / 1000.0; }
unsigned int ptMinToTopoMeV(int eta = 0) const { return m_ptMinToTopoMeV.at(eta); }
unsigned int ptMinToTopoCounts(int eta = 0) const { return energyInCounts( ptMinToTopoMeV(eta), resolutionMeV() ); }
const ValueWithEtaDependence<int> & ptMinToTopoEtaMeV() const { return m_ptMinToTopoMeV; }
float ptMinxTOB(int eta = 0) const { return ptMinxTOBMeV(eta) / 1000.0; }
unsigned int ptMinxTOBMeV(int eta = 0) const { return m_ptMinxTOBMeV.at(eta); }
unsigned int ptMinxTOBCounts(int eta = 0) const { return energyInCounts( ptMinxTOBMeV(eta), resolutionMeV() ); }
const ValueWithEtaDependence<int> & ptMinxTOBEtaMeV() const { return m_ptMinxTOBMeV; }
float ptMinToTopo(std::string module) const { return ptMinToTopoMeV(module)/ 1000.0; }
unsigned int ptMinToTopoCounts(std::string module) const { return energyInCounts(ptMinToTopoMeV(module), resolutionMeV()); }
unsigned int ptMinToTopoMeV(std::string module) const {
if(module=="1C" || module=="1A") return m_ptMinToTopoMeV1;
if(module=="2C" || module=="2A") return m_ptMinToTopoMeV2;
if(module=="3C" || module=="3A") return m_ptMinToTopoMeV3;
throw std::runtime_error("L1ThrExtraInfo: Module" + module + " not recongnised");
}
float ptMinxTOB(std::string module) const { return ptMinxTOBMeV(module)/ 1000.0; }
unsigned int ptMinxTOBCounts(std::string module) const { return energyInCounts(ptMinxTOBMeV(module), resolutionMeV()); }
unsigned int ptMinxTOBMeV(std::string module) const {
if(module=="1C" || module=="1A") return m_ptMinxTOBMeV1;
if(module=="2C" || module=="2A") return m_ptMinxTOBMeV2;
if(module=="3C" || module=="3A") return m_ptMinxTOBMeV3;
throw std::runtime_error("L1ThrExtraInfo: Module" + module + " not recongnised");
}
private:
/** Update the internal members */
void load();
/** jJ specific data */
ValueWithEtaDependence<int> m_ptMinToTopoMeV{"jJptMinTopo"};
ValueWithEtaDependence<int> m_ptMinxTOBMeV{"jJptMinxTOB"};
unsigned int m_ptMinToTopoMeV1{0};
unsigned int m_ptMinToTopoMeV2{0};
unsigned int m_ptMinToTopoMeV3{0};
unsigned int m_ptMinxTOBMeV1{0};
unsigned int m_ptMinxTOBMeV2{0};
unsigned int m_ptMinxTOBMeV3{0};
};
class L1ThrExtraInfo_jLJ final : public L1ThrExtraInfoBase {
......@@ -359,20 +395,32 @@ namespace TrigConf {
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_jLJ() = default;
virtual std::string className() const { return "L1ThrExtraInfo_jLJ"; }
float ptMinToTopo(int eta = 0) const { return ptMinToTopoMeV(eta) / 1000.0; }
unsigned int ptMinToTopoMeV(int eta = 0) const { return m_ptMinToTopoMeV.at(eta); }
unsigned int ptMinToTopoCounts(int eta = 0) const { return energyInCounts( ptMinToTopoMeV(eta), resolutionMeV() ); }
const ValueWithEtaDependence<int> & ptMinToTopoEtaMeV() const { return m_ptMinToTopoMeV; }
float ptMinxTOB(int eta = 0) const { return ptMinxTOBMeV(eta) / 1000.0; }
unsigned int ptMinxTOBMeV(int eta = 0) const { return m_ptMinxTOBMeV.at(eta); }
unsigned int ptMinxTOBCounts(int eta = 0) const { return energyInCounts( ptMinxTOBMeV(eta), resolutionMeV() ); }
const ValueWithEtaDependence<int> & ptMinxTOBEtaMeV() const { return m_ptMinxTOBMeV; }
float ptMinToTopo(std::string module) const { return ptMinToTopoMeV(module)/ 1000.0; }
unsigned int ptMinToTopoCounts(std::string module) const { return energyInCounts(ptMinToTopoMeV(module), resolutionMeV()); }
unsigned int ptMinToTopoMeV(std::string module) const {
if(module=="1C" || module=="1A") return m_ptMinToTopoMeV1;
if(module=="2C" || module=="2A") return m_ptMinToTopoMeV2;
if(module=="3C" || module=="3A") return m_ptMinToTopoMeV3;
throw std::runtime_error("L1ThrExtraInfo: Module" + module + " not recongnised");
}
float ptMinxTOB(std::string module) const { return ptMinxTOBMeV(module)/ 1000.0; }
unsigned int ptMinxTOBCounts(std::string module) const { return energyInCounts(ptMinxTOBMeV(module), resolutionMeV()); }
unsigned int ptMinxTOBMeV(std::string module) const {
if(module=="1C" || module=="1A") return m_ptMinxTOBMeV1;
if(module=="2C" || module=="2A") return m_ptMinxTOBMeV2;
if(module=="3C" || module=="3A") return m_ptMinxTOBMeV3;
throw std::runtime_error("L1ThrExtraInfo: Module" + module + " not recongnised");
}
private:
/** Update the internal members */
void load();
/** jLJ specific data */
ValueWithEtaDependence<int> m_ptMinToTopoMeV{"jLJptMinTopo"};
ValueWithEtaDependence<int> m_ptMinxTOBMeV{"jLJptMinxTOB"};
unsigned int m_ptMinToTopoMeV1{0};
unsigned int m_ptMinToTopoMeV2{0};
unsigned int m_ptMinToTopoMeV3{0};
unsigned int m_ptMinxTOBMeV1{0};
unsigned int m_ptMinxTOBMeV2{0};
unsigned int m_ptMinxTOBMeV3{0};
};
class L1ThrExtraInfo_jXE final : public L1ThrExtraInfoBase {
......@@ -393,12 +441,28 @@ namespace TrigConf {
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_jTE() = default;
virtual std::string className() const { return "L1ThrExtraInfo_jTE"; }
unsigned int etaBoundary() const { return m_etaBoundary; }
unsigned int etaBoundary_fw(std::string module) const {
if(module=="1C" || module=="1A") return m_etaBoundary1_fw;
if(module=="2C" || module=="2A") return m_etaBoundary2_fw;
if(module=="3C" || module=="3A") return m_etaBoundary3_fw;
throw std::runtime_error("L1ThrExtraInfo: Module" + module + " not recongnised");
}
unsigned int etaBoundary(std::string module) const {
if(module=="1C" || module=="1A") return m_etaBoundary1;
if(module=="2C" || module=="2A") return m_etaBoundary2;
if(module=="3C" || module=="3A") return m_etaBoundary3;
throw std::runtime_error("L1ThrExtraInfo: Module" + module + " not recongnised");
}
private:
/** Update the internal members */
void load();
/** jTE specific data */
unsigned int m_etaBoundary{0};
unsigned int m_etaBoundary1{0}; // eta for module 1A, 1C
unsigned int m_etaBoundary1_fw{0}; // tower number for module 1A, 1C
unsigned int m_etaBoundary2{0}; // eta for module 2A, 2C
unsigned int m_etaBoundary2_fw{0}; // tower number for module 2A, 2C
unsigned int m_etaBoundary3{0}; // eta for module 3A, 3C
unsigned int m_etaBoundary3_fw{0}; // tower number for module 3A, 3C
};
class L1ThrExtraInfo_gXE final : public L1ThrExtraInfoBase {
......
......@@ -190,8 +190,8 @@ namespace TrigConf {
virtual ~L1Threshold_eTAU() = default;
virtual std::string className() const override { return "L1Threshold_eTAU"; }
// access functions
Selection::WP isoConeRel() const { return m_isoConeRel; }
Selection::WP fEM() const { return m_fEM; }
Selection::WP rCore() const { return m_rCore; }
Selection::WP rHad() const { return m_rHad; }
protected:
virtual void update() override {
L1Threshold_Calo::update();
......@@ -200,8 +200,8 @@ namespace TrigConf {
private:
void load();
// the isolation requirement
Selection::WP m_isoConeRel { Selection::WP::NONE };
Selection::WP m_fEM { Selection::WP::NONE };
Selection::WP m_rCore { Selection::WP::NONE };
Selection::WP m_rHad { Selection::WP::NONE };
};
class L1Threshold_jTAU final : public L1Threshold_Calo {
......
......@@ -326,24 +326,18 @@ void
TrigConf::L1ThrExtraInfo_jEM::load()
{
for( auto & x : m_extraInfo ) {
if( x.first == "ptMinToTopo" ) {
for( auto & k : x.second.data() ) {
int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
float value = k.second.get_optional<float>("value").get_value_or(0);
auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
m_ptMinToTopoMeV.addRangeValue( lround(1000*value),
etamin, etamax, priority, /*symmetric=*/ false);
}
} else if( x.first == "ptMinxTOB" ){
for( auto & k : x.second.data() ) {
int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
float value = k.second.get_optional<float>("value").get_value_or(0);
auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
m_ptMinxTOBMeV.addRangeValue( lround(1000*value),
etamin, etamax, priority, /*symmetric=*/ false);
}
if( x.first == "ptMinToTopo1" ) {
m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinToTopo2" ){
m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinToTopo3" ){
m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB1" ){
m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB2" ){
m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB3" ){
m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "workingPoints" ) {
for( auto & y : x.second.data() ) {
auto wp = Selection::stringToWP(y.first);
......@@ -364,16 +358,16 @@ TrigConf::L1ThrExtraInfo_jEM::load()
*******/
TrigConf::L1ThrExtraInfo_eTAU::WorkingPoints_eTAU::WorkingPoints_eTAU( const boost::property_tree::ptree & pt ) {
m_isDefined = true;
m_isoConeRel_d = pt.get_optional<float>("isoConeRel").get_value_or(0);
m_fEM_d = pt.get_optional<float>("fEM").get_value_or(0);
m_isoConeRel_fw = pt.get_optional<float>("isoConeRel_fw").get_value_or(0);
m_fEM_fw = pt.get_optional<float>("fEM_fw").get_value_or(0);
m_maxEt = pt.get_optional<unsigned int>("maxEt").get_value_or(0);
m_rCore_d = pt.get_optional<float>("rCore").get_value_or(0);
m_rHad_d = pt.get_optional<float>("rHad").get_value_or(0);
m_rCore_fw = pt.get_optional<float>("rCore_fw").get_value_or(0);
m_rHad_fw = pt.get_optional<float>("rHad_fw").get_value_or(0);
m_maxEt = pt.get_optional<unsigned int>("maxEt").get_value_or(0);
}
std::ostream &
TrigConf::operator<<(std::ostream & os, const TrigConf::L1ThrExtraInfo_eTAU::WorkingPoints_eTAU & iso) {
os << "isoConeRel_fw=" << iso.isoConeRel_fw() << ", fEM_fw=" << iso.fEM_fw() ;
os << "rCore_fw=" << iso.rCore_fw() << ", rHad_fw=" << iso.rHad_fw() ;
return os;
}
......@@ -418,24 +412,18 @@ void
TrigConf::L1ThrExtraInfo_jTAU::load()
{
for( auto & x : m_extraInfo ) {
if( x.first == "ptMinToTopo" ) {
for( auto & k : x.second.data() ) {
int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
float value = k.second.get_optional<float>("value").get_value_or(0);
auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
m_ptMinToTopoMeV.addRangeValue( lround(1000*value),
etamin, etamax, priority, /*symmetric=*/ false);
}
} else if( x.first == "ptMinxTOB" ){
for( auto & k : x.second.data() ) {
int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
float value = k.second.get_optional<float>("value").get_value_or(0);
auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
m_ptMinxTOBMeV.addRangeValue( lround(1000*value),
etamin, etamax, priority, /*symmetric=*/ false);
}
if( x.first == "ptMinToTopo1" ) {
m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinToTopo2" ){
m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinToTopo3" ){
m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB1" ){
m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB2" ){
m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB3" ){
m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "workingPoints" ) {
for( auto & y : x.second.data() ) {
auto wp = TrigConf::Selection::stringToWP(y.first);
......@@ -493,25 +481,19 @@ void
TrigConf::L1ThrExtraInfo_jJ::load()
{
for( auto & x : m_extraInfo ) {
if( x.first == "ptMinToTopo" ) {
for( auto & k : x.second.data() ) {
int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
float value = k.second.get_optional<float>("value").get_value_or(0);
auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
m_ptMinToTopoMeV.addRangeValue( lround(1000*value),
etamin, etamax, priority, /*symmetric=*/ false);
}
} else if( x.first == "ptMinxTOB" ){
for( auto & k : x.second.data() ) {
int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
float value = k.second.get_optional<float>("value").get_value_or(0);
auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
m_ptMinxTOBMeV.addRangeValue( lround(1000*value),
etamin, etamax, priority, /*symmetric=*/ false);
}
}
if( x.first == "ptMinToTopo1" ) {
m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinToTopo2" ){
m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinToTopo3" ){
m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB1" ){
m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB2" ){
m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB3" ){
m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
}
}
}
......@@ -522,25 +504,19 @@ void
TrigConf::L1ThrExtraInfo_jLJ::load()
{
for( auto & x : m_extraInfo ) {
if( x.first == "ptMinToTopo" ) {
for( auto & k : x.second.data() ) {
int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
float value = k.second.get_optional<float>("value").get_value_or(0);
auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
m_ptMinToTopoMeV.addRangeValue( lround(1000*value),
etamin, etamax, priority, /*symmetric=*/ false);
}
} else if( x.first == "ptMinxTOB" ){
for( auto & k : x.second.data() ) {
int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
float value = k.second.get_optional<float>("value").get_value_or(0);
auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
m_ptMinxTOBMeV.addRangeValue( lround(1000*value),
etamin, etamax, priority, /*symmetric=*/ false);
}
}
if( x.first == "ptMinToTopo1" ) {
m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinToTopo2" ){
m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinToTopo3" ){
m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB1" ){
m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB2" ){
m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
} else if( x.first == "ptMinxTOB3" ){
m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
}
}
}
......@@ -559,9 +535,19 @@ void
TrigConf::L1ThrExtraInfo_jTE::load()
{
for( auto & x : m_extraInfo ) {
if( x.first == "etaBoundary" ) {
m_etaBoundary = x.second.getValue<unsigned int>();
}
if( x.first == "etaBoundary1" ) {
m_etaBoundary1 = x.second.getValue<unsigned int>();
} else if( x.first == "etaBoundary1_fw" ) {
m_etaBoundary1_fw = x.second.getValue<unsigned int>();
} else if( x.first == "etaBoundary2" ) {
m_etaBoundary2 = x.second.getValue<unsigned int>();
} else if( x.first == "etaBoundary2_fw" ) {
m_etaBoundary2_fw = x.second.getValue<unsigned int>();
} else if( x.first == "etaBoundary3" ) {
m_etaBoundary3 = x.second.getValue<unsigned int>();
} else if( x.first == "etaBoundary3_fw" ) {
m_etaBoundary3_fw = x.second.getValue<unsigned int>();
}
}
}
......
......@@ -134,8 +134,8 @@ void
TrigConf::L1Threshold_eTAU::load()
{
// read the isolation requirements
m_isoConeRel = Selection::stringToWP(getAttribute_optional<std::string>("isoConeRel").value_or("None"));
m_fEM = Selection::stringToWP(getAttribute_optional<std::string>("fEM").value_or("None"));
m_rCore = Selection::stringToWP(getAttribute_optional<std::string>("rCore").value_or("None"));
m_rHad = Selection::stringToWP(getAttribute_optional<std::string>("rHad").value_or("None"));
}
void
......@@ -154,11 +154,15 @@ TrigConf::L1Threshold_cTAU::load()
void
TrigConf::L1Threshold_jJ::load()
{}
{
m_etaDepThrValue.setOutsideRangeValue(getAttribute("maxValue", true, 14000000));
}
void
TrigConf::L1Threshold_jLJ::load()
{}
{
m_etaDepThrValue.setOutsideRangeValue(getAttribute("maxValue", true, 14000000));
}
void
TrigConf::L1Threshold_jXE::load()
......
......@@ -188,8 +188,8 @@ TrigConf::JsonFileWriterL1::writeJsonFile(const std::string & filename, const L1
// eTAU
try {
auto eTAUThr = dynamic_cast<const TrigConf::L1Threshold_eTAU &>(*thr);
jThr["isoConeRel"] = TrigConf::Selection::wpToString(eTAUThr.isoConeRel());
jThr["fEM"] = TrigConf::Selection::wpToString(eTAUThr.fEM());
jThr["rCore"] = TrigConf::Selection::wpToString(eTAUThr.rCore());
jThr["rHad"] = TrigConf::Selection::wpToString(eTAUThr.rHad());
jThr["value"] = int(eTAUThr.thrValue());
} catch(std::bad_cast&) {};
......@@ -389,22 +389,12 @@ TrigConf::JsonFileWriterL1::writeJsonFile(const std::string & filename, const L1
if(thrType == "jEM") {
auto & jeminfo = l1menu.thrExtraInfo().jEM();
jThrType["ptMinToTopo"] = json::array_t({});
for(auto & x : jeminfo.ptMinToTopoEtaMeV() ) {
jThrType["ptMinToTopo"] += json({
{"etamin",x.etaMin()},
{"etamax",x.etaMax()},
{"value",int(x.value()/1000.)},
});
}
jThrType["ptMinxTOB"] = json::array_t({});
for(auto & x : jeminfo.ptMinxTOBEtaMeV() ) {
jThrType["ptMinxTOB"] += json({
{"etamin",x.etaMin()},
{"etamax",x.etaMax()},
{"value",int(x.value()/1000.)},
});
}
jThrType["ptMinToTopo1"] = jeminfo.ptMinToTopo("1A");
jThrType["ptMinToTopo2"] = jeminfo.ptMinToTopo("2A");
jThrType["ptMinToTopo3"] = jeminfo.ptMinToTopo("3A");
jThrType["ptMinxTOB1"] = jeminfo.ptMinxTOB("1A");
jThrType["ptMinxTOB2"] = jeminfo.ptMinxTOB("2A");
jThrType["ptMinxTOB3"] = jeminfo.ptMinxTOB("3A");
for( auto wp : {TrigConf::Selection::WP::LOOSE, TrigConf::Selection::WP::MEDIUM, TrigConf::Selection::WP::TIGHT} ) {
auto wpstr = TrigConf::Selection::wpToString(wp);
jThrType["workingPoints"][wpstr] = json::array_t({});
......@@ -432,10 +422,10 @@ TrigConf::JsonFileWriterL1::writeJsonFile(const std::string & filename, const L1
jThrType["workingPoints"][wpstr] = json::array_t({});
for(auto & iso : eeminfo.isolation(wp)) {
json jWPIso({});
jWPIso["isoConeRel"] = iso.value().isoConeRel_d();
jWPIso["isoConeRel_fw"] = iso.value().isoConeRel_fw();
jWPIso["fEM"] = iso.value().fEM_d();
jWPIso["fEM_fw"] = iso.value().fEM_fw();
jWPIso["rCore"] = iso.value().rCore_d();
jWPIso["rCore_fw"] = iso.value().rCore_fw();