CMS 3D CMS Logo

DTTSCand Class Reference

A Trigger Server Candidate. More...

#include <L1Trigger/DTTriggerServerPhi/interface/DTTSCand.h>

List of all members.

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).
DTConfigTSPhiconfig () 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.
DTTSCandoperator= (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 DTTracoTrigDatatracoTr () const
 Return associated TRACO trigger.
DTTSStss () 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


Detailed Description

A Trigger Server Candidate.

Date
2008/06/30 13:43:31
Revision
1.5

Author:
C. Grandi, D. Bonacorsi, S. Marcellini

Definition at line 37 of file DTTSCand.h.


Constructor & Destructor Documentation

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 (  ) 

Constructor.

Definition at line 56 of file DTTSCand.cc.

00056 {}

DTTSCand::DTTSCand ( const DTTSCand tscand  ) 

Constructor.

Definition at line 48 of file DTTSCand.cc.

00049   : _tss(tscand._tss), _tctrig(tscand._tctrig), _tcPos(tscand._tcPos), 
00050   _isCarry(tscand._isCarry) {
00051 
00052  
00053 }

DTTSCand::~DTTSCand (  ) 

Destructor.

Definition at line 61 of file DTTSCand.cc.

00061                    {
00062 }


Member Function Documentation

void DTTSCand::clear ( void   )  [inline]

Clear the trigger.

Definition at line 81 of file DTTSCand.cc.

References _dataword, _isCarry, _tctrig, and BitArray< N >::one().

00081                  { 
00082   _tctrig=0; 
00083   _dataword.one();
00084 
00085   _isCarry=0;
00086 
00087 }

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().

00073 { _dataword.assign(5,3,0x7); }

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().

00076 { _dataword.assign(0,7,0xff); }

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().

00082 { return _tss->config(); }

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().

00136 { return _dataword.dataWord(0)&0x1ff; }

int DTTSCand::is0H (  )  const [inline]

Return if H outer.

Definition at line 127 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

00127 { return !_tctrig->pvCorr() && _tctrig->pvCode()==8; }

int DTTSCand::is0L (  )  const [inline]

Return if L outer.

Definition at line 133 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

00133 {  return !_tctrig->pvCorr() && _tctrig->pvCode()<8; }

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().

00109 { return _tctrig->pvCorr(); }

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().

00100 { return _dataword.element(14)==0; }

int DTTSCand::isH0 (  )  const [inline]

Return if H inner.

Definition at line 124 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

00124 { return !_tctrig->pvCorr() && _tctrig->pvCode()==80; }

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().

00115 { return _tctrig->pvCorr() && _tctrig->pvCode()==80; }

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().

00103                                { return _tctrig->pvCode()==8 || 
00104                                         _tctrig->pvCode()==80; }

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().

00106 { return _tctrig->pvCode()>8; }

int DTTSCand::isL0 (  )  const [inline]

Return if L inner.

Definition at line 130 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

00130                             {  return !_tctrig->pvCorr() && _tctrig->pvCode()<80 &&
00131                                                             _tctrig->pvCode()>8; }

int DTTSCand::isLH (  )  const [inline]

Return if LH.

Definition at line 118 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

00118 { return _tctrig->pvCorr() && _tctrig->pvCode()==8; }

int DTTSCand::isLL (  )  const [inline]

Return if LL.

Definition at line 121 of file DTTSCand.h.

References _tctrig, DTTracoTrigData::pvCode(), and DTTracoTrigData::pvCorr().

00121                             { return _tctrig->pvCorr() && !_tctrig->pvCode()==8 &&
00122                                                           !_tctrig->pvCode()==80; }  

bool DTTSCand::operator< ( const DTTSCand c  )  const [inline]

Operator < used for sorting.

Definition at line 139 of file DTTSCand.h.

References _dataword.

00139 { return _dataword<c._dataword; }

bool DTTSCand::operator<= ( const DTTSCand c  )  const [inline]

Operator <= used for sorting.

Definition at line 142 of file DTTSCand.h.

References _dataword.

00142 { return _dataword<=c._dataword; }

DTTSCand & DTTSCand::operator= ( const DTTSCand tscand  ) 

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 }

void DTTSCand::print ( void   )  const

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().

00067 { _dataword.set(14); _isCarry=1; }

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]

Return the DTTSS.

Definition at line 91 of file DTTSCand.h.

References _tss.

00091 { return _tss; }

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().

00094 { return _tss->number(); }


Member Data Documentation

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]

Definition at line 155 of file DTTSCand.h.

Referenced by operator=(), and TcPos().

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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:10 2009 for CMSSW by  doxygen 1.5.4