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
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::DTTracoCand ( )
inline

Constructor.

Definition at line 43 of file DTTracoCand.h.

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

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

Constructor.

Definition at line 92 of file DTTracoCand.cc.

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

Destructor.

Definition at line 100 of file DTTracoCand.cc.

100  {
101 }

Member Function Documentation

const DTBtiTrigData* DTTracoCand::BtiTrig ( ) const
inline

Return associated BTI trigger.

Definition at line 70 of file DTTracoCand.h.

References _btitr.

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

70 { return _btitr; }
const DTBtiTrigData * _btitr
Definition: DTTracoCand.h:110
int DTTracoCand::K ( ) const
inline

Return K-KRAD.

Definition at line 79 of file DTTracoCand.h.

References _tcK.

Referenced by DTTracoChip::setPV().

79 { return _tcK; }
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 88 of file DTTracoCand.h.

References _tcK.

88 { return _tcK<c._tcK; }
DTTracoCand & DTTracoCand::operator= ( const DTTracoCand tccand)

Assignment operator.

Definition at line 108 of file DTTracoCand.cc.

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

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

Return position inside TRACO.

Definition at line 76 of file DTTracoCand.h.

References _position.

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

76 { return _position; }
void DTTracoCand::print ( void  ) const

Print candidate.

Definition at line 122 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::run(), DTTracoChip::setPV(), DTTracoChip::storeCorr(), and DTTracoChip::storeUncorr().

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

set quality bits for first/second track

void DTTracoCand::setUnused ( )
inline

set candidate unused (usable)

Definition at line 61 of file DTTracoCand.h.

References _usable.

Referenced by DTTracoChip::storeUncorr().

61 {_usable=1; }
void DTTracoCand::setUsed ( )
inline

set candidate used (unusable)

Definition at line 58 of file DTTracoCand.h.

References _usable.

Referenced by DTTracoChip::run().

58 { _usable=0; }
int DTTracoCand::step ( ) const
inline

Return Bunch crossing.

Definition at line 73 of file DTTracoCand.h.

References _step.

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

73 { return _step; }
DTTracoChip* DTTracoCand::Traco ( ) const
inline

Return parent TRACO.

Definition at line 67 of file DTTracoCand.h.

References _traco.

67 { return _traco; }
DTTracoChip * _traco
Definition: DTTracoCand.h:108
int DTTracoCand::usable ( ) const
inline

Check if candidate is usable.

Definition at line 85 of file DTTracoCand.h.

References _usable.

85 { return _usable; }
int DTTracoCand::X ( ) const
inline

Return local X coordinate.

Definition at line 82 of file DTTracoCand.h.

References _tcX.

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

82 { return _tcX; }

Member Data Documentation

const DTBtiTrigData* DTTracoCand::_btitr
private

Definition at line 110 of file DTTracoCand.h.

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

BitArray<7> DTTracoCand::_dataword
private

Definition at line 113 of file DTTracoCand.h.

int DTTracoCand::_position
private

Definition at line 115 of file DTTracoCand.h.

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

int DTTracoCand::_step
private

Definition at line 114 of file DTTracoCand.h.

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

int DTTracoCand::_tcK
private

Definition at line 118 of file DTTracoCand.h.

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

int DTTracoCand::_tcX
private

Definition at line 117 of file DTTracoCand.h.

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

DTTracoChip* DTTracoCand::_traco
private

Definition at line 108 of file DTTracoCand.h.

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

int DTTracoCand::_usable
private

Definition at line 116 of file DTTracoCand.h.

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