00001 00017 // this class header 00018 #include "CondFormats/L1TObjects/interface/L1GtJetCountsTemplate.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 L1GtJetCountsTemplate::L1GtJetCountsTemplate() 00036 : L1GtCondition() 00037 { 00038 00039 m_condCategory = CondJetCounts; 00040 00041 } 00042 00043 L1GtJetCountsTemplate::L1GtJetCountsTemplate(const std::string& cName) 00044 : L1GtCondition(cName) 00045 { 00046 00047 m_condCategory = CondJetCounts; 00048 00049 } 00050 00051 L1GtJetCountsTemplate::L1GtJetCountsTemplate(const std::string& cName, 00052 const L1GtConditionType& cType) 00053 : L1GtCondition(cName, CondJetCounts, cType) 00054 { 00055 00056 m_condCategory = CondJetCounts; 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, JetCounts); 00066 } 00067 00068 } 00069 00070 // copy constructor 00071 L1GtJetCountsTemplate::L1GtJetCountsTemplate(const L1GtJetCountsTemplate& cp) 00072 : L1GtCondition(cp.m_condName) 00073 { 00074 copy(cp); 00075 } 00076 00077 // destructor 00078 L1GtJetCountsTemplate::~L1GtJetCountsTemplate() 00079 { 00080 // empty now 00081 } 00082 00083 // assign operator 00084 L1GtJetCountsTemplate& L1GtJetCountsTemplate::operator= (const L1GtJetCountsTemplate& cp) 00085 { 00086 00087 copy(cp); 00088 return *this; 00089 } 00090 00091 00092 // setConditionParameter - set the parameters of the condition 00093 void L1GtJetCountsTemplate::setConditionParameter( 00094 const std::vector<ObjectParameter>& objParameter) 00095 { 00096 00097 m_objectParameter = objParameter; 00098 00099 } 00100 00101 void L1GtJetCountsTemplate::print(std::ostream& myCout) const 00102 { 00103 00104 myCout << "\n L1GtJetCountsTemplate 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 myCout << " countOverflow = " 00118 << std::hex << m_objectParameter[0].countOverflow << std::endl; 00119 00120 } 00121 00122 // reset to decimal output 00123 myCout << std::dec << std::endl; 00124 } 00125 00126 void L1GtJetCountsTemplate::copy(const L1GtJetCountsTemplate& cp) 00127 { 00128 00129 m_condName = cp.condName(); 00130 m_condCategory = cp.condCategory(); 00131 m_condType = cp.condType(); 00132 m_objectType = cp.objectType(); 00133 m_condGEq = cp.condGEq(); 00134 m_condChipNr = cp.condChipNr(); 00135 00136 m_objectParameter = *(cp.objectParameter()); 00137 00138 } 00139 00140 // output stream operator 00141 std::ostream& operator<<(std::ostream& os, const L1GtJetCountsTemplate& result) 00142 { 00143 result.print(os); 00144 return os; 00145 00146 } 00147 00148 00149