#include <FTWire.h>
Public Member Functions | |
FTWire (const float x, const float y, const float dx, const float dy, const FTLayer &, const int localID, FTWire *const vt) | |
constructors | |
FTWire () | |
~FTWire () | |
destructor | |
void | initNeighbor (void) |
initNeighbor | |
const float | x (void) const |
returns position x | |
const float | y (void) const |
returns position y | |
float | phi (void) const |
returns phi | |
const int | localId (void) const |
returns local ID | |
const FTLayer & | layer (void) const |
returns layer | |
FTWire ** | neighborPtr (void) |
returns pointer of neighbor array | |
float | distance (void) const |
returns drift distance | |
float | distance_z (void) const |
returns z_distance from the center of wire by drift distance | |
float | t0 (void) const |
returns t0 read at begin run | |
float | pedestal (void) const |
returns pedestal read at begin run | |
unsigned | state (void) const |
returns state | |
unsigned | stateAND (const unsigned mask) const |
returns state bit | |
int | z (const Lpav &la, double &z) const |
returns z for track la | |
float | time (void) const |
rerurns TDC time(after t0 subtraction) | |
float | getAdc (void) const |
float | getChi2 (void) const |
void | clear (void) |
clear | |
float | distance (const float distance) |
set drift distance | |
float | t0 (const float t0) |
set t0 at begin-run | |
float | pedestal (const float ped) |
set pedestal at begin-run | |
unsigned | state (const unsigned state) |
set state | |
void | stateOR (const unsigned mask) |
set state bit | |
void | stateXOR (const unsigned mask) |
invert state bit | |
void | stateORXOR (const unsigned mask) |
reset state bit | |
void | chk_left_and_right (void) |
check neighbors of phi-side and raise invalid flag if both hits | |
float | time (float t) |
reset time | |
void | wireId (int wireID) |
set wireId | |
int | getWireId (void) |
get wireId | |
void | setAdc (float adc) |
wangdy add:set Adc value | |
void | setChi2 (float chi2) |
set residual fit chi2 | |
Private Member Functions | |
const FTWire * | left (void) const |
returns left wire; | |
const FTWire * | right (void) const |
returns left wire; | |
void | getInnerNeighbor (FTWire *const vtWire) |
compute inner Neighbor | |
void | getOuterNeighbor (FTWire *const vtWire) |
compute outer Neighbor | |
void | getMidNeighbor (void) |
compute mid Neighbor | |
Private Attributes | |
const float | _x |
const float | _y |
const float | _dx |
const float | _dy |
const FTLayer & | _layer |
FTWire *const & | _wire |
const int | _localId |
const float | _phi |
int | _wireId |
float | _distance |
float | _t0 |
float | _time |
float | _pedestal |
unsigned int | _state |
FTWire * | _neighbor [6] |
float | m_posx |
float | m_posy |
float | m_posz |
float | m_adc |
float | m_chi2 |
Definition at line 43 of file FTWire.h.
FTWire::FTWire | ( | const float | x, | |
const float | y, | |||
const float | dx, | |||
const float | dy, | |||
const FTLayer & | , | |||
const int | localID, | |||
FTWire *const | vt | |||
) | [inline] |
constructors
Definition at line 199 of file FTWire.h.
References getMidNeighbor().
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] |
Definition at line 223 of file FTWire.h.
References _neighbor.
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 }
void FTWire::chk_left_and_right | ( | void | ) | [inline] |
check neighbors of phi-side and raise invalid flag if both hits
Definition at line 552 of file FTWire.h.
References _neighbor, _state, FTWireHit, and FTWireHitInvalid.
Referenced by FTSuperLayer::clustering().
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 | ) | [inline] |
float FTWire::distance | ( | const float | distance | ) | [inline] |
float FTWire::distance | ( | void | ) | const [inline] |
returns drift distance
Definition at line 401 of file FTWire.h.
References _distance.
Referenced by FTTrack::r_phi2Fit(), and FTTrack::r_phi3Fit().
00402 { 00403 return _distance; 00404 }
float FTWire::distance_z | ( | void | ) | const [inline] |
float FTWire::getAdc | ( | void | ) | const [inline] |
float FTWire::getChi2 | ( | void | ) | const [inline] |
void FTWire::getInnerNeighbor | ( | FTWire *const | vtWire | ) | [inline, private] |
compute inner Neighbor
Definition at line 270 of file FTWire.h.
References _layer, _neighbor, localId(), FTLayer::localLayerId(), FTLayer::NWire(), and phi().
Referenced by initNeighbor().
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 | ) | [inline, private] |
void FTWire::getOuterNeighbor | ( | FTWire *const | vtWire | ) | [inline, private] |
compute outer Neighbor
Definition at line 305 of file FTWire.h.
References _layer, _neighbor, FTSuperLayer::layerMaxId(), localId(), FTLayer::localLayerId(), FTLayer::NWire(), phi(), and FTLayer::superLayer().
Referenced by initNeighbor().
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 | ) | [inline] |
void FTWire::initNeighbor | ( | void | ) | [inline] |
initNeighbor
Definition at line 255 of file FTWire.h.
References _wire, getInnerNeighbor(), and getOuterNeighbor().
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 [inline] |
returns layer
Definition at line 359 of file FTWire.h.
References _layer.
Referenced by FTSuperLayer::connect_short_segments(), FTSuperLayer::connect_singleHit(), FTFinder::linkAxialSegments(), FTFinder::linkAxialSegments_step(), FTTrack::r_phi2Fit(), FTTrack::r_phi3Fit(), FTSegment::update(), and FTSegment::update3D().
00360 { 00361 return _layer; 00362 }
const FTWire * FTWire::left | ( | void | ) | const [inline, private] |
returns left wire;
Definition at line 563 of file FTWire.h.
References _layer, _localId, and FTLayer::NWire().
Referenced by getMidNeighbor().
00563 { 00564 const FTWire * tmp = this; 00565 if (!_localId) tmp += _layer.NWire(); 00566 return --tmp; 00567 }
const int FTWire::localId | ( | void | ) | const [inline] |
returns local ID
Definition at line 380 of file FTWire.h.
References _localId.
Referenced by getInnerNeighbor(), and getOuterNeighbor().
00381 { 00382 return _localId; 00383 }
FTWire ** FTWire::neighborPtr | ( | void | ) | [inline] |
float FTWire::pedestal | ( | const float | ped | ) | [inline] |
float FTWire::pedestal | ( | void | ) | const [inline] |
float FTWire::phi | ( | void | ) | const [inline] |
returns phi
Definition at line 394 of file FTWire.h.
References _phi.
Referenced by getInnerNeighbor(), and getOuterNeighbor().
00395 { 00396 return _phi; 00397 }
const FTWire * FTWire::right | ( | void | ) | const [inline, private] |
void FTWire::setAdc | ( | float | adc | ) | [inline] |
void FTWire::setChi2 | ( | float | chi2 | ) | [inline] |
unsigned FTWire::state | ( | const unsigned | state | ) | [inline] |
set state
Definition at line 487 of file FTWire.h.
References _state, and FTWireStateMask.
00488 { 00489 return _state = (_state&FTWireStateMask)|state; 00490 }
unsigned FTWire::state | ( | void | ) | const [inline] |
returns state
Definition at line 480 of file FTWire.h.
References _state.
Referenced by FTSuperLayer::clear().
00481 { 00482 return _state; 00483 }
unsigned FTWire::stateAND | ( | const unsigned | mask | ) | const [inline] |
void FTWire::stateOR | ( | const unsigned | mask | ) | [inline] |
set state bit
Definition at line 501 of file FTWire.h.
References _state.
Referenced by FTTrack::r_phi2Fit(), and FTTrack::r_phi3Fit().
00502 { 00503 _state|=mask; 00504 }
void FTWire::stateORXOR | ( | const unsigned | mask | ) | [inline] |
void FTWire::stateXOR | ( | const unsigned | mask | ) | [inline] |
float FTWire::t0 | ( | const float | t0 | ) | [inline] |
float FTWire::t0 | ( | void | ) | const [inline] |
float FTWire::time | ( | float | t | ) | [inline] |
float FTWire::time | ( | void | ) | const [inline] |
rerurns TDC time(after t0 subtraction)
Definition at line 457 of file FTWire.h.
References _time.
Referenced by FTTrack::r_phi2Fit(), and FTTrack::r_phi3Fit().
00458 { 00459 return _time; 00460 }
void FTWire::wireId | ( | int | wireID | ) | [inline] |
const float FTWire::x | ( | void | ) | const [inline] |
returns position x
Definition at line 366 of file FTWire.h.
References _x.
Referenced by FTTrack::r_phi2Fit(), and FTTrack::r_phi3Fit().
00367 { 00368 return _x; 00369 }
const float FTWire::y | ( | void | ) | const [inline] |
returns position y
Definition at line 373 of file FTWire.h.
References _y.
Referenced by FTTrack::r_phi2Fit(), and FTTrack::r_phi3Fit().
00374 { 00375 return _y; 00376 }
int FTWire::z | ( | const Lpav & | la, | |
double & | z | |||
) | const [inline] |
returns z for track la
Definition at line 522 of file FTWire.h.
References _dx, _dy, _layer, _x, _y, Lpar::center(), Lpar::radius(), FTLayer::zb(), and FTLayer::zf().
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 }
float FTWire::_distance [private] |
const float FTWire::_dx [private] |
const float FTWire::_dy [private] |
const FTLayer& FTWire::_layer [private] |
Definition at line 170 of file FTWire.h.
Referenced by distance_z(), getInnerNeighbor(), getOuterNeighbor(), layer(), left(), right(), and z().
const int FTWire::_localId [private] |
FTWire* FTWire::_neighbor[6] [private] |
Definition at line 180 of file FTWire.h.
Referenced by chk_left_and_right(), FTWire(), getInnerNeighbor(), getMidNeighbor(), getOuterNeighbor(), and neighborPtr().
float FTWire::_pedestal [private] |
const float FTWire::_phi [private] |
unsigned int FTWire::_state [private] |
Definition at line 179 of file FTWire.h.
Referenced by chk_left_and_right(), clear(), state(), stateAND(), stateOR(), stateORXOR(), and stateXOR().
float FTWire::_t0 [private] |
float FTWire::_time [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] |