CMS 3D CMS Logo

Public Member Functions | Private Attributes

DTSectCollPhCand Class Reference

#include <DTSectCollPhCand.h>

List of all members.

Public Member Functions

void clear ()
 Set the SC Candidate step.
void clearBits ()
 Clear (set to 1) the quality bits (but first/second track bit)
void clearBitsSectColl ()
 Clear (set to 1) the quality bits for Sector Collector.
int CoarseSync () const
 Return the Coarse Sync Parameter.
DTConfigSectCollconfig () const
 Configuration set.
unsigned dataword () const
 Return an uint16 with the content of the data word (for debugging)
 DTSectCollPhCand ()
 Constructor.
 DTSectCollPhCand (DTSC *, const DTChambPhSegm *, int)
 Constructor.
 DTSectCollPhCand (const DTSectCollPhCand &tsccand)
 Constructor.
int isFirst () const
 Return first/second track bit value.
bool operator< (const DTSectCollPhCand &c) const
 Operator < used for sorting.
bool operator<= (const DTSectCollPhCand &c) const
 Operator <= used for sorting.
DTSectCollPhCandoperator= (const DTSectCollPhCand &tsccand)
 Assignment operator.
void print () const
 Print the trigger.
void resetCarry ()
 Reset the carry bit.
void setBitsSectColl ()
 Set the bits for DTTSM analysis.
void setSecondTrack ()
 Set the first track bit to second track (used for carry)
DTSCtsc () const
 Return the DTTSS.
const DTChambPhSegmtsTr () const
 Return associated TSPhi trigger.
 ~DTSectCollPhCand ()
 Destructor.

Private Attributes

BitArray< 15 > _dataword
int _isCarry
DTSC_tsc
const DTChambPhSegm_tsmsegm

Detailed Description

DTSectCollPhCand.h A Trigger Server Phi Candidate

Date:
2008/06/30 13:44:28

D. Bonacorsi, S. Marcellini

Definition at line 34 of file DTSectCollPhCand.h.


Constructor & Destructor Documentation

DTSectCollPhCand::DTSectCollPhCand ( DTSC tsc,
const DTChambPhSegm tsmsegm,
int  ifs 
)

Constructor.

Definition at line 30 of file DTSectCollPhCand.cc.

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

  : _tsc(tsc), _tsmsegm(tsmsegm) {
  _dataword.one();              // reset dataword to 0x1ff
  if(ifs==1)_dataword.unset(14); // set bit 14 (0=first, 1=second tracks)
}
DTSectCollPhCand::DTSectCollPhCand ( )

Constructor.

Definition at line 37 of file DTSectCollPhCand.cc.

                                   {
 
}
DTSectCollPhCand::DTSectCollPhCand ( const DTSectCollPhCand tsccand)

Constructor.

DTSectCollPhCand::~DTSectCollPhCand ( )

Destructor.

Definition at line 44 of file DTSectCollPhCand.cc.

                                   {
}

Member Function Documentation

void DTSectCollPhCand::clear ( void  ) [inline]

Set the SC Candidate step.

Clear the trigger

Definition at line 62 of file DTSectCollPhCand.cc.

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

                         { 
  _tsmsegm=0; 
  _dataword.one();
//   std::cout << " clear dataword : " << _dataword.print() << std::endl;
}
void DTSectCollPhCand::clearBits ( ) [inline]

Clear (set to 1) the quality bits (but first/second track bit)

Definition at line 59 of file DTSectCollPhCand.h.

References _dataword, and BitArray< N >::assign().

{ _dataword.assign(5,3,0x7); }
void DTSectCollPhCand::clearBitsSectColl ( ) [inline]

Clear (set to 1) the quality bits for Sector Collector.

Definition at line 62 of file DTSectCollPhCand.h.

References _dataword, and BitArray< N >::assign().

Referenced by setBitsSectColl().

{ _dataword.assign(0,13,0x1fff); }
int DTSectCollPhCand::CoarseSync ( ) const

Return the Coarse Sync Parameter.

Definition at line 69 of file DTSectCollPhCand.cc.

References _tsmsegm, DTChambPhSegm::ChamberId(), DTConfigSectColl::CoarseSync(), config(), DTChamberId::sector(), and DTChamberId::station().

Referenced by print(), and DTSectColl::runSectColl().

                                  {
  int sect= _tsmsegm->ChamberId().sector();
  if (sect<13) 
    return config()->CoarseSync(_tsmsegm->ChamberId().station());
  else 
    return config()->CoarseSync(5);
}
DTConfigSectColl* DTSectCollPhCand::config ( void  ) const [inline]

Configuration set.

Definition at line 79 of file DTSectCollPhCand.h.

References _tsc, and DTSC::config().

Referenced by CoarseSync().

{ return _tsc->config(); }
unsigned DTSectCollPhCand::dataword ( ) const [inline]

Return an uint16 with the content of the data word (for debugging)

Definition at line 91 of file DTSectCollPhCand.h.

References _dataword, and BitArray< N >::dataWord().

{ return _dataword.dataWord(0)&0x1ff; }
int DTSectCollPhCand::isFirst ( ) const [inline]

Return first/second track bit value.

Definition at line 85 of file DTSectCollPhCand.h.

References _dataword, and BitArray< N >::element().

Referenced by DTSC::addDTSectCollPhCand(), and DTSC::addPhCand().

{ return _dataword.element(14)==0; }
bool DTSectCollPhCand::operator< ( const DTSectCollPhCand c) const [inline]

Operator < used for sorting.

Definition at line 94 of file DTSectCollPhCand.h.

References _dataword.

{ return _dataword<c._dataword; }
bool DTSectCollPhCand::operator<= ( const DTSectCollPhCand c) const [inline]

Operator <= used for sorting.

Definition at line 97 of file DTSectCollPhCand.h.

References _dataword.

{ return _dataword<=c._dataword; }
DTSectCollPhCand & DTSectCollPhCand::operator= ( const DTSectCollPhCand tsccand)

Assignment operator.

Definition at line 53 of file DTSectCollPhCand.cc.

References _tsc, and _tsmsegm.

                                                           {
  if(this != &tsccand){
    _tsc = tsccand._tsc;
    _tsmsegm = tsccand._tsmsegm;
  }
  return *this;
}
void DTSectCollPhCand::print ( void  ) const

Print the trigger.

Definition at line 110 of file DTSectCollPhCand.cc.

References _dataword, _tsmsegm, CoarseSync(), gather_cfg::cout, BitArray< N >::element(), BitArray< N >::print(), DTChambPhSegm::pvCode(), and DTChambPhSegm::step().

                                {
    std::cout << "Sector Collector Phi Candidate: " << std::endl; 
    if(_dataword.element(14)==0) {std::cout << "First track type" << std::endl;}
    else {std::cout << "Second track type" << std::endl;}
       std::cout << " code=" << _tsmsegm->pvCode();
        std::cout << " dataword=";
        _dataword.print();
    // SM double TSM remove datawordbk section
        std::cout << " SC step=" << CoarseSync()+_tsmsegm->step(); 
    std::cout << std::endl;
  }
void DTSectCollPhCand::resetCarry ( ) [inline]

Reset the carry bit.

Definition at line 68 of file DTSectCollPhCand.h.

References _isCarry.

{ _isCarry=0; }
void DTSectCollPhCand::setBitsSectColl ( )

Set the bits for DTTSM analysis.

Definition at line 79 of file DTSectCollPhCand.cc.

References _dataword, _tsmsegm, abs, BitArray< N >::assign(), clearBitsSectColl(), DTChambPhSegm::code(), gather_cfg::cout, DTChambPhSegm::DeltaPsiR(), and BitArray< N >::unset().

Referenced by DTSC::DTSectCollsort1(), and DTSC::DTSectCollsort2().

                                  {

  clearBitsSectColl();
    
  if(abs(_tsmsegm->DeltaPsiR())>1024 ){ // Check phiB within 10 bits range
    std::cout << "DTSectCollPhCand::setBitsSectColl phiB outside valid range: " << _tsmsegm->DeltaPsiR();
    std::cout << " deltaPsiR set to 512" <<  std::endl;
  }
  else {
    // SM double TSM
    // assign preview in dataword (common to any other assignment)
    _dataword.assign(0,10,abs(_tsmsegm->DeltaPsiR()));
    // 
    int a2  = 12;
    int a1  = 11;
    int a0  = 10;
   
    if( _tsmsegm->code()==6 ) { _dataword.unset(a2); _dataword.unset(a1); _dataword.unset(a0); }  // 1-000
    if( _tsmsegm->code()==5 ) { _dataword.unset(a2); _dataword.unset(a1); }                         // 1-001
    if( _tsmsegm->code()==4 ) { _dataword.unset(a2); _dataword.unset(a0); }                         // 1-010
    if( _tsmsegm->code()==3 ) { _dataword.unset(a1); }                                                // 1-101
    if( _tsmsegm->code()==2 ) { _dataword.unset(a1); _dataword.unset(a0); }                         // 1-100
    // if( _tsmsegm->code()==1 ) no unset needed => 111
    if( _tsmsegm->code()==0 ) { _dataword.unset(a0); }                                                // 1-110

  }
  
}
void DTSectCollPhCand::setSecondTrack ( ) [inline]

Set the first track bit to second track (used for carry)

Definition at line 65 of file DTSectCollPhCand.h.

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

Referenced by DTSC::DTSectCollsort1().

{ _dataword.set(14); _isCarry=1; }
DTSC* DTSectCollPhCand::tsc ( ) const [inline]

Return the DTTSS.

Definition at line 82 of file DTSectCollPhCand.h.

References _tsc.

{ return _tsc; }
const DTChambPhSegm* DTSectCollPhCand::tsTr ( ) const [inline]

Return associated TSPhi trigger.

Definition at line 88 of file DTSectCollPhCand.h.

References _tsmsegm.

Referenced by DTSectColl::runSectColl().

{ return _tsmsegm; } 

Member Data Documentation

Definition at line 114 of file DTSectCollPhCand.h.

Referenced by resetCarry(), and setSecondTrack().

Definition at line 108 of file DTSectCollPhCand.h.

Referenced by config(), operator=(), and tsc().

Definition at line 109 of file DTSectCollPhCand.h.

Referenced by clear(), CoarseSync(), operator=(), print(), setBitsSectColl(), and tsTr().