Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-09 00:01:10

0001 // this class header
0002 #include "L1Trigger/L1TGlobal/interface/MuonShowerTemplate.h"
0003 
0004 // system include files
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 // copy constructor
0027 MuonShowerTemplate::MuonShowerTemplate(const MuonShowerTemplate& cp) : GlobalCondition(cp.m_condName) { copy(cp); }
0028 
0029 // destructor
0030 MuonShowerTemplate::~MuonShowerTemplate() {
0031   // empty now
0032 }
0033 
0034 // assign operator
0035 MuonShowerTemplate& MuonShowerTemplate::operator=(const MuonShowerTemplate& cp) {
0036   copy(cp);
0037   return *this;
0038 }
0039 
0040 // setConditionParameter - set the parameters of the condition
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 << "    MuonShowerOutOfTime0   = " << std::hex << m_objectParameter[i].MuonShowerOutOfTime0 << std::endl;
0058     myCout << "    MuonShowerOutOfTime1   = " << std::hex << m_objectParameter[i].MuonShowerOutOfTime1 << std::endl;
0059   }
0060 
0061   // reset to decimal output
0062   myCout << std::dec << std::endl;
0063 }
0064 
0065 void MuonShowerTemplate::copy(const MuonShowerTemplate& cp) {
0066   m_condName = cp.condName();
0067   m_condCategory = cp.condCategory();
0068   m_condType = cp.condType();
0069   m_objectType = cp.objectType();
0070   m_condGEq = cp.condGEq();
0071   m_condChipNr = cp.condChipNr();
0072   m_condRelativeBx = cp.condRelativeBx();
0073 
0074   m_objectParameter = *(cp.objectParameter());
0075 }
0076 
0077 // output stream operator
0078 std::ostream& operator<<(std::ostream& os, const MuonShowerTemplate& result) {
0079   result.print(os);
0080   return os;
0081 }