Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

FTWire Class Reference

#include <FTWire.h>

List of all members.

Public Member Functions

void chk_left_and_right (void)
 check neighbors of phi-side and raise invalid flag if both hits
void chk_left_and_right (void)
 check neighbors of phi-side and raise invalid flag if both hits
void clear (void)
 clear
void clear (void)
 clear
float distance (const float distance)
 set drift distance
float distance (void) const
 returns drift distance
float distance (const float distance)
 set drift distance
float distance (void) const
 returns drift distance
float distance_z (void) const
 returns z_distance from the center of wire by drift distance
float distance_z (void) const
 returns z_distance from the center of wire by drift distance
 FTWire ()
 FTWire (const float x, const float y, const float dx, const float dy, const FTLayer &, const int localID, FTWire *const vt)
 constructors
 FTWire ()
 FTWire (const float x, const float y, const float dx, const float dy, const FTLayer &, const int localID, FTWire *const vt)
 constructors
float getAdc (void) const
float getAdc (void) const
float getChi2 (void) const
float getChi2 (void) const
int getWireId (void)
 get wireId
int getWireId (void)
 get wireId
void initNeighbor (void)
 initNeighbor
void initNeighbor (void)
 initNeighbor
const FTLayerlayer (void) const
 returns layer
const FTLayerlayer (void) const
 returns layer
const int localId (void) const
 returns local ID
const int localId (void) const
 returns local ID
FTWire ** neighborPtr (void)
 returns pointer of neighbor array
FTWire ** neighborPtr (void)
 returns pointer of neighbor array
float pedestal (const float ped)
 set pedestal at begin-run
float pedestal (void) const
 returns pedestal read at begin run
float pedestal (const float ped)
 set pedestal at begin-run
float pedestal (void) const
 returns pedestal read at begin run
float phi (void) const
 returns phi
float phi (void) const
 returns phi
void setAdc (float adc)
 wangdy add:set Adc value
void setAdc (float adc)
 wangdy add:set Adc value
void setChi2 (float chi2)
 set residual fit chi2
void setChi2 (float chi2)
 set residual fit chi2
unsigned state (const unsigned state)
 set state
unsigned state (void) const
 returns state
unsigned state (const unsigned state)
 set state
unsigned state (void) const
 returns state
unsigned stateAND (const unsigned mask) const
 returns state bit
unsigned stateAND (const unsigned mask) const
 returns state bit
void stateOR (const unsigned mask)
 set state bit
void stateOR (const unsigned mask)
 set state bit
void stateORXOR (const unsigned mask)
 reset state bit
void stateORXOR (const unsigned mask)
 reset state bit
void stateXOR (const unsigned mask)
 invert state bit
void stateXOR (const unsigned mask)
 invert state bit
float t0 (const float t0)
 set t0 at begin-run
float t0 (void) const
 returns t0 read at begin run
float t0 (const float t0)
 set t0 at begin-run
float t0 (void) const
 returns t0 read at begin run
float time (float t)
 reset time
float time (void) const
 rerurns TDC time(after t0 subtraction)
float time (float t)
 reset time
float time (void) const
 rerurns TDC time(after t0 subtraction)
void wireId (int wireID)
 set wireId
void wireId (int wireID)
 set wireId
const float x (void) const
 returns position x
const float x (void) const
 returns position x
const float y (void) const
 returns position y
const float y (void) const
 returns position y
int z (const Lpav &la, double &z) const
 returns z for track la
int z (const Lpav &la, double &z) const
 returns z for track la
 ~FTWire ()
 destructor
 ~FTWire ()
 destructor

Private Member Functions

void getInnerNeighbor (FTWire *const vtWire)
 compute inner Neighbor
void getInnerNeighbor (FTWire *const vtWire)
 compute inner Neighbor
void getMidNeighbor (void)
 compute mid Neighbor
void getMidNeighbor (void)
 compute mid Neighbor
void getOuterNeighbor (FTWire *const vtWire)
 compute outer Neighbor
void getOuterNeighbor (FTWire *const vtWire)
 compute outer Neighbor
const FTWireleft (void) const
 returns left wire;
const FTWireleft (void) const
 returns left wire;
const FTWireright (void) const
 returns left wire;
const FTWireright (void) const
 returns left wire;

Private Attributes

float _distance
const float _dx
const float _dy
const FTLayer_layer
const FTLayer_layer
const int _localId
FTWire_neighbor [6]
FTWire_neighbor [6]
float _pedestal
const float _phi
unsigned int _state
float _t0
float _time
FTWire *const & _wire
FTWire *const & _wire
int _wireId
const float _x
const float _y
float m_adc
float m_chi2
float m_posx
float m_posy
float m_posz


Constructor & Destructor Documentation

FTWire::FTWire const float  x,
const float  y,
const float  dx,
const float  dy,
const FTLayer ,
const int  localID,
FTWire *const   vt
[inline]
 

constructors

00202   : _x(x),                      // x position in z = 0;
00203     _y(y),                      // y position in z = 0;
00204     _dx(dx),
00205     _dy(dy),
00206     _layer(layer),
00207     _wire(vt),
00208     _localId(localID),
00209     _phi((const float)2*M_PI*_localId/(float)_layer.NWire()+_layer.offset()),
00210     //_wireId(wireID),
00211     //_hep(NULL),
00212     _distance(0),
00213     _t0(0),
00214     _time(0),
00215     m_adc(0),
00216     _pedestal(0),
00217     _state(FTWireHitInvalid)
00218 {
00219     getMidNeighbor();
00220 }

FTWire::FTWire  )  [inline]
 

00224   : _x(0),
00225     _y(0),
00226     _dx(0),
00227     _dy(0),
00228     _layer(*(FTLayer *)NULL),
00229     _wire(NULL),
00230     _localId(0),
00231     //_wireId(0),
00232     _phi(0),
00233     _distance(0),
00234     _t0(0),
00235     _time(0),
00236     m_adc(0),
00237     _pedestal(0),
00238     _state(FTWireHitInvalid)
00239 {
00240   _neighbor[0] = NULL;
00241   _neighbor[1] = NULL;
00242   _neighbor[2] = NULL;
00243   _neighbor[3] = NULL;
00244   _neighbor[4] = NULL;
00245   _neighbor[5] = NULL;
00246 }

FTWire::~FTWire  )  [inline]
 

destructor

00250 {
00251 }

FTWire::FTWire const float  x,
const float  y,
const float  dx,
const float  dy,
const FTLayer ,
const int  localID,
FTWire *const   vt
 

constructors

FTWire::FTWire  ) 
 

FTWire::~FTWire  ) 
 

destructor


Member Function Documentation

void FTWire::chk_left_and_right void   ) 
 

check neighbors of phi-side and raise invalid flag if both hits

void FTWire::chk_left_and_right void   )  [inline]
 

check neighbors of phi-side and raise invalid flag if both hits

00552                               {
00553   if (((**(_neighbor+2))._state&FTWireHit) &&
00554       ((**(_neighbor+3))._state&FTWireHit)){
00555     _state |= FTWireHitInvalid;
00556     (**(_neighbor+2))._state |= FTWireHitInvalid;
00557     (**(_neighbor+3))._state |= FTWireHitInvalid;
00558   }
00559 }

void FTWire::clear void   ) 
 

clear

void FTWire::clear void   )  [inline]
 

clear

00348 {
00349   _distance = 0.;
00350   _time = 0.;
00351   _t0 = 0.;
00352   m_adc = 0.0; 
00353   _pedestal = 0.;
00354   _state = FTWireHitInvalid;
00355 }

float FTWire::distance const float  distance  ) 
 

set drift distance

float FTWire::distance void   )  const
 

returns drift distance

float FTWire::distance const float  distance  )  [inline]
 

set drift distance

00416 {
00417   return _distance = distance;
00418 }

float FTWire::distance void   )  const [inline]
 

returns drift distance

00402 {
00403   return _distance;
00404 }

float FTWire::distance_z void   )  const
 

returns z_distance from the center of wire by drift distance

float FTWire::distance_z void   )  const [inline]
 

returns z_distance from the center of wire by drift distance

00409 {
00410   return _distance * std::fabs(_layer.tanSlant());
00411 }

float FTWire::getAdc void   )  const
 

float FTWire::getAdc void   )  const [inline]
 

00591                                      {
00592   return m_adc;
00593 }

float FTWire::getChi2 void   )  const
 

float FTWire::getChi2 void   )  const [inline]
 

00600                                       {
00601   return m_chi2;
00602 }

void FTWire::getInnerNeighbor FTWire *const   vtWire  )  [private]
 

compute inner Neighbor

void FTWire::getInnerNeighbor FTWire *const   vtWire  )  [inline, private]
 

compute inner Neighbor

00271 {
00272   if (!_layer.localLayerId()) {
00273         _neighbor[0] = _neighbor[1] = vtWire;
00274         return;
00275   }
00276   float thisPhi = phi();
00277   const FTLayer * pLayer = &_layer;
00278   int n = (*(pLayer-1)).NWire(); 
00279   int low=0, high=n-1, mid = 0;
00280   int innerPosition = 1; 
00281   FTWire * lastInnerPointer = this - localId() - 1;
00282   while (low<=high){
00283     mid=(low+high)/2;
00284     if ((*(lastInnerPointer-mid)).phi() <= thisPhi)
00285       high=mid-1;
00286     else 
00287       low=mid+1;
00288   }
00289   
00290   innerPosition = mid; 
00291   if((*(lastInnerPointer-innerPosition)).phi() <= thisPhi) {
00292       _neighbor[0] = lastInnerPointer-innerPosition;
00293       if(innerPosition == 0) _neighbor[1] = lastInnerPointer-n+1;
00294       else _neighbor[1] = lastInnerPointer-innerPosition+1;
00295   } else {
00296       if((innerPosition+1) == n) _neighbor[0] = lastInnerPointer;
00297       else _neighbor[0] = lastInnerPointer-innerPosition-1;
00298       _neighbor[1] = lastInnerPointer-innerPosition;
00299   }
00300 
00301 }

void FTWire::getMidNeighbor void   )  [private]
 

compute mid Neighbor

void FTWire::getMidNeighbor void   )  [inline, private]
 

compute mid Neighbor

00340 {
00341     _neighbor[2] = (FTWire *) left();
00342     _neighbor[3] = (FTWire *) right();
00343 }

void FTWire::getOuterNeighbor FTWire *const   vtWire  )  [private]
 

compute outer Neighbor

void FTWire::getOuterNeighbor FTWire *const   vtWire  )  [inline, private]
 

compute outer Neighbor

00306 {
00307   if (_layer.localLayerId()==_layer.superLayer().layerMaxId()) {
00308         _neighbor[4] = _neighbor[5] = vtWire;
00309         return;
00310   }
00311   float thisPhi = phi();
00312   const FTLayer * pLayer = &_layer;  
00313   int n = (*(pLayer+1)).NWire();
00314   int low=0, high=n-1, mid = 0;
00315   int position;
00316   FTWire * firstPointer = this + _layer.NWire() - localId();
00317   while (low<=high){
00318     mid=(low+high)/2;
00319     if ((*(firstPointer+mid)).phi() > thisPhi)
00320       high=mid-1;
00321     else
00322       low=mid+1;
00323   }
00324  
00325   position = mid; 
00326   if((*(firstPointer+position)).phi() <= thisPhi) {
00327       _neighbor[4] = firstPointer+position;
00328       if((position+1) == n) _neighbor[5] = firstPointer;
00329       else _neighbor[5] = firstPointer+position+1;
00330   } else {
00331       if((position-1) == -1) _neighbor[4] = firstPointer + n - 1;
00332       else _neighbor[4] = firstPointer+position-1;
00333       _neighbor[5] = firstPointer+position;
00334   }
00335 }

int FTWire::getWireId void   ) 
 

get wireId

int FTWire::getWireId void   )  [inline]
 

get wireId

00585                                 {
00586   return _wireId;
00587 }

void FTWire::initNeighbor void   ) 
 

initNeighbor

void FTWire::initNeighbor void   )  [inline]
 

initNeighbor

00256 {
00257   getInnerNeighbor(_wire);
00258   getOuterNeighbor(_wire);
00259   /*cout << "_layer.layerId()::" << _layer.layerId() << endl;
00260   cout << "The WireId ::" << _localId << endl;
00261   cout << "Its neighbor 0 ::" << _neighbor[0]->localId() << endl;
00262   cout << "Its neighbor 1 ::" << _neighbor[1]->localId() << endl;
00263   cout << "Its neighbor 2 ::" << _neighbor[2]->localId() << endl;
00264   cout << "Its neighbor 3 ::" << _neighbor[3]->localId() << endl;
00265   cout << "Its neighbor 4 ::" << _neighbor[4]->localId() << endl;
00266   cout << "Its neighbor 5 ::" << _neighbor[5]->localId() << endl;*/
00267 }

const FTLayer& FTWire::layer void   )  const
 

returns layer

const FTLayer & FTWire::layer void   )  const [inline]
 

returns layer

00360 {
00361   return _layer;
00362 }

const FTWire* FTWire::left void   )  const [private]
 

returns left wire;

const FTWire * FTWire::left void   )  const [inline, private]
 

returns left wire;

00563                       {
00564   const FTWire * tmp = this;
00565   if (!_localId) tmp += _layer.NWire();
00566   return --tmp;
00567 }

const int FTWire::localId void   )  const
 

returns local ID

const int FTWire::localId void   )  const [inline]
 

returns local ID

00381 {
00382   return _localId;
00383 }

FTWire** FTWire::neighborPtr void   ) 
 

returns pointer of neighbor array

FTWire ** FTWire::neighborPtr void   )  [inline]
 

returns pointer of neighbor array

00388 {
00389   return _neighbor;
00390 }

float FTWire::pedestal const float  ped  ) 
 

set pedestal at begin-run

float FTWire::pedestal void   )  const
 

returns pedestal read at begin run

float FTWire::pedestal const float  ped  )  [inline]
 

set pedestal at begin-run

00444 {
00445   return _pedestal = ped;
00446 }

float FTWire::pedestal void   )  const [inline]
 

returns pedestal read at begin run

00437 {
00438   return _pedestal;
00439 }

float FTWire::phi void   )  const
 

returns phi

float FTWire::phi void   )  const [inline]
 

returns phi

00395 {
00396   return _phi;
00397 }

const FTWire* FTWire::right void   )  const [private]
 

returns left wire;

const FTWire * FTWire::right void   )  const [inline, private]
 

returns left wire;

00571                        {
00572   const FTWire * tmp = this;
00573   if (_localId == (_layer.NWire()-1)) {
00574     tmp -= _layer.NWire();
00575   }
00576   return ++tmp;
00577 }

void FTWire::setAdc float  adc  ) 
 

wangdy add:set Adc value

void FTWire::setAdc float  adc  )  [inline]
 

wangdy add:set Adc value

00595                                     {
00596    m_adc = adc;
00597 }

void FTWire::setChi2 float  chi2  ) 
 

set residual fit chi2

void FTWire::setChi2 float  chi2  )  [inline]
 

set residual fit chi2

00604                                       {
00605    m_chi2 = chi2;
00606 }

unsigned FTWire::state const unsigned  state  ) 
 

set state

unsigned FTWire::state void   )  const
 

returns state

unsigned FTWire::state const unsigned  state  )  [inline]
 

set state

00488 {
00489   return _state = (_state&FTWireStateMask)|state;
00490 }

unsigned FTWire::state void   )  const [inline]
 

returns state

00481 {
00482   return _state;
00483 }

unsigned FTWire::stateAND const unsigned  mask  )  const
 

returns state bit

unsigned FTWire::stateAND const unsigned  mask  )  const [inline]
 

returns state bit

00495 {
00496   return _state&mask;
00497 }

void FTWire::stateOR const unsigned  mask  ) 
 

set state bit

void FTWire::stateOR const unsigned  mask  )  [inline]
 

set state bit

00502 {
00503   _state|=mask;
00504 }

void FTWire::stateORXOR const unsigned  mask  ) 
 

reset state bit

void FTWire::stateORXOR const unsigned  mask  )  [inline]
 

reset state bit

00516 {
00517   _state=(_state|mask)^mask;
00518 }

void FTWire::stateXOR const unsigned  mask  ) 
 

invert state bit

void FTWire::stateXOR const unsigned  mask  )  [inline]
 

invert state bit

00509 {
00510   _state^=mask;
00511 }

float FTWire::t0 const float  t0  ) 
 

set t0 at begin-run

float FTWire::t0 void   )  const
 

returns t0 read at begin run

float FTWire::t0 const float  t0  )  [inline]
 

set t0 at begin-run

00430 {
00431   return _t0 = t0;
00432 }

float FTWire::t0 void   )  const [inline]
 

returns t0 read at begin run

00423 {
00424   return _t0;
00425 }

float FTWire::time float  t  ) 
 

reset time

float FTWire::time void   )  const
 

rerurns TDC time(after t0 subtraction)

float FTWire::time float  t  )  [inline]
 

reset time

00451 {
00452   return _time = t;
00453 }

float FTWire::time void   )  const [inline]
 

rerurns TDC time(after t0 subtraction)

00458 {
00459   return _time;
00460 }

void FTWire::wireId int  wireID  ) 
 

set wireId

void FTWire::wireId int  wireID  )  [inline]
 

set wireId

00580                                     {
00581   _wireId = wireID;
00582 }

const float FTWire::x void   )  const
 

returns position x

const float FTWire::x void   )  const [inline]
 

returns position x

00367 {
00368   return _x;
00369 }

const float FTWire::y void   )  const
 

returns position y

const float FTWire::y void   )  const [inline]
 

returns position y

00374 {
00375   return _y;
00376 }

int FTWire::z const Lpav la,
double &  z
const
 

returns z for track la

int FTWire::z const Lpav la,
double &  z
const [inline]
 

returns z for track la

00522                                            {
00523   HepVector center = la.center();
00524   double rho = la.radius();
00525   double dx2 = center(1) - _x;
00526   double dy2 = center(2) - _y;
00527   double par1 = _dx*_dx + _dy*_dy;
00528   double par2 = (_dx*dx2 + _dy*dy2)/par1;
00529   double par3 = _dx*dy2 - _dy*dx2;
00530   double par4 = rho*rho*par1 -  par3*par3;
00531   if (par4<0.) return 0;
00532   par4 = std::sqrt(par4)/par1;
00533   double delta = par2 + par4;
00534   //double delta = 0.5;
00535   if (delta>=0. && delta<1.){
00536     //z = _layer.zb()+delta*(_layer.zf()-_layer.zb());
00537     z = _layer.zf()+delta*(_layer.zb()-_layer.zf());
00538     return 1;
00539   }else{
00540     delta = par2 - par4;
00541     if (delta>=0. && delta<1.){
00542       //z = _layer.zb()+delta*(_layer.zf()-_layer.zb());
00543       z = _layer.zf()+delta*(_layer.zb()-_layer.zf());
00544       return 1;
00545     }
00546   }
00547   return 0;
00548 }


Member Data Documentation

float FTWire::_distance [private]
 

const float FTWire::_dx [private]
 

const float FTWire::_dy [private]
 

const FTLayer& FTWire::_layer [private]
 

const FTLayer& FTWire::_layer [private]
 

const int FTWire::_localId [private]
 

FTWire* FTWire::_neighbor[6] [private]
 

FTWire* FTWire::_neighbor[6] [private]
 

float FTWire::_pedestal [private]
 

const float FTWire::_phi [private]
 

unsigned int FTWire::_state [private]
 

float FTWire::_t0 [private]
 

float FTWire::_time [private]
 

FTWire* const& FTWire::_wire [private]
 

FTWire* const& FTWire::_wire [private]
 

int FTWire::_wireId [private]
 

const float FTWire::_x [private]
 

const float FTWire::_y [private]
 

float FTWire::m_adc [private]
 

float FTWire::m_chi2 [private]
 

float FTWire::m_posx [private]
 

float FTWire::m_posy [private]
 

float FTWire::m_posz [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:15:39 2011 for BOSS6.5.5 by  doxygen 1.3.9.1