Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:36

0001 ////
0002 /// \class l1t::GlobalScales.cc
0003 ///
0004 /// Description: Dump Accessors for L1 GT Result.
0005 ///
0006 /// Implementation:
0007 ///
0008 ///
0009 /// \author: Brian Winer Ohio State
0010 ///
0011 ///
0012 #include "L1Trigger/L1TGlobal/interface/GlobalScales.h"
0013 
0014 #include <iostream>
0015 #include <fstream>
0016 #include <iomanip>
0017 
0018 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0019 #include "FWCore/MessageLogger/interface/MessageDrop.h"
0020 
0021 // constructor
0022 l1t::GlobalScales::GlobalScales() {}
0023 
0024 // destructor
0025 l1t::GlobalScales::~GlobalScales() {}
0026 
0027 std::string l1t::GlobalScales::getScalesName() const { return m_ScaleSetName; }
0028 
0029 void l1t::GlobalScales::setLUT_CalMuEta(const std::string& lutName, std::vector<long long> lut) {
0030   if (m_lut_CalMuEta.count(lutName) != 0) {
0031     LogTrace("GlobalScales") << "      LUT \"" << lutName << "\"already exists in the LUT map- not inserted!"
0032                              << std::endl;
0033     return;
0034   }
0035 
0036   // Insert this LUT into the Table
0037   m_lut_CalMuEta.insert(std::map<std::string, std::vector<long long>>::value_type(lutName, lut));
0038 
0039   return;
0040 }
0041 
0042 void l1t::GlobalScales::setLUT_CalMuPhi(const std::string& lutName, std::vector<long long> lut) {
0043   if (m_lut_CalMuPhi.count(lutName) != 0) {
0044     LogTrace("GlobalScales") << "      LUT \"" << lutName << "\"already exists in the LUT map- not inserted!"
0045                              << std::endl;
0046     return;
0047   }
0048 
0049   // Insert this LUT into the Table
0050   m_lut_CalMuPhi.insert(std::map<std::string, std::vector<long long>>::value_type(lutName, lut));
0051 
0052   return;
0053 }
0054 
0055 void l1t::GlobalScales::setLUT_DeltaEta(const std::string& lutName,
0056                                         std::vector<long long> lut,
0057                                         unsigned int precision) {
0058   if (m_lut_DeltaEta.count(lutName) != 0) {
0059     LogTrace("GlobalScales") << "      LUT \"" << lutName << "\"already exists in the LUT map- not inserted!"
0060                              << std::endl;
0061     return;
0062   }
0063 
0064   // Insert this LUT into the Table
0065   m_lut_DeltaEta.insert(std::map<std::string, std::vector<long long>>::value_type(lutName, lut));
0066   m_Prec_DeltaEta.insert(std::map<std::string, unsigned int>::value_type(lutName, precision));
0067 
0068   return;
0069 }
0070 
0071 void l1t::GlobalScales::setLUT_DeltaPhi(const std::string& lutName,
0072                                         std::vector<long long> lut,
0073                                         unsigned int precision) {
0074   if (m_lut_DeltaPhi.count(lutName) != 0) {
0075     LogTrace("GlobalScales") << "      LUT \"" << lutName << "\"already exists in the LUT map- not inserted!"
0076                              << std::endl;
0077     return;
0078   }
0079 
0080   // Insert this LUT into the Table
0081   m_lut_DeltaPhi.insert(std::map<std::string, std::vector<long long>>::value_type(lutName, lut));
0082   m_Prec_DeltaPhi.insert(std::map<std::string, unsigned int>::value_type(lutName, precision));
0083 
0084   return;
0085 }
0086 
0087 void l1t::GlobalScales::setLUT_Pt(const std::string& lutName, std::vector<long long> lut, unsigned int precision) {
0088   if (m_lut_Pt.count(lutName) != 0) {
0089     LogTrace("GlobalScales") << "      LUT \"" << lutName << "\"already exists in the LUT map- not inserted!"
0090                              << std::endl;
0091     return;
0092   }
0093 
0094   // Insert this LUT into the Table
0095   m_lut_Pt.insert(std::map<std::string, std::vector<long long>>::value_type(lutName, lut));
0096   m_Prec_Pt.insert(std::map<std::string, unsigned int>::value_type(lutName, precision));
0097 
0098   return;
0099 }
0100 
0101 // Added for displaced muons
0102 void l1t::GlobalScales::setLUT_Upt(const std::string& lutName, std::vector<long long> lut, unsigned int precision) {
0103   if (m_lut_Upt.count(lutName) != 0) {
0104     LogTrace("GlobalScales") << "      LUT \"" << lutName << "\"already exists in the LUT map- not inserted!"
0105                              << std::endl;
0106     return;
0107   }
0108 
0109   // Insert this LUT into the Table
0110   m_lut_Upt.insert(std::map<std::string, std::vector<long long>>::value_type(lutName, lut));
0111   m_Prec_Upt.insert(std::map<std::string, unsigned int>::value_type(lutName, precision));
0112 
0113   return;
0114 }
0115 
0116 void l1t::GlobalScales::setLUT_Cosh(const std::string& lutName, std::vector<long long> lut, unsigned int precision) {
0117   if (m_lut_Cosh.count(lutName) != 0) {
0118     LogTrace("GlobalScales") << "      LUT \"" << lutName << "\"already exists in the LUT map- not inserted!"
0119                              << std::endl;
0120     return;
0121   }
0122 
0123   // Insert this LUT into the Table
0124   m_lut_Cosh.insert(std::map<std::string, std::vector<long long>>::value_type(lutName, lut));
0125   m_Prec_Cosh.insert(std::map<std::string, unsigned int>::value_type(lutName, precision));
0126 
0127   return;
0128 }
0129 
0130 void l1t::GlobalScales::setLUT_Cos(const std::string& lutName, std::vector<long long> lut, unsigned int precision) {
0131   if (m_lut_Cos.count(lutName) != 0) {
0132     LogTrace("GlobalScales") << "      LUT \"" << lutName << "\"already exists in the LUT map- not inserted!"
0133                              << std::endl;
0134     return;
0135   }
0136 
0137   // Insert this LUT into the Table
0138   m_lut_Cos.insert(std::map<std::string, std::vector<long long>>::value_type(lutName, lut));
0139   m_Prec_Cos.insert(std::map<std::string, unsigned int>::value_type(lutName, precision));
0140 
0141   return;
0142 }
0143 
0144 void l1t::GlobalScales::setLUT_Sin(const std::string& lutName, std::vector<long long> lut, unsigned int precision) {
0145   if (m_lut_Sin.count(lutName) != 0) {
0146     LogTrace("GlobalScales") << "      LUT \"" << lutName << "\"already exists in the LUT map- not inserted!"
0147                              << std::endl;
0148     return;
0149   }
0150 
0151   // Insert this LUT into the Table
0152   m_lut_Sin.insert(std::map<std::string, std::vector<long long>>::value_type(lutName, lut));
0153   m_Prec_Sin.insert(std::map<std::string, unsigned int>::value_type(lutName, precision));
0154 
0155   return;
0156 }
0157 
0158 long long l1t::GlobalScales::getLUT_CalMuEta(const std::string& lutName, int element) const {
0159   long long value = 0;
0160 
0161   if (element < 0) {
0162     edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for CalMuEta LUT ( "
0163                                   << lutName << ")" << std::endl;
0164   } else if (element >= (int)m_lut_CalMuEta.find(lutName)->second.size()) {
0165     edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for CalMuEta LUT ("
0166                                   << lutName << ") size = " << m_lut_CalMuEta.find(lutName)->second.size() << std::endl;
0167   } else {
0168     value = m_lut_CalMuEta.find(lutName)->second.at(element);
0169   }
0170   return value;
0171 }
0172 
0173 long long l1t::GlobalScales::getLUT_CalMuPhi(const std::string& lutName, int element) const {
0174   long long value = 0;
0175 
0176   if (element < 0) {
0177     edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for CalMuPhi LUT ( "
0178                                   << lutName << ")" << std::endl;
0179   } else if (element >= (int)m_lut_CalMuPhi.find(lutName)->second.size()) {
0180     edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for CalMuPhi LUT ("
0181                                   << lutName << ") size = " << m_lut_CalMuPhi.find(lutName)->second.size() << std::endl;
0182   } else {
0183     value = m_lut_CalMuPhi.find(lutName)->second.at(element);
0184   }
0185   return value;
0186 }
0187 
0188 long long l1t::GlobalScales::getLUT_DeltaEta(std::string lutName, int element) const {
0189   long long value = 0;
0190 
0191   //first check whether this LUT exists
0192   if (m_lut_DeltaEta.find(lutName) == m_lut_DeltaEta.end()) {
0193     //does not exist. Check for oppoisite ordering
0194     std::size_t pos = lutName.find('-');
0195     std::string name = lutName.substr(pos + 1);
0196     name += "-";
0197     name += lutName.substr(0, pos);
0198 
0199     //check again
0200     if (m_lut_DeltaEta.find(name) == m_lut_DeltaEta.end()) {
0201       edm::LogError("GlobalScales") << "Warning: No LUT by name " << lutName << " or " << name << " exists! "
0202                                     << std::endl;
0203       return value;
0204     } else {
0205       lutName = name;
0206     }
0207   }
0208 
0209   if (element < 0) {
0210     edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for DeltaEta LUT ( "
0211                                   << lutName << ")" << std::endl;
0212   } else if (element >= (int)m_lut_DeltaEta.find(lutName)->second.size()) {
0213     edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for DeltaEta LUT ("
0214                                   << lutName << ") size = " << m_lut_DeltaEta.find(lutName)->second.size() << std::endl;
0215   } else {
0216     value = m_lut_DeltaEta.find(lutName)->second.at(element);
0217   }
0218   return value;
0219 }
0220 unsigned int l1t::GlobalScales::getPrec_DeltaEta(const std::string& lutName) const {
0221   unsigned int value = 0;
0222 
0223   if (m_Prec_DeltaEta.find(lutName) != m_Prec_DeltaEta.end()) {
0224     value = m_Prec_DeltaEta.find(lutName)->second;
0225   } else {
0226     //does not exist. Check for oppoisite ordering
0227     std::size_t pos = lutName.find('-');
0228     std::string name = lutName.substr(pos + 1);
0229     name += "-";
0230     name += lutName.substr(0, pos);
0231 
0232     //check again
0233     if (m_Prec_DeltaEta.find(name) != m_Prec_DeltaEta.end()) {
0234       value = m_Prec_DeltaEta.find(name)->second;
0235     } else {
0236       edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for DeltaEta not found" << std::endl;
0237     }
0238   }
0239   return value;
0240 }
0241 
0242 long long l1t::GlobalScales::getLUT_DeltaPhi(std::string lutName, int element) const {
0243   long long value = 0;
0244 
0245   //first check whether this LUT exists
0246   if (m_lut_DeltaPhi.find(lutName) == m_lut_DeltaPhi.end()) {
0247     //does not exist. Check for oppoisite ordering
0248     std::size_t pos = lutName.find('-');
0249     std::string name = lutName.substr(pos + 1);
0250     name += "-";
0251     name += lutName.substr(0, pos);
0252 
0253     //check again
0254     if (m_lut_DeltaPhi.find(name) == m_lut_DeltaPhi.end()) {
0255       edm::LogError("GlobalScales") << "Warning: No LUT by name " << lutName << " or " << name << " exists! "
0256                                     << std::endl;
0257       return value;
0258     } else {
0259       lutName = name;
0260     }
0261   }
0262 
0263   if (element < 0) {
0264     edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for DeltaPhi LUT ( "
0265                                   << lutName << ")" << std::endl;
0266   } else if (element >= (int)m_lut_DeltaPhi.find(lutName)->second.size()) {
0267     edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for DeltaPhi LUT ("
0268                                   << lutName << ") size = " << m_lut_DeltaPhi.find(lutName)->second.size() << std::endl;
0269   } else {
0270     value = m_lut_DeltaPhi.find(lutName)->second.at(element);
0271   }
0272   return value;
0273 }
0274 unsigned int l1t::GlobalScales::getPrec_DeltaPhi(const std::string& lutName) const {
0275   unsigned int value = 0;
0276 
0277   if (m_Prec_DeltaPhi.find(lutName) != m_Prec_DeltaPhi.end()) {
0278     value = m_Prec_DeltaPhi.find(lutName)->second;
0279   } else {
0280     //does not exist. Check for oppoisite ordering
0281     std::size_t pos = lutName.find('-');
0282     std::string name = lutName.substr(pos + 1);
0283     name += "-";
0284     name += lutName.substr(0, pos);
0285 
0286     //check again
0287     if (m_Prec_DeltaPhi.find(name) != m_Prec_DeltaPhi.end()) {
0288       value = m_Prec_DeltaPhi.find(name)->second;
0289     } else {
0290       edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for DeltaPhi not found" << std::endl;
0291     }
0292   }
0293   return value;
0294 }
0295 
0296 long long l1t::GlobalScales::getLUT_Pt(const std::string& lutName, int element) const {
0297   long long value = 0;
0298 
0299   if (element < 0) {
0300     edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for Pt LUT ( " << lutName
0301                                   << ")" << std::endl;
0302   } else if (element >= (int)m_lut_Pt.find(lutName)->second.size()) {
0303     edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for Pt LUT (" << lutName
0304                                   << ") size = " << m_lut_Pt.find(lutName)->second.size() << std::endl;
0305   } else {
0306     value = m_lut_Pt.find(lutName)->second.at(element);
0307   }
0308   return value;
0309 }
0310 unsigned int l1t::GlobalScales::getPrec_Pt(const std::string& lutName) const {
0311   unsigned int value = 0;
0312 
0313   if (m_Prec_Pt.find(lutName) != m_Prec_Pt.end()) {
0314     value = m_Prec_Pt.find(lutName)->second;
0315   } else {
0316     edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for Pt not found" << std::endl;
0317   }
0318   return value;
0319 }
0320 
0321 // Added for displaced muons
0322 long long l1t::GlobalScales::getLUT_Upt(const std::string& lutName, int element) const {
0323   long long value = 0;
0324 
0325   if (element < 0) {
0326     edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for Upt LUT ( " << lutName
0327                                   << ")" << std::endl;
0328   } else if (element >= (int)m_lut_Upt.find(lutName)->second.size()) {
0329     edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for Upt LUT (" << lutName
0330                                   << ") size = " << m_lut_Upt.find(lutName)->second.size() << std::endl;
0331   } else {
0332     value = m_lut_Upt.find(lutName)->second.at(element);
0333   }
0334   return value;
0335 }
0336 // Added for displaced muons
0337 unsigned int l1t::GlobalScales::getPrec_Upt(const std::string& lutName) const {
0338   unsigned int value = 0;
0339 
0340   if (m_Prec_Upt.find(lutName) != m_Prec_Upt.end()) {
0341     value = m_Prec_Upt.find(lutName)->second;
0342   } else {
0343     edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for Upt not found" << std::endl;
0344   }
0345   return value;
0346 }
0347 
0348 long long l1t::GlobalScales::getLUT_DeltaEta_Cosh(std::string lutName, int element) const {
0349   long long value = 0;
0350 
0351   //first check whether this LUT exists
0352   if (m_lut_Cosh.find(lutName) == m_lut_Cosh.end()) {
0353     //does not exist. Check for oppoisite ordering
0354     std::size_t pos = lutName.find('-');
0355     std::string name = lutName.substr(pos + 1);
0356     name += "-";
0357     name += lutName.substr(0, pos);
0358 
0359     //check again
0360     if (m_lut_Cosh.find(name) == m_lut_Cosh.end()) {
0361       edm::LogError("GlobalScales") << "Warning: No LUT by name " << lutName << " or " << name << " exists! "
0362                                     << std::endl;
0363       return value;
0364     } else {
0365       lutName = name;
0366     }
0367   }
0368 
0369   if (element < 0) {
0370     edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for Cosh LUT ( " << lutName
0371                                   << ")" << std::endl;
0372   } else if (element >= (int)m_lut_Cosh.find(lutName)->second.size()) {
0373     edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for Cosh LUT (" << lutName
0374                                   << ") size = " << m_lut_Cosh.find(lutName)->second.size() << std::endl;
0375   } else {
0376     value = m_lut_Cosh.find(lutName)->second.at(element);
0377   }
0378   return value;
0379 }
0380 unsigned int l1t::GlobalScales::getPrec_DeltaEta_Cosh(const std::string& lutName) const {
0381   unsigned int value = 0;
0382 
0383   if (m_Prec_Cosh.find(lutName) != m_Prec_Cosh.end()) {
0384     value = m_Prec_Cosh.find(lutName)->second;
0385   } else {
0386     //does not exist. Check for oppoisite ordering
0387     std::size_t pos = lutName.find('-');
0388     std::string name = lutName.substr(pos + 1);
0389     name += "-";
0390     name += lutName.substr(0, pos);
0391 
0392     //check again
0393     if (m_Prec_Cosh.find(name) != m_Prec_Cosh.end()) {
0394       value = m_Prec_Cosh.find(name)->second;
0395     } else {
0396       edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for Cosh not found" << std::endl;
0397     }
0398   }
0399   return value;
0400 }
0401 
0402 long long l1t::GlobalScales::getLUT_DeltaPhi_Cos(std::string lutName, int element) const {
0403   long long value = 0;
0404 
0405   //first check whether this LUT exists
0406   if (m_lut_Cos.find(lutName) == m_lut_Cos.end()) {
0407     //does not exist. Check for oppoisite ordering
0408     std::size_t pos = lutName.find('-');
0409     std::string name = lutName.substr(pos + 1);
0410     name += "-";
0411     name += lutName.substr(0, pos);
0412 
0413     //check again
0414     if (m_lut_Cos.find(name) == m_lut_Cos.end()) {
0415       edm::LogError("GlobalScales") << "Warning: No LUT by name " << lutName << " or " << name << " exists! "
0416                                     << std::endl;
0417       return value;
0418     } else {
0419       lutName = name;
0420     }
0421   }
0422 
0423   if (element < 0) {
0424     edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for Cos LUT ( " << lutName
0425                                   << ")" << std::endl;
0426   } else if (element >= (int)m_lut_DeltaPhi.find(lutName)->second.size()) {
0427     edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for Cos LUT (" << lutName
0428                                   << ") size = " << m_lut_Cos.find(lutName)->second.size() << std::endl;
0429   } else {
0430     value = m_lut_Cos.find(lutName)->second.at(element);
0431   }
0432   return value;
0433 }
0434 
0435 long long l1t::GlobalScales::getLUT_Cos(const std::string& lutName, int element) const {
0436   long long value = 0;
0437 
0438   //first check whether this LUT exists
0439   if (m_lut_Cos.find(lutName) == m_lut_Cos.end()) {
0440     edm::LogError("GlobalScales") << "Warning: No LUT by name " << lutName << " exists! " << std::endl;
0441     return value;
0442   }
0443 
0444   if (element < 0) {
0445     edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for Cos LUT ( " << lutName
0446                                   << ")" << std::endl;
0447   } else if (element >= (int)m_lut_Cos.find(lutName)->second.size()) {
0448     edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for Cos LUT (" << lutName
0449                                   << ") size = " << m_lut_Cos.find(lutName)->second.size() << std::endl;
0450   } else {
0451     value = m_lut_Cos.find(lutName)->second.at(element);
0452   }
0453   return value;
0454 }
0455 
0456 long long l1t::GlobalScales::getLUT_Sin(const std::string& lutName, int element) const {
0457   long long value = 0;
0458 
0459   //first check whether this LUT exists
0460   if (m_lut_Sin.find(lutName) == m_lut_Sin.end()) {
0461     edm::LogError("GlobalScales") << "Warning: No LUT by name " << lutName << " exists! " << std::endl;
0462     return value;
0463   }
0464 
0465   if (element < 0) {
0466     edm::LogError("GlobalScales") << "Error: Negative index, " << element << ", requested for Sin LUT ( " << lutName
0467                                   << ")" << std::endl;
0468   } else if (element >= (int)m_lut_Sin.find(lutName)->second.size()) {
0469     edm::LogError("GlobalScales") << "Error: Element Requested " << element << " too large for Sin LUT (" << lutName
0470                                   << ") size = " << m_lut_Sin.find(lutName)->second.size() << std::endl;
0471   } else {
0472     value = m_lut_Sin.find(lutName)->second.at(element);
0473   }
0474   return value;
0475 }
0476 
0477 unsigned int l1t::GlobalScales::getPrec_DeltaPhi_Cos(const std::string& lutName) const {
0478   unsigned int value = 0;
0479 
0480   if (m_Prec_Cos.find(lutName) != m_Prec_Cos.end()) {
0481     value = m_Prec_Cos.find(lutName)->second;
0482   } else {
0483     //does not exist. Check for oppoisite ordering
0484     std::size_t pos = lutName.find('-');
0485     std::string name = lutName.substr(pos + 1);
0486     name += "-";
0487     name += lutName.substr(0, pos);
0488 
0489     //check again
0490     if (m_Prec_Cos.find(name) != m_Prec_Cos.end()) {
0491       value = m_Prec_Cos.find(name)->second;
0492     } else {
0493       edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for Cos not found" << std::endl;
0494     }
0495   }
0496   return value;
0497 }
0498 
0499 unsigned int l1t::GlobalScales::getPrec_Cos(const std::string& lutName) const {
0500   unsigned int value = 0;
0501 
0502   if (m_Prec_Sin.find(lutName) != m_Prec_Sin.end()) {
0503     value = m_Prec_Sin.find(lutName)->second;
0504   } else {
0505     edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for Sin not found" << std::endl;
0506   }
0507   return value;
0508 }
0509 
0510 unsigned int l1t::GlobalScales::getPrec_Sin(const std::string& lutName) const {
0511   unsigned int value = 0;
0512 
0513   if (m_Prec_Sin.find(lutName) != m_Prec_Sin.end()) {
0514     value = m_Prec_Sin.find(lutName)->second;
0515   } else {
0516     edm::LogError("GlobalScales") << "Warning: LUT " << lutName << " for Sin not found" << std::endl;
0517   }
0518   return value;
0519 }
0520 
0521 void l1t::GlobalScales::dumpAllLUTs(std::ostream& myCout) const {
0522   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_CalMuEta.begin();
0523        itr != m_lut_CalMuEta.end();
0524        itr++) {
0525     dumpLUT(myCout, 1, itr->first);
0526   }
0527 
0528   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_CalMuPhi.begin();
0529        itr != m_lut_CalMuPhi.end();
0530        itr++) {
0531     dumpLUT(myCout, 2, itr->first);
0532   }
0533 
0534   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_DeltaEta.begin();
0535        itr != m_lut_DeltaEta.end();
0536        itr++) {
0537     dumpLUT(myCout, 3, itr->first);
0538   }
0539 
0540   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_DeltaPhi.begin();
0541        itr != m_lut_DeltaPhi.end();
0542        itr++) {
0543     dumpLUT(myCout, 4, itr->first);
0544   }
0545 
0546   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Cosh.begin(); itr != m_lut_Cosh.end();
0547        itr++) {
0548     dumpLUT(myCout, 5, itr->first);
0549   }
0550 
0551   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Cos.begin(); itr != m_lut_Cos.end();
0552        itr++) {
0553     dumpLUT(myCout, 6, itr->first);
0554   }
0555 
0556   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Sin.begin(); itr != m_lut_Sin.end();
0557        itr++) {
0558     dumpLUT(myCout, 7, itr->first);
0559   }
0560 
0561   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Pt.begin(); itr != m_lut_Pt.end();
0562        itr++) {
0563     dumpLUT(myCout, 8, itr->first);
0564   }
0565   // Added for displaced muons
0566   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Upt.begin(); itr != m_lut_Upt.end();
0567        itr++) {
0568     dumpLUT(myCout, 8, itr->first);
0569   }
0570 }
0571 
0572 void l1t::GlobalScales::dumpLUT(std::ostream& myCout, int LUTtype, std::string name) const {
0573   std::vector<long long> dumpV;
0574   unsigned int prec = 0;
0575   std::string type = "Null";
0576   switch (LUTtype) {
0577     case 1: {
0578       dumpV = m_lut_CalMuEta.find(name)->second;
0579       type = "Cal-Mu Eta";
0580       break;
0581     }
0582     case 2: {
0583       dumpV = m_lut_CalMuPhi.find(name)->second;
0584       type = "Cal-Mu Phi";
0585       break;
0586     }
0587     case 3: {
0588       dumpV = m_lut_DeltaEta.find(name)->second;
0589       prec = m_Prec_DeltaEta.find(name)->second;
0590       type = "Delta Eta";
0591       break;
0592     }
0593     case 4: {
0594       dumpV = m_lut_DeltaPhi.find(name)->second;
0595       prec = m_Prec_DeltaPhi.find(name)->second;
0596       type = "Delta Phi";
0597       break;
0598     }
0599     case 5: {
0600       dumpV = m_lut_Cosh.find(name)->second;
0601       prec = m_Prec_Cosh.find(name)->second;
0602       type = "Cosh";
0603       break;
0604     }
0605     case 6: {
0606       dumpV = m_lut_Cos.find(name)->second;
0607       prec = m_Prec_Cos.find(name)->second;
0608       type = "Cos";
0609       break;
0610     }
0611     case 7: {
0612       dumpV = m_lut_Sin.find(name)->second;
0613       prec = m_Prec_Sin.find(name)->second;
0614       type = "Sin";
0615       break;
0616     }
0617     case 8: {
0618       dumpV = m_lut_Pt.find(name)->second;
0619       prec = m_Prec_Pt.find(name)->second;
0620       type = "Pt";
0621       break;
0622     }
0623     case 9: {  // Added for displaced muons
0624       dumpV = m_lut_Upt.find(name)->second;
0625       prec = m_Prec_Upt.find(name)->second;
0626       type = "Upt";
0627       break;
0628     }
0629   }
0630 
0631   myCout << "=========================================" << std::endl;
0632   myCout << "   LUT: " << type << "  Table: " << name << "   Size = " << dumpV.size() << " Precision " << prec
0633          << std::endl;
0634   myCout << "=========================================" << std::endl;
0635   for (int i = 0; i < (int)dumpV.size(); i++) {
0636     myCout << " Element " << i << " " << dumpV.at(i) << std::endl;
0637   }
0638 }
0639 
0640 void l1t::GlobalScales::print(std::ostream& myCout) const {
0641   myCout << "\n  *************  L1T Global Scales ************" << std::endl;
0642 
0643   myCout << "   Muon Scales: " << std::endl;
0644   printScale(m_muScales, myCout);
0645 
0646   myCout << "   EG Scales: " << std::endl;
0647   printScale(m_egScales, myCout);
0648 
0649   myCout << "   Tau Scales: " << std::endl;
0650   printScale(m_tauScales, myCout);
0651 
0652   myCout << "   Jet Scales: " << std::endl;
0653   printScale(m_jetScales, myCout);
0654 
0655   myCout << "   HTT Scales: " << std::endl;
0656   printScale(m_httScales, myCout);
0657 
0658   myCout << "   ETT Scales: " << std::endl;
0659   printScale(m_ettScales, myCout);
0660 
0661   myCout << "   HTM Scales: " << std::endl;
0662   printScale(m_htmScales, myCout);
0663 
0664   myCout << "   ETM Scales: " << std::endl;
0665   printScale(m_etmScales, myCout);
0666 
0667   myCout << std::endl;
0668   myCout << "   LUTs Stored: " << std::endl;
0669   myCout << " CalMuEta:";
0670   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_CalMuEta.begin();
0671        itr != m_lut_CalMuEta.end();
0672        itr++) {
0673     myCout << " " << itr->first;
0674   }
0675   myCout << std::endl;
0676 
0677   myCout << " CalMuPhi:";
0678   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_CalMuPhi.begin();
0679        itr != m_lut_CalMuPhi.end();
0680        itr++) {
0681     myCout << " " << itr->first;
0682   }
0683   myCout << std::endl;
0684 
0685   myCout << " DeltaEta:";
0686   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_DeltaEta.begin();
0687        itr != m_lut_DeltaEta.end();
0688        itr++) {
0689     myCout << " " << itr->first;
0690   }
0691   myCout << std::endl;
0692 
0693   myCout << " DeltaPhi:";
0694   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_DeltaPhi.begin();
0695        itr != m_lut_DeltaPhi.end();
0696        itr++) {
0697     myCout << " " << itr->first;
0698   }
0699   myCout << std::endl;
0700 
0701   myCout << " Cos:     ";
0702   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Cos.begin(); itr != m_lut_Cos.end();
0703        itr++) {
0704     myCout << " " << itr->first;
0705   }
0706   myCout << std::endl;
0707 
0708   myCout << " Sin:     ";
0709   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Sin.begin(); itr != m_lut_Sin.end();
0710        itr++) {
0711     myCout << " " << itr->first;
0712   }
0713   myCout << std::endl;
0714 
0715   myCout << " Cosh:    ";
0716   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Cosh.begin(); itr != m_lut_Cosh.end();
0717        itr++) {
0718     myCout << " " << itr->first;
0719   }
0720   myCout << std::endl;
0721 
0722   myCout << " Pt:      ";
0723   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Pt.begin(); itr != m_lut_Pt.end();
0724        itr++) {
0725     myCout << " " << itr->first;
0726   }
0727   myCout << std::endl;
0728 
0729   // Added for displaced muons
0730   myCout << " Upt:      ";
0731   for (std::map<std::string, std::vector<long long>>::const_iterator itr = m_lut_Upt.begin(); itr != m_lut_Upt.end();
0732        itr++) {
0733     myCout << " " << itr->first;
0734   }
0735   myCout << std::endl;
0736 }
0737 void l1t::GlobalScales::printScale(ScaleParameters scale, std::ostream& myCout) const {
0738   myCout << "    Pt Min   = " << std::setw(10) << scale.etMin << "      Pt Max   = " << std::setw(10) << scale.etMax
0739          << "      Pt Step  = " << std::setw(10) << scale.etStep << "      Number   = " << std::setw(10)
0740          << scale.etBins.size() << std::endl;
0741   myCout << "\n";
0742   for (int i = 0; i < int(scale.etBins.size()); i++) {
0743     std::pair<double, double> binEdges = scale.etBins.at(i);
0744     myCout << "        etBins[" << i << "]\trange:\t" << binEdges.first << " - " << binEdges.second << std::endl;
0745   }
0746 
0747   myCout << "\n    Phi Min  = " << std::setw(10) << scale.phiMin << "      Phi Max  = " << std::setw(10) << scale.phiMax
0748          << "      Phi Step = " << std::setw(10) << scale.phiStep << "      Number   = " << std::setw(10)
0749          << scale.phiBins.size() << std::endl;
0750   myCout << "\n";
0751   for (int i = 0; i < int(scale.phiBins.size()); i++) {
0752     std::pair<double, double> binEdges = scale.phiBins.at(i);
0753     myCout << "        phiBins[" << i << "]\trange:\t" << binEdges.first << " - " << binEdges.second << std::endl;
0754   }
0755 
0756   myCout << "\n    Eta Min  = " << std::setw(10) << scale.etaMin << "      Eta Max  = " << std::setw(10) << scale.etaMax
0757          << "      Eta Step = " << std::setw(10) << scale.etaStep << "      Number   = " << std::setw(10)
0758          << scale.etaBins.size() << std::endl;
0759   myCout << "\n";
0760   for (int i = 0; i < int(scale.etaBins.size()); i++) {
0761     std::pair<double, double> binEdges = scale.etaBins.at(i);
0762     myCout << "        etaBins[" << i << "]\trange:\t" << binEdges.first << " - " << binEdges.second << std::endl;
0763   }
0764 }