CMS 3D CMS Logo

Public Member Functions | Private Attributes

DTTracoCand Class Reference

#include <DTTracoCand.h>

List of all members.

Public Member Functions

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

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

Date:
2008/06/30 13:42:21
Revision:
1.3
Author:
C. Grandi, S. Vanini

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

Definition at line 40 of file DTTracoCand.h.


Constructor & Destructor Documentation

DTTracoCand::DTTracoCand ( ) [inline]

Constructor.

Definition at line 45 of file DTTracoCand.h.

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

Constructor.

Definition at line 39 of file DTTracoCand.cc.

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

                                                    : 
  _traco(tc), _btitr(btitr), _step(step), _position(pos), _usable(1) {
  
  if(pos<1 || pos>4*DTConfigTraco::NBTITC) {
    std::cout << "DTTracoCand::DTTracoCand: wrong position: " << pos;
    std::cout << ", dummy coordinates set!" << std::endl;
    _tcX = 9999;
    _tcK = 9999;
    return;
  }
  // abs value of K in local TRACO frame (angle conversion): 
  // for sorting the angle closest to normal of chamber
  // Ktr = Kbti - BTIC - KRAD
  _tcK = abs( btitr->K() - tc->KRad() - tc->BTIC() );
  
 
  // X in local TRACO frame (position conversion): Xtr = Xbti + BTIC*(i+4 or o-4)
  int lstep = tc->BTIC();
  _tcX = btitr->X() + lstep * (
         (pos<=DTConfigTraco::NBTITC)*(pos-1 + DTConfigTraco::NBTITC) +  // inner
         (pos> DTConfigTraco::NBTITC)*(pos-1 - DTConfigTraco::NBTITC) ); // outer

  //NEWGEO add phi sl offset to inner positions
  if(btitr->btiSL()==1)
    _tcX += tc->IBTIOFF();
  
/* DEBUG  
  btitr->print();
  std::cout << "K in local " << tc->number() << " TRACO " << K() << std::endl;
  std::cout << "X in local " << tc->number() << " TRACO " << X() << " offset " << tc->IBTIOFF() << std::endl;
  print();
*/

/*
  //OBSOLETE
  //ATTENTION!! This isn't the "real" MB-superlayer shift
  //because wires have been renamed/shifted in : DTTrigGeom::cellMapping(int sl, int lay, int tube)
  //this is a "patch" : to BE FIXED with NEW GEOMETRY! 

  //MB1: half cell shift
  if(btitr->btiSL()==1 && tc->station()==1)
    _tcX += (int)(0.5*lstep);
  //MB2 
  //  if(btitr->btiSL()==1   && tc->station()==2)
  //    _tcX += (int)(-lstep);

  //std::cout << "X in local TRACO frame = " << _tcX << std::endl;
  //print();
*/  
}
DTTracoCand::DTTracoCand ( const DTTracoCand tccand)

Constructor.

Definition at line 92 of file DTTracoCand.cc.

                                                  : 
  _traco(tccand._traco), _btitr(tccand._btitr), 
  _step(tccand._step), _position(tccand._position), _usable(tccand._usable), 
  _tcX(tccand._tcX), _tcK(tccand._tcK) {}
DTTracoCand::~DTTracoCand ( )

Destructor.

Definition at line 100 of file DTTracoCand.cc.

                         {
}

Member Function Documentation

const DTBtiTrigData* DTTracoCand::BtiTrig ( ) const [inline]

Return associated BTI trigger.

Definition at line 72 of file DTTracoCand.h.

References _btitr.

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

{ return _btitr; }
int DTTracoCand::K ( ) const [inline]

Return K-KRAD.

Definition at line 81 of file DTTracoCand.h.

References _tcK.

Referenced by DTTracoChip::setPV().

{ 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 90 of file DTTracoCand.h.

References _tcK.

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

                                               {
  if(this != &tccand){
    _traco = tccand._traco;
    _btitr = tccand._btitr;
    _position = tccand._position;
    _step = tccand._step;
    _usable = tccand._usable;
    _tcX = tccand._tcX;
    _tcK = tccand._tcK;
  }
  return *this;
}
int DTTracoCand::position ( ) const [inline]

Return position inside TRACO.

Definition at line 78 of file DTTracoCand.h.

References _position.

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

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

                         {
//  int sl = _btitr->btiSL();
  std::cout << " step " << _step;
  std::cout << " Position " << _position;
  std::cout << " Code = " <<  _btitr->code();
  std::cout << " SL = " << _btitr->btiSL();
  std::cout << " N = " << _btitr->btiNumber();
  std::cout << " X = " << _btitr->X();
  std::cout << " K = " << _btitr->K();
  std::cout << " Kr = " << _traco->KRad();
  std::cout << " |K-Kr| = " << _tcK << std::endl;
}
void DTTracoCand::setBits ( int  itk)

set quality bits for first/second track

void DTTracoCand::setUnused ( ) [inline]

set candidate unused (usable)

Definition at line 63 of file DTTracoCand.h.

References _usable.

Referenced by DTTracoChip::storeUncorr().

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

set candidate used (unusable)

Definition at line 60 of file DTTracoCand.h.

References _usable.

Referenced by DTTracoChip::run().

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

Return Bunch crossing.

Definition at line 75 of file DTTracoCand.h.

References _step.

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

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

Return parent TRACO.

Definition at line 69 of file DTTracoCand.h.

References _traco.

{ return _traco; }
int DTTracoCand::usable ( ) const [inline]

Check if candidate is usable.

Definition at line 87 of file DTTracoCand.h.

References _usable.

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

Return local X coordinate.

Definition at line 84 of file DTTracoCand.h.

References _tcX.

Referenced by DTTracoChip::storeCorr(), and DTTracoChip::storeUncorr().

{ return _tcX; }

Member Data Documentation

Definition at line 112 of file DTTracoCand.h.

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

Definition at line 115 of file DTTracoCand.h.

int DTTracoCand::_position [private]

Definition at line 117 of file DTTracoCand.h.

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

int DTTracoCand::_step [private]

Definition at line 116 of file DTTracoCand.h.

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

int DTTracoCand::_tcK [private]

Definition at line 120 of file DTTracoCand.h.

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

int DTTracoCand::_tcX [private]

Definition at line 119 of file DTTracoCand.h.

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

Definition at line 110 of file DTTracoCand.h.

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

int DTTracoCand::_usable [private]

Definition at line 118 of file DTTracoCand.h.

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