CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
38 
40  DTTSCand(DTTSS*, const DTTracoTrigData*, int, int);
41 
43  DTTSCand();
44 
46  DTTSCand(const DTTSCand& tscand);
47 
49  DTTSCand& operator=(const DTTSCand& tscand);
50 
52  ~DTTSCand();
53 
55  void setBitsTss();
56 
58  void setBitsBkmod();
59 
61  void setBitsTsm();
62 
64  // SM sector collector: it becomes bit 14
65  void setSecondTrack() { _dataword.set(14); _isCarry=1; }
66 
68  void resetCarry() { _isCarry=0; }
69 
71  void clearBits(){ _dataword.assign(5,3,0x7); }
72 
74  void clearBitsBkmod(){ _dataword.assign(0,7,0xff); }
75 
77  inline void clear();
78 
80  inline const DTConfigTSPhi* config() const { return _tss->config(); }
81 
83  inline const DTTracoTrigData* tracoTr() const { return _tctrig; }
84 
86  inline int TcPos() const { return _tcPos; }
87 
89  inline DTTSS* tss() const { return _tss; }
90 
92  inline int tssNumber() const { return _tss->number(); }
93 
95  inline int tracoNumber() const { return _tctrig->tracoNumber(); }
96 
98  inline int isFirst() const { return _dataword.element(14)==0; }
99 
101  inline int isHtrig() const { return _tctrig->pvCode()==8 ||
102  _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) &&
120  !(_tctrig->pvCode()==80); }
122  inline int isH0() const { return !_tctrig->pvCorr() && _tctrig->pvCode()==80; }
123 
125  inline int is0H() const { return !_tctrig->pvCorr() && _tctrig->pvCode()==8; }
126 
128  inline int isL0() const { return !_tctrig->pvCorr() && _tctrig->pvCode()<80 &&
129  _tctrig->pvCode()>8; }
131  inline int is0L() const { return !_tctrig->pvCorr() && _tctrig->pvCode()<8; }
132 
134  inline unsigned dataword() const { return _dataword.dataWord(0)&0x1ff; }
135 
137  bool operator < (const DTTSCand& c) const { return _dataword<c._dataword; }
138 
140  bool operator <= (const DTTSCand& c) const { return _dataword<=c._dataword; }
141 
142  // Operator <<= used for sorting in TSM back-up mode
143  // SM double TSM bool operator <<= (const DTTSCand& c) const { return _datawordbk<c._datawordbk; }
144 
146  void print() const;
147 
148  private:
151  BitArray<15> _dataword; // the word on which sorting is done. reserve space enough for Preview and full data
152  // SM double TSM BitArray<9> _datawordbk; // the word on which sorting is done (back-up mode)
153  int _tcPos; // TRACO position in TSS
154  // SM double TSM int _bkmod; // TSM back-up mode flag
155  int _isCarry; // info for TSM
156 
157 };
158 
159 #endif
int _isCarry
Definition: DTTSCand.h:155
void setBitsTss()
Set the quality bits for DTTSS analysis.
Definition: DTTSCand.cc:90
int isLH() const
Return if LH.
Definition: DTTSCand.h:116
int isHtrig() const
Return HTRIG/LTRIG bit.
Definition: DTTSCand.h:101
int _tcPos
Definition: DTTSCand.h:153
int tracoNumber() const
Return parent TRACO number.
~DTTSCand()
Destructor.
Definition: DTTSCand.cc:61
void clearBitsBkmod()
Clear (set to 1) all the bits (back-up mode)
Definition: DTTSCand.h:74
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:134
void clear()
Clear the trigger.
Definition: DTTSCand.cc:81
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:150
int isFirst() const
Return the first/second track bit.
Definition: DTTSCand.h:98
int tssNumber() const
Return the DTTSS number.
Definition: DTTSCand.h:92
const DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSCand.h:80
const DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSS.h:71
int isH0() const
Return if H inner.
Definition: DTTSCand.h:122
int tracoNumber() const
Return the TRACO number.
Definition: DTTSCand.h:95
DTTSS * _tss
Definition: DTTSCand.h:149
DTTSCand & operator=(const DTTSCand &tscand)
Assignment operator.
Definition: DTTSCand.cc:70
void setBitsTsm()
Set the quality bits for DTTSM analysis.
Definition: DTTSCand.cc:186
int isCarry() const
Return the carry bit.
Definition: DTTSCand.h:110
int isHHorHL() const
Return if HH or HL.
Definition: DTTSCand.h:113
void print() const
Print the trigger.
Definition: DTTSCand.cc:263
unsigned dataWord(const int i) const
Definition: BitArray.h:128
int isLL() const
Return if LL.
Definition: DTTSCand.h:119
int pvCode() const
Return the preview code.
DTTSCand()
Constructor.
Definition: DTTSCand.cc:56
const DTTracoTrigData * tracoTr() const
Return associated TRACO trigger.
Definition: DTTSCand.h:83
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:71
int isInner() const
Return Inner/Outer bit.
Definition: DTTSCand.h:104
int is0L() const
Return if L outer.
Definition: DTTSCand.h:131
void assign(const int p, const int n, const int val)
Definition: BitArray.h:239
void resetCarry()
Reset the carry bit.
Definition: DTTSCand.h:68
void setSecondTrack()
Set the first track bit to second track (used for carry)
Definition: DTTSCand.h:65
int number() const
Return identifier.
Definition: DTTSS.h:68
BitArray< 15 > _dataword
Definition: DTTSCand.h:151
int is0H() const
Return if H outer.
Definition: DTTSCand.h:125
int TcPos() const
Retrun the TRACO position inside the TSS.
Definition: DTTSCand.h:86
bool operator<=(const DTTSCand &c) const
Operator &lt;= used for sorting.
Definition: DTTSCand.h:140
int isL0() const
Return if L inner.
Definition: DTTSCand.h:128
bool operator<(const DTTSCand &c) const
Operator &lt; used for sorting.
Definition: DTTSCand.h:137
void set(const int i)
Definition: BitArray.h:230
void setBitsBkmod()
Set the bits for TSM back-up mode.
Definition: DTTSCand.cc:163
DTTSS * tss() const
Return the DTTSS.
Definition: DTTSCand.h:89
int isCorr() const
Return correlation bit.
Definition: DTTSCand.h:107