CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTTracoCand Class Reference

#include <DTTracoCand.h>

Public Member Functions

const DTBtiTrigDataBtiTrig () const
 Return associated BTI trigger. More...
 
 DTTracoCand ()
 Constructor. More...
 
 DTTracoCand (DTTracoChip *tc, const DTBtiTrigData *btitr, int pos, int step)
 Constructor. More...
 
 DTTracoCand (const DTTracoCand &tccand)
 Constructor. More...
 
int K () const
 Return K-KRAD. More...
 
bool operator< (const DTTracoCand &c) const
 returns true if it has smaller K w.r.t. DTTracoChip center K (sort ascend) More...
 
DTTracoCandoperator= (const DTTracoCand &tccand)
 Assignment operator. More...
 
int position () const
 Return position inside TRACO. More...
 
void print () const
 Print candidate. More...
 
void setBits (int itk)
 set quality bits for first/second track More...
 
void setUnused ()
 set candidate unused (usable) More...
 
void setUsed ()
 set candidate used (unusable) More...
 
int step () const
 Return Bunch crossing. More...
 
DTTracoChipTraco () const
 Return parent TRACO. More...
 
int usable () const
 Check if candidate is usable. More...
 
int X () const
 Return local X coordinate. More...
 
 ~DTTracoCand ()
 Destructor. More...
 

Private Attributes

const DTBtiTrigData_btitr
 
BitArray< 7 > _dataword
 
int _position
 
int _step
 
int _tcK
 
int _tcX
 
DTTracoChip_traco
 
int _usable
 

Detailed Description

Implementation of DTTracoChip candidate

Author
C. Grandi, S. Vanini

Modifications: S.V. store BtiTrig pointer instead of TrigData

Definition at line 38 of file DTTracoCand.h.

Constructor & Destructor Documentation

◆ DTTracoCand() [1/3]

DTTracoCand::DTTracoCand ( )
inline

Constructor.

Definition at line 41 of file DTTracoCand.h.

41 {}

◆ DTTracoCand() [2/3]

DTTracoCand::DTTracoCand ( DTTracoChip tc,
const DTBtiTrigData btitr,
int  pos,
int  step 
)

Constructor.

Definition at line 39 of file DTTracoCand.cc.

References _tcK, _tcX, funct::abs(), DTTracoChip::BTIC(), DTBtiTrigData::btiSL(), gather_cfg::cout, DTTracoChip::IBTIOFF(), DTBtiTrigData::K(), DTTracoChip::KRad(), DTConfig::NBTITC, and DTBtiTrigData::X().

40  : _traco(tc), _btitr(btitr), _step(step), _position(pos), _usable(1) {
41  if (pos < 1 || pos > 4 * DTConfigTraco::NBTITC) {
42  std::cout << "DTTracoCand::DTTracoCand: wrong position: " << pos;
43  std::cout << ", dummy coordinates set!" << std::endl;
44  _tcX = 9999;
45  _tcK = 9999;
46  return;
47  }
48  // abs value of K in local TRACO frame (angle conversion):
49  // for sorting the angle closest to normal of chamber
50  // Ktr = Kbti - BTIC - KRAD
51  _tcK = abs(btitr->K() - tc->KRad() - tc->BTIC());
52 
53  // X in local TRACO frame (position conversion): Xtr = Xbti + BTIC*(i+4 or
54  // o-4)
55  int lstep = tc->BTIC();
56  _tcX = btitr->X() + lstep * ((pos <= DTConfigTraco::NBTITC) * (pos - 1 + DTConfigTraco::NBTITC) + // inner
57  (pos > DTConfigTraco::NBTITC) * (pos - 1 - DTConfigTraco::NBTITC)); // outer
58 
59  // NEWGEO add phi sl offset to inner positions
60  if (btitr->btiSL() == 1)
61  _tcX += tc->IBTIOFF();
62 
63  /* DEBUG
64  btitr->print();
65  std::cout << "K in local " << tc->number() << " TRACO " << K() << std::endl;
66  std::cout << "X in local " << tc->number() << " TRACO " << X() << " offset "
67  << tc->IBTIOFF() << std::endl; print();
68  */
69 
70  /*
71  //OBSOLETE
72  //ATTENTION!! This isn't the "real" MB-superlayer shift
73  //because wires have been renamed/shifted in : DTTrigGeom::cellMapping(int
74  sl, int lay, int tube)
75  //this is a "patch" : to BE FIXED with NEW GEOMETRY!
76 
77  //MB1: half cell shift
78  if(btitr->btiSL()==1 && tc->station()==1)
79  _tcX += (int)(0.5*lstep);
80  //MB2
81  // if(btitr->btiSL()==1 && tc->station()==2)
82  // _tcX += (int)(-lstep);
83 
84  //std::cout << "X in local TRACO frame = " << _tcX << std::endl;
85  //print();
86  */
87 }
int btiSL() const
Return parent BTI superlayer.
Definition: DTBtiTrigData.h:99
int KRad() const
K par of the radial angle of corr center referred to plane sl.
int K() const
Return trigger K parameter.
int BTIC() const
BTIC parameter.
Definition: DTTracoChip.h:123
const DTBtiTrigData * _btitr
Definition: DTTracoCand.h:108
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int X() const
Return trigger X parameter.
int IBTIOFF() const
IBTIOFF parameter.
Definition: DTTracoChip.h:126
step
Definition: StallMonitor.cc:83
static const int NBTITC
Definition: DTConfig.h:37
DTTracoChip * _traco
Definition: DTTracoCand.h:106

◆ DTTracoCand() [3/3]

DTTracoCand::DTTracoCand ( const DTTracoCand tccand)

Constructor.

Definition at line 89 of file DTTracoCand.cc.

90  : _traco(tccand._traco),
91  _btitr(tccand._btitr),
92  _step(tccand._step),
93  _position(tccand._position),
94  _usable(tccand._usable),
95  _tcX(tccand._tcX),
96  _tcK(tccand._tcK) {}
const DTBtiTrigData * _btitr
Definition: DTTracoCand.h:108
DTTracoChip * _traco
Definition: DTTracoCand.h:106

◆ ~DTTracoCand()

DTTracoCand::~DTTracoCand ( )

Destructor.

Definition at line 101 of file DTTracoCand.cc.

101 {}

Member Function Documentation

◆ BtiTrig()

const DTBtiTrigData* DTTracoCand::BtiTrig ( ) const
inline

Return associated BTI trigger.

Definition at line 68 of file DTTracoCand.h.

References _btitr.

Referenced by DTTracoChip::AdjBtiLTSuppressed(), DTTracoChip::DoAdjBtiLts(), DTTracoChip::setPV(), and DTTracoChip::storeUncorr().

68 { return _btitr; }
const DTBtiTrigData * _btitr
Definition: DTTracoCand.h:108

◆ K()

int DTTracoCand::K ( ) const
inline

Return K-KRAD.

Definition at line 77 of file DTTracoCand.h.

References _tcK.

Referenced by DTTracoChip::setPV().

77 { return _tcK; }

◆ operator<()

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

returns true if it has smaller K w.r.t. DTTracoChip center K (sort ascend)

Definition at line 86 of file DTTracoCand.h.

References _tcK, and DummyCfis::c.

86 { return _tcK < c._tcK; }

◆ operator=()

DTTracoCand & DTTracoCand::operator= ( const DTTracoCand tccand)

Assignment operator.

Definition at line 107 of file DTTracoCand.cc.

References _btitr, _position, _step, _tcK, _tcX, _traco, and _usable.

107  {
108  if (this != &tccand) {
109  _traco = tccand._traco;
110  _btitr = tccand._btitr;
111  _position = tccand._position;
112  _step = tccand._step;
113  _usable = tccand._usable;
114  _tcX = tccand._tcX;
115  _tcK = tccand._tcK;
116  }
117  return *this;
118 }
const DTBtiTrigData * _btitr
Definition: DTTracoCand.h:108
DTTracoChip * _traco
Definition: DTTracoCand.h:106

◆ position()

int DTTracoCand::position ( ) const
inline

Return position inside TRACO.

Definition at line 74 of file DTTracoCand.h.

References _position.

Referenced by DTTracoChip::AdjBtiLTSuppressed(), and DTTracoChip::setPV().

74 { return _position; }

◆ print()

void DTTracoCand::print ( void  ) const

Print candidate.

Definition at line 120 of file DTTracoCand.cc.

References _btitr, _position, _step, _tcK, _traco, DTBtiTrigData::btiNumber(), DTBtiTrigData::btiSL(), DTBtiTrigData::code(), gather_cfg::cout, DTBtiTrigData::K(), DTTracoChip::KRad(), and DTBtiTrigData::X().

Referenced by DTTracoChip::setPV().

120  {
121  // int sl = _btitr->btiSL();
122  std::cout << " step " << _step;
123  std::cout << " Position " << _position;
124  std::cout << " Code = " << _btitr->code();
125  std::cout << " SL = " << _btitr->btiSL();
126  std::cout << " N = " << _btitr->btiNumber();
127  std::cout << " X = " << _btitr->X();
128  std::cout << " K = " << _btitr->K();
129  std::cout << " Kr = " << _traco->KRad();
130  std::cout << " |K-Kr| = " << _tcK << std::endl;
131 }
int btiNumber() const
Return parent BTI number.
Definition: DTBtiTrigData.h:96
int btiSL() const
Return parent BTI superlayer.
Definition: DTBtiTrigData.h:99
int KRad() const
K par of the radial angle of corr center referred to plane sl.
int K() const
Return trigger K parameter.
const DTBtiTrigData * _btitr
Definition: DTTracoCand.h:108
int code() const
Return trigger code.
int X() const
Return trigger X parameter.
DTTracoChip * _traco
Definition: DTTracoCand.h:106

◆ setBits()

void DTTracoCand::setBits ( int  itk)

set quality bits for first/second track

◆ setUnused()

void DTTracoCand::setUnused ( )
inline

set candidate unused (usable)

Definition at line 59 of file DTTracoCand.h.

References _usable.

59 { _usable = 1; }

◆ setUsed()

void DTTracoCand::setUsed ( )
inline

set candidate used (unusable)

Definition at line 56 of file DTTracoCand.h.

References _usable.

56 { _usable = 0; }

◆ step()

int DTTracoCand::step ( ) const
inline

Return Bunch crossing.

Definition at line 71 of file DTTracoCand.h.

References _step.

Referenced by DTTracoChip::AdjBtiLTSuppressed(), and DTTracoChip::setPV().

71 { return _step; }

◆ Traco()

DTTracoChip* DTTracoCand::Traco ( ) const
inline

Return parent TRACO.

Definition at line 65 of file DTTracoCand.h.

References _traco.

65 { return _traco; }
DTTracoChip * _traco
Definition: DTTracoCand.h:106

◆ usable()

int DTTracoCand::usable ( ) const
inline

Check if candidate is usable.

Definition at line 83 of file DTTracoCand.h.

References _usable.

83 { return _usable; }

◆ X()

int DTTracoCand::X ( ) const
inline

Return local X coordinate.

Definition at line 80 of file DTTracoCand.h.

References _tcX.

Referenced by svgfig.Curve.Sample::__repr__(), and DTTracoChip::storeUncorr().

80 { return _tcX; }

Member Data Documentation

◆ _btitr

const DTBtiTrigData* DTTracoCand::_btitr
private

Definition at line 108 of file DTTracoCand.h.

Referenced by BtiTrig(), operator=(), and print().

◆ _dataword

BitArray<7> DTTracoCand::_dataword
private

Definition at line 111 of file DTTracoCand.h.

◆ _position

int DTTracoCand::_position
private

Definition at line 113 of file DTTracoCand.h.

Referenced by operator=(), position(), and print().

◆ _step

int DTTracoCand::_step
private

Definition at line 112 of file DTTracoCand.h.

Referenced by operator=(), print(), and step().

◆ _tcK

int DTTracoCand::_tcK
private

Definition at line 116 of file DTTracoCand.h.

Referenced by DTTracoCand(), K(), operator<(), operator=(), and print().

◆ _tcX

int DTTracoCand::_tcX
private

Definition at line 115 of file DTTracoCand.h.

Referenced by DTTracoCand(), operator=(), and X().

◆ _traco

DTTracoChip* DTTracoCand::_traco
private

Definition at line 106 of file DTTracoCand.h.

Referenced by operator=(), print(), and Traco().

◆ _usable

int DTTracoCand::_usable
private

Definition at line 114 of file DTTracoCand.h.

Referenced by operator=(), setUnused(), setUsed(), and usable().