#include <L1Trigger/DTTriggerServerPhi/interface/DTTSCand.h>
Public Member Functions | |
void | clear () |
Clear the trigger. | |
void | clearBits () |
Clear (set to 1) the quality bits (but first/second track bit). | |
void | clearBitsBkmod () |
Clear (set to 1) all the bits (back-up mode). | |
DTConfigTSPhi * | config () const |
Configuration set. | |
unsigned | dataword () const |
Return an uint16 with the content of the data word (for debugging). | |
DTTSCand (const DTTSCand &tscand) | |
Constructor. | |
DTTSCand () | |
Constructor. | |
DTTSCand (DTTSS *, const DTTracoTrigData *, int, int) | |
Constructor. | |
int | is0H () const |
Return if H outer. | |
int | is0L () const |
Return if L outer. | |
int | isCarry () const |
Return the carry bit. | |
int | isCorr () const |
Return correlation bit. | |
int | isFirst () const |
Return the first/second track bit. | |
int | isH0 () const |
Return if H inner. | |
int | isHHorHL () const |
Return if HH or HL. | |
int | isHtrig () const |
Return HTRIG/LTRIG bit. | |
int | isInner () const |
Return Inner/Outer bit. | |
int | isL0 () const |
Return if L inner. | |
int | isLH () const |
Return if LH. | |
int | isLL () const |
Return if LL. | |
bool | operator< (const DTTSCand &c) const |
Operator < used for sorting. | |
bool | operator<= (const DTTSCand &c) const |
Operator <= used for sorting. | |
DTTSCand & | operator= (const DTTSCand &tscand) |
Assignment operator. | |
void | print () const |
Print the trigger. | |
void | resetCarry () |
Reset the carry bit. | |
void | setBitsBkmod () |
Set the bits for TSM back-up mode. | |
void | setBitsTsm () |
Set the quality bits for DTTSM analysis. | |
void | setBitsTss () |
Set the quality bits for DTTSS analysis. | |
void | setSecondTrack () |
Set the first track bit to second track (used for carry). | |
int | TcPos () const |
Retrun the TRACO position inside the TSS. | |
int | tracoNumber () const |
Return the TRACO number. | |
const DTTracoTrigData * | tracoTr () const |
Return associated TRACO trigger. | |
DTTSS * | tss () const |
Return the DTTSS. | |
int | tssNumber () const |
Return the DTTSS number. | |
~DTTSCand () | |
Destructor. | |
Private Attributes | |
BitArray< 15 > | _dataword |
int | _isCarry |
int | _tcPos |
const DTTracoTrigData * | _tctrig |
DTTSS * | _tss |
Definition at line 37 of file DTTSCand.h.
DTTSCand::DTTSCand | ( | DTTSS * | tss, | |
const DTTracoTrigData * | tctrig, | |||
int | ifs, | |||
int | pos | |||
) |
Constructor.
Definition at line 36 of file DTTSCand.cc.
References _dataword, BitArray< N >::one(), and BitArray< N >::unset().
00038 : _tss(tss), _tctrig(tctrig), _tcPos(pos), _isCarry(0) { 00039 00040 _dataword.one(); // reset dataword to 0x1ff 00041 00042 // SM sector collector Set bit 14 instead of 8, for 1st/2nd track to allow extra space 00043 // if(ifs==1)_dataword.unset(8); // set bit 8 (0=first, 1=second tracks) 00044 if(ifs==1)_dataword.unset(14); // set bit 14 (0=first, 1=second tracks) 00045 00046 }
DTTSCand::DTTSCand | ( | ) |
DTTSCand::DTTSCand | ( | const DTTSCand & | tscand | ) |
DTTSCand::~DTTSCand | ( | ) |
void DTTSCand::clearBits | ( | ) | [inline] |
Clear (set to 1) the quality bits (but first/second track bit).
Definition at line 73 of file DTTSCand.h.
References _dataword, and BitArray< N >::assign().
Referenced by setBitsTsm(), and setBitsTss().
void DTTSCand::clearBitsBkmod | ( | ) | [inline] |
Clear (set to 1) all the bits (back-up mode).
Definition at line 76 of file DTTSCand.h.
References _dataword, and BitArray< N >::assign().
Referenced by setBitsBkmod().
DTConfigTSPhi* DTTSCand::config | ( | ) | const [inline] |
Configuration set.
Definition at line 82 of file DTTSCand.h.
References _tss, and DTTSS::config().
Referenced by setBitsTsm(), and setBitsTss().
unsigned DTTSCand::dataword | ( | ) | const [inline] |
Return an uint16 with the content of the data word (for debugging).
Definition at line 136 of file DTTSCand.h.
References _dataword, and BitArray< N >::dataWord().
Referenced by DTTSS::sortTSS1(), and DTTSS::sortTSS2().
int DTTSCand::is0H | ( | ) | const [inline] |
Return if H outer.
Definition at line 127 of file DTTSCand.h.
References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().
int DTTSCand::is0L | ( | ) | const [inline] |
Return if L outer.
Definition at line 133 of file DTTSCand.h.
References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().
int DTTSCand::isCarry | ( | ) | const [inline] |
Return the carry bit.
Definition at line 112 of file DTTSCand.h.
References _isCarry.
Referenced by setBitsTsm(), setBitsTss(), and DTTSS::sortTSS2().
00112 { return _isCarry; }
int DTTSCand::isCorr | ( | ) | const [inline] |
Return correlation bit.
Definition at line 109 of file DTTSCand.h.
References _tctrig, and DTTracoTrigData::pvCorr().
Referenced by print(), DTTSPhi::runTSPhi(), setBitsTsm(), setBitsTss(), DTTSM::sortTSM1(), DTTSM::sortTSM2(), DTTSS::sortTSS1(), and DTTSS::sortTSS2().
int DTTSCand::isFirst | ( | ) | const [inline] |
Return the first/second track bit.
Definition at line 100 of file DTTSCand.h.
References _dataword, and BitArray< N >::element().
Referenced by DTTSM::addCand(), DTTSS::addDTTSCand(), print(), DTTSS::sortTSS1(), and DTTSS::sortTSS2().
int DTTSCand::isH0 | ( | ) | const [inline] |
Return if H inner.
Definition at line 124 of file DTTSCand.h.
References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().
int DTTSCand::isHHorHL | ( | ) | const [inline] |
Return if HH or HL.
Definition at line 115 of file DTTSCand.h.
References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().
int DTTSCand::isHtrig | ( | ) | const [inline] |
Return HTRIG/LTRIG bit.
Definition at line 103 of file DTTSCand.h.
References _tctrig, and DTTracoTrigData::pvCode().
Referenced by print(), DTTSPhi::runTSPhi(), setBitsTsm(), and setBitsTss().
int DTTSCand::isInner | ( | ) | const [inline] |
Return Inner/Outer bit.
Definition at line 106 of file DTTSCand.h.
References _tctrig, and DTTracoTrigData::pvCode().
Referenced by print(), DTTSPhi::runTSPhi(), setBitsTsm(), setBitsTss(), DTTSM::sortTSM1(), DTTSM::sortTSM2(), DTTSS::sortTSS1(), and DTTSS::sortTSS2().
int DTTSCand::isL0 | ( | ) | const [inline] |
Return if L inner.
Definition at line 130 of file DTTSCand.h.
References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().
int DTTSCand::isLH | ( | ) | const [inline] |
Return if LH.
Definition at line 118 of file DTTSCand.h.
References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().
int DTTSCand::isLL | ( | ) | const [inline] |
Return if LL.
Definition at line 121 of file DTTSCand.h.
References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().
Assignment operator.
Definition at line 70 of file DTTSCand.cc.
References _isCarry, _tcPos, _tctrig, and _tss.
00070 { 00071 if(this != &tscand){ 00072 _tss = tscand._tss; 00073 _tctrig = tscand._tctrig; 00074 _tcPos = tscand._tcPos; 00075 _isCarry = tscand._isCarry; 00076 } 00077 return *this; 00078 }
Print the trigger.
Definition at line 263 of file DTTSCand.cc.
References _dataword, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), isCorr(), isFirst(), isHtrig(), isInner(), BitArray< N >::print(), DTTracoTrigData::pvK(), and tracoTr().
00263 { 00264 std::cout << " First=" << isFirst(); 00265 std::cout << " HTRIG=" << isHtrig(); 00266 std::cout << " Inner=" << isInner(); 00267 std::cout << " Corr=" << isCorr(); 00268 std::cout << " Kpv=" << tracoTr()->pvK(); 00269 std::cout << " dataword="; 00270 _dataword.print(); 00271 std::cout << std::endl; 00272 }
void DTTSCand::resetCarry | ( | ) | [inline] |
Reset the carry bit.
Definition at line 70 of file DTTSCand.h.
References _isCarry.
00070 { _isCarry=0; }
void DTTSCand::setBitsBkmod | ( | ) |
Set the bits for TSM back-up mode.
Definition at line 163 of file DTTSCand.cc.
References _dataword, _tctrig, a1, a2, clearBitsBkmod(), DTTracoTrigData::qdec(), and BitArray< N >::unset().
Referenced by DTTSM::sortTSM1(), and DTTSM::sortTSM2().
00163 { 00164 // first/second track already set. Set other 4 bits (1 for null, 3 for a2, a1, a0) 00165 clearBitsBkmod(); 00166 // std::cout << " clearbits in TSM bk mode " << _dataword.print() << std::endl; 00167 00168 int a2 = 6; 00169 int a1 = 5; 00170 int a0 = 4; 00171 // 00172 // std::cout << " _tctrig->qdec(): " << _tctrig->qdec() << std::endl; 00173 if( _tctrig->qdec()==6 ) { _dataword.unset(a2); _dataword.unset(a1); _dataword.unset(a0); } // 1-000 00174 if( _tctrig->qdec()==5 ) { _dataword.unset(a2); _dataword.unset(a1); } // 1-001 00175 if( _tctrig->qdec()==4 ) { _dataword.unset(a2); _dataword.unset(a0); } // 1-010 00176 if( _tctrig->qdec()==3 ) { _dataword.unset(a1); } // 1-101 00177 if( _tctrig->qdec()==2 ) { _dataword.unset(a1); _dataword.unset(a0); } // 1-100 00178 00179 if( _tctrig->qdec()==0 ) { _dataword.unset(a0); } // 1-110 00180 00181 // std::cout << " set Bits TSM back up " << _dataword.print() << std::endl; 00182 }
void DTTSCand::setBitsTsm | ( | ) |
Set the quality bits for DTTSM analysis.
Definition at line 186 of file DTTSCand.cc.
References _dataword, _tctrig, BitArray< N >::assign(), clearBits(), config(), GenMuonPlsPt100GeV_cfg::cout, BitArray< N >::element(), lat::endl(), isCarry(), isCorr(), isHtrig(), isInner(), DTTracoTrigData::pvK(), DTConfigTSPhi::TsmCorrEna(), DTConfigTSPhi::TsmCorrEnaCarry(), DTConfigTSPhi::TsmHtrigEna(), DTConfigTSPhi::TsmHtrigEnaCarry(), DTConfigTSPhi::TsmInOutEna(), DTConfigTSPhi::TsmInOutEnaCarry(), DTConfigTSPhi::TsmMasking(), DTConfigTSPhi::TssMasking(), and BitArray< N >::unset().
00186 { 00187 // first/second track already set. Set other 3 bits 00188 int itk=_dataword.element(14); // first tracks 0, second tracks 1 00189 00190 clearBits(); 00191 00192 if(_tctrig->pvK()>31|| _tctrig->pvK()<0){ // Check K within 5 bits range 00193 std::cout << "DTTSCand::setBitsTsm pvK outside valid range: " << _tctrig->pvK(); 00194 std::cout << " deltaPsiR set to 31" << std::endl; 00195 } 00196 else { 00197 // SM double TSM 00198 // assign preview in dataword (common to any other assignment) 00199 _dataword.assign(0,5,_tctrig->pvK()); 00200 // _dataword.assign(0,5,0); 00201 // 00202 00203 int posH=-1; 00204 int posI=-1; 00205 int posC=-1; 00206 switch(config()->TsmMasking(itk)) { 00207 case 123: // H/L, In/Out, Corr/NotC 00208 posH = 7; 00209 posI = 6; 00210 posC = 5; 00211 break; 00212 case 132: // H/L, Corr/NotC, In/Out 00213 posH = 7; 00214 posI = 5; 00215 posC = 6; 00216 break; 00217 case 213: // In/Out, H/L, Corr/NotC 00218 posH = 6; 00219 posI = 7; 00220 posC = 5; 00221 break; 00222 case 231: // In/Out, Corr/NotC, H/L 00223 posH = 5; 00224 posI = 7; 00225 posC = 6; 00226 break; 00227 case 312: // Corr/NotC, H/L, In/Out 00228 posH = 6; 00229 posI = 5; 00230 posC = 7; 00231 break; 00232 case 321: // Corr/NotC, In/Out, H/L 00233 posH = 5; 00234 posI = 6; 00235 posC = 7; 00236 break; 00237 default: 00238 std::cout << "DTTSCand::DTTSCand(): masking not correct: "; 00239 std::cout << config()->TssMasking(itk); 00240 std::cout << " All bits set to 1" << std::endl; 00241 00242 // Masking: 00243 bool enaH = config()->TsmHtrigEna(itk); 00244 bool enaI = config()->TsmInOutEna(itk); 00245 bool enaC = config()->TsmCorrEna(itk) ; 00246 if(isCarry()) { 00247 // Special setting for carry 00248 enaH = config()->TsmHtrigEnaCarry(); 00249 enaI = config()->TsmInOutEnaCarry(); 00250 enaC = config()->TsmCorrEnaCarry() ; 00251 } 00252 // Bits set to 0 give higher priority: 00253 if(isHtrig()&&enaH&&posH>0)_dataword.unset(posH); 00254 if(isInner()&&enaI&&posI>0)_dataword.unset(posI); 00255 if(isCorr() &&enaC&&posC>0)_dataword.unset(posC); 00256 00257 } 00258 } 00259 00260 00261 }
void DTTSCand::setBitsTss | ( | ) |
Set the quality bits for DTTSS analysis.
Definition at line 90 of file DTTSCand.cc.
References _dataword, _tctrig, BitArray< N >::assign(), clearBits(), config(), GenMuonPlsPt100GeV_cfg::cout, BitArray< N >::element(), lat::endl(), isCarry(), isCorr(), isHtrig(), isInner(), DTTracoTrigData::pvK(), DTConfigTSPhi::TssCorrEna(), DTConfigTSPhi::TssCorrEnaCarry(), DTConfigTSPhi::TssHtrigEna(), DTConfigTSPhi::TssHtrigEnaCarry(), DTConfigTSPhi::TssInOutEna(), DTConfigTSPhi::TssInOutEnaCarry(), DTConfigTSPhi::TssMasking(), and BitArray< N >::unset().
Referenced by DTTSM::sortTSM1(), DTTSM::sortTSM2(), DTTSS::sortTSS1(), and DTTSS::sortTSS2().
00090 { 00091 // first/second track already set. Set other 3 bits 00092 int itk=_dataword.element(14); // first tracks 0, second tracks 1 00093 00094 clearBits(); 00095 if(_tctrig->pvK()>32|| _tctrig->pvK()<0){ // Check K within 5 bits range 00096 std::cout << "DTTSCand::setBitsTss() pvK outside valid range: " << _tctrig->pvK(); 00097 std::cout << " deltaPsiR set to 31" << std::endl; 00098 } 00099 else { 00100 // assign preview in dataword (common to any other assignment) 00101 _dataword.assign(0,5,_tctrig->pvK()); 00102 // _dataword.assign(0,5,0); 00103 00104 int posH=-1; 00105 int posI=-1; 00106 int posC=-1; 00107 switch(config()->TssMasking(itk)) { 00108 case 123: // H/L, In/Out, Corr/NotC 00109 posH = 7; 00110 posI = 6; 00111 posC = 5; 00112 break; 00113 case 132: // H/L, Corr/NotC, In/Out 00114 posH = 7; 00115 posI = 5; 00116 posC = 6; 00117 break; 00118 case 213: // In/Out, H/L, Corr/NotC 00119 posH = 6; 00120 posI = 7; 00121 posC = 5; 00122 break; 00123 case 231: // In/Out, Corr/NotC, H/L 00124 posH = 5; 00125 posI = 7; 00126 posC = 6; 00127 break; 00128 case 312: // Corr/NotC, H/L, In/Out 00129 posH = 6; 00130 posI = 5; 00131 posC = 7; 00132 break; 00133 case 321: // Corr/NotC, In/Out, H/L 00134 posH = 5; 00135 posI = 6; 00136 posC = 7; 00137 break; 00138 default: 00139 std::cout << "DTTSCand::DTTSCand(): masking not correct: "; 00140 std::cout << config()->TssMasking(itk); 00141 std::cout << " All bits set to 1" << std::endl; 00142 } 00143 // Masking: 00144 bool enaH = config()->TssHtrigEna(itk); 00145 bool enaI = config()->TssInOutEna(itk); 00146 bool enaC = config()->TssCorrEna(itk) ; 00147 if(isCarry()) { 00148 // Special setting for carry 00149 enaH = config()->TssHtrigEnaCarry(); 00150 enaI = config()->TssInOutEnaCarry(); 00151 enaC = config()->TssCorrEnaCarry() ; 00152 } 00153 // Bits set to 0 give higher priority: 00154 if(isHtrig()&&enaH&&posH>0)_dataword.unset(posH); 00155 if(isInner()&&enaI&&posI>0)_dataword.unset(posI); 00156 if(isCorr() &&enaC&&posC>0)_dataword.unset(posC); 00157 } 00158 00159 }
void DTTSCand::setSecondTrack | ( | ) | [inline] |
Set the first track bit to second track (used for carry).
Definition at line 67 of file DTTSCand.h.
References _dataword, _isCarry, and BitArray< N >::set().
Referenced by DTTSM::sortTSM1(), and DTTSS::sortTSS1().
int DTTSCand::TcPos | ( | ) | const [inline] |
Retrun the TRACO position inside the TSS.
Definition at line 88 of file DTTSCand.h.
References _tcPos.
Referenced by DTTSM::sortTSM1(), DTTSM::sortTSM2(), DTTSS::sortTSS1(), and DTTSS::sortTSS2().
00088 { return _tcPos; }
int DTTSCand::tracoNumber | ( | ) | const [inline] |
Return the TRACO number.
Definition at line 97 of file DTTSCand.h.
References _tctrig, and DTTracoTrigData::tracoNumber().
00097 { return _tctrig->tracoNumber(); }
const DTTracoTrigData* DTTSCand::tracoTr | ( | ) | const [inline] |
Return associated TRACO trigger.
Definition at line 85 of file DTTSCand.h.
References _tctrig.
Referenced by DTTSM::getTracoT(), DTTSS::getTracoT(), print(), and DTTSPhi::runTSPhi().
00085 { return _tctrig; }
DTTSS* DTTSCand::tss | ( | ) | const [inline] |
int DTTSCand::tssNumber | ( | ) | const [inline] |
Return the DTTSS number.
Definition at line 94 of file DTTSCand.h.
References _tss, and DTTSS::number().
Referenced by DTTSM::sortTSM1(), and DTTSM::sortTSM2().
BitArray<15> DTTSCand::_dataword [private] |
Definition at line 153 of file DTTSCand.h.
Referenced by clear(), clearBits(), clearBitsBkmod(), dataword(), DTTSCand(), isFirst(), operator<(), operator<=(), print(), setBitsBkmod(), setBitsTsm(), setBitsTss(), and setSecondTrack().
int DTTSCand::_isCarry [private] |
Definition at line 157 of file DTTSCand.h.
Referenced by clear(), isCarry(), operator=(), resetCarry(), and setSecondTrack().
int DTTSCand::_tcPos [private] |
const DTTracoTrigData* DTTSCand::_tctrig [private] |
Definition at line 152 of file DTTSCand.h.
Referenced by clear(), is0H(), is0L(), isCorr(), isH0(), isHHorHL(), isHtrig(), isInner(), isL0(), isLH(), isLL(), operator=(), setBitsBkmod(), setBitsTsm(), setBitsTss(), tracoNumber(), and tracoTr().
DTTSS* DTTSCand::_tss [private] |
Definition at line 151 of file DTTSCand.h.
Referenced by config(), operator=(), tss(), and tssNumber().