CMS 3D CMS Logo

DTChambThSegm.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: DTChambThSegm.cpp
4 //
5 // Description: Muon Chamber Trigger Theta candidate
6 //
7 //
8 // Author List:
9 // C. Grandi
10 // Modifications:
11 //
12 //
13 //--------------------------------------------------
14 
15 // #include "Utilities/Configuration/interface/Architecture.h"
16 
17 //-----------------------
18 // This Class's Header --
19 //-----------------------
21 
22 //-------------------------------
23 // Collaborating Class Headers --
24 //-------------------------------
25 
26 //---------------
27 // C++ Headers --
28 //---------------
29 #include <iostream>
30 
31 //----------------
32 // Constructors --
33 //----------------
35  int* pos, int* qual)
36  : m_chamberid(chamberid), m_step(step) {
37 
38  for(int i=0;i<7;i++) {
39  m_outPos[i] = pos[i];
40  m_outQual[i] = qual[i];
41  }
42 }
43 
46 
47  for(int i=0;i<7;i++) {
48  m_outPos[i] = seg.m_outPos[i];
49  m_outQual[i] = seg.m_outQual[i];
50  }
51 }
52 
53 //--------------
54 // Destructor --
55 //--------------
57 }
58 
59 //--------------
60 // Operations --
61 //--------------
62 
65  if(this != &seg){
67  m_step = seg.m_step;
68  for(int i=0;i<7;i++) {
69  m_outPos[i] = seg.m_outPos[i];
70  m_outQual[i] = seg.m_outQual[i];
71  }
72  }
73  return *this;
74 }
75 
76 int
77 DTChambThSegm::code(const int i) const {
78  if(i<0||i>=7){
79  std::cout << "DTChambThSegm::code : index out of range: " << i;
80  std::cout << "0 returned!" << std::endl;
81  return 0;
82  }
83  return (int)(m_outPos[i]+m_outQual[i]);
84 }
85 
86 int
87 DTChambThSegm::position(const int i) const {
88  if(i<0||i>=7){
89  std::cout << "DTChambThSegm::position : index out of range: " << i;
90  std::cout << "0 returned!" << std::endl;
91  return 0;
92  }
93  return (int)m_outPos[i];
94 }
95 
96 int
97 DTChambThSegm::quality(const int i) const {
98  if(i<0||i>=7){
99  std::cout << "DTChambThSegm::quality : index out of range: " << i;
100  std::cout << "0 returned!" << std::endl;
101  return 0;
102  }
103  return (int)m_outQual[i];
104 }
105 
106 void
108  std::cout << "TP at step " << step() << ", in wheel " << wheel();
109  std::cout << ", station " << station() << ", sector " << sector();
110  std::cout << " : " << std::endl;
111  std::cout << " output codes : ";
112  int i=0;
113  for(i=0;i<7;i++){
114  std::cout << (int)(m_outPos[i]+m_outQual[i]) << " ";
115  }
116  std::cout << "\n";
117 
118 }
int wheel() const
Return wheel number.
Definition: DTTrigData.h:48
int step() const
Return step number.
Definition: DTChambThSegm.h:60
int quality(const int i) const
Return the quality for a given set of 7 BTI.
myint8 m_outQual[7]
Definition: DTChambThSegm.h:87
DTChambThSegm & operator=(const DTChambThSegm &seg)
Assignment operator.
void print() const override
Print.
int position(const int i) const
Return the position for a given set of 7 BTI.
int sector() const
Return sector number.
Definition: DTTrigData.h:54
int station() const
Return station number.
Definition: DTTrigData.h:51
DTChambThSegm(DTChamberId, int, int *, int *)
Constructor.
myint8 m_outPos[7]
output code
Definition: DTChambThSegm.h:86
int m_step
step number
Definition: DTChambThSegm.h:83
int code(const int i) const
Return the code for a given set of 7 BTI.
step
~DTChambThSegm() override
Destructor.
DTChamberId m_chamberid
parent chamber
Definition: DTChambThSegm.h:80