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 //----------------
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 }
mps_fire.i
i
Definition: mps_fire.py:428
step
step
Definition: StallMonitor.cc:94
DTChambThSegm.h
DTTrigData::sector
int sector() const
Return sector number.
Definition: DTTrigData.h:53
DTChambThSegm::operator=
DTChambThSegm & operator=(const DTChambThSegm &seg)
Assignment operator.
Definition: DTChambThSegm.cc:58
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pos
Definition: PixelAliasList.h:18
DTChambThSegm::step
int step() const
Return step number.
Definition: DTChambThSegm.h:57
DTTrigData::station
int station() const
Return station number.
Definition: DTTrigData.h:50
DTChambThSegm::~DTChambThSegm
~DTChambThSegm() override
Destructor.
Definition: DTChambThSegm.cc:52
DTChambThSegm::quality
int quality(const int i) const
Return the quality for a given set of 7 BTI.
Definition: DTChambThSegm.cc:88
DTChambThSegm::code
int code(const int i) const
Return the code for a given set of 7 BTI.
Definition: DTChambThSegm.cc:70
DTChambThSegm
Definition: DTChambThSegm.h:39
DTChambThSegm::m_outQual
myint8 m_outQual[7]
Definition: DTChambThSegm.h:83
DTChambThSegm::print
void print() const override
Print.
Definition: DTChambThSegm.cc:97
DTChambThSegm::m_outPos
myint8 m_outPos[7]
output code
Definition: DTChambThSegm.h:82
DTChambThSegm::DTChambThSegm
DTChambThSegm(DTChamberId, int, int *, int *)
Constructor.
Definition: DTChambThSegm.cc:34
createfilelist.int
int
Definition: createfilelist.py:10
DTChambThSegm::m_chamberid
DTChamberId m_chamberid
parent chamber
Definition: DTChambThSegm.h:76
DTChamberId
Definition: DTChamberId.h:14
DTChambThSegm::position
int position(const int i) const
Return the position for a given set of 7 BTI.
Definition: DTChambThSegm.cc:79
DTTrigData::wheel
int wheel() const
Return wheel number.
Definition: DTTrigData.h:47
DTChambThSegm::m_step
int m_step
step number
Definition: DTChambThSegm.h:79