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 myCout << "\n ...end L1GtCaloTemplate print." << std::endl; 00133 } 00134 00135 void L1GtCaloTemplate::copy(const L1GtCaloTemplate& cp) 00136 { 00137 00138 m_condName = cp.condName(); 00139 m_condCategory = cp.condCategory(); 00140 m_condType = cp.condType(); 00141 m_objectType = cp.objectType(); 00142 m_condGEq = cp.condGEq(); 00143 m_condChipNr = cp.condChipNr(); 00144 00145 m_objectParameter = *(cp.objectParameter()); 00146 m_correlationParameter = *(cp.correlationParameter()); 00147 00148 } 00149 00150 00151