CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 //----------------
34 DTChambThSegm::DTChambThSegm(DTChamberId chamberid, int step, int* pos, int* qual)
35  : m_chamberid(chamberid), m_step(step) {
36  for (int i = 0; i < 7; i++) {
37  m_outPos[i] = pos[i];
38  m_outQual[i] = qual[i];
39  }
40 }
41 
42 DTChambThSegm::DTChambThSegm(const DTChambThSegm& seg) : m_chamberid(seg.m_chamberid), m_step(seg.m_step) {
43  for (int i = 0; i < 7; i++) {
44  m_outPos[i] = seg.m_outPos[i];
45  m_outQual[i] = seg.m_outQual[i];
46  }
47 }
48 
49 //--------------
50 // Destructor --
51 //--------------
53 
54 //--------------
55 // Operations --
56 //--------------
57 
59  if (this != &seg) {
61  m_step = seg.m_step;
62  for (int i = 0; i < 7; i++) {
63  m_outPos[i] = seg.m_outPos[i];
64  m_outQual[i] = seg.m_outQual[i];
65  }
66  }
67  return *this;
68 }
69 
70 int DTChambThSegm::code(const int i) const {
71  if (i < 0 || i >= 7) {
72  std::cout << "DTChambThSegm::code : index out of range: " << i;
73  std::cout << "0 returned!" << std::endl;
74  return 0;
75  }
76  return (int)(m_outPos[i] + m_outQual[i]);
77 }
78 
79 int DTChambThSegm::position(const int i) const {
80  if (i < 0 || i >= 7) {
81  std::cout << "DTChambThSegm::position : index out of range: " << i;
82  std::cout << "0 returned!" << std::endl;
83  return 0;
84  }
85  return (int)m_outPos[i];
86 }
87 
88 int DTChambThSegm::quality(const int i) const {
89  if (i < 0 || i >= 7) {
90  std::cout << "DTChambThSegm::quality : index out of range: " << i;
91  std::cout << "0 returned!" << std::endl;
92  return 0;
93  }
94  return (int)m_outQual[i];
95 }
96 
97 void DTChambThSegm::print() const {
98  std::cout << "TP at step " << step() << ", in wheel " << wheel();
99  std::cout << ", station " << station() << ", sector " << sector();
100  std::cout << " : " << std::endl;
101  std::cout << " output codes : ";
102  int i = 0;
103  for (i = 0; i < 7; i++) {
104  std::cout << (int)(m_outPos[i] + m_outQual[i]) << " ";
105  }
106  std::cout << "\n";
107 }
int wheel() const
Return wheel number.
Definition: DTTrigData.h:47
int step() const
Return step number.
Definition: DTChambThSegm.h:57
int quality(const int i) const
Return the quality for a given set of 7 BTI.
myint8 m_outQual[7]
Definition: DTChambThSegm.h:83
DTChambThSegm & operator=(const DTChambThSegm &seg)
Assignment operator.
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:53
int station() const
Return station number.
Definition: DTTrigData.h:50
DTChambThSegm(DTChamberId, int, int *, int *)
Constructor.
myint8 m_outPos[7]
output code
Definition: DTChambThSegm.h:82
int m_step
step number
Definition: DTChambThSegm.h:79
int code(const int i) const
Return the code for a given set of 7 BTI.
void print() const override
Print.
tuple cout
Definition: gather_cfg.py:144
step
Definition: StallMonitor.cc:98
~DTChambThSegm() override
Destructor.
DTChamberId m_chamberid
parent chamber
Definition: DTChambThSegm.h:76