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 public:
38  DTTSCand(DTTSS *, const DTTracoTrigData *, int, int);
39 
41  DTTSCand();
42 
44  DTTSCand(const DTTSCand &tscand);
45 
47  DTTSCand &operator=(const DTTSCand &tscand);
48 
50  ~DTTSCand();
51 
53  void setBitsTss();
54 
56  void setBitsBkmod();
57 
59  void setBitsTsm();
60 
62  // SM sector collector: it becomes bit 14
63  void setSecondTrack() {
64  _dataword.set(14);
65  _isCarry = 1;
66  }
67 
69  void resetCarry() { _isCarry = 0; }
70 
72  void clearBits() { _dataword.assign(5, 3, 0x7); }
73 
75  void clearBitsBkmod() { _dataword.assign(0, 7, 0xff); }
76 
78  inline void clear();
79 
81  inline const DTConfigTSPhi *config() const { return _tss->config(); }
82 
84  inline const DTTracoTrigData *tracoTr() const { return _tctrig; }
85 
87  inline int TcPos() const { return _tcPos; }
88 
90  inline DTTSS *tss() const { return _tss; }
91 
93  inline int tssNumber() const { return _tss->number(); }
94 
96  inline int tracoNumber() const { return _tctrig->tracoNumber(); }
97 
99  inline int isFirst() const { return _dataword.element(14) == 0; }
100 
102  inline int isHtrig() const { return _tctrig->pvCode() == 8 || _tctrig->pvCode() == 80; }
104  inline int isInner() const { return _tctrig->pvCode() > 8; }
105 
107  inline int isCorr() const { return _tctrig->pvCorr(); }
108 
110  inline int isCarry() const { return _isCarry; }
111 
113  inline int isHHorHL() const { return _tctrig->pvCorr() && _tctrig->pvCode() == 80; }
114 
116  inline int isLH() const { return _tctrig->pvCorr() && _tctrig->pvCode() == 8; }
117 
119  inline int isLL() const { return _tctrig->pvCorr() && !(_tctrig->pvCode() == 8) && !(_tctrig->pvCode() == 80); }
121  inline int isH0() const { return !_tctrig->pvCorr() && _tctrig->pvCode() == 80; }
122 
124  inline int is0H() const { return !_tctrig->pvCorr() && _tctrig->pvCode() == 8; }
125 
127  inline int isL0() const { return !_tctrig->pvCorr() && _tctrig->pvCode() < 80 && _tctrig->pvCode() > 8; }
129  inline int is0L() const { return !_tctrig->pvCorr() && _tctrig->pvCode() < 8; }
130 
132  inline unsigned dataword() const { return _dataword.dataWord(0) & 0x1ff; }
133 
135  bool operator<(const DTTSCand &c) const { return _dataword < c._dataword; }
136 
138  bool operator<=(const DTTSCand &c) const { return _dataword <= c._dataword; }
139 
140  // Operator <<= used for sorting in TSM back-up mode
141  // SM double TSM bool operator <<= (const DTTSCand& c) const { return
142  // _datawordbk<c._datawordbk; }
143 
145  void print() const;
146 
147 private:
150  BitArray<15> _dataword; // the word on which sorting is done. reserve space
151  // enough for Preview and full data
152  // SM double TSM BitArray<9> _datawordbk; // the word on which sorting is
153  // done (back-up mode)
154  int _tcPos; // TRACO position in TSS
155  // SM double TSM int _bkmod; // TSM back-up mode flag
156  int _isCarry; // info for TSM
157 };
158 
159 #endif
int _isCarry
Definition: DTTSCand.h:156
const DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSCand.h:81
int isH0() const
Return if H inner.
Definition: DTTSCand.h:121
void setBitsTss()
Set the quality bits for DTTSS analysis.
Definition: DTTSCand.cc:78
int pvCode() const
Return the preview code.
int number() const
Return identifier.
Definition: DTTSS.h:66
int _tcPos
Definition: DTTSCand.h:154
~DTTSCand()
Destructor.
Definition: DTTSCand.cc:55
void clearBitsBkmod()
Clear (set to 1) all the bits (back-up mode)
Definition: DTTSCand.h:75
DTTSS * tss() const
Return the DTTSS.
Definition: DTTSCand.h:90
int tracoNumber() const
Return the TRACO number.
Definition: DTTSCand.h:96
void clear()
Clear the trigger.
Definition: DTTSCand.cc:71
const DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSS.h:69
int isLH() const
Return if LH.
Definition: DTTSCand.h:116
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:149
int isInner() const
Return Inner/Outer bit.
Definition: DTTSCand.h:104
bool operator<=(const DTTSCand &c) const
Operator <= used for sorting.
Definition: DTTSCand.h:138
DTTSS * _tss
Definition: DTTSCand.h:148
int isHHorHL() const
Return if HH or HL.
Definition: DTTSCand.h:113
DTTSCand & operator=(const DTTSCand &tscand)
Assignment operator.
Definition: DTTSCand.cc:61
const DTTracoTrigData * tracoTr() const
Return associated TRACO trigger.
Definition: DTTSCand.h:84
int pvCorr() const
Return the preview correaltion bit.
int tracoNumber() const
Return parent TRACO number.
void setBitsTsm()
Set the quality bits for DTTSM analysis.
Definition: DTTSCand.cc:190
int isHtrig() const
Return HTRIG/LTRIG bit.
Definition: DTTSCand.h:102
void print() const
Print the trigger.
Definition: DTTSCand.cc:265
int isCorr() const
Return correlation bit.
Definition: DTTSCand.h:107
int isCarry() const
Return the carry bit.
Definition: DTTSCand.h:110
DTTSCand()
Constructor.
Definition: DTTSCand.cc:50
unsigned dataword() const
Return an uint16 with the content of the data word (for debugging)
Definition: DTTSCand.h:132
int isLL() const
Return if LL.
Definition: DTTSCand.h:119
Definition: DTTSS.h:36
void clearBits()
Clear (set to 1) the quality bits (but first/second track bit)
Definition: DTTSCand.h:72
void assign(const int p, const int n, const int val)
Definition: BitArray.h:233
void resetCarry()
Reset the carry bit.
Definition: DTTSCand.h:69
void setSecondTrack()
Set the first track bit to second track (used for carry)
Definition: DTTSCand.h:63
int is0L() const
Return if L outer.
Definition: DTTSCand.h:129
BitArray< 15 > _dataword
Definition: DTTSCand.h:150
int is0H() const
Return if H outer.
Definition: DTTSCand.h:124
int isFirst() const
Return the first/second track bit.
Definition: DTTSCand.h:99
int isL0() const
Return if L inner.
Definition: DTTSCand.h:127
int TcPos() const
Retrun the TRACO position inside the TSS.
Definition: DTTSCand.h:87
void set(const int i)
Definition: BitArray.h:224
void setBitsBkmod()
Set the bits for TSM back-up mode.
Definition: DTTSCand.cc:150
int element(const int pos) const
Definition: BitArray.h:206
unsigned dataWord(const int i) const
Definition: BitArray.h:124
bool operator<(const DTTSCand &c) const
Operator < used for sorting.
Definition: DTTSCand.h:135
int tssNumber() const
Return the DTTSS number.
Definition: DTTSCand.h:93