Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:14

0001 //-------------------------------------------------
0002 //
0003 //   Class: DTConfigSectColl
0004 //
0005 //   Description: Configurable parameters and constants
0006 //   for Level1 Mu DT Trigger - Sector Collector chip
0007 //
0008 //
0009 //   Author List:
0010 //   C. Battilana
0011 //
0012 //-----------------------------------------------------------------------
0013 
0014 //-----------------------
0015 // This Class's Header --
0016 //-----------------------
0017 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigSectColl.h"
0018 
0019 //---------------
0020 // C++ Headers --
0021 //---------------
0022 
0023 //-------------------------------
0024 // Collaborating Class Headers --
0025 //-------------------------------
0026 #include "FWCore/Utilities/interface/Exception.h"
0027 
0028 //----------------
0029 // Constructors --
0030 //----------------
0031 DTConfigSectColl::DTConfigSectColl() {
0032   m_debug = false;
0033   for (int i = 1; i < 4; i++)
0034     setSCCarryFlag(false, i);
0035   for (int i = 1; i < 5; i++)
0036     setCoarseSync(0, i);
0037 }
0038 
0039 DTConfigSectColl::DTConfigSectColl(const edm::ParameterSet& ps) {
0040   setDefaults(ps);
0041   if (debug())
0042     print();
0043 }
0044 
0045 //--------------
0046 // Destructor --
0047 //--------------
0048 DTConfigSectColl::~DTConfigSectColl() {}
0049 
0050 //--------------
0051 // Operations --
0052 //--------------
0053 
0054 void DTConfigSectColl::setSCCarryFlag(bool scecf, int istat) {
0055   if (istat < 1 || istat > 4) {
0056     throw cms::Exception("DTTPG") << "DTConfigSectColl::setSCCarryFlag: station number out of range: istat=" << istat
0057                                   << std::endl;
0058   }
0059   m_scecf[istat - 1] = scecf;
0060 }
0061 
0062 void DTConfigSectColl::setCoarseSync(int sccsp, int istat) {
0063   if (istat < 1 || istat > 5) {
0064     throw cms::Exception("DTTPG") << "DTConfigSectColl::setCoarseSync: station number out of range: istat=" << istat
0065                                   << std::endl;
0066   }
0067   if (sccsp < 0 || sccsp > 7) {
0068     throw cms::Exception("DTTPG") << "DTConfigSectColl::setCoarseSync: wrong SCCSP" << istat << "  value!" << std::endl;
0069   }
0070   m_sccsp[istat - 1] = sccsp;
0071 }
0072 
0073 void DTConfigSectColl::setDefaults(const edm::ParameterSet& ps) {
0074   // Debug flag
0075   m_debug = ps.getUntrackedParameter<bool>("Debug");
0076 
0077   //  Enabling Carry in Sector Collector for MB1 (1 means enabled, 0 disabled)
0078   m_scecf[0] = ps.getParameter<bool>("SCECF1");
0079 
0080   //  Enabling Carry in Sector Collector for MB2 (1 means enabled, 0 disabled)
0081   m_scecf[1] = ps.getParameter<bool>("SCECF2");
0082 
0083   //  Enabling Carry in Sector Collector for MB3 (1 means enabled, 0 disabled)
0084   m_scecf[2] = ps.getParameter<bool>("SCECF3");
0085 
0086   //  Enabling Carry in Sector Collector for MB4  (1 means enabled, 0 disabled)
0087   m_scecf[3] = ps.getParameter<bool>("SCECF4");
0088 
0089   // Progammable Coars Sync parameter in Sector Collector for MB1 (possible values [0-7])
0090   int mycsp = ps.getParameter<int>("SCCSP1");
0091   setCoarseSync(mycsp, 1);
0092 
0093   // Progammable Coars Sync parameter in Sector Collector for MB2 (possible values [0-7])
0094   mycsp = ps.getParameter<int>("SCCSP2");
0095   setCoarseSync(mycsp, 2);
0096 
0097   // Progammable Coars Sync parameter in Sector Collector for MB3 (possible values [0-7])
0098   mycsp = ps.getParameter<int>("SCCSP3");
0099   setCoarseSync(mycsp, 3);
0100 
0101   // Progammable Coars Sync parameter in Sector Collector for firts MB4 station (possible values [0-7])
0102   mycsp = ps.getParameter<int>("SCCSP4");
0103   setCoarseSync(mycsp, 4);
0104 
0105   // Progammable Coars Sync parameter in Sector Collector for second MB4 station (sectors 4 & 10) (possible values [0-7])
0106   mycsp = ps.getParameter<int>("SCCSP5");
0107   setCoarseSync(mycsp, 5);
0108 }
0109 
0110 void DTConfigSectColl::print() const {
0111   std::cout << "******************************************************************************" << std::endl;
0112   std::cout << "*              DTTrigger configuration : SectorCollector chips               *" << std::endl;
0113   std::cout << "******************************************************************************" << std::endl
0114             << std::endl;
0115   std::cout << "Debug flag : " << debug() << std::endl;
0116   std::cout << "SCECF1 :" << SCGetCarryFlag(1) << std::endl;
0117   std::cout << "SCECF2 :" << SCGetCarryFlag(2) << std::endl;
0118   std::cout << "SCECF3 :" << SCGetCarryFlag(3) << std::endl;
0119   std::cout << "SCECF4 :" << SCGetCarryFlag(4) << std::endl;
0120   std::cout << "SCCSP1 :" << CoarseSync(1) << std::endl;
0121   std::cout << "SCCSP2 :" << CoarseSync(2) << std::endl;
0122   std::cout << "SCCSP3 :" << CoarseSync(3) << std::endl;
0123   std::cout << "SCCSP4 :" << CoarseSync(4) << std::endl;
0124   std::cout << "SCCSP5 :" << CoarseSync(5) << std::endl;
0125   std::cout << "******************************************************************************" << std::endl;
0126 }