CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/CondFormats/L1TObjects/src/L1GtCaloTemplate.cc

Go to the documentation of this file.
00001 
00017 // this class header
00018 #include "CondFormats/L1TObjects/interface/L1GtCaloTemplate.h"
00019 
00020 // system include files
00021 
00022 #include <iostream>
00023 #include <iomanip>
00024 
00025 // user include files
00026 
00027 //   base class
00028 
00029 #include "CondFormats/L1TObjects/interface/L1GtFwd.h"
00030 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
00031 
00032 // forward declarations
00033 
00034 // constructors
00035 L1GtCaloTemplate::L1GtCaloTemplate()
00036         : L1GtCondition()
00037 {
00038 
00039     m_condCategory = CondCalo;
00040 
00041 }
00042 
00043 L1GtCaloTemplate::L1GtCaloTemplate(const std::string& cName)
00044         : L1GtCondition(cName)
00045 {
00046 
00047     m_condCategory = CondCalo;
00048 
00049 }
00050 
00051 L1GtCaloTemplate::L1GtCaloTemplate(const std::string& cName, const L1GtConditionType& cType)
00052         : L1GtCondition(cName, CondCalo, cType)
00053 {
00054 
00055     int nObjects = nrObjects();
00056 
00057     if (nObjects > 0) {
00058         m_objectParameter.reserve(nObjects);
00059 
00060         m_objectType.reserve(nObjects);
00061     }
00062 
00063 }
00064 
00065 // copy constructor
00066 L1GtCaloTemplate::L1GtCaloTemplate(const L1GtCaloTemplate& cp)
00067         : L1GtCondition(cp.m_condName)
00068 {
00069     copy(cp);
00070 }
00071 
00072 // destructor
00073 L1GtCaloTemplate::~L1GtCaloTemplate()
00074 {
00075     // empty now
00076 }
00077 
00078 // assign operator
00079 L1GtCaloTemplate& L1GtCaloTemplate::operator= (const L1GtCaloTemplate& cp)
00080 {
00081 
00082     copy(cp);
00083     return *this;
00084 }
00085 
00086 
00087 // setConditionParameter - set the parameters of the condition
00088 void L1GtCaloTemplate::setConditionParameter(
00089     const std::vector<ObjectParameter>& objParameter,
00090     const CorrelationParameter& corrParameter)
00091 {
00092 
00093     m_objectParameter = objParameter;
00094     m_correlationParameter = corrParameter;
00095 
00096 }
00097 
00098 void L1GtCaloTemplate::print(std::ostream& myCout) const
00099 {
00100 
00101     myCout << "\n  L1GtCaloTemplate print..." << std::endl;
00102 
00103     L1GtCondition::print(myCout);
00104 
00105     int nObjects = nrObjects();
00106 
00107     for (int i = 0; i < nObjects; i++) {
00108         myCout << std::endl;
00109         myCout << "  Template for object " << i << " [ hex ]" << std::endl;
00110         myCout << "    etThreshold       = "
00111         << std::hex << m_objectParameter[i].etThreshold << std::endl;
00112         myCout << "    etaRange          = "
00113         << std::hex << m_objectParameter[i].etaRange << std::endl;
00114         myCout << "    phiRange          = "
00115         << std::hex << m_objectParameter[i].phiRange << std::endl;
00116     }
00117 
00118     if ( wsc() ) {
00119 
00120         myCout << "  Correlation parameters " << "[ hex ]" <<  std::endl;
00121 
00122         myCout << "    deltaEtaRange     = "
00123         << std::hex << m_correlationParameter.deltaEtaRange << std::endl;
00124         myCout << "    deltaPhiRange     = "
00125         << std::hex << m_correlationParameter.deltaPhiRange << std::endl;
00126         myCout << "    deltaPhiMaxbits   = "
00127         << std::hex << m_correlationParameter.deltaPhiMaxbits << std::endl;
00128     }
00129 
00130     // reset to decimal output
00131     myCout << std::dec << std::endl;
00132 }
00133 
00134 void L1GtCaloTemplate::copy(const L1GtCaloTemplate& cp)
00135 {
00136 
00137     m_condName     = cp.condName();
00138     m_condCategory = cp.condCategory();
00139     m_condType     = cp.condType();
00140     m_objectType   = cp.objectType();
00141     m_condGEq      = cp.condGEq();
00142     m_condChipNr   = cp.condChipNr();
00143 
00144     m_objectParameter = *(cp.objectParameter());
00145     m_correlationParameter = *(cp.correlationParameter());
00146 
00147 }
00148 
00149 // output stream operator
00150 std::ostream& operator<<(std::ostream& os, const L1GtCaloTemplate& result)
00151 {
00152     result.print(os);
00153     return os;
00154 
00155 }
00156 
00157 
00158