File indexing completed on 2024-04-06 12:20:37
0001
0002 #include "L1Trigger/L1TGlobal/interface/MuonShowerTemplate.h"
0003
0004
0005 #include <iostream>
0006 #include <iomanip>
0007
0008 MuonShowerTemplate::MuonShowerTemplate() : GlobalCondition() { m_condCategory = l1t::CondMuonShower; }
0009
0010 MuonShowerTemplate::MuonShowerTemplate(const std::string& cName) : GlobalCondition(cName) {
0011 m_condCategory = l1t::CondMuonShower;
0012 }
0013
0014 MuonShowerTemplate::MuonShowerTemplate(const std::string& cName, const l1t::GtConditionType& cType)
0015 : GlobalCondition(cName, l1t::CondMuonShower, cType) {
0016 int nObjects = nrObjects();
0017
0018 if (nObjects > 0) {
0019 m_objectParameter.reserve(nObjects);
0020
0021 m_objectType.reserve(nObjects);
0022 m_objectType.assign(nObjects, l1t::gtMuShower);
0023 }
0024 }
0025
0026
0027 MuonShowerTemplate::MuonShowerTemplate(const MuonShowerTemplate& cp) : GlobalCondition(cp.m_condName) { copy(cp); }
0028
0029
0030 MuonShowerTemplate::~MuonShowerTemplate() {
0031
0032 }
0033
0034
0035 MuonShowerTemplate& MuonShowerTemplate::operator=(const MuonShowerTemplate& cp) {
0036 copy(cp);
0037 return *this;
0038 }
0039
0040
0041 void MuonShowerTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter) {
0042 m_objectParameter = objParameter;
0043 }
0044
0045 void MuonShowerTemplate::print(std::ostream& myCout) const {
0046 myCout << "\n MuonShowerTemplate print..." << std::endl;
0047
0048 GlobalCondition::print(myCout);
0049
0050 int nObjects = nrObjects();
0051
0052 for (int i = 0; i < nObjects; i++) {
0053 myCout << std::endl;
0054 myCout << " Template for object " << i << " [ hex ]" << std::endl;
0055 myCout << " MuonShower0 = " << std::hex << m_objectParameter[i].MuonShower0 << std::endl;
0056 myCout << " MuonShower1 = " << std::hex << m_objectParameter[i].MuonShower1 << std::endl;
0057 myCout << " MuonShower2 = " << std::hex << m_objectParameter[i].MuonShower2 << std::endl;
0058 myCout << " MuonShowerOutOfTime0 = " << std::hex << m_objectParameter[i].MuonShowerOutOfTime0 << std::endl;
0059 myCout << " MuonShowerOutOfTime1 = " << std::hex << m_objectParameter[i].MuonShowerOutOfTime1 << std::endl;
0060 }
0061
0062
0063 myCout << std::dec << std::endl;
0064 }
0065
0066 void MuonShowerTemplate::copy(const MuonShowerTemplate& cp) {
0067 m_condName = cp.condName();
0068 m_condCategory = cp.condCategory();
0069 m_condType = cp.condType();
0070 m_objectType = cp.objectType();
0071 m_condGEq = cp.condGEq();
0072 m_condChipNr = cp.condChipNr();
0073 m_condRelativeBx = cp.condRelativeBx();
0074
0075 m_objectParameter = *(cp.objectParameter());
0076 }
0077
0078
0079 std::ostream& operator<<(std::ostream& os, const MuonShowerTemplate& result) {
0080 result.print(os);
0081 return os;
0082 }