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
DTTracoTrigData::pvCorr
int pvCorr() const
Return the preview correaltion bit.
Definition: DTTracoTrigData.h:192
DTTracoTrigData::tracoNumber
int tracoNumber() const
Return parent TRACO number.
Definition: DTTracoTrigData.h:159
DTTracoTrigData.h
DTTSCand::_tctrig
const DTTracoTrigData * _tctrig
Definition: DTTSCand.h:149
DTTSCand
Definition: DTTSCand.h:35
BitArray::assign
void assign(const int p, const int n, const int val)
Definition: BitArray.h:233
DTTracoTrigData::pvCode
int pvCode() const
Return the preview code.
Definition: DTTracoTrigData.h:186
DTTSCand::~DTTSCand
~DTTSCand()
Destructor.
Definition: DTTSCand.cc:55
DTTSS::number
int number() const
Return identifier.
Definition: DTTSS.h:66
DTTSCand::isCarry
int isCarry() const
Return the carry bit.
Definition: DTTSCand.h:110
DTTSCand::tssNumber
int tssNumber() const
Return the DTTSS number.
Definition: DTTSCand.h:93
DTTSCand::isInner
int isInner() const
Return Inner/Outer bit.
Definition: DTTSCand.h:104
DTTSCand::config
const DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSCand.h:81
DTTSS
Definition: DTTSS.h:36
DTTSCand::isH0
int isH0() const
Return if H inner.
Definition: DTTSCand.h:121
DTTSCand::_tcPos
int _tcPos
Definition: DTTSCand.h:154
DTTSCand::setSecondTrack
void setSecondTrack()
Set the first track bit to second track (used for carry)
Definition: DTTSCand.h:63
BitArray::dataWord
unsigned dataWord(const int i) const
Definition: BitArray.h:124
DTTSCand::isLH
int isLH() const
Return if LH.
Definition: DTTSCand.h:116
DTTSCand::clear
void clear()
Clear the trigger.
Definition: DTTSCand.cc:71
DTTSCand::is0L
int is0L() const
Return if L outer.
Definition: DTTSCand.h:129
DTTSS.h
DTTSCand::isCorr
int isCorr() const
Return correlation bit.
Definition: DTTSCand.h:107
DTTSCand::setBitsBkmod
void setBitsBkmod()
Set the bits for TSM back-up mode.
Definition: DTTSCand.cc:150
BitArray::element
int element(const int pos) const
Definition: BitArray.h:206
DTTSCand::tracoNumber
int tracoNumber() const
Return the TRACO number.
Definition: DTTSCand.h:96
DTTSCand::dataword
unsigned dataword() const
Return an uint16 with the content of the data word (for debugging)
Definition: DTTSCand.h:132
DTTSCand::operator<=
bool operator<=(const DTTSCand &c) const
Operator <= used for sorting.
Definition: DTTSCand.h:138
DTTSS::config
const DTConfigTSPhi * config() const
Configuration set.
Definition: DTTSS.h:69
DTTSCand::DTTSCand
DTTSCand()
Constructor.
Definition: DTTSCand.cc:50
DTTSCand::_dataword
BitArray< 15 > _dataword
Definition: DTTSCand.h:150
DTTSCand::clearBitsBkmod
void clearBitsBkmod()
Clear (set to 1) all the bits (back-up mode)
Definition: DTTSCand.h:75
DTTSCand::setBitsTsm
void setBitsTsm()
Set the quality bits for DTTSM analysis.
Definition: DTTSCand.cc:190
DTTSCand::operator=
DTTSCand & operator=(const DTTSCand &tscand)
Assignment operator.
Definition: DTTSCand.cc:61
DTTSCand::print
void print() const
Print the trigger.
Definition: DTTSCand.cc:265
DTTSCand::setBitsTss
void setBitsTss()
Set the quality bits for DTTSS analysis.
Definition: DTTSCand.cc:78
DTTSCand::operator<
bool operator<(const DTTSCand &c) const
Operator < used for sorting.
Definition: DTTSCand.h:135
DTTSCand::tracoTr
const DTTracoTrigData * tracoTr() const
Return associated TRACO trigger.
Definition: DTTSCand.h:84
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
DTConfigTSPhi
Definition: DTConfigTSPhi.h:36
DTTSCand::clearBits
void clearBits()
Clear (set to 1) the quality bits (but first/second track bit)
Definition: DTTSCand.h:72
DTTSCand::isL0
int isL0() const
Return if L inner.
Definition: DTTSCand.h:127
DTTSCand::_tss
DTTSS * _tss
Definition: DTTSCand.h:148
DTTSCand::TcPos
int TcPos() const
Retrun the TRACO position inside the TSS.
Definition: DTTSCand.h:87
DTTSCand::isHHorHL
int isHHorHL() const
Return if HH or HL.
Definition: DTTSCand.h:113
DTTracoTrigData
Definition: DTTracoTrigData.h:37
DTTSCand::is0H
int is0H() const
Return if H outer.
Definition: DTTSCand.h:124
DTTSCand::isHtrig
int isHtrig() const
Return HTRIG/LTRIG bit.
Definition: DTTSCand.h:102
DTTSCand::resetCarry
void resetCarry()
Reset the carry bit.
Definition: DTTSCand.h:69
DTTSCand::tss
DTTSS * tss() const
Return the DTTSS.
Definition: DTTSCand.h:90
BitArray::set
void set(const int i)
Definition: BitArray.h:224
DTTSCand::isLL
int isLL() const
Return if LL.
Definition: DTTSCand.h:119
BitArray.h
BitArray< 15 >
DTTSCand::isFirst
int isFirst() const
Return the first/second track bit.
Definition: DTTSCand.h:99
DTTSCand::_isCarry
int _isCarry
Definition: DTTSCand.h:156