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 ()
 Constructor. More...
 
 DTSectCollPhCand (const DTSectCollPhCand &tsccand)
 Constructor. More...
 
 DTSectCollPhCand (DTSC *, const DTChambPhSegm *, int)
 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

\Class DTSectCollPhCand.h A Trigger Server Phi Candidate

\Authors 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.

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 }

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

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

54  {
55  _tsmsegm = nullptr;
56  _dataword.one();
57  // std::cout << " clear dataword : " << _dataword.print() << std::endl;
58 }

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

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

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

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

◆ clearBitsSectColl()

void DTSectCollPhCand::clearBitsSectColl ( )
inline

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

Definition at line 58 of file DTSectCollPhCand.h.

58 { _dataword.assign(0, 13, 0x1fff); }

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

Referenced by setBitsSectColl().

◆ CoarseSync()

int DTSectCollPhCand::CoarseSync ( ) const

Return the Coarse Sync Parameter.

Definition at line 60 of file DTSectCollPhCand.cc.

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 }

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

Referenced by print().

◆ config()

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

Configuration set.

Definition at line 77 of file DTSectCollPhCand.h.

77 { return _tsc->config(); }

References _tsc, and DTSC::config().

Referenced by CoarseSync().

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

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

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

◆ isFirst()

int DTSectCollPhCand::isFirst ( ) const
inline

Return first/second track bit value.

Definition at line 83 of file DTSectCollPhCand.h.

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

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

◆ operator<()

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

Operator < used for sorting.

Definition at line 92 of file DTSectCollPhCand.h.

92 { return _dataword < c._dataword; }

References _dataword, and HltBtagPostValidation_cff::c.

◆ operator<=()

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

Operator <= used for sorting.

Definition at line 95 of file DTSectCollPhCand.h.

95 { return _dataword <= c._dataword; }

References _dataword, and HltBtagPostValidation_cff::c.

◆ operator=()

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

Assignment operator.

Definition at line 46 of file DTSectCollPhCand.cc.

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

References _tsc, and _tsmsegm.

◆ print()

void DTSectCollPhCand::print ( void  ) const

Print the trigger.

Definition at line 111 of file DTSectCollPhCand.cc.

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 }

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

◆ resetCarry()

void DTSectCollPhCand::resetCarry ( )
inline

Reset the carry bit.

Definition at line 67 of file DTSectCollPhCand.h.

67 { _isCarry = 0; }

References _isCarry.

◆ setBitsSectColl()

void DTSectCollPhCand::setBitsSectColl ( )

Set the bits for DTTSM analysis.

Definition at line 69 of file DTSectCollPhCand.cc.

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 }

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

◆ setSecondTrack()

void DTSectCollPhCand::setSecondTrack ( )
inline

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

Definition at line 61 of file DTSectCollPhCand.h.

61  {
62  _dataword.set(14);
63  _isCarry = 1;
64  }

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

Referenced by DTSC::DTSectCollsort1().

◆ tsc()

DTSC* DTSectCollPhCand::tsc ( ) const
inline

Return the DTTSS.

Definition at line 80 of file DTSectCollPhCand.h.

80 { return _tsc; }

References _tsc.

◆ tsTr()

const DTChambPhSegm* DTSectCollPhCand::tsTr ( ) const
inline

Return associated TSPhi trigger.

Definition at line 86 of file DTSectCollPhCand.h.

86 { return _tsmsegm; }

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

DTChambPhSegm::pvCode
int pvCode() const
Return the preview code (10*inner_code or outer_code; X_code=1,2,3,4,8)
Definition: DTChambPhSegm.h:118
DTConfigSectColl::CoarseSync
int CoarseSync(int istat) const
Return coarsesync parameter in Sector Collector for station istat (5 is second MB4 station)
Definition: DTConfigSectColl.h:67
DTChambPhSegm::code
int code() const
Return trigger code (MTTF input format [0,7])
Definition: DTChambPhSegm.h:88
DTSectCollPhCand::_tsmsegm
const DTChambPhSegm * _tsmsegm
Definition: DTSectCollPhCand.h:105
BitArray::assign
void assign(const int p, const int n, const int val)
Definition: BitArray.h:233
DTSectCollPhCand::CoarseSync
int CoarseSync() const
Return the Coarse Sync Parameter.
Definition: DTSectCollPhCand.cc:60
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTSectCollPhCand::clearBitsSectColl
void clearBitsSectColl()
Clear (set to 1) the quality bits for Sector Collector.
Definition: DTSectCollPhCand.h:58
BitArray::print
std::ostream & print(std::ostream &o=std::cout) const
Definition: BitArray.h:340
testProducerWithPsetDescEmpty_cfi.a2
a2
Definition: testProducerWithPsetDescEmpty_cfi.py:35
BitArray::dataWord
unsigned dataWord(const int i) const
Definition: BitArray.h:124
DTSectCollPhCand::tsc
DTSC * tsc() const
Return the DTTSS.
Definition: DTSectCollPhCand.h:80
BitArray::element
int element(const int pos) const
Definition: BitArray.h:206
BitArray::one
void one()
Definition: BitArray.h:217
DTChambPhSegm::DeltaPsiR
int DeltaPsiR() const
Return bending angle (bit pattern)
Definition: DTChambPhSegm.h:109
DTSC::config
const DTConfigSectColl * config() const
Configuration set.
Definition: DTSC.h:82
DTSectCollPhCand::_isCarry
int _isCarry
Definition: DTSectCollPhCand.h:110
DTSectCollPhCand::_tsc
DTSC * _tsc
Definition: DTSectCollPhCand.h:104
DTChambPhSegm::ChamberId
DTChamberId ChamberId() const override
Return chamber identifier.
Definition: DTChambPhSegm.h:76
DTSectCollPhCand::config
const DTConfigSectColl * config() const
Configuration set.
Definition: DTSectCollPhCand.h:77
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
BitArray::unset
void unset(const int i)
Definition: BitArray.h:225
DTChambPhSegm::step
int step() const
Return step number.
Definition: DTChambPhSegm.h:73
BitArray::set
void set(const int i)
Definition: BitArray.h:224
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DTSectCollPhCand::_dataword
BitArray< 15 > _dataword
Definition: DTSectCollPhCand.h:108
a0
static constexpr float a0
Definition: L1EGammaCrystalsEmulatorProducer.cc:81
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42