Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:50

0001 //-------------------------------------------------
0002 //
0003 //   Class: DTChambThSegm.cpp
0004 //
0005 //   Description: Muon Chamber Trigger Theta candidate
0006 //
0007 //
0008 //   Author List:
0009 //   C. Grandi
0010 //   Modifications:
0011 //
0012 //
0013 //--------------------------------------------------
0014 
0015 // #include "Utilities/Configuration/interface/Architecture.h"
0016 
0017 //-----------------------
0018 // This Class's Header --
0019 //-----------------------
0020 #include "L1Trigger/DTTriggerServerTheta/interface/DTChambThSegm.h"
0021 
0022 //-------------------------------
0023 // Collaborating Class Headers --
0024 //-------------------------------
0025 
0026 //---------------
0027 // C++ Headers --
0028 //---------------
0029 #include <iostream>
0030 
0031 //----------------
0032 // Constructors --
0033 //----------------
0034 DTChambThSegm::DTChambThSegm(DTChamberId chamberid, int step, int* pos, int* qual)
0035     : m_chamberid(chamberid), m_step(step) {
0036   for (int i = 0; i < 7; i++) {
0037     m_outPos[i] = pos[i];
0038     m_outQual[i] = qual[i];
0039   }
0040 }
0041 
0042 DTChambThSegm::DTChambThSegm(const DTChambThSegm& seg) : m_chamberid(seg.m_chamberid), m_step(seg.m_step) {
0043   for (int i = 0; i < 7; i++) {
0044     m_outPos[i] = seg.m_outPos[i];
0045     m_outQual[i] = seg.m_outQual[i];
0046   }
0047 }
0048 
0049 //--------------
0050 // Destructor --
0051 //--------------
0052 DTChambThSegm::~DTChambThSegm() {}
0053 
0054 //--------------
0055 // Operations --
0056 //--------------
0057 
0058 DTChambThSegm& DTChambThSegm::operator=(const DTChambThSegm& seg) {
0059   if (this != &seg) {
0060     m_chamberid = seg.m_chamberid;
0061     m_step = seg.m_step;
0062     for (int i = 0; i < 7; i++) {
0063       m_outPos[i] = seg.m_outPos[i];
0064       m_outQual[i] = seg.m_outQual[i];
0065     }
0066   }
0067   return *this;
0068 }
0069 
0070 int DTChambThSegm::code(const int i) const {
0071   if (i < 0 || i >= 7) {
0072     std::cout << "DTChambThSegm::code : index out of range: " << i;
0073     std::cout << "0 returned!" << std::endl;
0074     return 0;
0075   }
0076   return (int)(m_outPos[i] + m_outQual[i]);
0077 }
0078 
0079 int DTChambThSegm::position(const int i) const {
0080   if (i < 0 || i >= 7) {
0081     std::cout << "DTChambThSegm::position : index out of range: " << i;
0082     std::cout << "0 returned!" << std::endl;
0083     return 0;
0084   }
0085   return (int)m_outPos[i];
0086 }
0087 
0088 int DTChambThSegm::quality(const int i) const {
0089   if (i < 0 || i >= 7) {
0090     std::cout << "DTChambThSegm::quality : index out of range: " << i;
0091     std::cout << "0 returned!" << std::endl;
0092     return 0;
0093   }
0094   return (int)m_outQual[i];
0095 }
0096 
0097 void DTChambThSegm::print() const {
0098   std::cout << "TP at step " << step() << ", in wheel " << wheel();
0099   std::cout << ", station " << station() << ", sector " << sector();
0100   std::cout << " : " << std::endl;
0101   std::cout << "  output codes : ";
0102   int i = 0;
0103   for (i = 0; i < 7; i++) {
0104     std::cout << (int)(m_outPos[i] + m_outQual[i]) << " ";
0105   }
0106   std::cout << "\n";
0107 }