File indexing completed on 2024-04-06 12:20:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include "L1Trigger/L1TGlobal/interface/EnergySumZdcTemplate.h"
0020
0021
0022
0023 #include <iostream>
0024 #include <iomanip>
0025
0026
0027
0028
0029
0030
0031
0032
0033 EnergySumZdcTemplate::EnergySumZdcTemplate() : GlobalCondition() { m_condCategory = l1t::CondEnergySumZdc; }
0034
0035 EnergySumZdcTemplate::EnergySumZdcTemplate(const std::string& cName) : GlobalCondition(cName) {
0036 m_condCategory = l1t::CondEnergySumZdc;
0037 }
0038
0039 EnergySumZdcTemplate::EnergySumZdcTemplate(const std::string& cName, const l1t::GtConditionType& cType)
0040 : GlobalCondition(cName, l1t::CondEnergySumZdc, cType) {
0041 m_condCategory = l1t::CondEnergySumZdc;
0042
0043
0044 int nObjects = nrObjects();
0045
0046 if (nObjects > 0) {
0047 m_objectParameter.reserve(nObjects);
0048 m_objectType.reserve(nObjects);
0049 }
0050 }
0051
0052
0053 EnergySumZdcTemplate::EnergySumZdcTemplate(const EnergySumZdcTemplate& cp) : GlobalCondition(cp.m_condName) {
0054 copy(cp);
0055 }
0056
0057
0058 EnergySumZdcTemplate::~EnergySumZdcTemplate() = default;
0059
0060
0061 EnergySumZdcTemplate& EnergySumZdcTemplate::operator=(const EnergySumZdcTemplate& cp) {
0062 copy(cp);
0063 return *this;
0064 }
0065
0066
0067 void EnergySumZdcTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter) {
0068 m_objectParameter = objParameter;
0069 }
0070
0071 void EnergySumZdcTemplate::print(std::ostream& myCout) const {
0072 myCout << "\n EnergySumZdcTemplate print..." << std::endl;
0073
0074 GlobalCondition::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].etLowThreshold << " - "
0082 << m_objectParameter[i].etHighThreshold << std::endl;
0083 }
0084
0085
0086 myCout << std::dec << std::endl;
0087 }
0088
0089 void EnergySumZdcTemplate::copy(const EnergySumZdcTemplate& cp) {
0090 m_condName = cp.condName();
0091 m_condCategory = cp.condCategory();
0092 m_condType = cp.condType();
0093 m_objectType = cp.objectType();
0094 m_condGEq = cp.condGEq();
0095 m_condChipNr = cp.condChipNr();
0096 m_condRelativeBx = cp.condRelativeBx();
0097
0098 m_objectParameter = *(cp.objectParameter());
0099 }
0100
0101
0102 std::ostream& operator<<(std::ostream& os, const EnergySumZdcTemplate& result) {
0103 result.print(os);
0104 return os;
0105 }