Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:55:06

0001 // this class header
0002 #include "L1Trigger/L1TGlobal/interface/AXOL1TLTemplate.h"
0003 
0004 // system include files
0005 #include <iostream>
0006 #include <iomanip>
0007 
0008 AXOL1TLTemplate::AXOL1TLTemplate() : GlobalCondition() { m_condCategory = l1t::CondAXOL1TL; }
0009 
0010 AXOL1TLTemplate::AXOL1TLTemplate(const std::string& cName) : GlobalCondition(cName) {
0011   m_condCategory = l1t::CondAXOL1TL;
0012 }
0013 
0014 AXOL1TLTemplate::AXOL1TLTemplate(const std::string& cName, const l1t::GtConditionType& cType)  //not sure we need cType
0015     : GlobalCondition(cName, l1t::CondAXOL1TL, cType) {
0016   int nObjects = nrObjects();
0017 
0018   if (nObjects > 0) {
0019     m_objectType.reserve(nObjects);
0020   }
0021 }
0022 
0023 // copy constructor
0024 AXOL1TLTemplate::AXOL1TLTemplate(const AXOL1TLTemplate& cp) : GlobalCondition(cp.m_condName) { copy(cp); }
0025 
0026 // destructor
0027 AXOL1TLTemplate::~AXOL1TLTemplate() {
0028   // empty now
0029 }
0030 
0031 // assign operator
0032 AXOL1TLTemplate& AXOL1TLTemplate::operator=(const AXOL1TLTemplate& cp) {
0033   copy(cp);
0034   return *this;
0035 }
0036 
0037 // setConditionParameter - set the parameters of the condition
0038 void AXOL1TLTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter) {
0039   m_objectParameter = objParameter;
0040 }
0041 
0042 void AXOL1TLTemplate::print(std::ostream& myCout) const {
0043   myCout << "\n  AXOL1TLTemplate print..." << std::endl;
0044 
0045   GlobalCondition::print(myCout);
0046 
0047   int nObjects = nrObjects();
0048 
0049   for (int i = 0; i < nObjects; i++) {
0050     myCout << std::endl;
0051     myCout << "  Template for object " << i << " [ hex ]" << std::endl;
0052     myCout << "    AXOL1TLThreshold   = " << std::hex << m_objectParameter[i].minAXOL1TLThreshold << std::endl;
0053   }
0054 
0055   // reset to decimal output
0056   myCout << std::dec << std::endl;
0057 }
0058 
0059 void AXOL1TLTemplate::copy(const AXOL1TLTemplate& cp) {
0060   m_condName = cp.condName();
0061   m_condCategory = cp.condCategory();
0062   m_condType = cp.condType();
0063   m_objectType = cp.objectType();  //not needed for AXOL1TL
0064   m_condGEq = cp.condGEq();
0065   m_condChipNr = cp.condChipNr();
0066   m_condRelativeBx = cp.condRelativeBx();
0067 
0068   m_objectParameter = *(cp.objectParameter());
0069 }
0070 
0071 // output stream operator
0072 std::ostream& operator<<(std::ostream& os, const AXOL1TLTemplate& result) {
0073   result.print(os);
0074   return os;
0075 }