Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:20

0001 /**
0002  * \class L1GtMuonTemplate
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  *
0012  * $Date$
0013  * $Revision$
0014  *
0015  */
0016 
0017 // this class header
0018 #include "CondFormats/L1TObjects/interface/L1GtMuonTemplate.h"
0019 
0020 // system include files
0021 
0022 #include <iostream>
0023 #include <iomanip>
0024 
0025 // user include files
0026 
0027 //   base class
0028 
0029 #include "CondFormats/L1TObjects/interface/L1GtFwd.h"
0030 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0031 
0032 // forward declarations
0033 
0034 // constructors
0035 L1GtMuonTemplate::L1GtMuonTemplate() : L1GtCondition() { m_condCategory = CondMuon; }
0036 
0037 L1GtMuonTemplate::L1GtMuonTemplate(const std::string& cName) : L1GtCondition(cName) { m_condCategory = CondMuon; }
0038 
0039 L1GtMuonTemplate::L1GtMuonTemplate(const std::string& cName, const L1GtConditionType& cType)
0040     : L1GtCondition(cName, CondMuon, cType) {
0041   int nObjects = nrObjects();
0042 
0043   if (nObjects > 0) {
0044     m_objectParameter.reserve(nObjects);
0045 
0046     m_objectType.reserve(nObjects);
0047     m_objectType.assign(nObjects, Mu);
0048   }
0049 }
0050 
0051 // copy constructor
0052 L1GtMuonTemplate::L1GtMuonTemplate(const L1GtMuonTemplate& cp) : L1GtCondition(cp.m_condName) { copy(cp); }
0053 
0054 // destructor
0055 L1GtMuonTemplate::~L1GtMuonTemplate() {
0056   // empty now
0057 }
0058 
0059 // assign operator
0060 L1GtMuonTemplate& L1GtMuonTemplate::operator=(const L1GtMuonTemplate& cp) {
0061   copy(cp);
0062   return *this;
0063 }
0064 
0065 // setConditionParameter - set the parameters of the condition
0066 void L1GtMuonTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter,
0067                                              const CorrelationParameter& corrParameter) {
0068   m_objectParameter = objParameter;
0069   m_correlationParameter = corrParameter;
0070 }
0071 
0072 void L1GtMuonTemplate::print(std::ostream& myCout) const {
0073   myCout << "\n  L1GtMuonTemplate print..." << std::endl;
0074 
0075   L1GtCondition::print(myCout);
0076 
0077   int nObjects = nrObjects();
0078 
0079   for (int i = 0; i < nObjects; i++) {
0080     myCout << std::endl;
0081     myCout << "  Template for object " << i << " [ hex ]" << std::endl;
0082     myCout << "    ptHighThreshold   = " << std::hex << m_objectParameter[i].ptHighThreshold << std::endl;
0083     myCout << "    ptLowThreshold    = " << std::hex << m_objectParameter[i].ptLowThreshold << std::endl;
0084     myCout << "    enableMip         = " << std::hex << m_objectParameter[i].enableMip << std::endl;
0085     myCout << "    enableIso         = " << std::hex << m_objectParameter[i].enableIso << std::endl;
0086     myCout << "    requestIso        = " << std::hex << m_objectParameter[i].requestIso << std::endl;
0087     myCout << "    qualityRange      = " << std::hex << m_objectParameter[i].qualityRange << std::endl;
0088     myCout << "    etaRange          = " << std::hex << m_objectParameter[i].etaRange << std::endl;
0089     myCout << "    phiHigh           = " << std::hex << m_objectParameter[i].phiHigh << std::endl;
0090     myCout << "    phiLow            = " << std::hex << m_objectParameter[i].phiLow << std::endl;
0091   }
0092 
0093   if (wsc()) {
0094     myCout << "  Correlation parameters "
0095            << "[ hex ]" << std::endl;
0096 
0097     myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << std::endl;
0098 
0099     myCout << "    deltaEtaRange      = " << std::hex << m_correlationParameter.deltaEtaRange << std::endl;
0100     myCout << "    deltaPhiRange1Word = " << std::hex << m_correlationParameter.deltaPhiRange1Word << std::endl;
0101     myCout << "    deltaPhiRange0Word = " << std::hex << m_correlationParameter.deltaPhiRange0Word << std::endl;
0102     myCout << "    deltaPhiMaxbits    = " << std::hex << m_correlationParameter.deltaPhiMaxbits << std::endl;
0103   } else {
0104     if (m_condType == Type1s) {
0105       myCout << "  Correlation parameters "
0106              << "[ hex ]" << std::endl;
0107 
0108       myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << " (charge sign) "
0109              << std::endl;
0110 
0111     } else {
0112       myCout << "\n  Correlation parameters "
0113              << "[ hex ]" << std::endl;
0114 
0115       myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << std::endl;
0116     }
0117   }
0118 
0119   // reset to decimal output
0120   myCout << std::dec << std::endl;
0121 }
0122 
0123 void L1GtMuonTemplate::copy(const L1GtMuonTemplate& cp) {
0124   m_condName = cp.condName();
0125   m_condCategory = cp.condCategory();
0126   m_condType = cp.condType();
0127   m_objectType = cp.objectType();
0128   m_condGEq = cp.condGEq();
0129   m_condChipNr = cp.condChipNr();
0130 
0131   m_objectParameter = *(cp.objectParameter());
0132   m_correlationParameter = *(cp.correlationParameter());
0133 }
0134 
0135 // output stream operator
0136 std::ostream& operator<<(std::ostream& os, const L1GtMuonTemplate& result) {
0137   result.print(os);
0138   return os;
0139 }