CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
FTWire Class Reference

#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 FTLayerlayer (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
 

Detailed Description

Definition at line 43 of file FTWire.h.

Constructor & Destructor Documentation

◆ FTWire() [1/2]

FTWire::FTWire ( const float x,
const float y,
const float dx,
const float dy,
const FTLayer & layer,
const int localID,
FTWire *const vt )
inline

constructors

Definition at line 199 of file FTWire.h.

202 : _x(x), // x position in z = 0;
203 _y(y), // y position in z = 0;
204 _dx(dx),
205 _dy(dy),
206 _layer(layer),
207 _wire(vt),
208 _localId(localID),
209 _phi((const float)2*M_PI*_localId/(float)_layer.NWire()+_layer.offset()),
210 //_wireId(wireID),
211 //_hep(NULL),
212 _distance(0),
213 _t0(0),
214 _time(0),
215 m_adc(0),
216 _pedestal(0),
217 _state(FTWireHitInvalid)
218{
219 getMidNeighbor();
220}
#define FTWireHitInvalid
Definition FTWire.h:13
#define M_PI
Definition FTWire.h:32
const int NWire(void) const
returns the number of wire
Definition FTLayer.h:126
const float offset(void) const
returns offset of numbering(local ID)
Definition FTLayer.h:176
const float y(void) const
returns position y
Definition FTWire.h:373
const FTLayer & layer(void) const
returns layer
Definition FTWire.h:359
const float x(void) const
returns position x
Definition FTWire.h:366

◆ FTWire() [2/2]

FTWire::FTWire ( )
inline

Definition at line 223 of file FTWire.h.

224 : _x(0),
225 _y(0),
226 _dx(0),
227 _dy(0),
228 _layer(*(FTLayer *)NULL),
229 _wire(NULL),
230 _localId(0),
231 //_wireId(0),
232 _phi(0),
233 _distance(0),
234 _t0(0),
235 _time(0),
236 m_adc(0),
237 _pedestal(0),
238 _state(FTWireHitInvalid)
239{
240 _neighbor[0] = NULL;
241 _neighbor[1] = NULL;
242 _neighbor[2] = NULL;
243 _neighbor[3] = NULL;
244 _neighbor[4] = NULL;
245 _neighbor[5] = NULL;
246}

◆ ~FTWire()

FTWire::~FTWire ( )
inline

destructor

Definition at line 249 of file FTWire.h.

250{
251}

Member Function Documentation

◆ chk_left_and_right()

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.

552 {
553 if (((**(_neighbor+2))._state&FTWireHit) &&
554 ((**(_neighbor+3))._state&FTWireHit)){
555 _state |= FTWireHitInvalid;
556 (**(_neighbor+2))._state |= FTWireHitInvalid;
557 (**(_neighbor+3))._state |= FTWireHitInvalid;
558 }
559}
#define FTWireHit
Definition FTWire.h:12

◆ clear()

void FTWire::clear ( void )
inline

clear

Definition at line 347 of file FTWire.h.

348{
349 _distance = 0.;
350 _time = 0.;
351 _t0 = 0.;
352 m_adc = 0.0;
353 _pedestal = 0.;
354 _state = FTWireHitInvalid;
355}

◆ distance() [1/2]

float FTWire::distance ( const float distance)
inline

set drift distance

Definition at line 415 of file FTWire.h.

416{
417 return _distance = distance;
418}
float distance(void) const
returns drift distance
Definition FTWire.h:401

◆ distance() [2/2]

float FTWire::distance ( void ) const
inline

returns drift distance

Definition at line 401 of file FTWire.h.

402{
403 return _distance;
404}

Referenced by distance(), FTTrack::r_phi2Fit(), FTTrack::r_phi3Fit(), FTTrack::r_phi4Fit(), FTTrack::r_phiFit(), FTTrack::r_phiReFit(), and FTTrack::s_zFit().

◆ distance_z()

float FTWire::distance_z ( void ) const
inline

returns z_distance from the center of wire by drift distance

Definition at line 408 of file FTWire.h.

409{
410 return _distance * std::fabs(_layer.tanSlant());
411}
const float tanSlant(void) const
returns tangent of slant angle
Definition FTLayer.h:133

◆ getAdc()

float FTWire::getAdc ( void ) const
inline

Definition at line 591 of file FTWire.h.

591 {
592 return m_adc;
593}

◆ getChi2()

float FTWire::getChi2 ( void ) const
inline

Definition at line 600 of file FTWire.h.

600 {
601 return m_chi2;
602}

◆ getWireId()

int FTWire::getWireId ( void )
inline

get wireId

Definition at line 585 of file FTWire.h.

585 {
586 return _wireId;
587}

◆ initNeighbor()

void FTWire::initNeighbor ( void )
inline

initNeighbor

Definition at line 255 of file FTWire.h.

256{
257 getInnerNeighbor(_wire);
258 getOuterNeighbor(_wire);
259 /*cout << "_layer.layerId()::" << _layer.layerId() << endl;
260 cout << "The WireId ::" << _localId << endl;
261 cout << "Its neighbor 0 ::" << _neighbor[0]->localId() << endl;
262 cout << "Its neighbor 1 ::" << _neighbor[1]->localId() << endl;
263 cout << "Its neighbor 2 ::" << _neighbor[2]->localId() << endl;
264 cout << "Its neighbor 3 ::" << _neighbor[3]->localId() << endl;
265 cout << "Its neighbor 4 ::" << _neighbor[4]->localId() << endl;
266 cout << "Its neighbor 5 ::" << _neighbor[5]->localId() << endl;*/
267}

◆ layer()

const FTLayer & FTWire::layer ( void ) const
inline

◆ localId()

const int FTWire::localId ( void ) const
inline

returns local ID

Definition at line 380 of file FTWire.h.

381{
382 return _localId;
383}

Referenced by FTSuperLayer::reduce_noise().

◆ neighborPtr()

FTWire ** FTWire::neighborPtr ( void )
inline

returns pointer of neighbor array

Definition at line 387 of file FTWire.h.

388{
389 return _neighbor;
390}

◆ pedestal() [1/2]

float FTWire::pedestal ( const float ped)
inline

set pedestal at begin-run

Definition at line 443 of file FTWire.h.

444{
445 return _pedestal = ped;
446}

◆ pedestal() [2/2]

float FTWire::pedestal ( void ) const
inline

returns pedestal read at begin run

Definition at line 436 of file FTWire.h.

437{
438 return _pedestal;
439}

◆ phi()

float FTWire::phi ( void ) const
inline

returns phi

Definition at line 394 of file FTWire.h.

395{
396 return _phi;
397}

Referenced by FTSegment::printout(), and FTSuperLayer::reduce_noise().

◆ setAdc()

void FTWire::setAdc ( float adc)
inline

wangdy add:set Adc value

Definition at line 595 of file FTWire.h.

595 {
596 m_adc = adc;
597}

◆ setChi2()

void FTWire::setChi2 ( float chi2)
inline

set residual fit chi2

Definition at line 604 of file FTWire.h.

604 {
605 m_chi2 = chi2;
606}

Referenced by FTTrack::r_phi4Fit(), and FTTrack::r_phiReFit().

◆ state() [1/2]

unsigned FTWire::state ( const unsigned state)
inline

set state

Definition at line 487 of file FTWire.h.

488{
489 return _state = (_state&FTWireStateMask)|state;
490}
#define FTWireStateMask
Definition FTWire.h:29
unsigned state(void) const
returns state
Definition FTWire.h:480

◆ state() [2/2]

unsigned FTWire::state ( void ) const
inline

returns state

Definition at line 480 of file FTWire.h.

481{
482 return _state;
483}

Referenced by state().

◆ stateAND()

unsigned FTWire::stateAND ( const unsigned mask) const
inline

returns state bit

Definition at line 494 of file FTWire.h.

495{
496 return _state&mask;
497}

Referenced by FTTrack::r_phiFit().

◆ stateOR()

void FTWire::stateOR ( const unsigned mask)
inline

set state bit

Definition at line 501 of file FTWire.h.

502{
503 _state|=mask;
504}

Referenced by FTTrack::r_phi2Fit(), FTTrack::r_phi3Fit(), FTTrack::r_phi4Fit(), FTTrack::r_phiFit(), and FTTrack::r_phiReFit().

◆ stateORXOR()

void FTWire::stateORXOR ( const unsigned mask)
inline

reset state bit

Definition at line 515 of file FTWire.h.

516{
517 _state=(_state|mask)^mask;
518}

◆ stateXOR()

void FTWire::stateXOR ( const unsigned mask)
inline

invert state bit

Definition at line 508 of file FTWire.h.

509{
510 _state^=mask;
511}

◆ t0() [1/2]

float FTWire::t0 ( const float t0)
inline

set t0 at begin-run

Definition at line 429 of file FTWire.h.

430{
431 return _t0 = t0;
432}
float t0(void) const
returns t0 read at begin run
Definition FTWire.h:422

◆ t0() [2/2]

float FTWire::t0 ( void ) const
inline

returns t0 read at begin run

Definition at line 422 of file FTWire.h.

423{
424 return _t0;
425}

Referenced by t0().

◆ time() [1/2]

float FTWire::time ( float t)
inline

reset time

Definition at line 450 of file FTWire.h.

451{
452 return _time = t;
453}
int t()
Definition t.c:1

◆ time() [2/2]

float FTWire::time ( void ) const
inline

◆ wireId()

void FTWire::wireId ( int wireID)
inline

set wireId

Definition at line 580 of file FTWire.h.

580 {
581 _wireId = wireID;
582}

◆ x()

const float FTWire::x ( void ) const
inline

returns position x

Definition at line 366 of file FTWire.h.

367{
368 return _x;
369}

Referenced by FTTrack::r_phi2Fit(), FTTrack::r_phi3Fit(), FTTrack::r_phi4Fit(), FTTrack::r_phiFit(), and FTTrack::r_phiReFit().

◆ y()

const float FTWire::y ( void ) const
inline

returns position y

Definition at line 373 of file FTWire.h.

374{
375 return _y;
376}

Referenced by FTTrack::r_phi2Fit(), FTTrack::r_phi3Fit(), FTTrack::r_phi4Fit(), FTTrack::r_phiFit(), and FTTrack::r_phiReFit().

◆ z()

int FTWire::z ( const Lpav & la,
double & z ) const
inline

returns z for track la

Definition at line 522 of file FTWire.h.

522 {
523 HepVector center = la.center();
524 double rho = la.radius();
525 double dx2 = center(1) - _x;
526 double dy2 = center(2) - _y;
527 double par1 = _dx*_dx + _dy*_dy;
528 double par2 = (_dx*dx2 + _dy*dy2)/par1;
529 double par3 = _dx*dy2 - _dy*dx2;
530 double par4 = rho*rho*par1 - par3*par3;
531 if (par4<0.) return 0;
532 par4 = std::sqrt(par4)/par1;
533 double delta = par2 + par4;
534 //double delta = 0.5;
535 if (delta>=0. && delta<1.){
536 //z = _layer.zb()+delta*(_layer.zf()-_layer.zb());
537 z = _layer.zf()+delta*(_layer.zb()-_layer.zf());
538 return 1;
539 }else{
540 delta = par2 - par4;
541 if (delta>=0. && delta<1.){
542 //z = _layer.zb()+delta*(_layer.zf()-_layer.zb());
543 z = _layer.zf()+delta*(_layer.zb()-_layer.zf());
544 return 1;
545 }
546 }
547 return 0;
548}
const float zf(void) const
returns z of forward end-plate
Definition FTLayer.h:148
const float zb(void) const
returns z of backward end-plate
Definition FTLayer.h:155
int z(const Lpav &la, double &z) const
returns z for track la
Definition FTWire.h:522

Referenced by FTTrack::s_zFit(), and z().


The documentation for this class was generated from the following file: