CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DTSectCollPhCand Class Reference

#include <DTSectCollPhCand.h>

Public Member Functions

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

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

31  : _tsc(tsc), _tsmsegm(tsmsegm) {
32  _dataword.one(); // reset dataword to 0x1ff
33  if(ifs==1)_dataword.unset(14); // set bit 14 (0=first, 1=second tracks)
34 }
const DTChambPhSegm * _tsmsegm
void one()
Definition: BitArray.h:223
void unset(const int i)
Definition: BitArray.h:231
BitArray< 15 > _dataword
DTSectCollPhCand::DTSectCollPhCand ( )

Constructor.

Definition at line 37 of file DTSectCollPhCand.cc.

37  {
38 
39 }
DTSectCollPhCand::DTSectCollPhCand ( const DTSectCollPhCand tsccand)

Constructor.

DTSectCollPhCand::~DTSectCollPhCand ( )

Destructor.

Definition at line 44 of file DTSectCollPhCand.cc.

44  {
45 }

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

62  {
63  _tsmsegm=0;
64  _dataword.one();
65 // std::cout << " clear dataword : " << _dataword.print() << std::endl;
66 }
const DTChambPhSegm * _tsmsegm
void one()
Definition: BitArray.h:223
BitArray< 15 > _dataword
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().

59 { _dataword.assign(5,3,0x7); }
void assign(const int p, const int n, const int val)
Definition: BitArray.h:239
BitArray< 15 > _dataword
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().

62 { _dataword.assign(0,13,0x1fff); }
void assign(const int p, const int n, const int val)
Definition: BitArray.h:239
BitArray< 15 > _dataword
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().

69  {
70  int sect= _tsmsegm->ChamberId().sector();
71  if (sect<13)
72  return config()->CoarseSync(_tsmsegm->ChamberId().station());
73  else
74  return config()->CoarseSync(5);
75 }
const DTChambPhSegm * _tsmsegm
DTChamberId ChamberId() const
Return chamber identifier.
Definition: DTChambPhSegm.h:83
int CoarseSync(int istat) const
Return coarsesync parameter in Sector Collector for station istat (5 is second MB4 station) ...
DTConfigSectColl * config() const
Configuration set.
int sector() const
Definition: DTChamberId.h:63
int station() const
Return the station number.
Definition: DTChamberId.h:53
DTConfigSectColl* DTSectCollPhCand::config ( void  ) const
inline

Configuration set.

Definition at line 79 of file DTSectCollPhCand.h.

References _tsc, and DTSC::config().

Referenced by CoarseSync().

79 { return _tsc->config(); }
DTConfigSectColl * config() const
Configuration set.
Definition: DTSC.h:87
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().

91 { return _dataword.dataWord(0)&0x1ff; }
unsigned dataWord(const int i) const
Definition: BitArray.h:128
BitArray< 15 > _dataword
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().

85 { return _dataword.element(14)==0; }
int element(const int pos) const
Definition: BitArray.h:210
BitArray< 15 > _dataword
bool DTSectCollPhCand::operator< ( const DTSectCollPhCand c) const
inline

Operator < used for sorting.

Definition at line 94 of file DTSectCollPhCand.h.

References _dataword.

94 { return _dataword<c._dataword; }
BitArray< 15 > _dataword
bool DTSectCollPhCand::operator<= ( const DTSectCollPhCand c) const
inline

Operator <= used for sorting.

Definition at line 97 of file DTSectCollPhCand.h.

References _dataword.

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

Assignment operator.

Definition at line 53 of file DTSectCollPhCand.cc.

References _tsc, and _tsmsegm.

53  {
54  if(this != &tsccand){
55  _tsc = tsccand._tsc;
56  _tsmsegm = tsccand._tsmsegm;
57  }
58  return *this;
59 }
const DTChambPhSegm * _tsmsegm
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().

110  {
111  std::cout << "Sector Collector Phi Candidate: " << std::endl;
112  if(_dataword.element(14)==0) {std::cout << "First track type" << std::endl;}
113  else {std::cout << "Second track type" << std::endl;}
114  std::cout << " code=" << _tsmsegm->pvCode();
115  std::cout << " dataword=";
116  _dataword.print();
117  // SM double TSM remove datawordbk section
118  std::cout << " SC step=" << CoarseSync()+_tsmsegm->step();
119  std::cout << std::endl;
120  }
const DTChambPhSegm * _tsmsegm
int step() const
Return step number.
Definition: DTChambPhSegm.h:80
int CoarseSync() const
Return the Coarse Sync Parameter.
int element(const int pos) const
Definition: BitArray.h:210
int pvCode() const
Return the preview code (10*inner_code or outer_code; X_code=1,2,3,4,8)
BitArray< 15 > _dataword
tuple cout
Definition: gather_cfg.py:121
std::ostream & print(std::ostream &o=std::cout) const
Definition: BitArray.h:345
void DTSectCollPhCand::resetCarry ( )
inline

Reset the carry bit.

Definition at line 68 of file DTSectCollPhCand.h.

References _isCarry.

68 { _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().

79  {
80 
82 
83  if(abs(_tsmsegm->DeltaPsiR())>1024 ){ // Check phiB within 10 bits range
84  std::cout << "DTSectCollPhCand::setBitsSectColl phiB outside valid range: " << _tsmsegm->DeltaPsiR();
85  std::cout << " deltaPsiR set to 512" << std::endl;
86  }
87  else {
88  // SM double TSM
89  // assign preview in dataword (common to any other assignment)
91  //
92  int a2 = 12;
93  int a1 = 11;
94  int a0 = 10;
95 
96  if( _tsmsegm->code()==6 ) { _dataword.unset(a2); _dataword.unset(a1); _dataword.unset(a0); } // 1-000
97  if( _tsmsegm->code()==5 ) { _dataword.unset(a2); _dataword.unset(a1); } // 1-001
98  if( _tsmsegm->code()==4 ) { _dataword.unset(a2); _dataword.unset(a0); } // 1-010
99  if( _tsmsegm->code()==3 ) { _dataword.unset(a1); } // 1-101
100  if( _tsmsegm->code()==2 ) { _dataword.unset(a1); _dataword.unset(a0); } // 1-100
101  // if( _tsmsegm->code()==1 ) no unset needed => 111
102  if( _tsmsegm->code()==0 ) { _dataword.unset(a0); } // 1-110
103 
104  }
105 
106 }
const DTChambPhSegm * _tsmsegm
void clearBitsSectColl()
Clear (set to 1) the quality bits for Sector Collector.
int code() const
Return trigger code (MTTF input format [0,7])
Definition: DTChambPhSegm.h:95
#define abs(x)
Definition: mlp_lapack.h:159
void unset(const int i)
Definition: BitArray.h:231
int DeltaPsiR() const
Return bending angle (bit pattern)
void assign(const int p, const int n, const int val)
Definition: BitArray.h:239
BitArray< 15 > _dataword
tuple cout
Definition: gather_cfg.py:121
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().

65 { _dataword.set(14); _isCarry=1; }
BitArray< 15 > _dataword
void set(const int i)
Definition: BitArray.h:230
DTSC* DTSectCollPhCand::tsc ( ) const
inline

Return the DTTSS.

Definition at line 82 of file DTSectCollPhCand.h.

References _tsc.

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

88 { return _tsmsegm; }
const DTChambPhSegm * _tsmsegm

Member Data Documentation

BitArray<15> DTSectCollPhCand::_dataword
private
int DTSectCollPhCand::_isCarry
private

Definition at line 114 of file DTSectCollPhCand.h.

Referenced by resetCarry(), and setSecondTrack().

DTSC* DTSectCollPhCand::_tsc
private

Definition at line 108 of file DTSectCollPhCand.h.

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

const DTChambPhSegm* DTSectCollPhCand::_tsmsegm
private

Definition at line 109 of file DTSectCollPhCand.h.

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