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 //
11 //
12 //--------------------------------------------------
13 #ifndef DT_TS_CAND_H
14 #define DT_TS_CAND_H
15 
16 //------------------------------------
17 // Collaborating Class Declarations --
18 //------------------------------------
19 class DTConfigTSPhi;
20 
21 //----------------------
22 // Base Class Headers --
23 //----------------------
27 
28 //---------------
29 // C++ Headers --
30 //---------------
31 #include <string>
32 
33 // ---------------------
34 // -- Class Interface --
35 // ---------------------
36 
37 class DTTSCand {
38 
39  public:
40 
42  DTTSCand(DTTSS*, const DTTracoTrigData*, int, int);
43 
45  DTTSCand();
46 
48  DTTSCand(const DTTSCand& tscand);
49 
51  DTTSCand& operator=(const DTTSCand& tscand);
52 
54  ~DTTSCand();
55 
57  void setBitsTss();
58 
60  void setBitsBkmod();
61 
63  void setBitsTsm();
64 
66  // SM sector collector: it becomes bit 14
67  void setSecondTrack() { _dataword.set(14); _isCarry=1; }
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 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 { return _tctrig->pvCode()==8 ||
104  _tctrig->pvCode()==80; }
106  inline int isInner() const { return _tctrig->pvCode()>8; }
107 
109  inline int isCorr() const { return _tctrig->pvCorr(); }
110 
112  inline int isCarry() const { return _isCarry; }
113 
115  inline int isHHorHL() const { return _tctrig->pvCorr() && _tctrig->pvCode()==80; }
116 
118  inline int isLH() const { return _tctrig->pvCorr() && _tctrig->pvCode()==8; }
119 
121  inline int isLL() const { return _tctrig->pvCorr() && !_tctrig->pvCode()==8 &&
122  !_tctrig->pvCode()==80; }
124  inline int isH0() const { return !_tctrig->pvCorr() && _tctrig->pvCode()==80; }
125 
127  inline int is0H() const { return !_tctrig->pvCorr() && _tctrig->pvCode()==8; }
128 
130  inline int isL0() const { return !_tctrig->pvCorr() && _tctrig->pvCode()<80 &&
131  _tctrig->pvCode()>8; }
133  inline int is0L() const { return !_tctrig->pvCorr() && _tctrig->pvCode()<8; }
134 
136  inline unsigned dataword() const { return _dataword.dataWord(0)&0x1ff; }
137 
139  bool operator < (const DTTSCand& c) const { return _dataword<c._dataword; }
140 
142  bool operator <= (const DTTSCand& c) const { return _dataword<=c._dataword; }
143 
144  // Operator <<= used for sorting in TSM back-up mode
145  // SM double TSM bool operator <<= (const DTTSCand& c) const { return _datawordbk<c._datawordbk; }
146 
148  void print() const;
149 
150  private:
153  BitArray<15> _dataword; // the word on which sorting is done. reserve space enough for Preview and full data
154  // SM double TSM BitArray<9> _datawordbk; // the word on which sorting is done (back-up mode)
155  int _tcPos; // TRACO position in TSS
156  // SM double TSM int _bkmod; // TSM back-up mode flag
157  int _isCarry; // info for TSM
158 
159 };
160 
161 #endif
int _isCarry
Definition: DTTSCand.h:157
void setBitsTss()
Set the quality bits for DTTSS analysis.
Definition: DTTSCand.cc:90
int isLH() const
Return if LH.
Definition: DTTSCand.h:118
int isHtrig() const
Return HTRIG/LTRIG bit.
Definition: DTTSCand.h:103
int _tcPos
Definition: DTTSCand.h:155
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: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:136
void clear()
Clear the trigger.
Definition: DTTSCand.cc:81
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:152
int isFirst() const
Return the first/second track bit.
Definition: DTTSCand.h:100
int tssNumber() const
Return the DTTSS number.
Definition: DTTSCand.h:94
int isH0() const
Return if H inner.
Definition: DTTSCand.h:124
int tracoNumber() const
Return the TRACO number.
Definition: DTTSCand.h:97
DTTSS * _tss
Definition: DTTSCand.h:151
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:112
int isHHorHL() const
Return if HH or HL.
Definition: DTTSCand.h:115
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:121
int pvCode() const
Return the preview code.
DTTSCand()
Constructor.
Definition: DTTSCand.cc:56
DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSCand.h:82
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:38
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:106
int is0L() const
Return if L outer.
Definition: DTTSCand.h:133
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:67
int number() const
Return identifier.
Definition: DTTSS.h:70
BitArray< 15 > _dataword
Definition: DTTSCand.h:153
int is0H() const
Return if H outer.
Definition: DTTSCand.h:127
int TcPos() const
Retrun the TRACO position inside the TSS.
Definition: DTTSCand.h:88
bool operator<=(const DTTSCand &c) const
Operator &lt;= used for sorting.
Definition: DTTSCand.h:142
DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSS.h:73
int isL0() const
Return if L inner.
Definition: DTTSCand.h:130
bool operator<(const DTTSCand &c) const
Operator &lt; used for sorting.
Definition: DTTSCand.h:139
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:91
int isCorr() const
Return correlation bit.
Definition: DTTSCand.h:109