Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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 << "    phiWindow1Lower   =" << std::hex << m_objectParameter[i].phiWindow1Lower << std::endl;
0095     myCout << "    phiWindow1Upper   =" << std::hex << m_objectParameter[i].phiWindow1Upper << std::endl;
0096     myCout << "    phiWindow2Lower   =" << std::hex << m_objectParameter[i].phiWindow2Lower << std::endl;
0097     myCout << "    phiWindow2Upper   =" << std::hex << m_objectParameter[i].phiWindow2Upper << std::endl;
0098 
0099     size_t etaWindowIndex = 1;
0100     for (const auto& window : m_objectParameter[i].etaWindows) {
0101       myCout << "    etaWindows[" << etaWindowIndex << "].lower =" << std::hex << window.lower << std::endl;
0102       myCout << "    etaWindows[" << etaWindowIndex << "].upper =" << std::hex << window.upper << std::endl;
0103       ++etaWindowIndex;
0104     }
0105   }
0106 
0107   if (wsc()) {
0108     myCout << "  Correlation parameters "
0109            << "[ hex ]" << std::endl;
0110 
0111     myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << std::endl;
0112 
0113     myCout << "    deltaEtaRange      = " << std::hex << m_correlationParameter.deltaEtaRange << std::endl;
0114     myCout << "    deltaPhiRange1Word = " << std::hex << m_correlationParameter.deltaPhiRange1Word << std::endl;
0115     myCout << "    deltaPhiRange0Word = " << std::hex << m_correlationParameter.deltaPhiRange0Word << std::endl;
0116     myCout << "    deltaPhiMaxbits    = " << std::hex << m_correlationParameter.deltaPhiMaxbits << std::endl;
0117   } else {
0118     if (m_condType == l1t::Type1s) {
0119       myCout << "  Correlation parameters "
0120              << "[ hex ]" << std::endl;
0121 
0122       myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << " (charge sign) "
0123              << std::endl;
0124 
0125     } else {
0126       myCout << "\n  Correlation parameters "
0127              << "[ hex ]" << std::endl;
0128 
0129       myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << std::endl;
0130     }
0131   }
0132 
0133   // reset to decimal output
0134   myCout << std::dec << std::endl;
0135 }
0136 
0137 void MuonTemplate::copy(const MuonTemplate& cp) {
0138   m_condName = cp.condName();
0139   m_condCategory = cp.condCategory();
0140   m_condType = cp.condType();
0141   m_objectType = cp.objectType();
0142   m_condGEq = cp.condGEq();
0143   m_condChipNr = cp.condChipNr();
0144   m_condRelativeBx = cp.condRelativeBx();
0145 
0146   m_objectParameter = *(cp.objectParameter());
0147   m_correlationParameter = *(cp.correlationParameter());
0148 }
0149 
0150 // output stream operator
0151 std::ostream& operator<<(std::ostream& os, const MuonTemplate& result) {
0152   result.print(os);
0153   return os;
0154 }