Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:55

0001 /**
0002  * \class CaloTemplate
0003  *
0004  *
0005  * Description: L1 Global Trigger calo template.
0006  *
0007  * Implementation:
0008  *    <TODO: enter implementation details>
0009  *
0010  * \author: Vasile Mihai Ghete - HEPHY Vienna
0011  *          Vladimir Rekovic - extend for indexing
0012  *
0013  * $Date$
0014  * $Revision$
0015  *
0016  */
0017 
0018 // this class header
0019 #include "L1Trigger/L1TGlobal/interface/CaloTemplate.h"
0020 
0021 // system include files
0022 
0023 #include <iostream>
0024 #include <iomanip>
0025 
0026 // user include files
0027 
0028 //   base class
0029 
0030 // forward declarations
0031 
0032 // constructors
0033 CaloTemplate::CaloTemplate() : GlobalCondition() { m_condCategory = l1t::CondCalo; }
0034 
0035 CaloTemplate::CaloTemplate(const std::string& cName) : GlobalCondition(cName) { m_condCategory = l1t::CondCalo; }
0036 
0037 CaloTemplate::CaloTemplate(const std::string& cName, const l1t::GtConditionType& cType)
0038     : GlobalCondition(cName, l1t::CondCalo, cType) {
0039   int nObjects = nrObjects();
0040 
0041   if (nObjects > 0) {
0042     m_objectParameter.reserve(nObjects);
0043 
0044     m_objectType.reserve(nObjects);
0045   }
0046 }
0047 
0048 // copy constructor
0049 CaloTemplate::CaloTemplate(const CaloTemplate& cp) : GlobalCondition(cp.m_condName) { copy(cp); }
0050 
0051 // destructor
0052 CaloTemplate::~CaloTemplate() {
0053   // empty now
0054 }
0055 
0056 // assign operator
0057 CaloTemplate& CaloTemplate::operator=(const CaloTemplate& cp) {
0058   copy(cp);
0059   return *this;
0060 }
0061 
0062 // setConditionParameter - set the parameters of the condition
0063 void CaloTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter,
0064                                          const CorrelationParameter& corrParameter) {
0065   m_objectParameter = objParameter;
0066   m_correlationParameter = corrParameter;
0067 }
0068 
0069 void CaloTemplate::print(std::ostream& myCout) const {
0070   myCout << "\n  CaloTemplate print..." << std::endl;
0071 
0072   GlobalCondition::print(myCout);
0073 
0074   int nObjects = nrObjects();
0075 
0076   for (int i = 0; i < nObjects; i++) {
0077     myCout << std::endl;
0078     myCout << "  Template for object " << i << " [ hex ]" << std::endl;
0079     myCout << "    etThreshold       = " << std::hex << m_objectParameter[i].etLowThreshold << "  "
0080            << m_objectParameter[i].etHighThreshold << std::endl;
0081     myCout << "    indexLow       = " << std::hex << m_objectParameter[i].indexLow << std::endl;
0082     myCout << "    indexHigh      = " << std::hex << m_objectParameter[i].indexHigh << std::endl;
0083     myCout << "    etaRange          = " << std::hex << m_objectParameter[i].etaRange << std::endl;
0084     myCout << "    phiRange          = " << std::hex << m_objectParameter[i].phiRange << std::endl;
0085     myCout << "    isolationLUT      = " << std::hex << m_objectParameter[i].isolationLUT << std::endl;
0086     myCout << "    qualityLUT      = " << std::hex << m_objectParameter[i].qualityLUT << std::endl;
0087   }
0088 
0089   if (wsc()) {
0090     myCout << "  Correlation parameters "
0091            << "[ hex ]" << std::endl;
0092 
0093     myCout << "    deltaEtaRange     = " << std::hex << m_correlationParameter.deltaEtaRange << std::endl;
0094     myCout << "    deltaPhiRange     = " << std::hex << m_correlationParameter.deltaPhiRange << std::endl;
0095     myCout << "    deltaPhiMaxbits   = " << std::hex << m_correlationParameter.deltaPhiMaxbits << std::endl;
0096   }
0097 
0098   // reset to decimal output
0099   myCout << std::dec << std::endl;
0100 }
0101 
0102 void CaloTemplate::copy(const CaloTemplate& cp) {
0103   m_condName = cp.condName();
0104   m_condCategory = cp.condCategory();
0105   m_condType = cp.condType();
0106   m_objectType = cp.objectType();
0107   m_condGEq = cp.condGEq();
0108   m_condChipNr = cp.condChipNr();
0109   m_condRelativeBx = cp.condRelativeBx();
0110 
0111   m_objectParameter = *(cp.objectParameter());
0112   m_correlationParameter = *(cp.correlationParameter());
0113 }
0114 
0115 // output stream operator
0116 std::ostream& operator<<(std::ostream& os, const CaloTemplate& result) {
0117   result.print(os);
0118   return os;
0119 }