CMS 3D CMS Logo

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...
 
const 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

D. Bonacorsi, S. Marcellini

Definition at line 32 of file DTSectCollPhCand.h.

Constructor & Destructor Documentation

◆ DTSectCollPhCand() [1/3]

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

Constructor.

Definition at line 29 of file DTSectCollPhCand.cc.

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

29  : _tsc(tsc), _tsmsegm(tsmsegm) {
30  _dataword.one(); // reset dataword to 0x1ff
31  if (ifs == 1)
32  _dataword.unset(14); // set bit 14 (0=first, 1=second tracks)
33 }
const DTChambPhSegm * _tsmsegm
DTSC * tsc() const
Return the DTTSS.
void one()
Definition: BitArray.h:217
void unset(const int i)
Definition: BitArray.h:225
BitArray< 15 > _dataword

◆ DTSectCollPhCand() [2/3]

DTSectCollPhCand::DTSectCollPhCand ( )

Constructor.

Definition at line 35 of file DTSectCollPhCand.cc.

35 {}

◆ DTSectCollPhCand() [3/3]

DTSectCollPhCand::DTSectCollPhCand ( const DTSectCollPhCand tsccand)

Constructor.

◆ ~DTSectCollPhCand()

DTSectCollPhCand::~DTSectCollPhCand ( )

Destructor.

Definition at line 40 of file DTSectCollPhCand.cc.

40 {}

Member Function Documentation

◆ clear()

void DTSectCollPhCand::clear ( void  )
inline

Set the SC Candidate step.

Clear the trigger

Definition at line 54 of file DTSectCollPhCand.cc.

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

54  {
55  _tsmsegm = nullptr;
56  _dataword.one();
57  // std::cout << " clear dataword : " << _dataword.print() << std::endl;
58 }
const DTChambPhSegm * _tsmsegm
void one()
Definition: BitArray.h:217
BitArray< 15 > _dataword

◆ clearBits()

void DTSectCollPhCand::clearBits ( )
inline

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

Definition at line 55 of file DTSectCollPhCand.h.

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

55 { _dataword.assign(5, 3, 0x7); }
void assign(const int p, const int n, const int val)
Definition: BitArray.h:233
BitArray< 15 > _dataword

◆ clearBitsSectColl()

void DTSectCollPhCand::clearBitsSectColl ( )
inline

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

Definition at line 58 of file DTSectCollPhCand.h.

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

Referenced by setBitsSectColl().

58 { _dataword.assign(0, 13, 0x1fff); }
void assign(const int p, const int n, const int val)
Definition: BitArray.h:233
BitArray< 15 > _dataword

◆ CoarseSync()

int DTSectCollPhCand::CoarseSync ( ) const

Return the Coarse Sync Parameter.

Definition at line 60 of file DTSectCollPhCand.cc.

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

Referenced by print().

60  {
61  int sect = _tsmsegm->ChamberId().sector();
62  if (sect < 13)
63  return config()->CoarseSync(_tsmsegm->ChamberId().station());
64  else
65  return config()->CoarseSync(5);
66 }
const DTChambPhSegm * _tsmsegm
int station() const
Return the station number.
Definition: DTChamberId.h:45
int CoarseSync(int istat) const
Return coarsesync parameter in Sector Collector for station istat (5 is second MB4 station) ...
DTChamberId ChamberId() const override
Return chamber identifier.
Definition: DTChambPhSegm.h:76
const DTConfigSectColl * config() const
Configuration set.
int sector() const
Definition: DTChamberId.h:52

◆ config()

const DTConfigSectColl* DTSectCollPhCand::config ( void  ) const
inline

Configuration set.

Definition at line 77 of file DTSectCollPhCand.h.

References _tsc, and DTSC::config().

Referenced by CoarseSync().

77 { return _tsc->config(); }
const DTConfigSectColl * config() const
Configuration set.
Definition: DTSC.h:82

◆ dataword()

unsigned DTSectCollPhCand::dataword ( ) const
inline

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

Definition at line 89 of file DTSectCollPhCand.h.

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

89 { return _dataword.dataWord(0) & 0x1ff; }
BitArray< 15 > _dataword
unsigned dataWord(const int i) const
Definition: BitArray.h:124

◆ isFirst()

int DTSectCollPhCand::isFirst ( ) const
inline

Return first/second track bit value.

Definition at line 83 of file DTSectCollPhCand.h.

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

83 { return _dataword.element(14) == 0; }
BitArray< 15 > _dataword
int element(const int pos) const
Definition: BitArray.h:206

◆ operator<()

bool DTSectCollPhCand::operator< ( const DTSectCollPhCand c) const
inline

Operator < used for sorting.

Definition at line 92 of file DTSectCollPhCand.h.

References _dataword, and HltBtagPostValidation_cff::c.

92 { return _dataword < c._dataword; }
BitArray< 15 > _dataword

◆ operator<=()

bool DTSectCollPhCand::operator<= ( const DTSectCollPhCand c) const
inline

Operator <= used for sorting.

Definition at line 95 of file DTSectCollPhCand.h.

References _dataword, and HltBtagPostValidation_cff::c.

95 { return _dataword <= c._dataword; }
BitArray< 15 > _dataword

◆ operator=()

DTSectCollPhCand & DTSectCollPhCand::operator= ( const DTSectCollPhCand tsccand)

Assignment operator.

Definition at line 46 of file DTSectCollPhCand.cc.

References _tsc, and _tsmsegm.

46  {
47  if (this != &tsccand) {
48  _tsc = tsccand._tsc;
49  _tsmsegm = tsccand._tsmsegm;
50  }
51  return *this;
52 }
const DTChambPhSegm * _tsmsegm

◆ print()

void DTSectCollPhCand::print ( void  ) const

Print the trigger.

Definition at line 111 of file DTSectCollPhCand.cc.

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

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

◆ resetCarry()

void DTSectCollPhCand::resetCarry ( )
inline

Reset the carry bit.

Definition at line 67 of file DTSectCollPhCand.h.

References _isCarry.

67 { _isCarry = 0; }

◆ setBitsSectColl()

void DTSectCollPhCand::setBitsSectColl ( )

Set the bits for DTTSM analysis.

Definition at line 69 of file DTSectCollPhCand.cc.

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

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

69  {
71 
72  if (abs(_tsmsegm->DeltaPsiR()) > 1024) { // Check phiB within 10 bits range
73  std::cout << "DTSectCollPhCand::setBitsSectColl phiB outside valid range: " << _tsmsegm->DeltaPsiR();
74  std::cout << " deltaPsiR set to 512" << std::endl;
75  } else {
76  // SM double TSM
77  // assign preview in dataword (common to any other assignment)
79  //
80  int a2 = 12;
81  int a1 = 11;
82  int a0 = 10;
83 
84  if (_tsmsegm->code() == 6) {
86  _dataword.unset(a1);
88  } // 1-000
89  if (_tsmsegm->code() == 5) {
91  _dataword.unset(a1);
92  } // 1-001
93  if (_tsmsegm->code() == 4) {
96  } // 1-010
97  if (_tsmsegm->code() == 3) {
98  _dataword.unset(a1);
99  } // 1-101
100  if (_tsmsegm->code() == 2) {
101  _dataword.unset(a1);
102  _dataword.unset(a0);
103  } // 1-100
104  // if( _tsmsegm->code()==1 ) no unset needed => 111
105  if (_tsmsegm->code() == 0) {
106  _dataword.unset(a0);
107  } // 1-110
108  }
109 }
const DTChambPhSegm * _tsmsegm
void clearBitsSectColl()
Clear (set to 1) the quality bits for Sector Collector.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void unset(const int i)
Definition: BitArray.h:225
static constexpr float a0
int DeltaPsiR() const
Return bending angle (bit pattern)
void assign(const int p, const int n, const int val)
Definition: BitArray.h:233
BitArray< 15 > _dataword
int code() const
Return trigger code (MTTF input format [0,7])
Definition: DTChambPhSegm.h:88

◆ setSecondTrack()

void DTSectCollPhCand::setSecondTrack ( )
inline

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

Definition at line 61 of file DTSectCollPhCand.h.

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

Referenced by DTSC::DTSectCollsort1().

61  {
62  _dataword.set(14);
63  _isCarry = 1;
64  }
BitArray< 15 > _dataword
void set(const int i)
Definition: BitArray.h:224

◆ tsc()

DTSC* DTSectCollPhCand::tsc ( ) const
inline

Return the DTTSS.

Definition at line 80 of file DTSectCollPhCand.h.

References _tsc.

80 { return _tsc; }

◆ tsTr()

const DTChambPhSegm* DTSectCollPhCand::tsTr ( ) const
inline

Return associated TSPhi trigger.

Definition at line 86 of file DTSectCollPhCand.h.

References _tsmsegm.

86 { return _tsmsegm; }
const DTChambPhSegm * _tsmsegm

Member Data Documentation

◆ _dataword

BitArray<15> DTSectCollPhCand::_dataword
private

◆ _isCarry

int DTSectCollPhCand::_isCarry
private

Definition at line 110 of file DTSectCollPhCand.h.

Referenced by resetCarry(), and setSecondTrack().

◆ _tsc

DTSC* DTSectCollPhCand::_tsc
private

Definition at line 104 of file DTSectCollPhCand.h.

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

◆ _tsmsegm

const DTChambPhSegm* DTSectCollPhCand::_tsmsegm
private

Definition at line 105 of file DTSectCollPhCand.h.

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