CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/CondFormats/L1TObjects/src/L1GtCastorTemplate.cc

Go to the documentation of this file.
00001 
00021 // this class header
00022 #include "CondFormats/L1TObjects/interface/L1GtCastorTemplate.h"
00023 
00024 // system include files
00025 
00026 #include <iostream>
00027 #include <iomanip>
00028 
00029 // user include files
00030 
00031 //   base class
00032 
00033 #include "CondFormats/L1TObjects/interface/L1GtFwd.h"
00034 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
00035 
00036 // forward declarations
00037 
00038 // constructors
00039 L1GtCastorTemplate::L1GtCastorTemplate()
00040         : L1GtCondition()
00041 {
00042 
00043     m_condCategory = CondCastor;
00044     m_condType = TypeCastor;
00045 
00046 }
00047 
00048 L1GtCastorTemplate::L1GtCastorTemplate(const std::string& cName)
00049         : L1GtCondition(cName)
00050 {
00051 
00052     m_condCategory = CondCastor;
00053     m_condType = TypeCastor;
00054 
00055 }
00056 
00057 L1GtCastorTemplate::L1GtCastorTemplate(const std::string& cName, const L1GtConditionType& cType)
00058         : L1GtCondition(cName, CondEnergySum, cType)
00059 {
00060 
00061     m_condCategory = CondCastor;
00062     m_condType = TypeCastor;
00063 
00064     // actually no objects are sent by CASTOR, only the result of the condition
00065     int nObjects = nrObjects();
00066 
00067     if (nObjects > 0) {
00068         m_objectType.reserve(nObjects);
00069     }
00070 
00071 }
00072 
00073 // copy constructor
00074 L1GtCastorTemplate::L1GtCastorTemplate(const L1GtCastorTemplate& cp)
00075         : L1GtCondition(cp.m_condName)
00076 {
00077     copy(cp);
00078 }
00079 
00080 // destructor
00081 L1GtCastorTemplate::~L1GtCastorTemplate()
00082 {
00083     // empty now
00084 }
00085 
00086 // assign operator
00087 L1GtCastorTemplate& L1GtCastorTemplate::operator= (const L1GtCastorTemplate& cp)
00088 {
00089 
00090     copy(cp);
00091     return *this;
00092 }
00093 
00094 
00095 void L1GtCastorTemplate::print(std::ostream& myCout) const
00096 {
00097 
00098     myCout << "\n  L1GtCastorTemplate print..." << std::endl;
00099 
00100     L1GtCondition::print(myCout);
00101 
00102 
00103     // reset to decimal output
00104     myCout << std::dec << std::endl;
00105 }
00106 
00107 void L1GtCastorTemplate::copy(const L1GtCastorTemplate& cp)
00108 {
00109 
00110     m_condName     = cp.condName();
00111     m_condCategory = cp.condCategory();
00112     m_condType     = cp.condType();
00113     m_objectType   = cp.objectType();
00114     m_condGEq      = cp.condGEq();
00115     m_condChipNr   = cp.condChipNr();
00116 
00117 }
00118 
00119 // output stream operator
00120 std::ostream& operator<<(std::ostream& os, const L1GtCastorTemplate& result)
00121 {
00122     result.print(os);
00123     return os;
00124 
00125 }
00126 
00127