Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /**
0002  * \class L1GtCaloTemplate
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  *
0012  * $Date$
0013  * $Revision$
0014  *
0015  */
0016 
0017 // this class header
0018 #include "CondFormats/L1TObjects/interface/L1GtCaloTemplate.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 L1GtCaloTemplate::L1GtCaloTemplate() : L1GtCondition() { m_condCategory = CondCalo; }
0036 
0037 L1GtCaloTemplate::L1GtCaloTemplate(const std::string& cName) : L1GtCondition(cName) { m_condCategory = CondCalo; }
0038 
0039 L1GtCaloTemplate::L1GtCaloTemplate(const std::string& cName, const L1GtConditionType& cType)
0040     : L1GtCondition(cName, CondCalo, cType) {
0041   int nObjects = nrObjects();
0042 
0043   if (nObjects > 0) {
0044     m_objectParameter.reserve(nObjects);
0045 
0046     m_objectType.reserve(nObjects);
0047   }
0048 }
0049 
0050 // copy constructor
0051 L1GtCaloTemplate::L1GtCaloTemplate(const L1GtCaloTemplate& cp) : L1GtCondition(cp.m_condName) { copy(cp); }
0052 
0053 // destructor
0054 L1GtCaloTemplate::~L1GtCaloTemplate() {
0055   // empty now
0056 }
0057 
0058 // assign operator
0059 L1GtCaloTemplate& L1GtCaloTemplate::operator=(const L1GtCaloTemplate& cp) {
0060   copy(cp);
0061   return *this;
0062 }
0063 
0064 // setConditionParameter - set the parameters of the condition
0065 void L1GtCaloTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter,
0066                                              const CorrelationParameter& corrParameter) {
0067   m_objectParameter = objParameter;
0068   m_correlationParameter = corrParameter;
0069 }
0070 
0071 void L1GtCaloTemplate::print(std::ostream& myCout) const {
0072   myCout << "\n  L1GtCaloTemplate print..." << std::endl;
0073 
0074   L1GtCondition::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 << "    etThreshold       = " << std::hex << m_objectParameter[i].etThreshold << std::endl;
0082     myCout << "    etaRange          = " << std::hex << m_objectParameter[i].etaRange << std::endl;
0083     myCout << "    phiRange          = " << std::hex << m_objectParameter[i].phiRange << std::endl;
0084   }
0085 
0086   if (wsc()) {
0087     myCout << "  Correlation parameters "
0088            << "[ hex ]" << std::endl;
0089 
0090     myCout << "    deltaEtaRange     = " << std::hex << m_correlationParameter.deltaEtaRange << std::endl;
0091     myCout << "    deltaPhiRange     = " << std::hex << m_correlationParameter.deltaPhiRange << std::endl;
0092     myCout << "    deltaPhiMaxbits   = " << std::hex << m_correlationParameter.deltaPhiMaxbits << std::endl;
0093   }
0094 
0095   // reset to decimal output
0096   myCout << std::dec << std::endl;
0097 }
0098 
0099 void L1GtCaloTemplate::copy(const L1GtCaloTemplate& cp) {
0100   m_condName = cp.condName();
0101   m_condCategory = cp.condCategory();
0102   m_condType = cp.condType();
0103   m_objectType = cp.objectType();
0104   m_condGEq = cp.condGEq();
0105   m_condChipNr = cp.condChipNr();
0106 
0107   m_objectParameter = *(cp.objectParameter());
0108   m_correlationParameter = *(cp.correlationParameter());
0109 }
0110 
0111 // output stream operator
0112 std::ostream& operator<<(std::ostream& os, const L1GtCaloTemplate& result) {
0113   result.print(os);
0114   return os;
0115 }