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