Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-15 02:45:13

0001 /**
0002  * \class MuonTemplate
0003  *
0004  *
0005  * Description: L1 Global Trigger muon template.
0006  *
0007  * Implementation:
0008  *    <TODO: enter implementation details>
0009  *
0010  * \author: Vasile Mihai Ghete - HEPHY Vienna
0011  *          Vladimir Rekovic - extend for indexing
0012  *          Rick Cavanaugh - extend for displaced muons
0013  *
0014  * $Date$
0015  * $Revision$
0016  *
0017  */
0018 
0019 // this class header
0020 #include "L1Trigger/L1TGlobal/interface/MuonTemplate.h"
0021 
0022 // system include files
0023 
0024 #include <iostream>
0025 #include <iomanip>
0026 
0027 // user include files
0028 
0029 //   base class
0030 
0031 // forward declarations
0032 
0033 // constructors
0034 MuonTemplate::MuonTemplate() : GlobalCondition() { m_condCategory = l1t::CondMuon; }
0035 
0036 MuonTemplate::MuonTemplate(const std::string& cName) : GlobalCondition(cName) { m_condCategory = l1t::CondMuon; }
0037 
0038 MuonTemplate::MuonTemplate(const std::string& cName, const l1t::GtConditionType& cType)
0039     : GlobalCondition(cName, l1t::CondMuon, cType) {
0040   int nObjects = nrObjects();
0041 
0042   if (nObjects > 0) {
0043     m_objectParameter.reserve(nObjects);
0044 
0045     m_objectType.reserve(nObjects);
0046     m_objectType.assign(nObjects, l1t::gtMu);
0047   }
0048 }
0049 
0050 // copy constructor
0051 MuonTemplate::MuonTemplate(const MuonTemplate& cp) : GlobalCondition(cp.m_condName) { copy(cp); }
0052 
0053 // destructor
0054 MuonTemplate::~MuonTemplate() {
0055   // empty now
0056 }
0057 
0058 // assign operator
0059 MuonTemplate& MuonTemplate::operator=(const MuonTemplate& cp) {
0060   copy(cp);
0061   return *this;
0062 }
0063 
0064 // setConditionParameter - set the parameters of the condition
0065 void MuonTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter,
0066                                          const CorrelationParameter& corrParameter) {
0067   m_objectParameter = objParameter;
0068   m_correlationParameter = corrParameter;
0069 }
0070 
0071 void MuonTemplate::print(std::ostream& myCout) const {
0072   myCout << "\n  MuonTemplate print..." << std::endl;
0073 
0074   GlobalCondition::print(myCout);
0075 
0076   int nObjects = nrObjects();
0077 
0078   for (int i = 0; i < nObjects; i++) {
0079     myCout << std::endl;
0080     myCout << "  Template for object " << i << " [ hex ]" << std::endl;
0081     myCout << "    ptHighThreshold   = " << std::hex << m_objectParameter[i].ptHighThreshold << std::endl;
0082     myCout << "    ptLowThreshold    = " << std::hex << m_objectParameter[i].ptLowThreshold << std::endl;
0083     myCout << "    uptHighCut        = " << std::hex << m_objectParameter[i].unconstrainedPtHigh << std::endl;
0084     myCout << "    uptLowCut         = " << std::hex << m_objectParameter[i].unconstrainedPtLow << std::endl;
0085     myCout << "    indexHigh           = " << std::hex << m_objectParameter[i].indexHigh << std::endl;
0086     myCout << "    indexLow            = " << std::hex << m_objectParameter[i].indexLow << std::endl;
0087     myCout << "    enableMip         = " << std::hex << m_objectParameter[i].enableMip << std::endl;
0088     myCout << "    enableIso         = " << std::hex << m_objectParameter[i].enableIso << std::endl;
0089     myCout << "    requestIso        = " << std::hex << m_objectParameter[i].requestIso << std::endl;
0090     myCout << "    charge            =" << std::dec << m_objectParameter[i].charge << std::endl;
0091     myCout << "    qualityLUT        = " << std::hex << m_objectParameter[i].qualityLUT << std::endl;
0092     myCout << "    isolationLUT      = " << std::hex << m_objectParameter[i].isolationLUT << std::endl;
0093     myCout << "    impactParameterLUT= " << std::hex << m_objectParameter[i].impactParameterLUT << std::endl;
0094     //       myCout << "    etaRange          = "
0095     //       << std::hex << m_objectParameter[i].etaRange << std::endl;
0096     //       myCout << "    phiHigh           = "
0097     //       << std::hex << m_objectParameter[i].phiHigh << std::endl;
0098     //       myCout << "    phiLow            = "
0099     //        << std::hex << m_objectParameter[i].phiLow << std::endl;
0100     myCout << "    phiWindow1Lower   =" << std::hex << m_objectParameter[i].phiWindow1Lower << std::endl;
0101     myCout << "    phiWindow1Upper   =" << std::hex << m_objectParameter[i].phiWindow1Upper << std::endl;
0102     myCout << "    phiWindow2Lower   =" << std::hex << m_objectParameter[i].phiWindow2Lower << std::endl;
0103     myCout << "    phiWindow2Upper   =" << std::hex << m_objectParameter[i].phiWindow2Upper << std::endl;
0104     myCout << "    etaWindow1Lower   =" << std::hex << m_objectParameter[i].etaWindow1Lower << std::endl;
0105     myCout << "    etaWindow1Upper   =" << std::hex << m_objectParameter[i].etaWindow1Upper << std::endl;
0106     myCout << "    etaWindow2Lower   =" << std::hex << m_objectParameter[i].etaWindow2Lower << std::endl;
0107     myCout << "    etaWindow2Upper   =" << std::hex << m_objectParameter[i].etaWindow2Upper << std::endl;
0108   }
0109 
0110   if (wsc()) {
0111     myCout << "  Correlation parameters "
0112            << "[ hex ]" << std::endl;
0113 
0114     myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << std::endl;
0115 
0116     myCout << "    deltaEtaRange      = " << std::hex << m_correlationParameter.deltaEtaRange << std::endl;
0117     myCout << "    deltaPhiRange1Word = " << std::hex << m_correlationParameter.deltaPhiRange1Word << std::endl;
0118     myCout << "    deltaPhiRange0Word = " << std::hex << m_correlationParameter.deltaPhiRange0Word << std::endl;
0119     myCout << "    deltaPhiMaxbits    = " << std::hex << m_correlationParameter.deltaPhiMaxbits << std::endl;
0120   } else {
0121     if (m_condType == l1t::Type1s) {
0122       myCout << "  Correlation parameters "
0123              << "[ hex ]" << std::endl;
0124 
0125       myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << " (charge sign) "
0126              << std::endl;
0127 
0128     } else {
0129       myCout << "\n  Correlation parameters "
0130              << "[ hex ]" << std::endl;
0131 
0132       myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << std::endl;
0133     }
0134   }
0135 
0136   // reset to decimal output
0137   myCout << std::dec << std::endl;
0138 }
0139 
0140 void MuonTemplate::copy(const MuonTemplate& cp) {
0141   m_condName = cp.condName();
0142   m_condCategory = cp.condCategory();
0143   m_condType = cp.condType();
0144   m_objectType = cp.objectType();
0145   m_condGEq = cp.condGEq();
0146   m_condChipNr = cp.condChipNr();
0147   m_condRelativeBx = cp.condRelativeBx();
0148 
0149   m_objectParameter = *(cp.objectParameter());
0150   m_correlationParameter = *(cp.correlationParameter());
0151 }
0152 
0153 // output stream operator
0154 std::ostream& operator<<(std::ostream& os, const MuonTemplate& result) {
0155   result.print(os);
0156   return os;
0157 }