FTTrack Class Reference

#include <FTTrack.h>

List of all members.

Public Member Functions

 FTTrack (FTList< FTSegment * > &axial_segments, float kappa, float chi2_kappa)
 constructor
 ~FTTrack ()
 destructor
int r_phiFit (void)
 do r-phi circle fit
int r_phiReFit (float vx, float xy, int vtx_flag)
 do r-phi refit
int r_phi2Fit (float vx, float xy, int vtx_flag)
int r_phi3Fit (int l, float vx, float xy, int vtx_flag)
int r_phi4Fit (float vx, float xy, int vtx_flag)
int s_zFit (void)
 do s-z linear fit
void updateSZ (void)
 update s and z information for linking
int linkStereoSegments (void)
 link stereo segments by tanLambda
Helixhelix (void) const
 returns helix parameters
const Lpavlpav (void) const
 returns lpav
const zavZav (void) const
 returns zav
FTList< FTSegment * > & axial_segments (void) const
 returns axial segments
FTList< FTSegment * > & stereo_segments (void) const
 returns stereo_segments
float kappa_tmp (void) const
 returns kappa at linking
float chi2_kappa_tmp (void) const
 returns sigmaKappa at linking
float d_z (float s, float z) const
void printout ()
float SigmaZ (float z)
 add z for culculation of tanLambda
float SigmaS (float s)
 add s for culculation of tanLambda
float SigmaSS (float ss)
 add s for culculation of dz, tanLambda
float SigmaSZ (float sz)
 add s for culculation of dz, tanLambda
void append_stereo (FTSegment *, float s, float z)
 append stereo segment to the stereo segment list
void append_stereo_cache (FTSegment *)
 append stereo segment to the cache
int get_nhits (void)
 calculate the wire hits number
void setFTFinder (FTFinder *)

Public Attributes

float minPt
float minDr
float xtCoEff
float Testime
Lpav_la
zav_za
Helix_helix
FTList< FTSegment * > & _axial_segments
FTList< FTSegment * > * _stereo_segments
FTList< FTSegment * > * _stereo_segments_cache
FTList< FTList< FTSegment * > * > * _stereo_segments_by_superLayer
union {
   float   _kappa
   float   _SigmaS
}; 
union {
   float   _chi2_kappa
   float   _SigmaSS
}; 
float _SigmaZ
float _SigmaSZ

Static Public Attributes

static MdcParameterparam = MdcParameter::instance()

Private Attributes

FTFinderm_ftFinder
IMagneticFieldSvcm_pmgnIMF


Detailed Description

Definition at line 27 of file FTTrack.h.


Constructor & Destructor Documentation

FTTrack::FTTrack ( FTList< FTSegment * > &  axial_segments,
float  kappa,
float  chi2_kappa 
) [inline]

constructor

Definition at line 160 of file FTTrack.h.

References m_pmgnIMF.

00162   : _la(NULL),
00163     _za(NULL),
00164     _helix(NULL),
00165     _axial_segments(axial_segments),
00166     _stereo_segments(NULL),
00167     _stereo_segments_cache(NULL),
00168     _stereo_segments_by_superLayer(NULL),
00169     //_wireHits(*(new FTList<FTWire *>(50))),
00170     _kappa(kappa),
00171     _chi2_kappa(chi2_kappa)
00172 {
00173   StatusCode scmgn = Gaudi::svcLocator()->service("MagneticFieldSvc",m_pmgnIMF);
00174   if(scmgn!=StatusCode::SUCCESS) {
00175     std::cout<< "Unable to open Magnetic field service"<<std::endl;
00176   }
00177 }

FTTrack::~FTTrack (  )  [inline]

destructor

Definition at line 180 of file FTTrack.h.

References _axial_segments, _helix, _la, _stereo_segments, and _za.

00181 {
00182   delete &_axial_segments;
00183   delete _la;
00184   delete _za;
00185   delete _stereo_segments;
00186   delete _helix;
00187 }


Member Function Documentation

void FTTrack::append_stereo ( FTSegment ,
float  s,
float  z 
) [inline]

append stereo segment to the stereo segment list

Definition at line 212 of file FTTrack.h.

References _SigmaS, _SigmaSS, _SigmaSZ, _SigmaZ, _stereo_segments, FTList< T >::append(), and s.

00213 {
00214   _stereo_segments->append(src);
00215   _SigmaS += s;
00216   _SigmaZ += z;
00217   _SigmaSZ += s*z;
00218   _SigmaSS += s*s;
00219 }

void FTTrack::append_stereo_cache ( FTSegment  )  [inline]

append stereo segment to the cache

Definition at line 205 of file FTTrack.h.

References _stereo_segments_cache, and FTList< T >::append().

00206 {
00207   _stereo_segments_cache->append(src);
00208 }

FTList< FTSegment * > & FTTrack::axial_segments ( void   )  const [inline]

returns axial segments

Definition at line 191 of file FTTrack.h.

References _axial_segments.

Referenced by FTFinder::makeTds(), FTFinder::mkTrackList(), and printout().

00192 {
00193   return _axial_segments;
00194 }

float FTTrack::chi2_kappa_tmp ( void   )  const [inline]

returns sigmaKappa at linking

Definition at line 230 of file FTTrack.h.

References _chi2_kappa.

Referenced by FTFinder::mkTrackList().

00231 {
00232   return _chi2_kappa;
00233 }

float FTTrack::d_z ( float  s,
float  z 
) const [inline]

returns difference between z and estimated z at stereo segment linking if its valid

Definition at line 286 of file FTTrack.h.

References _SigmaS, _SigmaSS, _SigmaSZ, _SigmaZ, _stereo_segments, and FTList< T >::length().

Referenced by linkStereoSegments(), and updateSZ().

00287 {
00288   int n = _stereo_segments->length();
00289   if (!n) return 0;
00290   float Dz = (n==1)
00291     ? z - s*_SigmaZ/_SigmaS
00292     : z - (s*(_SigmaSZ-_SigmaS*_SigmaZ)+_SigmaSS*_SigmaZ-_SigmaS*_SigmaSZ)
00293       / (_SigmaSS - _SigmaS*_SigmaS);
00294   return (Dz < 10*(7-n)) ? Dz : 9999.;
00295 }

int FTTrack::get_nhits ( void   ) 

calculate the wire hits number

Definition at line 484 of file FTTrack.cxx.

References _axial_segments, _stereo_segments, genRecEmupikp::i, ganga-rec::j, and FTList< T >::length().

00485 {
00486   int nhits = 0;
00487   int n = _axial_segments.length();
00488   for (int i = 0; i^n; i++) {
00489     nhits += _axial_segments[i]->wireHits().length();
00490   }
00491   n = _stereo_segments->length();
00492   for (int j = 0; j^n; j++) {
00493     nhits += (*_stereo_segments)[j]->wireHits().length();
00494   }
00495   return nhits;
00496 }

Helix * FTTrack::helix ( void   )  const [inline]

returns helix parameters

Definition at line 251 of file FTTrack.h.

References _helix.

Referenced by FTFinder::makeTds().

00252 {
00253   return _helix;
00254 }

float FTTrack::kappa_tmp ( void   )  const [inline]

returns kappa at linking

Definition at line 223 of file FTTrack.h.

References _kappa.

00224 {
00225   return _kappa;
00226 }

int FTTrack::linkStereoSegments ( void   ) 

link stereo segments by tanLambda

Definition at line 342 of file FTTrack.cxx.

References _SigmaS, _SigmaSS, _SigmaSZ, _SigmaZ, _stereo_segments, _stereo_segments_by_superLayer, _stereo_segments_cache, FTList< T >::append(), d_z(), FTList< T >::deleteAll(), genRecEmupikp::i, ganga-rec::j, FTList< T >::length(), s, and selected.

00342                                {
00343   delete _stereo_segments_cache;
00344   int n = _stereo_segments_by_superLayer->length();
00345   for (int i = 0; i^n; i++){
00346     FTList<FTSegment *> & segments = *(*_stereo_segments_by_superLayer)[i];
00347     int m = segments.length();
00348     float min_D_z = 9998.;
00349     float S = 0.;
00350     float Z = 0.;
00351     FTSegment * selected = NULL;
00352     for (int j = 0; j^m; j++){
00353       FTSegment * s = segments[j];
00354       float s_tmp = s->s();
00355       float z_tmp = s->z();
00356       double D_z = fabs(d_z(s_tmp,z_tmp));
00357       if (D_z < min_D_z){
00358         selected = s;
00359         min_D_z = D_z;
00360         S = s_tmp;
00361         Z = z_tmp;
00362       }
00363     }
00364     if (selected){
00365       _stereo_segments->append(selected);
00366       _SigmaS += S;
00367       _SigmaZ += Z;
00368       _SigmaSZ += S*Z;
00369       _SigmaSS += S*S;
00370     }
00371   }
00372   _stereo_segments_by_superLayer->deleteAll();
00373   delete _stereo_segments_by_superLayer;
00374   return 0;
00375 }

const Lpav & FTTrack::lpav ( void   )  const [inline]

returns lpav

Definition at line 237 of file FTTrack.h.

References _la.

Referenced by FTFinder::makeTds(), and FTSegment::update3D().

00238 {
00239   return *_la;
00240 }

void FTTrack::printout (  ) 

printout _tracks infomation added by X.-R. Lu

Definition at line 499 of file FTTrack.cxx.

References axial_segments(), genRecEmupikp::i, FTList< T >::length(), and stereo_segments().

00499                       {
00500   int n = axial_segments().length();
00501   for (int i = 0; i^n; i++) axial_segments()[i]->printout();
00502   n = stereo_segments().length();
00503   for (int i = 0; i^n; i++) stereo_segments()[i]->printout();  
00504 }

int FTTrack::r_phi2Fit ( float  vx,
float  xy,
int  vtx_flag 
)

Definition at line 191 of file FTTrack.cxx.

References _axial_segments, _la, Lpav::add_point(), Lpav::chisq(), Lpav::clear(), FTLayer::csize(), Lpar::d(), FTWire::distance(), FTFinder::evtTiming, Lpav::fit(), FTWireHitLeft, FTWireHitRight, Lpar::Hpar(), genRecEmupikp::i, ganga-rec::j, FTWire::layer(), FTList< T >::length(), m_ftFinder, Lpav::nc(), FTFinder::pivot, FTLayer::r(), FTWire::stateOR(), FTFinder::t2x(), subSeperate::temp, FTWire::time(), FTWire::x(), x, and FTWire::y().

00192 {
00193   if (vtx_flag) _la->fit(vx, vy, 20*_la->chisq()/_la->nc());
00194   int n = _axial_segments.length();
00195   _la->clear();
00196   int k=0,l=0;
00197   float temp=0;
00198   for (int i = 0; i^n; i++){
00199     FTList<FTWire *> & hits = _axial_segments[i]->wireHits();
00200      int m = hits.length();
00201      for (int j = 0; j^m; j++){
00202       k++;
00203       FTWire & h = * hits[j];
00204       const float x = h.x();
00205       const float y = h.y();
00206       double d0 = _la->d((double)x,(double)y);
00207       float cellsize = h.layer().csize();
00208       if (m_ftFinder->evtTiming){
00209         float time = h.time() + m_ftFinder->evtTiming ;
00210         if(time<-100) continue;
00211         h.distance(m_ftFinder->t2x(h.layer(),time));
00212         //      h.distance(time*40*0.0001);
00213       }
00214       float delta = h.distance()/h.layer().r();
00215       if (fabs(d0) > 0.5*cellsize) continue; // remove bad hits
00216       if (h.distance()<0.1 || h.distance()>0.6) continue;
00217       if (d0>0){                        // left or right
00218         h.stateOR(FTWireHitRight);
00219         d0 = -d0;
00220       }else{
00221         h.stateOR(FTWireHitLeft);
00222         delta = -delta;
00223       }
00224 #ifndef OnlineMode
00225       //fill histogram 
00226        //g_sigmaxy->fill(h.distance()+d0, 1.0);
00227 #endif
00228       _la->add_point(x - delta*y, y + delta*x, 1);
00229       if(temp<fabs(h.distance()+d0)){
00230         temp=fabs(h.distance()+d0);
00231         l=k;
00232       }
00233     }
00234   }
00235   HepVector b = _la->Hpar(m_ftFinder->pivot);
00236   double  chi2 = _la->fit();            // refit using drift distance
00237 #ifndef OnlineMode
00238   // g_chi2xy->fill(chi2/_la->nc(), 1.0);
00239 #endif
00240   if(k>5){        
00241     return  l;
00242   }
00243   else{
00244     return -99;
00245   }
00246 }

int FTTrack::r_phi3Fit ( int  l,
float  vx,
float  xy,
int  vtx_flag 
)

Definition at line 249 of file FTTrack.cxx.

References _axial_segments, _la, Lpav::add_point(), Lpav::chisq(), Lpav::clear(), FTLayer::csize(), Lpar::d(), FTWire::distance(), FTFinder::evtTiming, Lpav::fit(), FTWireHitLeft, FTWireHitRight, Lpar::Hpar(), genRecEmupikp::i, ganga-rec::j, FTWire::layer(), FTList< T >::length(), m_ftFinder, Lpav::nc(), FTFinder::pivot, FTLayer::r(), FTWire::stateOR(), FTFinder::t2x(), FTWire::time(), FTWire::x(), x, and FTWire::y().

00250 {
00251   if (vtx_flag) _la->fit(vx, vy, 20*_la->chisq()/_la->nc());
00252   int n = _axial_segments.length();
00253   _la->clear();
00254   int k=0;
00255   for (int i = 0; i^n; i++){
00256     FTList<FTWire *> & hits = _axial_segments[i]->wireHits();
00257     int m = hits.length();
00258     for (int j = 0; j^m; j++){
00259       k++;
00260       FTWire & h = * hits[j];
00261       const float x = h.x();
00262       const float y = h.y();
00263       double d0 = _la->d((double)x,(double)y);
00264       float cellsize = h.layer().csize();
00265       if (m_ftFinder->evtTiming){
00266         float time = h.time() + m_ftFinder->evtTiming ;
00267         if(time<-100) continue;
00268         h.distance(m_ftFinder->t2x(h.layer(),time));
00269         //h.distance(time*40*0.0001);
00270       }
00271       float delta = h.distance()/h.layer().r();
00272       if (fabs(d0) > 0.5*cellsize) continue; // remove bad hits
00273       if (d0>0){                        // left or right
00274         h.stateOR(FTWireHitRight);
00275         d0 = -d0;
00276       }else{
00277         h.stateOR(FTWireHitLeft);
00278         delta = -delta;
00279       }
00280       if (k==l){
00281         //delete hits[j];
00282         m=hits.remove(j);
00283         continue;
00284       }
00285       _la->add_point(x - delta*y, y + delta*x, 1);
00286       // h.setChi2(h.distance()+d0);
00287     }
00288   }
00289   HepVector b = _la->Hpar(m_ftFinder->pivot);
00290   double chi2 = _la->fit();            // refit using drift distance
00291   return 1;
00292 }

int FTTrack::r_phi4Fit ( float  vx,
float  xy,
int  vtx_flag 
)

Definition at line 295 of file FTTrack.cxx.

References _axial_segments, _la, Lpav::add_point(), Lpav::chisq(), Lpav::clear(), Lpar::d(), FTFinder::evtTiming, Lpav::fit(), FTWireHitLeft, FTWireHitRight, Lpar::Hpar(), genRecEmupikp::i, ganga-rec::j, FTList< T >::length(), m_ftFinder, Lpav::nc(), FTFinder::pivot, FTFinder::t2x(), and x.

00296 {
00297   if (vtx_flag) _la->fit(vx, vy, 20*_la->chisq()/_la->nc());
00298   int n = _axial_segments.length();
00299   _la->clear();
00300   for (int i = 0; i^n; i++){
00301     FTList<FTWire *> & hits = _axial_segments[i]->wireHits();
00302     int m = hits.length();
00303     for (int j = 0; j^m; j++){
00304       FTWire & h = * hits[j];
00305       const float x = h.x();
00306       const float y = h.y();
00307       double d0 = _la->d((double)x,(double)y);
00308       float cellsize = h.layer().csize();
00309       if (m_ftFinder->evtTiming){
00310         float time = h.time() + m_ftFinder->evtTiming ;
00311         if(time<-100) continue;
00312         h.distance(m_ftFinder->t2x(h.layer(),time));
00313         //h.distance(time*40*0.0001);
00314       }
00315       float delta = h.distance()/h.layer().r();
00316       if (fabs(d0) > 0.5*cellsize) continue; // remove bad hits
00317       if (d0>0){                        // left or right
00318         h.stateOR(FTWireHitRight);
00319         d0 = -d0;
00320       }else{
00321         h.stateOR(FTWireHitLeft);
00322         delta = -delta;
00323       }
00324     
00325       _la->add_point(x - delta*y, y + delta*x, 1);
00326       h.setChi2(h.distance()+d0);
00327 #ifndef OnlineMode
00328       //fill histogram 
00329       // g_sigmaxy->fill(h.distance()+d0, 1.0);
00330 #endif
00331     }
00332   }
00333   HepVector b = _la->Hpar(m_ftFinder->pivot);
00334   double chi2 = _la->fit();            // refit using drift distance
00335 #ifndef OnlineMode
00336  // g_chi2xy->fill(chi2/_la->nc(), 1.0);
00337 #endif
00338   return 1;
00339 }

int FTTrack::r_phiFit ( void   ) 

do r-phi circle fit

Definition at line 37 of file FTTrack.cxx.

References _axial_segments, _kappa, _la, MdcParameter::_minDr, MdcParameter::_minPt, _SigmaS, _SigmaSS, _SigmaSZ, _SigmaZ, _stereo_segments, _stereo_segments_by_superLayer, _stereo_segments_cache, _za, Lpav::add_point(), FTList< T >::append(), Lpar::center(), Lpav::clear(), FTSuperLayer::complecated_segments(), Lpar::d(), Bes_Common::DEBUG, exp(), Lpav::fit(), FTWireFittingInvalid, FTWireHitLeft, FTWireHitRight, IMagneticFieldSvc::getReferField(), Lpar::Hpar(), genRecEmupikp::i, ganga-rec::j, FTList< T >::length(), m_ftFinder, m_pmgnIMF, msgSvc(), Lpav::nc(), param, FTFinder::pivot, FTFinder::superLayer(), and x.

00038 {
00039   IMessageSvc *msgSvc;
00040   Gaudi::svcLocator()->service("MessageSvc", msgSvc);
00041 
00042   MsgStream log(msgSvc, "FTFinder");
00043 
00044   // static const float alpha(333.564095);
00045   if (fabs(_kappa) > 1.2/param->_minPt) return 0;
00046 
00047   _la = new Lpav;
00048   int n = _axial_segments.length();
00049   for (int i = 0; i^n; i++){
00050     FTList<FTWire *> & hits = _axial_segments[i]->wireHits();
00051     int m = hits.length();
00052     for (int j = 0; j^m; j++){
00053       FTWire & h = * hits[j];
00054       if (h.stateAND(FTWireFittingInvalid)){
00055         hits.remove(j);
00056         continue;
00057       }
00058       //      log << MSG::DEBUG << "layer: "<< h.layer().layerId() << " phi: " << h.phi() << " df_distance: "<< h.distance() << endreq;
00059       double par = h.distance()/(0.25*h.layer().csize());
00060       _la->add_point((double)h.x(),(double)h.y(),exp(-par*par));
00061     }
00062   }
00063 
00064   double chi2 = _la->fit();
00065   HepVector a = _la->Hpar(m_ftFinder->pivot);
00066   log << MSG::DEBUG << " chi2/_la cut(1): " << chi2 << " / " << _la->nc() 
00067       <<" a1(" << param->_minDr << "): " << a(1) 
00068       <<" a3(" << 1.05/param->_minPt << "):" << a(3) <<endreq;
00069   if (chi2/_la->nc() > 1.) return 0;
00070   if (fabs(a(3))>(1.05/param->_minPt)) return 0; 
00071   if (fabs(a(1))>param->_minDr) return 0;
00072   _la->clear();
00073   log << MSG::DEBUG << " passed chi2/_la, a(3) and a(1) cut" <<endreq;
00074   int layer0 = 0;
00075   for (int i = 0; i^n; i++){
00076     FTList<FTWire *> & hits = _axial_segments[i]->wireHits();
00077     if (!_axial_segments[i]->superLayer().superLayerId()) layer0 = 1;
00078     int m = hits.length();
00079     for (int j = 0; j^m; j++){
00080       FTWire & h = * hits[j];
00081       const float x = h.x();
00082       const float y = h.y();
00083       double d0 = _la->d((double)x,(double)y);
00084       float delta = h.distance()/h.layer().r();
00085       if (fabs(d0) > 0.7*h.layer().csize()) continue; // remove bad hits
00086       if (d0>0){                        // left or right
00087         d0 = -d0;
00088       }else{
00089         delta = -delta;
00090       }
00091       _la->add_point(x - delta*y, y + delta*x, 1);
00092     }
00093   }
00094   if (!layer0){          // salvage hits from complecated segments in layer0
00095     FTList<FTSegment *> & salvage = 
00096       m_ftFinder->superLayer(0)->complecated_segments();
00097     HepVector center = _la->center();
00098     const float xc = center(1);
00099     const float yc = center(2);
00100     const float rc = a(1)+(-1. / 2.99792458 /m_pmgnIMF->getReferField())/a(3); // rho+drho(signed)
00101     int nn = salvage.length();
00102     for (int i = 0; i^nn; i++){
00103       int salvaged = 0;
00104       FTList<FTWire *> & hits = salvage[i]->wireHits();
00105       int m = hits.length();
00106       for (int j = 0; j^m; j++){
00107         FTWire & h = * hits[j];
00108         float x = h.x();
00109         float y = h.y();
00110         float r = h.layer().r();
00111         if ((y*xc-x*yc)/(r*rc)<0.707) break;
00112         double d0 = _la->d((double)x,(double)y);
00113         float delta = h.distance()/r;
00114         if (fabs(d0) > 0.7*h.layer().csize()) continue; // remove bad hits
00115         if (d0>0){                      // left or right
00116           h.stateOR(FTWireHitRight);
00117           d0 = -d0;
00118         }else{
00119           h.stateOR(FTWireHitLeft);
00120           delta = -delta;
00121         }
00122         _la->add_point(x - delta*y, y + delta*x, 1);
00123         salvaged = 1;
00124       }
00125       if (salvaged){
00126         _axial_segments.append(salvage[i]);
00127         break;
00128       }
00129     }
00130   }
00131   chi2 = _la->fit();            // refit using drift distance
00132   _stereo_segments = new FTList<FTSegment *>(6);  
00133   _stereo_segments_cache = new FTList<FTSegment *>(3);
00134   _stereo_segments_by_superLayer = new FTList<FTList<FTSegment *> *>(6);
00135   _za = new zav;
00136   _SigmaS = 0.;
00137   _SigmaZ = 0.;
00138   _SigmaSS = 0.;
00139   _SigmaSZ = 0.;
00140   return 1;
00141 }

int FTTrack::r_phiReFit ( float  vx,
float  xy,
int  vtx_flag 
)

do r-phi refit

Definition at line 144 of file FTTrack.cxx.

References _axial_segments, _la, Lpav::add_point(), Lpav::chisq(), Lpav::clear(), Lpar::d(), FTFinder::evtTiming, Lpav::fit(), FTWireHitLeft, FTWireHitRight, g_chi2xy, g_sigmaxy, Lpar::Hpar(), genRecEmupikp::i, ganga-rec::j, FTList< T >::length(), m_ftFinder, Lpav::nc(), FTFinder::pivot, FTFinder::t2x(), and x.

00145 {
00146   if (vtx_flag) _la->fit(vx, vy, 20*_la->chisq()/_la->nc());
00147   int n = _axial_segments.length();
00148   _la->clear();
00149   for (int i = 0; i^n; i++){
00150     FTList<FTWire *> & hits = _axial_segments[i]->wireHits();
00151     int m = hits.length();
00152     for (int j = 0; j^m; j++){
00153       FTWire & h = * hits[j];
00154       const float x = h.x();
00155       const float y = h.y();
00156       double d0 = _la->d((double)x,(double)y);
00157       float cellsize = h.layer().csize();
00158       if (m_ftFinder->evtTiming){
00159         float time = h.time() + m_ftFinder->evtTiming;
00160         if(time<-100) continue; // discard the bad TDC time
00161         h.distance(m_ftFinder->t2x(h.layer(),time));
00162         //h.distance(time*40*0.0001);
00163       }
00164       float delta = h.distance()/h.layer().r();
00165       if (fabs(d0) > 0.5*cellsize) continue; // remove bad hits
00166       if (d0>0){                        // left or right
00167         h.stateOR(FTWireHitRight);
00168         d0 = -d0;
00169       }else{
00170         h.stateOR(FTWireHitLeft);
00171         delta = -delta;
00172       }
00173       h.setChi2(h.distance()+d0);
00174 #ifndef OnlineMode
00175       //fill histogram 
00176       g_sigmaxy->fill(h.distance()+d0, 1.0);
00177 #endif
00178       _la->add_point(x - delta*y, y + delta*x, 1);
00179     }
00180   }
00181   HepVector b = _la->Hpar(m_ftFinder->pivot);
00182   double  chi2 = _la->fit();            // refit using drift distance
00183 #ifndef OnlineMode
00184   g_chi2xy->fill(chi2/_la->nc(), 1.0);
00185 #endif
00186           
00187   return 1;
00188 } 

int FTTrack::s_zFit ( void   ) 

do s-z linear fit

Definition at line 378 of file FTTrack.cxx.

References _helix, _la, MdcParameter::_nc, MdcParameter::_nlength, MdcParameter::_nseg, _stereo_segments, MdcParameter::_z_cut1, MdcParameter::_z_cut2, _za, zav::a(), zav::add(), FTList< T >::append(), zav::b(), zav::calculate(), zav::clear(), zav::d(), Bes_Common::DEBUG, FTFinder::evtTiming, exp(), g_chi2sz, g_sigmaz, Helix, Lpar::Hpar(), genRecEmupikp::i, ganga-rec::j, FTList< T >::length(), m_ftFinder, msgSvc(), zav::nc(), param, FTFinder::pivot, FTList< T >::remove(), FTList< T >::remove2(), Lpar::s(), s, and FTFinder::t2x().

00378                    {
00379   IMessageSvc *msgSvc;
00380   Gaudi::svcLocator()->service("MessageSvc", msgSvc);
00381 
00382   MsgStream log(msgSvc, "FTFinder");
00383 
00384   HepVector a = _la->Hpar(m_ftFinder->pivot);
00385   int n = _stereo_segments->length();
00386   log<<MSG::DEBUG<<"number of stereo segments: "<< n << endreq;
00387   if (n < (param->_nseg)){
00388     a(4) = -9999.;
00389     a(5) = -9999.;
00390     _helix = new Helix(m_ftFinder->pivot,a);
00391     log<<MSG::DEBUG<<"cut by _nseg" << param->_nseg << endreq;
00392     return 0;
00393   }
00394   FTList<double> zList(50);
00395   FTList<double> sList(50);
00396   FTList<FTWire *> hList(50);
00397   for (int i = 0; i^n; i++){
00398     FTList<FTWire *> & hits = (*_stereo_segments)[i]->wireHits();
00399     int m = hits.length();
00400     for (int j = 0; j^m; j++){
00401       FTWire & h = * hits[j];
00402       double z;
00403       if (!(h.z(*_la,z))) continue;
00404       double s = _la->s(h.layer().r());
00405       float cellsize = h.layer().csize();
00406       log<<MSG::DEBUG<<"cellsize: " << cellsize << endreq;
00407 
00408       if (m_ftFinder->evtTiming){
00409         float time = h.time() + m_ftFinder->evtTiming;
00410         if(time<-100) continue; //discard the bad TDC time
00411         double distance = m_ftFinder->t2x(h.layer(),time);
00412         h.distance(distance);
00413         log<<MSG::DEBUG<<"m_ftFinder->evtTiming: "<< m_ftFinder->evtTiming << " TDC time: " << h.time() << " distance: "<< distance << endreq;
00414       }
00415 
00416       double par = h.distance()/(0.25*cellsize);
00417       _za->add(s,z,exp(-par*par));
00418       sList.append(s);
00419       zList.append(z);
00420       hList.append(&h);
00421     }
00422   }
00423   if (hList.length() < (param->_nlength)){
00424     a(4) = -9999.;
00425     a(5) = -9999.;
00426     _helix = new Helix(m_ftFinder->pivot,a);
00427     log << MSG::DEBUG << "cut by _nlength: " << param->_nlength << endreq;
00428     return 0;
00429   }   
00430   double chi2 = _za->calculate();
00431   _za->clear();
00432   n = hList.length();
00433   for (int i = 0; i^n; i++){
00434     double d = _za->d(sList[i],zList[i]);
00435     float z_distance = hList[i]->distance_z();
00436     if (fabs(fabs(d)-z_distance) > (param->_z_cut1)){ 
00437       log<<MSG::DEBUG<<"cut by _z_cut1: "<< param->_z_cut1 << endreq;
00438       zList.remove2(i);
00439       sList.remove2(i);
00440       n = hList.remove(i);
00441       continue;
00442     }
00443     _za->add(sList[i], (d>0) ? zList[i]-z_distance : zList[i]+z_distance, 1.);
00444   }
00445 
00446   if (_za->nc() < (param->_nc)){
00447     a(4) = -9999.;
00448     a(5) = -9999.;
00449     _helix = new Helix(m_ftFinder->pivot,a);
00450     log<<MSG::DEBUG<<"cut by _nc: " << param->_nc << endreq;
00451     return 0;
00452   }    
00453   chi2 = _za->calculate();
00454   _za->clear();
00455   for (int i = 0; i^n; i++){
00456     double d = _za->d(sList[i],zList[i]);
00457     float z_distance = hList[i]->distance_z();
00458     hList[i]->setChi2(fabs(d)-z_distance);
00459  #ifndef OnlineMode
00460     //fill ntuple
00461     g_sigmaz->fill(fabs(d)-z_distance, 1.0);
00462 #endif
00463     if (fabs(fabs(d)-z_distance) > (param->_z_cut2)) continue; 
00464     _za->add(sList[i], (d>0) ? zList[i]-z_distance : zList[i]+z_distance, 1.);
00465   }
00466 
00467   if (_za->nc() < (param->_nc)){
00468     a(4) = -9999.;
00469     a(5) = -9999.;
00470     _helix = new Helix(m_ftFinder->pivot,a);
00471     log<<MSG::DEBUG<<"cut by _nc" << param->_nc << endreq;
00472     return 0;
00473   }    
00474   chi2 = _za->calculate();
00475 #ifndef OnlineMode
00476   g_chi2sz->fill(chi2/_za->nc(), 1.0);
00477 #endif
00478   a(4) = _za->b();              // dz
00479   a(5) = _za->a();              // tanLambda
00480   _helix = new Helix(m_ftFinder->pivot,a);
00481   return 1;
00482 }

void FTTrack::setFTFinder ( FTFinder  )  [inline]

Definition at line 323 of file FTTrack.h.

References m_ftFinder.

Referenced by FTFinder::mkTrackList().

00324 {
00325   m_ftFinder = finder;
00326 }

float FTTrack::SigmaS ( float  s  )  [inline]

add s for culculation of tanLambda

Definition at line 265 of file FTTrack.h.

References _SigmaS.

00266 {
00267   return _SigmaS += s;
00268 }

float FTTrack::SigmaSS ( float  ss  )  [inline]

add s for culculation of dz, tanLambda

Definition at line 279 of file FTTrack.h.

References _SigmaSS.

00280 {
00281   return _SigmaSS += ss;
00282 }

float FTTrack::SigmaSZ ( float  sz  )  [inline]

add s for culculation of dz, tanLambda

Definition at line 272 of file FTTrack.h.

References _SigmaSZ.

00273 {
00274   return _SigmaSZ += sz;
00275 }

float FTTrack::SigmaZ ( float  z  )  [inline]

add z for culculation of tanLambda

Definition at line 258 of file FTTrack.h.

References _SigmaZ.

00259 {
00260   return _SigmaZ += z;
00261 }

FTList< FTSegment * > & FTTrack::stereo_segments ( void   )  const [inline]

returns stereo_segments

Definition at line 198 of file FTTrack.h.

References _stereo_segments.

Referenced by FTFinder::makeTds(), and printout().

00199 {
00200   return *_stereo_segments;
00201 }

void FTTrack::updateSZ ( void   )  [inline]

update s and z information for linking

Definition at line 300 of file FTTrack.h.

References _SigmaS, _SigmaSS, _SigmaSZ, _SigmaZ, _stereo_segments, _stereo_segments_by_superLayer, _stereo_segments_cache, FTList< T >::append(), FTList< T >::clear(), d_z(), FTList< T >::first(), FTList< T >::length(), and s.

00301 {
00302   int n = _stereo_segments_cache->length();
00303   if (n==1){
00304     FTSegment * s = _stereo_segments_cache->first();
00305     float s_tmp = s->s();
00306     float z_tmp = s->z();
00307     if (d_z(s_tmp,z_tmp) < 9998.){
00308       _SigmaS += s_tmp;
00309       _SigmaZ += z_tmp;
00310       _SigmaSS += s_tmp*s_tmp;
00311       _SigmaSZ += s_tmp*z_tmp;
00312       _stereo_segments->append(s);
00313     }
00314     _stereo_segments_cache->clear();
00315   }else if(n){
00316     _stereo_segments_by_superLayer->append(_stereo_segments_cache);
00317     _stereo_segments_cache = new FTList<FTSegment *>(3);
00318   }
00319 }

const zav & FTTrack::Zav ( void   )  const [inline]

returns zav

Definition at line 244 of file FTTrack.h.

References _za.

Referenced by FTFinder::makeTds().

00245 {
00246   return *_za;
00247 }


Member Data Documentation

union { ... }

union { ... }

FTList<FTSegment *>& FTTrack::_axial_segments

Definition at line 130 of file FTTrack.h.

Referenced by axial_segments(), get_nhits(), r_phi2Fit(), r_phi3Fit(), r_phi4Fit(), r_phiFit(), r_phiReFit(), and ~FTTrack().

float FTTrack::_chi2_kappa

Definition at line 141 of file FTTrack.h.

Referenced by chi2_kappa_tmp().

Helix* FTTrack::_helix

Definition at line 129 of file FTTrack.h.

Referenced by helix(), s_zFit(), and ~FTTrack().

float FTTrack::_kappa

Definition at line 137 of file FTTrack.h.

Referenced by kappa_tmp(), and r_phiFit().

Lpav* FTTrack::_la

Definition at line 127 of file FTTrack.h.

Referenced by lpav(), r_phi2Fit(), r_phi3Fit(), r_phi4Fit(), r_phiFit(), r_phiReFit(), s_zFit(), and ~FTTrack().

float FTTrack::_SigmaS

Definition at line 138 of file FTTrack.h.

Referenced by append_stereo(), d_z(), linkStereoSegments(), r_phiFit(), SigmaS(), and updateSZ().

float FTTrack::_SigmaSS

Definition at line 142 of file FTTrack.h.

Referenced by append_stereo(), d_z(), linkStereoSegments(), r_phiFit(), SigmaSS(), and updateSZ().

float FTTrack::_SigmaSZ

Definition at line 145 of file FTTrack.h.

Referenced by append_stereo(), d_z(), linkStereoSegments(), r_phiFit(), SigmaSZ(), and updateSZ().

float FTTrack::_SigmaZ

Definition at line 144 of file FTTrack.h.

Referenced by append_stereo(), d_z(), linkStereoSegments(), r_phiFit(), SigmaZ(), and updateSZ().

FTList<FTSegment *>* FTTrack::_stereo_segments

Definition at line 131 of file FTTrack.h.

Referenced by append_stereo(), d_z(), get_nhits(), linkStereoSegments(), r_phiFit(), s_zFit(), stereo_segments(), updateSZ(), and ~FTTrack().

FTList<FTList<FTSegment *> *>* FTTrack::_stereo_segments_by_superLayer

Definition at line 133 of file FTTrack.h.

Referenced by linkStereoSegments(), r_phiFit(), and updateSZ().

FTList<FTSegment *>* FTTrack::_stereo_segments_cache

Definition at line 132 of file FTTrack.h.

Referenced by append_stereo_cache(), linkStereoSegments(), r_phiFit(), and updateSZ().

zav* FTTrack::_za

Definition at line 128 of file FTTrack.h.

Referenced by r_phiFit(), s_zFit(), Zav(), and ~FTTrack().

FTFinder* FTTrack::m_ftFinder [private]

Definition at line 123 of file FTTrack.h.

Referenced by r_phi2Fit(), r_phi3Fit(), r_phi4Fit(), r_phiFit(), r_phiReFit(), s_zFit(), and setFTFinder().

IMagneticFieldSvc* FTTrack::m_pmgnIMF [private]

Definition at line 124 of file FTTrack.h.

Referenced by FTTrack(), and r_phiFit().

float FTTrack::minDr

Definition at line 113 of file FTTrack.h.

float FTTrack::minPt

Definition at line 112 of file FTTrack.h.

MdcParameter * FTTrack::param = MdcParameter::instance() [static]

Definition at line 134 of file FTTrack.h.

Referenced by r_phiFit(), and s_zFit().

float FTTrack::Testime

Definition at line 117 of file FTTrack.h.

float FTTrack::xtCoEff

Definition at line 116 of file FTTrack.h.


Generated on Tue Nov 29 23:19:36 2016 for BOSS_7.0.2 by  doxygen 1.4.7