CMS 3D CMS Logo

DTTSCand.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
9 //
10 //--------------------------------------------------
11 #ifndef DT_TS_CAND_H
12 #define DT_TS_CAND_H
13 
14 //------------------------------------
15 // Collaborating Class Declarations --
16 //------------------------------------
17 class DTConfigTSPhi;
18 
19 //----------------------
20 // Base Class Headers --
21 //----------------------
25 
26 //---------------
27 // C++ Headers --
28 //---------------
29 #include <string>
30 
31 // ---------------------
32 // -- Class Interface --
33 // ---------------------
34 
35 class DTTSCand {
36 
37 public:
39  DTTSCand(DTTSS *, const DTTracoTrigData *, int, int);
40 
42  DTTSCand();
43 
45  DTTSCand(const DTTSCand &tscand);
46 
48  DTTSCand &operator=(const DTTSCand &tscand);
49 
51  ~DTTSCand();
52 
54  void setBitsTss();
55 
57  void setBitsBkmod();
58 
60  void setBitsTsm();
61 
63  // SM sector collector: it becomes bit 14
64  void setSecondTrack() {
65  _dataword.set(14);
66  _isCarry = 1;
67  }
68 
70  void resetCarry() { _isCarry = 0; }
71 
73  void clearBits() { _dataword.assign(5, 3, 0x7); }
74 
76  void clearBitsBkmod() { _dataword.assign(0, 7, 0xff); }
77 
79  inline void clear();
80 
82  inline const DTConfigTSPhi *config() const { return _tss->config(); }
83 
85  inline const DTTracoTrigData *tracoTr() const { return _tctrig; }
86 
88  inline int TcPos() const { return _tcPos; }
89 
91  inline DTTSS *tss() const { return _tss; }
92 
94  inline int tssNumber() const { return _tss->number(); }
95 
97  inline int tracoNumber() const { return _tctrig->tracoNumber(); }
98 
100  inline int isFirst() const { return _dataword.element(14) == 0; }
101 
103  inline int isHtrig() const {
104  return _tctrig->pvCode() == 8 || _tctrig->pvCode() == 80;
105  }
107  inline int isInner() const { return _tctrig->pvCode() > 8; }
108 
110  inline int isCorr() const { return _tctrig->pvCorr(); }
111 
113  inline int isCarry() const { return _isCarry; }
114 
116  inline int isHHorHL() const {
117  return _tctrig->pvCorr() && _tctrig->pvCode() == 80;
118  }
119 
121  inline int isLH() const {
122  return _tctrig->pvCorr() && _tctrig->pvCode() == 8;
123  }
124 
126  inline int isLL() const {
127  return _tctrig->pvCorr() && !(_tctrig->pvCode() == 8) &&
128  !(_tctrig->pvCode() == 80);
129  }
131  inline int isH0() const {
132  return !_tctrig->pvCorr() && _tctrig->pvCode() == 80;
133  }
134 
136  inline int is0H() const {
137  return !_tctrig->pvCorr() && _tctrig->pvCode() == 8;
138  }
139 
141  inline int isL0() const {
142  return !_tctrig->pvCorr() && _tctrig->pvCode() < 80 &&
143  _tctrig->pvCode() > 8;
144  }
146  inline int is0L() const {
147  return !_tctrig->pvCorr() && _tctrig->pvCode() < 8;
148  }
149 
151  inline unsigned dataword() const { return _dataword.dataWord(0) & 0x1ff; }
152 
154  bool operator<(const DTTSCand &c) const { return _dataword < c._dataword; }
155 
157  bool operator<=(const DTTSCand &c) const { return _dataword <= c._dataword; }
158 
159  // Operator <<= used for sorting in TSM back-up mode
160  // SM double TSM bool operator <<= (const DTTSCand& c) const { return
161  // _datawordbk<c._datawordbk; }
162 
164  void print() const;
165 
166 private:
169  BitArray<15> _dataword; // the word on which sorting is done. reserve space
170  // enough for Preview and full data
171  // SM double TSM BitArray<9> _datawordbk; // the word on which sorting is
172  // done (back-up mode)
173  int _tcPos; // TRACO position in TSS
174  // SM double TSM int _bkmod; // TSM back-up mode flag
175  int _isCarry; // info for TSM
176 };
177 
178 #endif
int _isCarry
Definition: DTTSCand.h:175
void setBitsTss()
Set the quality bits for DTTSS analysis.
Definition: DTTSCand.cc:80
int isLH() const
Return if LH.
Definition: DTTSCand.h:121
int isHtrig() const
Return HTRIG/LTRIG bit.
Definition: DTTSCand.h:103
int _tcPos
Definition: DTTSCand.h:173
int tracoNumber() const
Return parent TRACO number.
~DTTSCand()
Destructor.
Definition: DTTSCand.cc:57
void clearBitsBkmod()
Clear (set to 1) all the bits (back-up mode)
Definition: DTTSCand.h:76
int pvCorr() const
Return the preview correaltion bit.
unsigned dataword() const
Return an uint16 with the content of the data word (for debugging)
Definition: DTTSCand.h:151
void clear()
Clear the trigger.
Definition: DTTSCand.cc:73
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:168
int isFirst() const
Return the first/second track bit.
Definition: DTTSCand.h:100
int tssNumber() const
Return the DTTSS number.
Definition: DTTSCand.h:94
const DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSCand.h:82
const DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSS.h:70
int isH0() const
Return if H inner.
Definition: DTTSCand.h:131
int tracoNumber() const
Return the TRACO number.
Definition: DTTSCand.h:97
DTTSS * _tss
Definition: DTTSCand.h:167
DTTSCand & operator=(const DTTSCand &tscand)
Assignment operator.
Definition: DTTSCand.cc:63
void setBitsTsm()
Set the quality bits for DTTSM analysis.
Definition: DTTSCand.cc:194
int isCarry() const
Return the carry bit.
Definition: DTTSCand.h:113
int isHHorHL() const
Return if HH or HL.
Definition: DTTSCand.h:116
void print() const
Print the trigger.
Definition: DTTSCand.cc:271
unsigned dataWord(const int i) const
Definition: BitArray.h:128
int isLL() const
Return if LL.
Definition: DTTSCand.h:126
int pvCode() const
Return the preview code.
DTTSCand()
Constructor.
Definition: DTTSCand.cc:52
const DTTracoTrigData * tracoTr() const
Return associated TRACO trigger.
Definition: DTTSCand.h:85
int element(const int pos) const
Definition: BitArray.h:210
Definition: DTTSS.h:36
void clearBits()
Clear (set to 1) the quality bits (but first/second track bit)
Definition: DTTSCand.h:73
int isInner() const
Return Inner/Outer bit.
Definition: DTTSCand.h:107
int is0L() const
Return if L outer.
Definition: DTTSCand.h:146
void assign(const int p, const int n, const int val)
Definition: BitArray.h:239
void resetCarry()
Reset the carry bit.
Definition: DTTSCand.h:70
void setSecondTrack()
Set the first track bit to second track (used for carry)
Definition: DTTSCand.h:64
int number() const
Return identifier.
Definition: DTTSS.h:67
BitArray< 15 > _dataword
Definition: DTTSCand.h:169
int is0H() const
Return if H outer.
Definition: DTTSCand.h:136
int TcPos() const
Retrun the TRACO position inside the TSS.
Definition: DTTSCand.h:88
bool operator<=(const DTTSCand &c) const
Operator <= used for sorting.
Definition: DTTSCand.h:157
int isL0() const
Return if L inner.
Definition: DTTSCand.h:141
bool operator<(const DTTSCand &c) const
Operator < used for sorting.
Definition: DTTSCand.h:154
void set(const int i)
Definition: BitArray.h:230
void setBitsBkmod()
Set the bits for TSM back-up mode.
Definition: DTTSCand.cc:154
DTTSS * tss() const
Return the DTTSS.
Definition: DTTSCand.h:91
int isCorr() const
Return correlation bit.
Definition: DTTSCand.h:110