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/L1GtEnergySumTemplate.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 L1GtEnergySumTemplate::L1GtEnergySumTemplate() : L1GtCondition() { m_condCategory = CondEnergySum; }
0036
0037 L1GtEnergySumTemplate::L1GtEnergySumTemplate(const std::string& cName) : L1GtCondition(cName) {
0038 m_condCategory = CondEnergySum;
0039 }
0040
0041 L1GtEnergySumTemplate::L1GtEnergySumTemplate(const std::string& cName, const L1GtConditionType& cType)
0042 : L1GtCondition(cName, CondEnergySum, cType) {
0043 m_condCategory = CondEnergySum;
0044
0045
0046 int nObjects = nrObjects();
0047
0048 if (nObjects > 0) {
0049 m_objectParameter.reserve(nObjects);
0050 m_objectType.reserve(nObjects);
0051 }
0052 }
0053
0054
0055 L1GtEnergySumTemplate::L1GtEnergySumTemplate(const L1GtEnergySumTemplate& cp) : L1GtCondition(cp.m_condName) {
0056 copy(cp);
0057 }
0058
0059
0060 L1GtEnergySumTemplate::~L1GtEnergySumTemplate() {
0061
0062 }
0063
0064
0065 L1GtEnergySumTemplate& L1GtEnergySumTemplate::operator=(const L1GtEnergySumTemplate& cp) {
0066 copy(cp);
0067 return *this;
0068 }
0069
0070
0071 void L1GtEnergySumTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter) {
0072 m_objectParameter = objParameter;
0073 }
0074
0075 void L1GtEnergySumTemplate::print(std::ostream& myCout) const {
0076 myCout << "\n L1GtEnergySumTemplate print..." << std::endl;
0077
0078 L1GtCondition::print(myCout);
0079
0080 int nObjects = nrObjects();
0081
0082 for (int i = 0; i < nObjects; i++) {
0083 myCout << std::endl;
0084 myCout << " Template for object " << i << " [ hex ]" << std::endl;
0085 myCout << " etThreshold = " << std::hex << m_objectParameter[i].etThreshold << std::endl;
0086 myCout << " energyOverflow = " << std::hex << m_objectParameter[0].energyOverflow << std::endl;
0087
0088 if (m_condType == TypeETM) {
0089 myCout << " phi = " << std::hex << m_objectParameter[i].phiRange1Word << std::hex
0090 << m_objectParameter[i].phiRange0Word << std::endl;
0091 } else if (m_condType == TypeHTM) {
0092 myCout << " phi = " << std::hex << m_objectParameter[i].phiRange0Word << std::endl;
0093 }
0094 }
0095
0096
0097 myCout << std::dec << std::endl;
0098 }
0099
0100 void L1GtEnergySumTemplate::copy(const L1GtEnergySumTemplate& cp) {
0101 m_condName = cp.condName();
0102 m_condCategory = cp.condCategory();
0103 m_condType = cp.condType();
0104 m_objectType = cp.objectType();
0105 m_condGEq = cp.condGEq();
0106 m_condChipNr = cp.condChipNr();
0107
0108 m_objectParameter = *(cp.objectParameter());
0109 }
0110
0111
0112 std::ostream& operator<<(std::ostream& os, const L1GtEnergySumTemplate& result) {
0113 result.print(os);
0114 return os;
0115 }