Commit 3714b3db authored by Daniele Zanzi's avatar Daniele Zanzi Committed by Adam Edward Barton
Browse files

Addition of jTAU, cTAU and jJ thresholds (ATR-24012, ATR-21235)

parent 9fd9ef1f
......@@ -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 45 179 152 4"
ENVIRONMENT "CLArgs=TRIGGERDBDEV1_I8 92 442 429 4"
PRE_EXEC_SCRIPT "rm -f *1.json *2.json NoDBConnection.txt"
POST_EXEC_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/share/doubleTestComp.py )
endif()
......@@ -20,8 +20,9 @@ namespace TrigConf {
class L1ThrExtraInfo_XSLegacy;
class L1ThrExtraInfo_eEM;
class L1ThrExtraInfo_eTAU;
class L1ThrExtraInfo_jJ;
class L1ThrExtraInfo_jTAU;
class L1ThrExtraInfo_cTAU;
class L1ThrExtraInfo_jJ;
class L1ThrExtraInfo_gXE;
class L1ThrExtraInfo_MU;
......@@ -37,8 +38,9 @@ namespace TrigConf {
const L1ThrExtraInfo_XSLegacy & XS() const;
const L1ThrExtraInfo_eEM & eEM() const;
const L1ThrExtraInfo_eTAU & eTAU() const;
const L1ThrExtraInfo_jJ & jJ() const;
const L1ThrExtraInfo_jTAU & jTAU() const;
const L1ThrExtraInfo_cTAU & cTAU() const;
const L1ThrExtraInfo_jJ & jJ() const;
const L1ThrExtraInfo_gXE & gXE() const;
const L1ThrExtraInfo_MU & MU() const;
......@@ -169,17 +171,23 @@ namespace TrigConf {
std::ostream & operator<<(std::ostream & os, const TrigConf::L1ThrExtraInfo_eEM::WorkingPoints_eEM & iso);
class L1ThrExtraInfo_eTAU final : public L1ThrExtraInfoBase {
public:
class WorkingPoints_eTAU {
public:
WorkingPoints_eTAU( const boost::property_tree::ptree & );
int isolation() const { return m_isolation; }
double isolation_d() const { return m_isolation/100.; }
unsigned int maxEt() const { return m_maxEt; }
bool isDefined() const { return m_isDefined; }
int isoConeRel_fw() const { return m_isoConeRel_fw; }
double isoConeRel_d() const { return m_isoConeRel_d; }
int fEM_fw() const { return m_fEM_fw; }
double fEM_d() const { return m_fEM_d; }
unsigned int maxEt() const { return m_maxEt; }
private:
int m_isolation {0};
bool m_isDefined { false };
int m_isoConeRel_fw {0};
int m_fEM_fw {0};
double m_isoConeRel_d { 0 };
double m_fEM_d { 0 };
unsigned int m_maxEt { 0 };
};
L1ThrExtraInfo_eTAU(const std::string & thrTypeName, const ptree & data) :
......@@ -194,46 +202,90 @@ namespace TrigConf {
private:
/** Update the internal members */
void load();
/** eEM specific data */
/** eTAU specific data */
unsigned int m_ptMinToTopoMeV{0};
std::map<TrigConf::Selection::WP, ValueWithEtaDependence<WorkingPoints_eTAU>> m_isolation{};
};
std::ostream & operator<<(std::ostream & os, const TrigConf::L1ThrExtraInfo_eTAU::WorkingPoints_eTAU & iso);
class L1ThrExtraInfo_jJ final : public L1ThrExtraInfoBase {
class L1ThrExtraInfo_jTAU final : public L1ThrExtraInfoBase {
public:
L1ThrExtraInfo_jJ(const std::string & thrTypeName, const ptree & data) :
class WorkingPoints_jTAU {
public:
WorkingPoints_jTAU( const boost::property_tree::ptree & );
bool isDefined() const { return m_isDefined; }
int isolation_fw() const { return m_isolation_fw; }
double isolation_d() const { return m_isolation_d; }
unsigned int maxEt() const { return m_maxEt; }
private:
bool m_isDefined { false };
int m_isolation_fw {0};
double m_isolation_d { 0 };
unsigned int m_maxEt { 0 };
};
L1ThrExtraInfo_jTAU(const std::string & thrTypeName, const ptree & data) :
L1ThrExtraInfoBase(thrTypeName, data) { load(); }
virtual ~L1ThrExtraInfo_jJ() = default;
virtual std::string className() const { return "L1ThrExtraInfo_jJ"; }
double ptMinToTopoLarge(int eta = 0) const { return ptMinToTopoLargeMeV(eta) / 1000.0; }
double ptMinToTopoSmall(int eta = 0) const { return ptMinToTopoSmallMeV(eta) / 1000.0; }
unsigned int ptMinToTopoLargeMeV(int eta = 0) const { return m_ptMinToTopoMeV.at(eta).second; }
unsigned int ptMinToTopoSmallMeV(int eta = 0) const { return m_ptMinToTopoMeV.at(eta).first; }
unsigned int ptMinToTopoLargeCounts(int eta = 0) const { return energyInCounts( ptMinToTopoLargeMeV(eta), resolutionMeV() ); }
unsigned int ptMinToTopoSmallCounts(int eta = 0) const { return energyInCounts( ptMinToTopoSmallMeV(eta), resolutionMeV() ); }
const ValueWithEtaDependence<std::pair<unsigned int,unsigned int>> & ptMinToTopoMeV() const { return m_ptMinToTopoMeV; }
virtual ~L1ThrExtraInfo_jTAU() = default;
virtual std::string className() const { return "L1ThrExtraInfo_jTAU"; }
float ptMinToTopo() const { return m_ptMinToTopoMeV/1000.0f; }
unsigned int ptMinToTopoMeV() const { return m_ptMinToTopoMeV; }
unsigned int ptMinToTopoCounts() const { return energyInCounts( m_ptMinToTopoMeV, resolutionMeV() ); }
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); }
private:
/** Update the internal members */
void load();
/** jJ specific data */
ValueWithEtaDependence<std::pair<unsigned int,unsigned int>> m_ptMinToTopoMeV{"jJptMinTopo"};
/** jTAU specific data */
unsigned int m_ptMinToTopoMeV{0};
std::map<TrigConf::Selection::WP, ValueWithEtaDependence<WorkingPoints_jTAU>> m_isolation{};
};
std::ostream & operator<<(std::ostream & os, const TrigConf::L1ThrExtraInfo_jTAU::WorkingPoints_jTAU & iso);
class L1ThrExtraInfo_jTAU final : public L1ThrExtraInfoBase {
class L1ThrExtraInfo_cTAU final : public L1ThrExtraInfoBase {
public:
L1ThrExtraInfo_jTAU(const std::string & thrTypeName, const ptree & data) :
class WorkingPoints_cTAU {
public:
WorkingPoints_cTAU( const boost::property_tree::ptree & );
bool isDefined() const { return m_isDefined; }
int isolation_fw() const { return m_isolation_fw; }
double isolation_d() const { return m_isolation_d; }
unsigned int maxEt() const { return m_maxEt; }
private:
bool m_isDefined { false };
int m_isolation_fw {0};
double m_isolation_d { 0 };
unsigned int m_maxEt { 0 };
};
L1ThrExtraInfo_cTAU(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; }
virtual ~L1ThrExtraInfo_cTAU() = default;
virtual std::string className() const { return "L1ThrExtraInfo_cTAU"; }
const WorkingPoints_cTAU & isolation(TrigConf::Selection::WP wp, int eta) const { return m_isolation.at(wp).at(eta); }
const ValueWithEtaDependence<WorkingPoints_cTAU> & isolation(TrigConf::Selection::WP wp) const { return m_isolation.at(wp); }
private:
/** Update the internal members */
void load();
/** jTAU specific data */
unsigned int m_ptMinToTopo{0};
/** cTAU specific data */
std::map<TrigConf::Selection::WP, ValueWithEtaDependence<WorkingPoints_cTAU>> m_isolation{};
};
std::ostream & operator<<(std::ostream & os, const TrigConf::L1ThrExtraInfo_cTAU::WorkingPoints_cTAU & iso);
class L1ThrExtraInfo_jJ final : public L1ThrExtraInfoBase {
public:
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"; }
double 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; }
private:
/** Update the internal members */
void load();
/** jJ specific data */
ValueWithEtaDependence<int> m_ptMinToTopoMeV{"jJptMinTopo"};
};
class L1ThrExtraInfo_gXE final : public L1ThrExtraInfoBase {
public:
......
......@@ -166,6 +166,29 @@ namespace TrigConf {
L1Threshold_Calo(name, type, extraInfo, data) { load(); }
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; }
protected:
virtual void update() override {
L1Threshold_Calo::update();
load();
}
private:
void load();
// the isolation requirement
Selection::WP m_isoConeRel { Selection::WP::NONE };
Selection::WP m_fEM { Selection::WP::NONE };
};
class L1Threshold_jTAU final : public L1Threshold_Calo {
public:
L1Threshold_jTAU( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> extraInfo, const ptree & data) :
L1Threshold_Calo(name, type, extraInfo, data) { load(); }
virtual ~L1Threshold_jTAU() = default;
virtual std::string className() const override { return "L1Threshold_jTAU"; }
// access functions
Selection::WP isolation() const { return m_isolation; }
protected:
virtual void update() override {
L1Threshold_Calo::update();
......@@ -173,6 +196,27 @@ namespace TrigConf {
}
private:
void load();
// the isolation requirement
Selection::WP m_isolation { Selection::WP::NONE };
};
class L1Threshold_cTAU final : public L1Threshold_Calo {
public:
L1Threshold_cTAU( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> extraInfo, const ptree & data) :
L1Threshold_Calo(name, type, extraInfo, data) { load(); }
virtual ~L1Threshold_cTAU() = default;
virtual std::string className() const override { return "L1Threshold_cTAU"; }
// access functions
Selection::WP isolation() const { return m_isolation; }
protected:
virtual void update() override {
L1Threshold_Calo::update();
load();
}
private:
void load();
// the isolation requirement
Selection::WP m_isolation { Selection::WP::NONE };
};
class L1Threshold_jJ final : public L1Threshold_Calo {
......
......@@ -223,12 +223,18 @@ namespace TrigConf {
*/
virtual unsigned int thrValueMeV(int eta = 0) const;
/** as above above but in 100 MeV */
virtual unsigned int thrValue100MeV(int eta = 0) const;
/** access to the list of ThresholdValues in GeV */
virtual ValueWithEtaDependence<float> thrValues() const;
/** access to the list of ThresholdValues in MeV */
virtual const ValueWithEtaDependence<unsigned int> & thrValuesMeV() const;
/** access to the list of ThresholdValues in 100 MeV (for L1Topo multiplicity) */
virtual ValueWithEtaDependence<unsigned int> thrValues100MeV() const;
/** access to the list of ThresholdValues in energy units */
virtual ValueWithEtaDependence<unsigned int> thrValuesCounts() const;
......@@ -287,7 +293,7 @@ namespace TrigConf {
**************************************/
class Selection {
public:
enum class WP { NONE = 0, LOOSE = 1, MEDIUM = 2, TIGHT = 3 };
enum class WP { NONE = 0, LOOSE = 1, MEDIUM = 2, TIGHT = 3, HAD = 4 };
static std::string wpToString(WP);
static WP stringToWP(const std::string &);
};
......
......@@ -34,6 +34,12 @@ TrigConf::L1ThrExtraInfo::createExtraInfo(const std::string & thrTypeName, const
if( thrTypeName == "eTAU" )
return std::make_unique<L1ThrExtraInfo_eTAU>(thrTypeName, data);
if( thrTypeName == "jTAU" )
return std::make_unique<L1ThrExtraInfo_jTAU>(thrTypeName, data);
if( thrTypeName == "cTAU" )
return std::make_unique<L1ThrExtraInfo_cTAU>(thrTypeName, data);
if( thrTypeName == "jJ" )
return std::make_unique<L1ThrExtraInfo_jJ>(thrTypeName, data);
......@@ -99,16 +105,21 @@ TrigConf::L1ThrExtraInfo::eTAU() const {
return dynamic_cast<const TrigConf::L1ThrExtraInfo_eTAU&>( * m_thrExtraInfo.at("eTAU") );
}
const TrigConf::L1ThrExtraInfo_jJ &
TrigConf::L1ThrExtraInfo::jJ() const {
return dynamic_cast<const TrigConf::L1ThrExtraInfo_jJ&>( * m_thrExtraInfo.at("jJ") );
}
const TrigConf::L1ThrExtraInfo_jTAU &
TrigConf::L1ThrExtraInfo::jTAU() const {
return dynamic_cast<const TrigConf::L1ThrExtraInfo_jTAU&>( * m_thrExtraInfo.at("jTAU") );
}
const TrigConf::L1ThrExtraInfo_cTAU &
TrigConf::L1ThrExtraInfo::cTAU() const {
return dynamic_cast<const TrigConf::L1ThrExtraInfo_cTAU&>( * m_thrExtraInfo.at("cTAU") );
}
const TrigConf::L1ThrExtraInfo_jJ &
TrigConf::L1ThrExtraInfo::jJ() const {
return dynamic_cast<const TrigConf::L1ThrExtraInfo_jJ&>( * m_thrExtraInfo.at("jJ") );
}
const TrigConf::L1ThrExtraInfo_gXE &
TrigConf::L1ThrExtraInfo::gXE() const {
return dynamic_cast<const TrigConf::L1ThrExtraInfo_gXE&>( * m_thrExtraInfo.at("gXE") );
......@@ -253,8 +264,18 @@ TrigConf::L1ThrExtraInfo_eEM::load()
* eTAU
*******/
TrigConf::L1ThrExtraInfo_eTAU::WorkingPoints_eTAU::WorkingPoints_eTAU( const boost::property_tree::ptree & pt ) {
m_isolation = lround(100 * pt.get_optional<float>("isolation").get_value_or(0));
m_maxEt = pt.get_optional<unsigned int>("maxEt").get_value_or(0);
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);
}
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() ;
return os;
}
void
......@@ -266,7 +287,7 @@ TrigConf::L1ThrExtraInfo_eTAU::load()
} else if( x.first == "workingPoints" ) {
for( auto & y : x.second.data() ) {
auto wp = TrigConf::Selection::stringToWP(y.first);
auto & iso = m_isolation.emplace(wp, string("eEM_WP_" + y.first)).first->second;
auto & iso = m_isolation.emplace(wp, string("eTAU_WP_" + y.first)).first->second;
for(auto & c : y.second ) {
int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
......@@ -278,26 +299,73 @@ TrigConf::L1ThrExtraInfo_eTAU::load()
}
}
/*******
* jTAU
*******/
TrigConf::L1ThrExtraInfo_jTAU::WorkingPoints_jTAU::WorkingPoints_jTAU( const boost::property_tree::ptree & pt ) {
m_isDefined = true;
m_isolation_d = pt.get_optional<float>("isolation").get_value_or(0);
m_isolation_fw = pt.get_optional<float>("isolation_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_jTAU::WorkingPoints_jTAU & iso) {
os << "isolation_fw=" << iso.isolation_fw() ;
return os;
}
void
TrigConf::L1ThrExtraInfo_jTAU::load()
{
for( auto & x : m_extraInfo ) {
if( x.first == "ptMinToTopo" ) {
m_ptMinToTopoMeV = lround(1000 * x.second.getValue<float>());
} else if( x.first == "workingPoints" ) {
for( auto & y : x.second.data() ) {
auto wp = TrigConf::Selection::stringToWP(y.first);
auto & iso = m_isolation.emplace(wp, string("jTAU_WP_" + y.first)).first->second;
for(auto & c : y.second ) {
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(WorkingPoints_jTAU(c.second), etamin, etamax, priority, /*symmetric=*/ false);
}
}
}
}
}
/*******
* jJ
* cTAU
*******/
TrigConf::L1ThrExtraInfo_cTAU::WorkingPoints_cTAU::WorkingPoints_cTAU( const boost::property_tree::ptree & pt ) {
m_isDefined = true;
m_isolation_d = pt.get_optional<float>("isolation").get_value_or(0);
m_isolation_fw = pt.get_optional<float>("isolation_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_cTAU::WorkingPoints_cTAU & iso) {
os << "isolation_fw=" << iso.isolation_fw() ;
return os;
}
void
TrigConf::L1ThrExtraInfo_jJ::load()
TrigConf::L1ThrExtraInfo_cTAU::load()
{
for( auto & x : m_extraInfo ) {
if( x.first == "ptMinToTopo" ) {
for( auto & k : x.second.data() ) {
auto etamin = k.second.get_child("etamin").get_value<unsigned int>();
auto etamax = k.second.get_child("etamax").get_value<unsigned int>();
auto small = k.second.get_child("small").get_value<float>();
auto large = k.second.get_child("large").get_value<float>();
auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
m_ptMinToTopoMeV.addRangeValue( std::make_pair<unsigned int, unsigned int>(lround(1000*small),lround(1000*large)),
etamin, etamax, priority, /*symmetric=*/ false);
if( x.first == "workingPoints" ) {
for( auto & y : x.second.data() ) {
auto wp = TrigConf::Selection::stringToWP(y.first);
auto & iso = m_isolation.emplace(wp, string("cTAU_WP_" + y.first)).first->second;
for(auto & c : y.second ) {
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(WorkingPoints_cTAU(c.second), etamin, etamax, priority, /*symmetric=*/ false);
}
}
}
}
......@@ -305,14 +373,21 @@ TrigConf::L1ThrExtraInfo_jJ::load()
/*******
* jTAU
* jJ
*******/
void
TrigConf::L1ThrExtraInfo_jTAU::load()
TrigConf::L1ThrExtraInfo_jJ::load()
{
for( auto & x : m_extraInfo ) {
if( x.first == "ptMinToTopo" ) {
m_ptMinToTopo = x.second.getValue<unsigned int>();
for( auto & k : x.second.data() ) {
auto etamin = k.second.get_child("etamin").get_value<unsigned int>();
auto etamax = k.second.get_child("etamax").get_value<unsigned int>();
auto value = k.second.get_child("value").get_value<float>();
auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
m_ptMinToTopoMeV.addRangeValue( lround(1000*value),
etamin, etamax, priority, /*symmetric=*/ false);
}
}
}
}
......
......@@ -41,8 +41,9 @@ TrigConf::L1Threshold_EM::print(std::ostream & os) const {
auto value = thrValue(eta);
auto valueMeV = thrValueMeV(eta);
auto counts = thrValueCounts(eta);
auto value100MeV = thrValue100MeV(eta);
auto iso = isolationMask(eta);
os << " eta = " << eta << " : " << value << " GeV " << valueMeV << " MeV "
os << " eta = " << eta << " : " << value << " GeV " << valueMeV << " MeV " << value100MeV << " 100MeV "
<< counts << " counts , isoMaks " << iso << std::endl;
}
}
......@@ -125,7 +126,25 @@ TrigConf::L1Threshold_eEM::load()
void
TrigConf::L1Threshold_eTAU::load()
{}
{
// read the isolation requirements
m_isoConeRel = Selection::stringToWP(getAttribute("isoConeRel"));
m_fEM = Selection::stringToWP(getAttribute("fEM"));
}
void
TrigConf::L1Threshold_jTAU::load()
{
// read the isolation requirements
m_isolation = Selection::stringToWP(getAttribute("isolation"));
}
void
TrigConf::L1Threshold_cTAU::load()
{
// read the isolation requirements
m_isolation = Selection::stringToWP(getAttribute("isolation"));
}
void
TrigConf::L1Threshold_jJ::load()
......
......@@ -52,6 +52,12 @@ TrigConf::L1Threshold::createThreshold( const std::string & name, const std::str
if( type == "eTAU" )
return std::make_shared<L1Threshold_eTAU>( name, type, extraInfo, data );
if( type == "jTAU" )
return std::make_shared<L1Threshold_jTAU>( name, type, extraInfo, data );
if( type == "cTAU" )
return std::make_shared<L1Threshold_cTAU>( name, type, extraInfo, data );
if( type == "jJ" )
return std::make_shared<L1Threshold_jJ>( name, type, extraInfo, data );
......@@ -253,6 +259,11 @@ TrigConf::L1Threshold_Calo::thrValueCounts(int eta) const {
return energyInCounts( thrValueMeV(eta), extraInfo->resolutionMeV() );
}
unsigned int
TrigConf::L1Threshold_Calo::thrValue100MeV(int eta) const {
return energyInCounts( thrValueMeV(eta), 100 );
}
unsigned int
TrigConf::L1Threshold_Calo::thrValueMeV(int eta) const {
return m_etaDepThrValue.empty() ? m_thrValue : m_etaDepThrValue.at(eta);
......@@ -260,7 +271,7 @@ TrigConf::L1Threshold_Calo::thrValueMeV(int eta) const {
TrigConf::ValueWithEtaDependence<float>
TrigConf::L1Threshold_Calo::thrValues() const {
auto thresholdValuesGeV = ValueWithEtaDependence<float>{ m_etaDepThrValue.name()+"Counts" };
auto thresholdValuesGeV = ValueWithEtaDependence<float>{ m_etaDepThrValue.name()+"GeV" };
for( auto & r : m_etaDepThrValue ) {
thresholdValuesGeV.addRangeValue(r.value() / 1000.0f, r.etaMin(), r.etaMax(), r.priority(), r.symmetric());
}
......@@ -272,6 +283,15 @@ TrigConf::L1Threshold_Calo::thrValuesMeV() const {
return m_etaDepThrValue;
}
TrigConf::ValueWithEtaDependence<unsigned int>
TrigConf::L1Threshold_Calo::thrValues100MeV() const {
auto thrValues100MeV = ValueWithEtaDependence<unsigned int>{ m_etaDepThrValue.name()+"100MeV" };
for( auto & r : m_etaDepThrValue ) {
thrValues100MeV.addRangeValue( energyInCounts( r.value(), 100 ), r.etaMin(), r.etaMax(), r.priority(), r.symmetric());
}
return thrValues100MeV;
}
TrigConf::ValueWithEtaDependence<unsigned int>
TrigConf::L1Threshold_Calo::thrValuesCounts() const {
auto extraInfo = m_extraInfo.lock();
......@@ -313,6 +333,8 @@ TrigConf::Selection::wpToString(TrigConf::Selection::WP wp)
return "Medium";
if (wp == Selection::WP::TIGHT)
return "Tight";
if (wp == Selection::WP::HAD)
return "Had";
throw std::runtime_error("Unknown working point " + std::to_string(int(wp)));
}
......@@ -327,5 +349,7 @@ TrigConf::Selection::stringToWP(const std::string & wpStr)
return Selection::WP::MEDIUM;
if (wpStr == "Tight")
return Selection::WP::TIGHT;
if (wpStr == "Had")
return Selection::WP::HAD;
throw std::runtime_error("Unknown working point name " + wpStr);
}
......@@ -168,6 +168,28 @@ TrigConf::JsonFileWriterL1::writeJsonFile(const std::string & filename, const L1
}
} catch(std::bad_cast&) {};
// 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["value"] = int(eTAUThr.thrValue());
} catch(std::bad_cast&) {};
// jTAU
try {
auto jTAUThr = dynamic_cast<const TrigConf::L1Threshold_jTAU &>(*thr);
jThr["isolation"] = TrigConf::Selection::wpToString(jTAUThr.isolation());
jThr["value"] = int(jTAUThr.thrValue());
} catch(std::bad_cast&) {};