Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:34

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 //setModelVersion - set the model version of the condition
0043 void AXOL1TLTemplate::setModelVersion(const std::string& modelversion) { m_modelVersion = modelversion; }
0044 
0045 void AXOL1TLTemplate::print(std::ostream& myCout) const {
0046   myCout << "\n  AXOL1TLTemplate 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 << "    AXOL1TLThreshold   = " << std::hex << m_objectParameter[i].minAXOL1TLThreshold << std::endl;
0056   }
0057 
0058   // reset to decimal output
0059   myCout << std::dec << std::endl;
0060 }
0061 
0062 void AXOL1TLTemplate::copy(const AXOL1TLTemplate& cp) {
0063   m_condName = cp.condName();
0064   m_condCategory = cp.condCategory();
0065   m_condType = cp.condType();
0066   m_objectType = cp.objectType();  //not needed for AXOL1TL
0067   m_condGEq = cp.condGEq();
0068   m_condChipNr = cp.condChipNr();
0069   m_condRelativeBx = cp.condRelativeBx();
0070 
0071   m_modelVersion = cp.modelVersion();  // new for utm 0.12.0
0072   m_objectParameter = *(cp.objectParameter());
0073 }
0074 
0075 // output stream operator
0076 std::ostream& operator<<(std::ostream& os, const AXOL1TLTemplate& result) {
0077   result.print(os);
0078   return os;
0079 }