File indexing completed on 2024-04-06 12:02:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include "CondFormats/L1TObjects/interface/L1GtCaloTemplate.h"
0019
0020
0021
0022 #include <iostream>
0023 #include <iomanip>
0024
0025
0026
0027
0028
0029 #include "CondFormats/L1TObjects/interface/L1GtFwd.h"
0030 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0031
0032
0033
0034
0035 L1GtCaloTemplate::L1GtCaloTemplate() : L1GtCondition() { m_condCategory = CondCalo; }
0036
0037 L1GtCaloTemplate::L1GtCaloTemplate(const std::string& cName) : L1GtCondition(cName) { m_condCategory = CondCalo; }
0038
0039 L1GtCaloTemplate::L1GtCaloTemplate(const std::string& cName, const L1GtConditionType& cType)
0040 : L1GtCondition(cName, CondCalo, cType) {
0041 int nObjects = nrObjects();
0042
0043 if (nObjects > 0) {
0044 m_objectParameter.reserve(nObjects);
0045
0046 m_objectType.reserve(nObjects);
0047 }
0048 }
0049
0050
0051 L1GtCaloTemplate::L1GtCaloTemplate(const L1GtCaloTemplate& cp) : L1GtCondition(cp.m_condName) { copy(cp); }
0052
0053
0054 L1GtCaloTemplate::~L1GtCaloTemplate() {
0055
0056 }
0057
0058
0059 L1GtCaloTemplate& L1GtCaloTemplate::operator=(const L1GtCaloTemplate& cp) {
0060 copy(cp);
0061 return *this;
0062 }
0063
0064
0065 void L1GtCaloTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter,
0066 const CorrelationParameter& corrParameter) {
0067 m_objectParameter = objParameter;
0068 m_correlationParameter = corrParameter;
0069 }
0070
0071 void L1GtCaloTemplate::print(std::ostream& myCout) const {
0072 myCout << "\n L1GtCaloTemplate print..." << std::endl;
0073
0074 L1GtCondition::print(myCout);
0075
0076 int nObjects = nrObjects();
0077
0078 for (int i = 0; i < nObjects; i++) {
0079 myCout << std::endl;
0080 myCout << " Template for object " << i << " [ hex ]" << std::endl;
0081 myCout << " etThreshold = " << std::hex << m_objectParameter[i].etThreshold << std::endl;
0082 myCout << " etaRange = " << std::hex << m_objectParameter[i].etaRange << std::endl;
0083 myCout << " phiRange = " << std::hex << m_objectParameter[i].phiRange << std::endl;
0084 }
0085
0086 if (wsc()) {
0087 myCout << " Correlation parameters "
0088 << "[ hex ]" << std::endl;
0089
0090 myCout << " deltaEtaRange = " << std::hex << m_correlationParameter.deltaEtaRange << std::endl;
0091 myCout << " deltaPhiRange = " << std::hex << m_correlationParameter.deltaPhiRange << std::endl;
0092 myCout << " deltaPhiMaxbits = " << std::hex << m_correlationParameter.deltaPhiMaxbits << std::endl;
0093 }
0094
0095
0096 myCout << std::dec << std::endl;
0097 }
0098
0099 void L1GtCaloTemplate::copy(const L1GtCaloTemplate& cp) {
0100 m_condName = cp.condName();
0101 m_condCategory = cp.condCategory();
0102 m_condType = cp.condType();
0103 m_objectType = cp.objectType();
0104 m_condGEq = cp.condGEq();
0105 m_condChipNr = cp.condChipNr();
0106
0107 m_objectParameter = *(cp.objectParameter());
0108 m_correlationParameter = *(cp.correlationParameter());
0109 }
0110
0111
0112 std::ostream& operator<<(std::ostream& os, const L1GtCaloTemplate& result) {
0113 result.print(os);
0114 return os;
0115 }