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