CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/L1Trigger/DTTriggerServerTheta/src/DTChambThSegm.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: DTChambThSegm.cpp
00004 //
00005 //   Description: Muon Chamber Trigger Theta candidate 
00006 //
00007 //
00008 //   Author List:
00009 //   C. Grandi
00010 //   Modifications: 
00011 //
00012 //
00013 //--------------------------------------------------
00014 
00015 // #include "Utilities/Configuration/interface/Architecture.h"
00016 
00017 //-----------------------
00018 // This Class's Header --
00019 //-----------------------
00020 #include "L1Trigger/DTTriggerServerTheta/interface/DTChambThSegm.h"
00021 
00022 //-------------------------------
00023 // Collaborating Class Headers --
00024 //-------------------------------
00025 
00026 //---------------
00027 // C++ Headers --
00028 //---------------
00029 #include <iostream>
00030 
00031 //----------------
00032 // Constructors --
00033 //----------------
00034 DTChambThSegm::DTChambThSegm(DTChamberId chamberid, int step, 
00035                                      int* pos, int* qual)
00036   : m_chamberid(chamberid),  m_step(step) {
00037 
00038   for(int i=0;i<7;i++) {
00039     m_outPos[i] = pos[i];
00040     m_outQual[i] = qual[i];
00041   }
00042 }
00043 
00044 DTChambThSegm::DTChambThSegm(const DTChambThSegm& seg) : 
00045   m_chamberid(seg.m_chamberid), m_step(seg.m_step)  {
00046 
00047   for(int i=0;i<7;i++) {
00048     m_outPos[i] = seg.m_outPos[i];
00049     m_outQual[i] = seg.m_outQual[i];
00050   }
00051 }
00052 
00053 //--------------
00054 // Destructor --
00055 //--------------
00056 DTChambThSegm::~DTChambThSegm(){
00057 }
00058 
00059 //--------------
00060 // Operations --
00061 //--------------
00062 
00063 DTChambThSegm&
00064 DTChambThSegm::operator=(const DTChambThSegm& seg){
00065   if(this != &seg){
00066     m_chamberid = seg.m_chamberid;
00067     m_step = seg.m_step;
00068     for(int i=0;i<7;i++) {
00069       m_outPos[i] = seg.m_outPos[i];
00070       m_outQual[i] = seg.m_outQual[i];
00071     }
00072   }
00073   return *this;
00074 }
00075 
00076 int 
00077 DTChambThSegm::code(const int i) const {
00078   if(i<0||i>=7){
00079     std::cout << "DTChambThSegm::code : index out of range: " << i;
00080     std::cout << "0 returned!" << std::endl;
00081     return 0;
00082   }
00083   return (int)(m_outPos[i]+m_outQual[i]);
00084 }
00085 
00086 int 
00087 DTChambThSegm::position(const int i) const {
00088   if(i<0||i>=7){
00089     std::cout << "DTChambThSegm::position : index out of range: " << i;
00090     std::cout << "0 returned!" << std::endl;
00091     return 0;
00092   }
00093   return (int)m_outPos[i];
00094 }
00095 
00096 int 
00097 DTChambThSegm::quality(const int i) const {
00098   if(i<0||i>=7){
00099     std::cout << "DTChambThSegm::quality : index out of range: " << i;
00100     std::cout << "0 returned!" << std::endl;
00101     return 0;
00102   }
00103   return (int)m_outQual[i];
00104 }
00105 
00106 void
00107 DTChambThSegm::print() const {
00108   std::cout << "TP at step " << step() << ", in wheel " << wheel();
00109   std::cout << ", station " << station() << ", sector " << sector();
00110   std::cout << " : " << std::endl;
00111   std::cout << "  output codes : ";
00112   int i=0;
00113   for(i=0;i<7;i++){
00114     std::cout << (int)(m_outPos[i]+m_outQual[i]) << " ";
00115   }
00116   std::cout << "\n";
00117   
00118 }