17 if (
pnodes_[nodeIdx].uparams_.size() != 4) {
21 for (
size_t i = 0;
i < 28; ++
i) {
43 if (
pnodes_[nodeIdx].uparams_.size() == 4) {
46 return std::bitset<28>();
53 if (
pnodes_[nodeIdx].uparams_.size() == 4) {
54 return std::bitset<12>(
pnodes_[nodeIdx].uparams_[tfIdx]);
56 return std::bitset<12>();
64 if (
pnodes_[nodeIdx].uparams_.size() == 4) {
65 for (
size_t i = 0;
i < 6; ++
i) {
66 inputFlags[
i] = ((
pnodes_[nodeIdx].uparams_[tfIdx] >> (
i + startIdx)) & 0x1);
82 pnodes_[nodeIdx].uparams_.resize(4);
83 for (
size_t i = 0;
i < 28; ++
i) {
100 pnodes_[nodeIdx].uparams_.resize(4);
101 for (
size_t i = 0;
i < 28; ++
i) {
109 pnodes_[nodeIdx].uparams_.resize(4);
110 for (
size_t i = 0;
i < 12; ++
i) {
111 pnodes_[nodeIdx].uparams_[tfIdx] += (inputFlags.test(
i) <<
i);
118 pnodes_[nodeIdx].uparams_.resize(4);
119 for (
size_t i = 0;
i < 6; ++
i) {
120 pnodes_[nodeIdx].uparams_[tfIdx] += (inputFlags.test(
i) << (
i + startIdx));
130 const std::map<std::string, std::string>& procRoleMap = trgSys.
getProcRole();
131 if (procRoleMap.size() != 1) {
132 if (procRoleMap.size() == 0) {
133 edm::LogError(
"uGMT config from online") <<
"No processor id found for uGMT HW configuration.";
135 edm::LogError(
"uGMT config from online") <<
"More than one processor id found for uGMT HW configuration.";
138 procId = procRoleMap.cbegin()->first;
143 std::map<std::string, l1t::Setting> settings = trgSys.
getSettings(procId);
144 std::map<std::string, l1t::Mask>
masks = trgSys.
getMasks(procId);
154 if (settings.count(
"algoRev") > 0) {
155 fwVersion = settings[
"algoRev"].getValue<
unsigned int>();
159 std::stringstream
ss;
161 bool disableCaloInputs = settings[
"caloInputsDisable"].getValue<
bool>();
162 std::string bmtfInputsToDisableStr = settings[
"bmtfInputsToDisable"].getValueAsStr();
163 std::string omtfInputsToDisableStr = settings[
"omtfInputsToDisable"].getValueAsStr();
164 std::string emtfInputsToDisableStr = settings[
"emtfInputsToDisable"].getValueAsStr();
169 for (
unsigned i = 0;
i < 12; ++
i) {
172 if (bmtfInputsToDisableStr.find(ss.str()) != std::string::npos) {
173 bmtfInputsToDisable[
i] = 1;
182 if (omtfInputsToDisableStr.find(ss.str()) != std::string::npos) {
183 omtfInputsToDisable[
i] = 1;
192 if (emtfInputsToDisableStr.find(ss.str()) != std::string::npos) {
193 emtfInputsToDisable[
i] = 1;
198 if (disableCaloInputs) {
204 std::bitset<12> bmtfDisables;
205 for (
size_t i = 0;
i < bmtfInputsToDisable.size(); ++
i) {
206 bmtfDisables.set(
i, bmtfInputsToDisable[
i] > 0);
210 std::bitset<6> omtfpDisables;
211 std::bitset<6> omtfnDisables;
212 for (
size_t i = 0;
i < omtfInputsToDisable.size(); ++
i) {
214 omtfpDisables.set(
i, omtfInputsToDisable[
i] > 0);
216 omtfnDisables.set(
i-6, omtfInputsToDisable[
i] > 0);
222 std::bitset<6> emtfpDisables;
223 std::bitset<6> emtfnDisables;
224 for (
size_t i = 0;
i < emtfInputsToDisable.size(); ++
i) {
226 emtfpDisables.set(
i, emtfInputsToDisable[
i] > 0);
228 emtfnDisables.set(
i-6, emtfInputsToDisable[
i] > 0);
235 bool caloInputsMasked =
true;
239 ss << std::setfill(
'0');
241 for (
unsigned i = 0;
i < 28; ++
i) {
243 ss <<
"inputPorts.CaloL2_" << std::setw(2) <<
i+1;
245 if (!trgSys.
isMasked(procId, ss.str())) {
246 caloInputsMasked =
false;
250 ss <<
"inputPorts.BMTF_" << std::setw(2) << i+1;
251 if (trgSys.
isMasked(procId, ss.str())) {
252 maskedBmtfInputs[
i] = 1;
255 ss <<
"inputPorts.OMTF";
257 ss <<
"+_" << std::setw(2) << i+1;
259 ss <<
"-_" << std::setw(2) << i-5;
261 if (trgSys.
isMasked(procId, ss.str())) {
262 maskedOmtfInputs[
i] = 1;
265 ss <<
"inputPorts.EMTF";
267 ss <<
"+_" << std::setw(2) << i+1;
269 ss <<
"-_" << std::setw(2) << i-5;
271 if (trgSys.
isMasked(procId, ss.str())) {
272 maskedEmtfInputs[
i] = 1;
276 ss << std::setfill(
' ');
279 if (caloInputsMasked) {
285 std::bitset<12> bmtfMasked;
286 for (
size_t i = 0;
i < maskedBmtfInputs.size(); ++
i) {
287 bmtfMasked.set(
i, maskedBmtfInputs[
i] > 0);
291 std::bitset<6> omtfpMasked;
292 std::bitset<6> omtfnMasked;
293 for (
size_t i = 0;
i < maskedOmtfInputs.size(); ++
i) {
295 omtfpMasked.set(
i, maskedOmtfInputs[
i] > 0);
297 omtfnMasked.set(
i-6, maskedOmtfInputs[
i] > 0);
303 std::bitset<6> emtfpMasked;
304 std::bitset<6> emtfnMasked;
305 for (
size_t i = 0;
i < maskedEmtfInputs.size(); ++
i) {
307 emtfpMasked.set(
i, maskedEmtfInputs[
i] > 0);
309 emtfnMasked.set(
i-6, maskedEmtfInputs[
i] > 0);
413 out <<
"L1 MicroGMT Parameters" << std::endl;
415 out <<
"Firmware version: " << this->
fwVersion() << std::endl;
418 out <<
" EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0" << std::endl;
420 out <<
"Masked Inputs: " << this->
maskedInputs() << std::endl;
421 out <<
" EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0" << std::endl;
423 out <<
"LUT paths (LUTs are generated analytically if path is empty)" << std::endl;
void setFOPosMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
const std::map< std::string, std::string > & getProcRole()
void setInputFlags(const int &nodeIdx, const std::bitset< 72 > &flags)
void setMaskedCaloInputs(const std::bitset< 28 > &masked)
void setIdxSelMemEtaLUT(const l1t::LUT &lut)
bool isMasked(const std::string &proccessor, const std::string &id)
std::bitset< 12 > emtfInputsToDisable() const
std::string oEtaExtrapolationLUTPath() const
void setOPhiExtrapolationLUT(const l1t::LUT &lut)
void setBEtaExtrapolationLUT(const l1t::LUT &lut)
void setFwdPosSingleMatchQualLUT(const l1t::LUT &lut)
std::string fEtaExtrapolationLUTPath() const
double fOPosMatchQualLUTMaxDR() const
void setBmtfInputsToDisable(const std::bitset< 12 > &disables)
double fwdPosSingleMatchQualLUTMaxDR() const
std::bitset< 12 > bmtfInputsToDisable() const
std::string fONegMatchQualLUTPath() const
std::string idxSelMemPhiLUTPath() const
double fwdNegSingleMatchQualLUTMaxDR() const
void setFEtaExtrapolationLUT(const l1t::LUT &lut)
std::string relIsoCheckMemLUTPath() const
double bONegMatchQualLUTfPhi() const
std::bitset< 6 > eomtfInputFlags(const int &nodeIdx, const size_t &startIdx, const int &tfIdx) const
void setTfInputFlags(const int &nodeIdx, const int &tfIdx, const std::bitset< 12 > &flags)
void setFPhiExtrapolationLUT(const l1t::LUT &lut)
std::vector< Node > pnodes_
std::string fwdPosSingleMatchQualLUTPath() const
double ovlPosSingleMatchQualLUTMaxDR() const
double bONegMatchQualLUTfEtaCoarse() const
void setOmtfpInputsToDisable(const std::bitset< 6 > &disables)
void setOEtaExtrapolationLUT(const l1t::LUT &lut)
L1TMuonGlobalParamsHelper()
double bOPosMatchQualLUTfEtaCoarse() const
void setEOmtfInputFlags(const int &nodeIdx, const size_t &startIdx, const int &tfIdx, const std::bitset< 6 > &flags)
void setIdxSelMemPhiLUT(const l1t::LUT &lut)
double fONegMatchQualLUTMaxDR() const
std::bitset< 72 > inputsToDisable() const
std::string absIsoCheckMemLUTPath() const
std::string oPhiExtrapolationLUTPath() const
void setBPhiExtrapolationLUT(const l1t::LUT &lut)
std::string ovlPosSingleMatchQualLUTPath() const
std::string sortRankLUTPath() const
std::string bPhiExtrapolationLUTPath() const
double bOPosMatchQualLUTfEta() const
double bOPosMatchQualLUTMaxDR() const
void setFOPosMatchQualLUT(const l1t::LUT &lut)
void setBONegMatchQualLUT(const l1t::LUT &lut)
void setFwdPosSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fPhi)
void setMaskedOmtfpInputs(const std::bitset< 6 > &masked)
void setCaloInputFlags(const int &nodeIdx, const std::bitset< 28 > &flags)
std::string bONegMatchQualLUTPath() const
void setFONegMatchQualLUT(const l1t::LUT &lut)
std::bitset< 12 > maskedOmtfInputs() const
void setRelIsoCheckMemLUT(const l1t::LUT &lut)
std::bitset< 12 > maskedEmtfInputs() const
void setEmtfnInputsToDisable(const std::bitset< 6 > &disables)
std::string fOPosMatchQualLUTPath() const
void setOvlPosSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
std::string bEtaExtrapolationLUTPath() const
void setAbsIsoCheckMemLUT(const l1t::LUT &lut)
void setOvlPosSingleMatchQualLUT(const l1t::LUT &lut)
unsigned sortRankLUTPtFactor() const
void setFwVersion(unsigned fwVersion)
void setBOPosMatchQualLUT(const l1t::LUT &lut)
std::string fPhiExtrapolationLUTPath() const
void setMaskedOmtfnInputs(const std::bitset< 6 > &masked)
void setCaloInputsToDisable(const std::bitset< 28 > &disables)
std::bitset< 72 > maskedInputs() const
std::map< std::string, Setting > getSettings(const std::string &processor)
double ovlNegSingleMatchQualLUTMaxDR() const
void loadFromOnline(l1t::TrigSystem &trgSys, const std::string &processorId="")
std::bitset< 12 > tfInputFlags(const int &nodeIdx, const int &tfIdx) const
void setBOPosMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
void setMaskedBmtfInputs(const std::bitset< 12 > &masked)
void setFONegMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
void print(std::ostream &) const
void setFwdNegSingleMatchQualLUT(const l1t::LUT &lut)
double bONegMatchQualLUTMaxDR() const
unsigned fwVersion() const
constexpr uint32_t masks[]
double bONegMatchQualLUTfEta() const
void setSortRankLUT(const l1t::LUT &lut)
void setBONegMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
std::string idxSelMemEtaLUTPath() const
void setOvlNegSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fEtaCoarse, double fPhi)
std::string bOPosMatchQualLUTPath() const
const L1TMuonGlobalParams_PUBLIC & cast_to_L1TMuonGlobalParams_PUBLIC(const L1TMuonGlobalParams &x)
std::bitset< 28 > caloInputFlags(const int &nodeIdx) const
std::bitset< 12 > omtfInputsToDisable() const
void setMaskedEmtfpInputs(const std::bitset< 6 > &masked)
void setMaskedEmtfnInputs(const std::bitset< 6 > &masked)
void setEmtfpInputsToDisable(const std::bitset< 6 > &disables)
void setOmtfnInputsToDisable(const std::bitset< 6 > &disables)
std::map< std::string, Mask > getMasks(const std::string &proccessor)
std::bitset< 12 > maskedBmtfInputs() const
unsigned sortRankLUTQualFactor() const
void setFwdNegSingleMatchQualLUTMaxDR(double maxDR, double fEta, double fPhi)
std::string fwdNegSingleMatchQualLUTPath() const
std::string ovlNegSingleMatchQualLUTPath() const
void setOvlNegSingleMatchQualLUT(const l1t::LUT &lut)
std::bitset< 72 > inputFlags(const int &nodeIdx) const