#include <FTWire.h>
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 FTLayer & | layer (void) const |
returns layer | |
const FTLayer & | layer (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 FTWire * | left (void) const |
returns left wire; | |
const FTWire * | left (void) const |
returns left wire; | |
const FTWire * | right (void) const |
returns left wire; | |
const FTWire * | right (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 |
|
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 }
|
|
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 }
|
|
destructor
00250 { 00251 }
|
|
constructors
|
|
|
|
destructor
|
|
check neighbors of phi-side and raise invalid flag if both hits
|
|
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 }
|
|
clear
|
|
clear
00348 { 00349 _distance = 0.; 00350 _time = 0.; 00351 _t0 = 0.; 00352 m_adc = 0.0; 00353 _pedestal = 0.; 00354 _state = FTWireHitInvalid; 00355 }
|
|
set drift distance
|
|
returns drift distance
|
|
set drift distance
00416 { 00417 return _distance = distance; 00418 }
|
|
returns drift distance
00402 {
00403 return _distance;
00404 }
|
|
returns z_distance from the center of wire by drift distance
|
|
returns z_distance from the center of wire by drift distance
|
|
|
|
00591 {
00592 return m_adc;
00593 }
|
|
|
|
00600 {
00601 return m_chi2;
00602 }
|
|
compute inner Neighbor
|
|
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 }
|
|
compute mid Neighbor
|
|
compute mid Neighbor
|
|
compute outer Neighbor
|
|
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 }
|
|
get wireId
|
|
get wireId
00585 {
00586 return _wireId;
00587 }
|
|
initNeighbor
|
|
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 }
|
|
returns layer
|
|
returns layer
00360 {
00361 return _layer;
00362 }
|
|
returns left wire;
|
|
returns left wire;
00563 { 00564 const FTWire * tmp = this; 00565 if (!_localId) tmp += _layer.NWire(); 00566 return --tmp; 00567 }
|
|
returns local ID
|
|
returns local ID
00381 {
00382 return _localId;
00383 }
|
|
returns pointer of neighbor array
|
|
returns pointer of neighbor array
00388 {
00389 return _neighbor;
00390 }
|
|
set pedestal at begin-run
|
|
returns pedestal read at begin run
|
|
set pedestal at begin-run
00444 { 00445 return _pedestal = ped; 00446 }
|
|
returns pedestal read at begin run
00437 {
00438 return _pedestal;
00439 }
|
|
returns phi
|
|
returns phi
00395 {
00396 return _phi;
00397 }
|
|
returns left wire;
|
|
returns left wire;
00571 { 00572 const FTWire * tmp = this; 00573 if (_localId == (_layer.NWire()-1)) { 00574 tmp -= _layer.NWire(); 00575 } 00576 return ++tmp; 00577 }
|
|
wangdy add:set Adc value
|
|
wangdy add:set Adc value
00595 { 00596 m_adc = adc; 00597 }
|
|
set residual fit chi2
|
|
set residual fit chi2
00604 { 00605 m_chi2 = chi2; 00606 }
|
|
set state
|
|
returns state
|
|
set state
|
|
returns state
00481 {
00482 return _state;
00483 }
|
|
returns state bit
|
|
returns state bit
00495 { 00496 return _state&mask; 00497 }
|
|
set state bit
|
|
set state bit
00502 { 00503 _state|=mask; 00504 }
|
|
reset state bit
|
|
reset state bit
|
|
invert state bit
|
|
invert state bit
00509 { 00510 _state^=mask; 00511 }
|
|
set t0 at begin-run
|
|
returns t0 read at begin run
|
|
set t0 at begin-run
00430 { 00431 return _t0 = t0; 00432 }
|
|
returns t0 read at begin run
00423 {
00424 return _t0;
00425 }
|
|
reset time
|
|
rerurns TDC time(after t0 subtraction)
|
|
reset time
00451 { 00452 return _time = t; 00453 }
|
|
rerurns TDC time(after t0 subtraction)
00458 {
00459 return _time;
00460 }
|
|
set wireId
|
|
set wireId
00580 { 00581 _wireId = wireID; 00582 }
|
|
returns position x
|
|
returns position x
00367 {
00368 return _x;
00369 }
|
|
returns position y
|
|
returns position y
00374 {
00375 return _y;
00376 }
|
|
returns z for track la
|
|
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 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|