CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/CondFormats/L1TObjects/src/L1GtEnergySumTemplate.cc

Go to the documentation of this file.
00001 
00017 // this class header
00018 #include "CondFormats/L1TObjects/interface/L1GtEnergySumTemplate.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 L1GtEnergySumTemplate::L1GtEnergySumTemplate()
00036         : L1GtCondition()
00037 {
00038 
00039     m_condCategory = CondEnergySum;
00040 
00041 }
00042 
00043 L1GtEnergySumTemplate::L1GtEnergySumTemplate(const std::string& cName)
00044         : L1GtCondition(cName)
00045 {
00046 
00047     m_condCategory = CondEnergySum;
00048 
00049 }
00050 
00051 L1GtEnergySumTemplate::L1GtEnergySumTemplate(const std::string& cName, const L1GtConditionType& cType)
00052         : L1GtCondition(cName, CondEnergySum, cType)
00053 {
00054 
00055     m_condCategory = CondEnergySum;
00056 
00057     // should be always 1 - they are global quantities...
00058     int nObjects = nrObjects();
00059 
00060     if (nObjects > 0) {
00061         m_objectParameter.reserve(nObjects);
00062         m_objectType.reserve(nObjects);
00063     }
00064 
00065 }
00066 
00067 // copy constructor
00068 L1GtEnergySumTemplate::L1GtEnergySumTemplate(const L1GtEnergySumTemplate& cp)
00069         : L1GtCondition(cp.m_condName)
00070 {
00071     copy(cp);
00072 }
00073 
00074 // destructor
00075 L1GtEnergySumTemplate::~L1GtEnergySumTemplate()
00076 {
00077     // empty now
00078 }
00079 
00080 // assign operator
00081 L1GtEnergySumTemplate& L1GtEnergySumTemplate::operator= (const L1GtEnergySumTemplate& cp)
00082 {
00083 
00084     copy(cp);
00085     return *this;
00086 }
00087 
00088 
00089 // setConditionParameter - set the parameters of the condition
00090 void L1GtEnergySumTemplate::setConditionParameter(
00091     const std::vector<ObjectParameter>& objParameter)
00092 {
00093 
00094     m_objectParameter = objParameter;
00095 
00096 }
00097 
00098 void L1GtEnergySumTemplate::print(std::ostream& myCout) const
00099 {
00100 
00101     myCout << "\n  L1GtEnergySumTemplate 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 << "    energyOverflow    = "
00113         <<  std::hex << m_objectParameter[0].energyOverflow << std::endl;
00114 
00115         if (m_condType == TypeETM) {
00116             myCout << "    phi               = "
00117             << std::hex << m_objectParameter[i].phiRange1Word
00118             << std::hex << m_objectParameter[i].phiRange0Word
00119             << std::endl;
00120         } else if (m_condType == TypeHTM) {
00121             myCout << "    phi               = "
00122             << std::hex << m_objectParameter[i].phiRange0Word
00123             << std::endl;
00124         }
00125 
00126     }
00127 
00128     // reset to decimal output
00129     myCout << std::dec << std::endl;
00130 }
00131 
00132 void L1GtEnergySumTemplate::copy(const L1GtEnergySumTemplate& cp)
00133 {
00134 
00135     m_condName     = cp.condName();
00136     m_condCategory = cp.condCategory();
00137     m_condType     = cp.condType();
00138     m_objectType   = cp.objectType();
00139     m_condGEq      = cp.condGEq();
00140     m_condChipNr   = cp.condChipNr();
00141 
00142     m_objectParameter = *(cp.objectParameter());
00143 
00144 }
00145 
00146 // output stream operator
00147 std::ostream& operator<<(std::ostream& os, const L1GtEnergySumTemplate& result)
00148 {
00149     result.print(os);
00150     return os;
00151 
00152 }
00153 
00154