diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h index 77cb1167fce7946b51fef8fc54e69f1934645ea2..d407b6f88245617728e8230ced987a61fb4ce4e9 100644 --- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h +++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h @@ -49,6 +49,12 @@ namespace TrigConf { uint16_t m_isolationMask; }; + class L1Threshold_JET final : public L1Threshold_Calo { + public: + 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; + }; class L1Threshold_XE final : public L1Threshold_Calo { public: diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThresholdBase.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThresholdBase.h index 4e75a8441630fad77c5046d8220dad7911052c0c..f943f2d31122372909c3555f6061739fe71042cf 100644 --- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThresholdBase.h +++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThresholdBase.h @@ -105,7 +105,7 @@ namespace TrigConf { // load the internal members void load(); - unsigned int m_resolutionMeV; + unsigned int m_resolutionMeV { 1000 }; // default resolution is 1 GeV }; diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx index 4d1dec2c9b653efadb996f9e0852e5b6ec2de4f6..ef30d09c6cb2e140732e99e9a2c88584f0a8333c 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx @@ -34,11 +34,8 @@ TrigConf::L1ThrExtraInfo::createExtraInfo(const std::string & thrTypeName, const if( thrTypeName == "jJ" ) return std::make_unique<L1ThrExtraInfo_jJ>(thrTypeName, data); - L1ThrExtraInfoBase x(thrTypeName, data); - if( x.hasExtraInfo() ) - return std::make_unique<L1ThrExtraInfoBase>(std::move(x)); - - return extraInfo; + // if no special extra information is supplied for the threshold type return base class + return std::make_unique<L1ThrExtraInfoBase>(thrTypeName, data); } std::weak_ptr<TrigConf::L1ThrExtraInfoBase> diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx index b15e4a057de189731ca443236022c29ad5db9463..ce80fe7f5c983f1e60fe54517a415e22457a2662 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx @@ -35,6 +35,9 @@ TrigConf::L1Threshold::createThreshold( const std::string & name, const std::str if( type == "XE" ) return std::make_shared<L1Threshold_XE>( name, type, extraInfo, data ); + + if( type == "JET" ) + return std::make_shared<L1Threshold_JET>( name, type, extraInfo, data ); if( type == "XS" ) return std::make_shared<L1Threshold_XS>( name, type, extraInfo, data ); diff --git a/Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx b/Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx index 71315d8bb0f267db7f33533e658d0b0781ce8d63..5537df0c2ab1a7e3ebd3867b2d6ff59e3290d530 100644 --- a/Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx +++ b/Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx @@ -130,7 +130,7 @@ bool testL1Menu(const string & filename) { cout << "L1 menu has " << l1menu.thresholds(tt).size() << " " << tt << " thresholds, going to print the first three." << endl; int ni = 3; // print the first 3 - for(const auto & thr : l1menu.thresholds(tt) ) { + for(auto thr : l1menu.thresholds(tt) ) { cout << " " << thr->name() << " of type " << thr->type() << " (mapping " << thr->mapping() << ") " << endl; if(--ni==0) break; } @@ -145,9 +145,36 @@ bool testL1Menu(const string & filename) { cout << thrName << " threshold value: " << l1menu.threshold(thrName).thrValue() << endl; } } + + auto thrJET = dynamic_pointer_cast<TrigConf::L1Threshold_JET>(l1menu.thresholds("JET")[0]); + if(thrJET) { + cout << thrJET->name() << ":" << endl; + for(int eta : {0, 20, 30, 40}) { + cout << " value at eta = " << eta << ": " << thrJET->thrValue(eta) << " GeV, " << thrJET->thrValueMeV(eta) << " MeV, " << thrJET->thrValueCounts(eta) << " counts" << endl; + } + } + + auto thrXE = dynamic_pointer_cast<TrigConf::L1Threshold_XE>(l1menu.thresholds("XE")[0]); + if(thrXE) { + cout << thrXE->name() << ": value " << thrXE->thrValue() << " GeV, " << thrXE->thrValueMeV() << " MeV, " << thrXE->thrValueCounts() << " counts" << endl; + } + + + auto thrTERR = dynamic_cast<const TrigConf::L1Threshold_TE&>(l1menu.threshold("TE5.0ETA24")); + if(thrTERR) { + cout << thrTERR.name() << ":" << endl; + for(int eta : {0, 20, 30, 40}) { + cout << " value at eta = " << eta << ": " << thrTERR.thrValue(eta) << " GeV, " << thrTERR.thrValueMeV(eta) << " MeV, " << thrTERR.thrValueCounts(eta) << " counts" << endl; + } + } + + const auto & threEM = dynamic_cast<const TrigConf::L1Threshold_eEM&>(l1menu.threshold("eEM18VHI")); cout << "eEM18VHI isolation: rhad = " << (int)threEM.rhad() << ", reta = " << (int)threEM.reta() << ", wstot = " << (int)threEM.wstot() << endl; + + + const auto & thrMU10 = dynamic_cast<const TrigConf::L1Threshold_MU&>(l1menu.threshold("MU10")); cout << "Threshold MU10 with " << "barrel pt=" << thrMU10.ptBarrel() << " (idx " << thrMU10.idxBarrel() << "), "