FTFinder Class Reference

#include <FTFinder.h>

List of all members.

Public Member Functions

void setAlgorithmPointer (Algorithm *)
 returns FTFinder pointer
 FTFinder ()
 Constructors and destructor.
void init ()
 initializer(creates geometry)
void term ()
 terminator
void begin_run ()
 begin run function(reads constants)
void event ()
 track finder core
FTSuperLayersuperLayer (int id) const
 returns superlayer
FTList< FTTrack * > & tracks (void) const
 returns track list
CLHEP::Hep3Vector vertex (void) const
 returns event primary vertex
int getWireId (FTWire *) const
 returns wire ID for given FTWire object
float t2x (const FTLayer &l, const float t) const
 convert t to x
float x2t (const FTLayer &l, const float x) const
 convert x to t
void setBunchtime (double bunchtime)
 set bunchtime for MC events
void setT0cal (double t0cal)
 set crude mdc time calibconst (~200 ns) for t0 calculation

Public Attributes

int eventNo
int runNo
int expflag
float t0Estime
float tOffSet
float evtTiming
const HepPoint3D pivot
float Testime
int i_rPhiFit
int tEstFlag
FTList< float > tEstime [10]

Private Member Functions

void clear (void)
 clear object
int updateMdc (void)
 unpack RAWCDC and create wire-hit
int getTestime (void)
 get event start time from segment linear fit
void mkTrackList (void)
 create track list
void mkTrack3D (void)
 create 3D track list
int VertexFit (int z_flag)
 finds event primary vertex
int VertexFit2D ()
 finds event primary vertex from 2D tracks
int findBestVertex (void)
 find vertex closest to IP
int CorrectEvtTiming (void)
 corrects event timing after 2nd r-phi fit and returns event timing
FTTracklinkAxialSegments (FTSegment **inner, FTSegment **outer)
 link axial segments to make track
void linkAxialSuperLayer234 (FTList< FTSegment * > &inner_segments)
void linkAxialSuperLayer910 (FTList< FTSegment * > &outer_segments)
void linkAxialSegments_step (FTList< FTSegment * > &InnerSegments, FTList< FTSegment * > &OuterSegments, FTList< FTSegment * > &Connected, float maxDphi, float maxChi2)
void makeMdst (void)
 make Mdst_charged/trk/trk_fit table from reconstruted tracks
StatusCode makeTds (void)
 output tracking results into TDS
StatusCode registT0 (void)

Private Attributes

Algorithmm_algorithm
FTWire_wire
FTLayer_layer
FTSuperLayer_superLayer
FTList< FTTrack * > & _tracks
FTList< FTSegment * > * _linkedSegments
FTList< FTSegment * > _axialSegCollect
double _vx
double _vy
double _vz
int _ExpNo
int _RunNo
double _bunchtime
double _t0cal
int m_total_trk
HepPDT::ParticleDataTable * m_particleTable
IRawDataProviderSvcm_rawDataProviderSvc
IMagneticFieldSvcm_pmgnIMF
int _widbase [43]

Static Private Attributes

static MdcParameterparam = MdcParameter::instance()


Detailed Description

Definition at line 41 of file FTFinder.h.


Constructor & Destructor Documentation

FTFinder::FTFinder (  ) 

Constructors and destructor.

Definition at line 121 of file FTFinder.cxx.

References m_pmgnIMF.

00122   :// findEventVertex(1),
00123   // evtTimeCorr(1),
00124   
00125   //  minPt(0.07),
00126   // minDr(7.5),
00127   // tOffSet(0.),
00128   // xtCoEff(0.0344),
00129   // doIt(1),
00130 #ifndef OnlineMode
00131   // mkMdst(true),
00132 #endif
00133   // mkTds(true),
00134   tOffSet(0.),
00135   t0Estime(-999.),
00136   tEstFlag(0),
00137   
00138   _wire(NULL),
00139   _layer(NULL),
00140   _superLayer(NULL),
00141   _tracks(*(new FTList<FTTrack *>(20))),
00142   _linkedSegments(new FTList<FTSegment *>(6)),
00143   _axialSegCollect(10),
00144   _vx(0.),
00145   _vy(0.),
00146   _vz(0.),
00147   _ExpNo(0),
00148   _RunNo(0),
00149   m_total_trk(0),
00150   pivot(0,0,0)
00151 {
00152  StatusCode scmgn = Gaudi::svcLocator()->service("MagneticFieldSvc",m_pmgnIMF); 
00153  if(scmgn!=StatusCode::SUCCESS) {
00154    std::cout<< "Unable to open Magnetic field service"<<std::endl;
00155  }
00156 }


Member Function Documentation

void FTFinder::begin_run (  ) 

begin run function(reads constants)

Definition at line 331 of file FTFinder.cxx.

References MdcParameter::_doIt, _ExpNo, _layer, _RunNo, _superLayer, _widbase, _wire, MdcGeoWire::Backward(), eventNo, expflag, MdcGeoWire::Forward(), IMdcGeomSvc::getLayerSize(), IMdcGeomSvc::getSuperLayerSize(), IMdcGeomSvc::getWireSize(), genRecEmupikp::i, IMdcGeomSvc::Layer(), MdcGeoWire::Lyr(), param, runNo, MdcGeoLayer::Slant(), MdcGeoLayer::Sup(), superLayer(), MdcGeoSuper::Type(), and IMdcGeomSvc::Wire().

Referenced by MdcFastTrkAlg::beginRun().

00331                    {
00332 
00333   eventNo = 0;
00334   runNo=0;
00335   expflag=0;
00336   if (!param->_doIt) return;
00337   _ExpNo = 0;
00338   _RunNo = 0;
00339 
00340   IMdcGeomSvc* mdcGeomSvc;
00341   StatusCode sc = Gaudi::svcLocator()->service("MdcGeomSvc", mdcGeomSvc);
00342 
00343   if (sc ==  StatusCode::SUCCESS) {
00344    //mdcGeomSvc->Dump();
00345    
00346   } else {
00347     return ;
00348   }
00349   
00350   const int Nwire = mdcGeomSvc->getWireSize();
00351   const int Nlyr =  mdcGeomSvc->getLayerSize();
00352   const int Nsup =  mdcGeomSvc->getSuperLayerSize();
00353 
00354   if(!Nwire || !Nlyr){
00355     std::cerr << "FTFINDER::GEOCDC not found (please put cdctable before l4)" << std::endl;
00356     std::cerr << "JOB will stop" << std::endl;
00357     exit(-1);
00358   }
00359  
00360   if (!_wire) _wire = (FTWire *) malloc((Nwire+1) * sizeof(FTWire));
00361   if (!_layer) _layer = (FTLayer *) malloc(Nlyr * sizeof(FTLayer));
00362   if (!_superLayer) _superLayer =
00363                       (FTSuperLayer *) malloc(Nsup * sizeof(FTSuperLayer));
00364  
00365   if (!_wire || !_layer || !_superLayer){
00366     std::cerr << "FTFINDER::Cannot allocate geometries" << std::endl;
00367     std::cerr << "JOB will stop" << std::endl;
00368     exit(-1);
00369   }
00370 
00371   int superLayerID = 0;
00372   int layerID = 0;
00373   int localLayerID = 0;
00374   int localWireID = 0;
00375   int localID = 0;
00376   int wireID;
00377   MdcGeoLayer * layer_back = NULL;
00378   MdcGeoSuper * superLayer_back = NULL;
00379   int k = 0;
00380   int Nlayer[12];
00381   int Nlocal[12];
00382   int NlocalWireID[44];
00383 
00384   for (wireID = 0;wireID <= Nwire; wireID++){
00385     MdcGeoLayer * layer = (wireID==Nwire) ? NULL : mdcGeomSvc->Wire(wireID)->Lyr();
00386     if (layer != layer_back){
00387       layer_back = layer;
00388       MdcGeoSuper * superLayer = (wireID==Nwire) ? NULL : mdcGeomSvc->Layer(layerID)->Sup();
00389       if (superLayer != superLayer_back){
00390         superLayer_back = superLayer;
00391         Nlayer[k] = localLayerID;
00392         Nlocal[k] = localID;
00393         localLayerID = 0;
00394         k++;
00395       }
00396       NlocalWireID[layerID] = localWireID;
00397       localID = 0;
00398       localWireID = 0;
00399       layerID++;
00400       localLayerID++;
00401     }
00402     localID++;
00403     localWireID++;
00404   }
00405 
00406 
00407   superLayerID = -1;
00408   layerID = -1;
00409   localLayerID = 0;
00410   localID = 0;
00411   layer_back = NULL;
00412   superLayer_back = NULL;
00413   for (wireID = 0;wireID < Nwire; wireID++){
00414     MdcGeoLayer * layer = mdcGeomSvc->Wire(wireID)->Lyr();
00415     if (layer != layer_back){
00416       layer_back = layer;
00417       MdcGeoSuper * superLayer = mdcGeomSvc->Layer(layerID+1)->Sup();
00418       if (superLayer != superLayer_back){
00419         superLayer_back = superLayer;
00420         // initialize super-layer
00421         superLayerID++;
00422         new(_superLayer+superLayerID) FTSuperLayer(wireID,
00423                                                    Nlocal[superLayerID+1],
00424                                                    layerID+1,
00425                                                    Nlayer[superLayerID+1],
00426                                                    superLayerID);
00427         localLayerID=0;
00428       }
00429       // initialize layer
00430       layerID++;
00431       double slantWithSymbol = (mdcGeomSvc->Layer(layerID)->Slant())*(mdcGeomSvc->Layer(layerID)->Sup()->Type());
00432       // slant in new MdcGeomSvc include  symbol 
00433        new(_layer+layerID) FTLayer(0.1*layer->Radius(), layer->Slant(),
00434                                   0.1*(+layer->Length()/2), 0.1*(-layer->Length()/2), 0.1*layer->Offset(),
00435                                   layerID, localLayerID++, NlocalWireID[layerID+1],
00436                                   _superLayer[superLayerID]);
00437       localID = 0;
00438     }
00439     // initialize wire
00440     const MdcGeoWire * wire = mdcGeomSvc->Wire(wireID); 
00441     if (superLayerID == 2 || superLayerID == 3  ||
00442         superLayerID == 4 || superLayerID == 9 ||
00443         superLayerID == 10){     // axial wire
00444       new(_wire+wireID) FTWire(0.1*(float)0.5*(wire->Backward().x()+wire->Forward().x()),
00445                                0.1*(float)0.5*(wire->Backward().y()+wire->Forward().y()),
00446                                0.,0.,
00447                                _layer[layerID], localID++, _wire+Nwire);
00448                               
00449     }else{                      // stereo wire
00450       new(_wire+wireID) FTWire(0.1*(float)wire->Backward().x(),
00451                                0.1*(float)wire->Backward().y(),
00452                                0.1*(float)wire->Forward().x() - 0.1*(float)wire->Backward().x(),
00453                                0.1*(float)wire->Forward().y() - 0.1*(float)wire->Backward().y(),
00454                                _layer[layerID], localID++, _wire+Nwire);
00455     }
00456   }
00457  
00458   // make virtual wire object for the pointer of boundary's neighbor
00459   new(_wire+Nwire) FTWire();
00460 
00461   for (int i = 0; i < Nwire; i++){
00462     (*(_wire+i)).initNeighbor(); 
00463   }
00464   
00465   _widbase[0] = 0;
00466   for (int k = 1; k < 43; k++){
00467     _widbase[k] = _widbase[k-1] + (*(_layer+k-1)).NWire();
00468   }
00469 }

void FTFinder::clear ( void   )  [private]

clear object

Definition at line 843 of file FTFinder.cxx.

References _axialSegCollect, _superLayer, _tracks, _vx, _vy, _vz, FTList< T >::deleteAll(), evtTiming, genRecEmupikp::i, and tEstime.

Referenced by event(), and term().

00843                    {
00844   evtTiming = 0;
00845   
00846   if ( _superLayer ) {
00847      for (int i = 0; i^11; i++) (*(_superLayer+i)).clear();
00848   }
00849   _tracks.deleteAll();
00850   _axialSegCollect.deleteAll();
00851   _vx = -99999.;
00852   _vy = -99999.;
00853   _vz = -99999.;
00854   for (int i = 0; i < 10; i++) {
00855     tEstime[i].clear();
00856   }
00857 }

int FTFinder::CorrectEvtTiming ( void   )  [private]

corrects event timing after 2nd r-phi fit and returns event timing

Definition at line 1646 of file FTFinder.cxx.

References _tracks, Lpar::d(), dt, exp(), genRecEmupikp::i, ganga-rec::j, FTList< T >::length(), x, and x2t().

Referenced by event().

01647 {
01648   int nTrks = _tracks.length();
01649   float weight_sum = 0.;
01650   float dt_sum2 = 0.;
01651   for (int i = 0; i^nTrks; i++){
01652     float dt_sum = 0.;
01653     float dtt_sum = 0.;
01654     int nHits = 0;
01655     const Lpav & la = _tracks[i]->lpav();
01656     FTList<FTSegment *>& axial_sgmnts = _tracks[i]->axial_segments();
01657     int m = axial_sgmnts.length();
01658     for (int j = 0; j^m; j++){
01659       FTList<FTWire *>& hits = axial_sgmnts[j]->wireHits();
01660       int l = hits.length();
01661       for (int k = 0; k^l; k++){
01662         FTWire & h = * hits[k];
01663         const float x = h.x();
01664         const float y = h.y();
01665         double d0 = fabs(la.d((double)x,(double)y));
01666         if (d0 >= 0.47f*h.layer().csize()) continue;
01667         nHits++;
01668         float dt = x2t(h.layer(), d0) - h.time();
01669         //   float dt = d0/(40*0.0001) - h.time();
01670         dt_sum += dt;
01671         dtt_sum += (dt*dt);
01672       }
01673     }
01674     if (!nHits) continue;
01675     float weight_t = exp(-(dtt_sum - (dt_sum*dt_sum/nHits))/(nHits*1600));
01676     weight_sum += (nHits*weight_t);
01677     dt_sum2 += (dt_sum*weight_t);
01678   }
01679   //  cout<<"event correction time: "<< int(dt_sum2/weight_sum)<<endl;
01680   return int(dt_sum2/weight_sum);
01681 
01682 }

void FTFinder::event (  ) 

track finder core

-- vertex(r-phi) fit and event timing correction

-- 2D track re-fitting

Definition at line 472 of file FTFinder.cxx.

References MdcParameter::_doIt, MdcParameter::_evtTimeCorr, MdcParameter::_hitscut, _superLayer, _tracks, _vx, _vy, clear(), CorrectEvtTiming(), Bes_Common::DEBUG, evtTiming, Bes_Common::FATAL, for, getTestime(), genRecEmupikp::i, i_rPhiFit, ganga-rec::j, FTList< T >::length(), makeTds(), mkTrackList(), msgSvc(), num_2Dtrk, param, EventModel::Recon::RecEsTimeCol, FTList< T >::remove(), t0Estime, tEstFlag, tEstime, updateMdc(), and VertexFit().

Referenced by MdcFastTrkAlg::execute().

00472                 {
00473   IMessageSvc *msgSvc;
00474   Gaudi::svcLocator()->service("MessageSvc", msgSvc);
00475 
00476   MsgStream log(msgSvc, "FTFinder");
00477 
00478   IDataProviderSvc* eventSvc = NULL;
00479   Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
00480   
00481   if (!param->_doIt) return;
00482   //--
00483   // clear old information
00484   //--
00485   clear();
00486 
00487   //check whether  Recon  already registered
00488   DataObject *aReconEvent;
00489   eventSvc->findObject("/Event/Recon",aReconEvent);
00490   if(!aReconEvent) {
00491     // register ReconEvent Data Object to TDS;
00492     ReconEvent* recevt = new ReconEvent;
00493     StatusCode sc = eventSvc->registerObject("/Event/Recon",recevt );
00494     if(sc!=StatusCode::SUCCESS) {
00495       log << MSG::FATAL << "Could not register ReconEvent" <<endreq;
00496       return;
00497     }
00498   }
00499   //register Event start time
00500   IDataManagerSvc *dataManSvc = dynamic_cast<IDataManagerSvc*> (eventSvc);
00501   DataObject *aEsTimeEvent;
00502   eventSvc->findObject("/Event/Recon/RecEsTimeCol",aEsTimeEvent);
00503   if(aEsTimeEvent != NULL) {
00504     dataManSvc->clearSubTree("/Event/Recon/RecEsTimeCol");
00505     eventSvc->unregisterObject("/Event/Recon/RecEsTimeCol");
00506   }
00507 
00508   RecEsTimeCol *aRecEsTimeCol = new RecEsTimeCol;
00509   StatusCode est;
00510   est = eventSvc->registerObject("/Event/Recon/RecEsTimeCol",aRecEsTimeCol);
00511   if( est.isFailure() ) {
00512       log << MSG::FATAL << "Could not register RecEsTimeCol" << endreq;
00513       return;
00514    }
00515   log << MSG::DEBUG << "RecEsTimeCol registered successfully!" <<endreq; 
00516   //--
00517   // update wirehit information
00518   //--
00519   updateMdc();
00520 
00521   //--
00522   // segment finding
00523   //--
00524   for (int i =  0; i^11; i++){
00525     (*(_superLayer+i)).mkSegmentList();
00526   }
00527 
00528   //--
00529   // reduce noise and get start time from segment fit
00530   for(int j=0;j<10;j++){
00531     (*(_superLayer+j)).reduce_noise(tEstime);
00532   }
00533 
00534   getTestime();
00535   
00536   //--
00537   // register t0Estime to TDS
00538   //--
00539   //if(t0Estime!=-999&&t0Estime<24) registT0();
00540 
00541   //--
00542   // axial segment linking
00543   //--
00544   mkTrackList();
00545 
00546   //--
00547   // 2D track fitting
00548   //--
00549   //(*_superLayer).reAppendSalvage();
00550 
00551   int n = _tracks.length();
00552   log << MSG::DEBUG << "number of 2D tracks: " << n <<endreq;
00553 #ifndef OnlineMode
00554   num_2Dtrk+=n;
00555 #endif
00556   for (int i = 0; i^n; i++){
00557     if (!_tracks[i]->r_phiFit()){
00558       delete _tracks[i];
00559       log<<MSG::DEBUG<<"===========>deleted 2D track :  "<< i+1 <<endreq;
00560       n = _tracks.remove(i);
00561     }
00562   }
00563 
00564   if(t0Estime!=-999){
00565     //begin to make Event start time
00566     RecEsTime *arecestime = new RecEsTime;
00567     arecestime -> setTest(t0Estime);
00568     arecestime -> setStat(tEstFlag);
00569     aRecEsTimeCol->push_back(arecestime);
00570   }
00571   if (!n){
00572     makeTds();
00573     return;
00574   }
00575 
00578   //--
00579   int vtx_flag = VertexFit(0);
00580   evtTiming = (param->_evtTimeCorr) ? CorrectEvtTiming() : 0;
00581 
00584   //--
00585   if(param->_hitscut==1){
00586     for (int i = 0; i^n; i++){
00587       _tracks[i]->r_phiReFit(_vx, _vy, vtx_flag);
00588     }
00589   }
00590 
00591   //--
00592   //cut bad hits from 2D track re-fitting
00593   if(param->_hitscut==2){
00594     for (int i = 0; i^n; i++){
00595       for(int j = 0; j<2; j++){
00596         i_rPhiFit= _tracks[i]->r_phi2Fit(_vx, _vy, vtx_flag);
00597         if(i_rPhiFit!=-99) _tracks[i]->r_phi3Fit(i_rPhiFit,_vx, _vy, vtx_flag);
00598       }
00599       _tracks[i]->r_phi4Fit(_vx, _vy, vtx_flag);
00600     }
00601   }
00602 
00603   //--
00604   // stereo segment linking
00605   //--
00606   mkTrack3D();
00607 
00608   //--
00609   // final track fittng
00610   //--
00611   n = _tracks.length();
00612   log<< MSG::DEBUG <<"number of 3D tracks: " << n << endreq;
00613 
00614 #ifndef OnlineMode
00615   num_3Dtrk+=n;
00616 #endif
00617 
00618   for (int i = 0; i^n; i++) {
00619 
00620 #ifndef OnlineMode
00621     log<<MSG::DEBUG<<"=======>3D track: "<<i<<endreq;
00622     _tracks[i]->printout();
00623 #endif
00624 
00625     if (_tracks[i]->get_nhits() < 18) {
00626       delete _tracks[i];
00627       log<< MSG::DEBUG <<"================>deleted 3D track :  "<< i+1 <<endreq;
00628       n = _tracks.remove(i);
00629     }
00630   }
00631   
00632   if (!n){
00633     makeTds();
00634     return;
00635   }
00636 
00637   for (int i = 0; i^n; i++){
00638     _tracks[i]->s_zFit();
00639   }
00640 
00641   //--
00642   // find primary event vertex
00643   //--
00644   if (param->_findEventVertex){
00645     VertexFit(1);
00646   }
00647   
00648   n = _tracks.length();
00649   log<<MSG::DEBUG<<"final number of tracks: " << n << endreq;
00650 
00651 #ifndef OnlineMode
00652   num_finaltrk+=n;
00653   if (param->_mkMdst) makeMdst();
00654 #endif
00655 
00656   //--
00657   // output tracking result into TDS
00658   // by wangdy
00659   //--
00660   if (param->_mkTds) makeTds();
00661 
00662 }

int FTFinder::findBestVertex ( void   )  [private]

find vertex closest to IP

Definition at line 1617 of file FTFinder.cxx.

References _tracks, _vx, _vy, _vz, cos(), genRecEmupikp::i, FTList< T >::length(), phi0, pivot, and sin().

01618 {
01619   int nTrks = _tracks.length();
01620   if (nTrks < 2){
01621     _vx = -9999.;
01622     _vy = -9999.;
01623     _vz = -9999.;
01624     return 0;
01625   }
01626   float min_dr = 9999.;
01627   float phi0 = 9999.;
01628   for (int i = 0; i < nTrks; i++){
01629     HepVector a = _tracks[i]->lpav().Hpar(pivot);
01630     if (fabs(a(1)) < fabs(min_dr)){
01631       min_dr = a(1);
01632       phi0 = a(2);
01633     }
01634   }
01635   _vx = min_dr*cos(phi0);
01636   _vy = min_dr*sin(phi0);
01637   return 1;
01638 }

int FTFinder::getTestime ( void   )  [private]

get event start time from segment linear fit

Definition at line 860 of file FTFinder.cxx.

References _bunchtime, _t0cal, expflag, g_estime, genRecEmupikp::i, Bes_Common::INFO, ganga-rec::j, FTList< T >::length(), t0Estime, tEstFlag, tEstime, and tOffSet.

Referenced by event().

00861 {
00862   IMessageSvc *msgSvc;
00863   Gaudi::svcLocator()->service("MessageSvc", msgSvc);
00864 
00865   MsgStream log(msgSvc, "FTFinder");
00866 
00867   IDataProviderSvc* eventSvc = NULL;
00868   Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
00869 
00870    float sumT=0,estime=0;
00871    int n=0;
00872    t0Estime=-999;
00873    // for(int i=0;i<4;i++){
00874    for(int i=0;i<10;i++){
00875     for(int j=0;j<tEstime[i].length();j++){
00876       if(tEstime[i][j]!=0){
00877         sumT+=tEstime[i][j];
00878         n++;
00879       }
00880     }
00881    }
00882    if(n!=0){
00883      estime=sumT/n;
00884                  estime+=_t0cal;
00885      if(estime>-1){  // && estime<50){
00886        //if(m_nbunch==3){
00887        if(expflag==0){      
00888          int nbunch=((int)(estime-tOffSet))/_bunchtime;
00889          if(((int)(estime-tOffSet))%(int)_bunchtime>_bunchtime/2) nbunch=nbunch+1;
00890          t0Estime=nbunch*_bunchtime+tOffSet;
00891          //cout<<"_bunchtime: "<< _bunchtime<<" , t0Estime :  "<< t0Estime<<endl;
00892        }
00893        else{
00894          t0Estime=estime;
00895        }
00896        //if(m_nbunch==6){
00897        /* int nbunch=((int)(estime-tOffSet))/4;
00898           if(((int)(estime-tOffSet))%4>2) nbunch=nbunch+1;
00899           t0Estime=nbunch*4+tOffSet;
00900        */
00901        // if(t0Estime>-1 && t0Estime<24)  FTTrack::Testime=t0Estime;
00902        int trigtimming=0;
00903        // Retrieve trigger timming information
00904        // timing system: TOF:1,  MDC:2, EMC:3, NONE:0
00905        SmartDataPtr<TrigData> trigData(eventSvc,"/Event/Trig/TrigData");
00906        if (trigData) {
00907          trigtimming=trigData->getTimingType();
00908          log << MSG::INFO <<"Timing type: "<< trigData->getTimingType() << endreq;
00909        }
00910        if(trigtimming==1)  tEstFlag=117;
00911        if(trigtimming==2)  tEstFlag=127;
00912        if(trigtimming==3)  tEstFlag=137;
00913        if(trigtimming==0)  tEstFlag=107;
00914 #ifndef OnlineMode
00915        g_estime=estime;
00916 #endif
00917      }
00918    }
00919 }

int FTFinder::getWireId ( FTWire  )  const [inline]

returns wire ID for given FTWire object

Definition at line 208 of file FTFinder.h.

References _wire, and w.

00208                                     {
00209   return ((long)w - (long)_wire)/sizeof(FTWire);
00210 }

void FTFinder::init (  ) 

initializer(creates geometry)

Definition at line 159 of file FTFinder.cxx.

References MdcParameter::_doIt, m_particleTable, m_rawDataProviderSvc, and param.

Referenced by MdcFastTrkAlg::initialize().

00160 {
00161   if (!param->_doIt) return;
00162 //      param->updateAlpha();
00163 
00164   // Get the Particle Properties Service
00165   IPartPropSvc* p_PartPropSvc;
00166   static const bool CREATEIFNOTTHERE(true);
00167   StatusCode PartPropStatus = Gaudi::svcLocator()->service("PartPropSvc", p_PartPropSvc, CREATEIFNOTTHERE);
00168   if (!PartPropStatus.isSuccess() || 0 == p_PartPropSvc) {
00169     // log << MSG::ERROR << " Could not initialize Particle Properties Service" << endreq;
00170     std::cerr << "Could not initialize Particle Properties Service" << std::endl;  
00171     //  return PartPropStatus;
00172     return;
00173   }
00174   m_particleTable = p_PartPropSvc->PDT();
00175   
00176   // IRawDataProviderSvc* m_rawDataProviderSvc;
00177   StatusCode RawData = Gaudi::svcLocator()-> service ("RawDataProviderSvc", m_rawDataProviderSvc, CREATEIFNOTTHERE);
00178   if ( !RawData.isSuccess() ){
00179     std::cerr  << "Could not load RawDataProviderSvc!" << m_rawDataProviderSvc << endreq;
00180     return;
00181   }
00182  
00183 //  IMdcGeomSvc* mdcGeomSvc;
00184 //  StatusCode sc = Gaudi::svcLocator()->service("MdcGeomSvc", mdcGeomSvc);
00185 //
00186 //  if (sc ==  StatusCode::SUCCESS) {
00187 //   //mdcGeomSvc->Dump();
00188 //   
00189 //  } else {
00190 //    return ;
00191 //  }
00192 //  
00193 //  const int Nwire = mdcGeomSvc->getWireSize();
00194 //  const int Nlyr =  mdcGeomSvc->getLayerSize();
00195 //  const int Nsup =  mdcGeomSvc->getSuperLayerSize();
00196 //
00197 //  if(!Nwire || !Nlyr){
00198 //    std::cerr << "FTFINDER::GEOCDC not found (please put cdctable before l4)" << std::endl;
00199 //    std::cerr << "JOB will stop" << std::endl;
00200 //    exit(-1);
00201 //  }
00202 // 
00203 //  if (!_wire) _wire = (FTWire *) malloc((Nwire+1) * sizeof(FTWire));
00204 //  if (!_layer) _layer = (FTLayer *) malloc(Nlyr * sizeof(FTLayer));
00205 //  if (!_superLayer) _superLayer =
00206 //                      (FTSuperLayer *) malloc(Nsup * sizeof(FTSuperLayer));
00207 // 
00208 //  if (!_wire || !_layer || !_superLayer){
00209 //    std::cerr << "FTFINDER::Cannot allocate geometries" << std::endl;
00210 //    std::cerr << "JOB will stop" << std::endl;
00211 //    exit(-1);
00212 //  }
00213 //
00214 //  int superLayerID = 0;
00215 //  int layerID = 0;
00216 //  int localLayerID = 0;
00217 //  int localWireID = 0;
00218 //  int localID = 0;
00219 //  int wireID;
00220 //  MdcGeoLayer * layer_back = NULL;
00221 //  MdcGeoSuper * superLayer_back = NULL;
00222 //  int k = 0;
00223 //  int Nlayer[12];
00224 //  int Nlocal[12];
00225 //  int NlocalWireID[44];
00226 //
00227 //  for (wireID = 0;wireID <= Nwire; wireID++){
00228 //    MdcGeoLayer * layer = (wireID==Nwire) ? NULL : mdcGeomSvc->Wire(wireID)->Lyr();
00229 //    if (layer != layer_back){
00230 //      layer_back = layer;
00231 //      MdcGeoSuper * superLayer = (wireID==Nwire) ? NULL : mdcGeomSvc->Layer(layerID)->Sup();
00232 //      if (superLayer != superLayer_back){
00233 //        superLayer_back = superLayer;
00234 //        Nlayer[k] = localLayerID;
00235 //        Nlocal[k] = localID;
00236 //        localLayerID = 0;
00237 //        k++;
00238 //      }
00239 //      NlocalWireID[layerID] = localWireID;
00240 //      localID = 0;
00241 //      localWireID = 0;
00242 //      layerID++;
00243 //      localLayerID++;
00244 //    }
00245 //    localID++;
00246 //    localWireID++;
00247 //  }
00248 //
00249 //
00250 //  superLayerID = -1;
00251 //  layerID = -1;
00252 //  localLayerID = 0;
00253 //  localID = 0;
00254 //  layer_back = NULL;
00255 //  superLayer_back = NULL;
00256 //  for (wireID = 0;wireID < Nwire; wireID++){
00257 //    MdcGeoLayer * layer = mdcGeomSvc->Wire(wireID)->Lyr();
00258 //    if (layer != layer_back){
00259 //      layer_back = layer;
00260 //      MdcGeoSuper * superLayer = mdcGeomSvc->Layer(layerID+1)->Sup();
00261 //      if (superLayer != superLayer_back){
00262 //        superLayer_back = superLayer;
00263 //        // initialize super-layer
00264 //        superLayerID++;
00265 //        new(_superLayer+superLayerID) FTSuperLayer(wireID,
00266 //                                                   Nlocal[superLayerID+1],
00267 //                                                   layerID+1,
00268 //                                                   Nlayer[superLayerID+1],
00269 //                                                   superLayerID);
00270 //        localLayerID=0;
00271 //      }
00272 //      // initialize layer
00273 //      layerID++;
00274 //      double slantWithSymbol = (mdcGeomSvc->Layer(layerID)->Slant())*(mdcGeomSvc->Layer(layerID)->Sup()->Type());
00275 //      // slant in new MdcGeomSvc include  symbol 
00276 //       new(_layer+layerID) FTLayer(0.1*layer->Radius(), layer->Slant(),
00277 //                                  0.1*(+layer->Length()/2), 0.1*(-layer->Length()/2), 0.1*layer->Offset(),
00278 //                                  layerID, localLayerID++, NlocalWireID[layerID+1],
00279 //                                  _superLayer[superLayerID]);
00280 //      localID = 0;
00281 //    }
00282 //    // initialize wire
00283 //    const MdcGeoWire * wire = mdcGeomSvc->Wire(wireID); 
00284 //    if (superLayerID == 2 || superLayerID == 3  ||
00285 //        superLayerID == 4 || superLayerID == 9 ||
00286 //        superLayerID == 10){     // axial wire
00287 //      new(_wire+wireID) FTWire(0.1*(float)0.5*(wire->Backward().x()+wire->Forward().x()),
00288 //                               0.1*(float)0.5*(wire->Backward().y()+wire->Forward().y()),
00289 //                               0.,0.,
00290 //                               _layer[layerID], localID++, _wire+Nwire);
00291 //                            
00292 //    }else{                      // stereo wire
00293 //      new(_wire+wireID) FTWire(0.1*(float)wire->Backward().x(),
00294 //                               0.1*(float)wire->Backward().y(),
00295 //                               0.1*(float)wire->Forward().x() - 0.1*(float)wire->Backward().x(),
00296 //                               0.1*(float)wire->Forward().y() - 0.1*(float)wire->Backward().y(),
00297 //                               _layer[layerID], localID++, _wire+Nwire);
00298 //    }
00299 //  }
00300 // 
00301 //  // make virtual wire object for the pointer of boundary's neighbor
00302 //  new(_wire+Nwire) FTWire();
00303 //
00304 //  for (int i = 0; i < Nwire; i++){
00305 //    (*(_wire+i)).initNeighbor(); 
00306 //  }
00307 //  
00308 //  _widbase[0] = 0;
00309 //  for (int k = 1; k < 43; k++){
00310 //    _widbase[k] = _widbase[k-1] + (*(_layer+k-1)).NWire();
00311 //  }
00312 
00313   //minPt = (float)param->_minPt;
00314   //minDr = (float)param->_minDr;
00315   //xtCoEff = param->_xtCoEff;
00316 }

FTTrack * FTFinder::linkAxialSegments ( FTSegment **  inner,
FTSegment **  outer 
) [private]

link axial segments to make track

Definition at line 1081 of file FTFinder.cxx.

References MdcParameter::_chi2_kappa, _linkedSegments, MdcParameter::_Min_chi2, FTList< T >::append(), FTList< T >::clear(), IMagneticFieldSvc::getReferField(), FTWire::layer(), M_PI, m_pmgnIMF, next, param, FTLayer::r(), and s.

Referenced by mkTrackList().

01082 {
01083   float chi2_kappa = param->_chi2_kappa;
01084   _linkedSegments->clear();
01085   if(!outer) {
01086       // allow only 2, 3, 4,  axial segments in one track
01087       int n = (*inner)->wireHits().length();
01088       _linkedSegments->append(*inner);
01089       if(n >= 7) return (new FTTrack(*_linkedSegments, (*inner)->kappa(), chi2_kappa));
01090       else return NULL;
01091   }
01092   int n = _linkedSegments->append(*outer);
01093   float SigmaK = (*outer)->kappa();
01094   float SigmaRR = (*outer)->r();
01095   SigmaRR *= SigmaRR;
01096   float SigmaKRR = SigmaK*SigmaRR;
01097   float SigmaKKRR = SigmaK*SigmaKRR;
01098   FTSegment & s = * (*_linkedSegments)[n-1];
01099   FTSegment * innerSegment = NULL;
01100   float SigmaK_cache, SigmaRR_cache, SigmaKRR_cache, SigmaKKRR_cache;
01101 
01102   float Min_chi2 = param->_Min_chi2;
01103   float inX = s.incomingX();
01104   float inY = s.incomingY();
01105   //const FTWire & innerBoundHit = * s.innerBoundHits().first();
01106   //float in_r = innerBoundHit.layer().r();
01107   //float incomingPhi = innerBoundHit.phi();
01108   float in_r = s.innerBoundHits().first()->layer().r();
01109   float incomingPhi = s.incomingPhi();
01110 
01111   FTSegment* next = *inner;
01112   const FTWire & NextOuterBoundHit = * next->outerBoundHits().first();
01113     
01114   //float deltaPhi =fabs(incomingPhi - next->outgoingPhi());
01115   //if (deltaPhi > param->_deltaPhi  && deltaPhi < (2*M_PI-param->_deltaPhi)) return NULL;   
01116   float outX = next->outgoingX();
01117   float outY = next->outgoingY();
01118 
01120   float _trk_d = -2*(-1. / 2.99792458 /m_pmgnIMF->getReferField())/s.kappa();
01121   float _angle1 = asin(NextOuterBoundHit.layer().r()/_trk_d);
01122   float _angle2 = asin(s.outerBoundHits().first()->layer().r()/_trk_d);
01123   float _ang_diff = _angle2 - _angle1;
01124   float _diff = s.outgoingPhi() - next->outgoingPhi();
01125   _diff = _diff - (int(_diff/M_PI))*2*M_PI;
01126   float _require = _ang_diff - _diff;
01127   //cut of connecting inner and outer segments
01128   if (_require < -0.10 || _require > 0.11) return NULL;
01129 
01130   float SegK = next->kappa();
01131   float SegRR = next->r();
01132   SegRR *= SegRR;
01133   const float out_r = NextOuterBoundHit.layer().r();
01134   // kappa = -2. * alpha * ((Vout X Vin)_z / |Vin|*|Vout|) / |Vin-Vout|
01135   float GapK = 2.*(-1. / 2.99792458 /m_pmgnIMF->getReferField())*(inX*outY-inY*outX) /
01136           (in_r*out_r*sqrt((inX-outX)*(inX-outX)+(inY-outY)*(inY-outY)));
01137   //float GapRR = (currentLayer==j+1||currentLayer==j+2) ? 0.5*(in_r+out_r) : in_r+out_r;
01138   float GapRR = 0.5*(in_r+out_r);
01139   GapRR*=GapRR;
01140   float SigmaK_tmp = (SigmaK + SegK + GapK);
01141   float SigmaRR_tmp = SigmaRR + SegRR + GapRR;
01142   float SigmaKRR_tmp = SigmaKRR + SegK*SegRR + GapK*GapRR;
01143   float SigmaKKRR_tmp = SigmaKKRR + SegK*SegK*SegRR + GapK*GapK*GapRR;
01144   float MuK_tmp = SigmaK_tmp/(2*n+1);
01145   float chi2 = (MuK_tmp*MuK_tmp*SigmaRR_tmp
01146           - 2.*MuK_tmp*SigmaKRR_tmp + SigmaKKRR_tmp)/(2*n+1);
01147   if ((chi2-chi2_kappa) < Min_chi2){
01148     Min_chi2 = chi2;
01149     innerSegment = next;
01150     SigmaK_cache = SigmaK_tmp;
01151     SigmaRR_cache = SigmaRR_tmp;
01152     SigmaKRR_cache = SigmaKRR_tmp;
01153     SigmaKKRR_cache = SigmaKKRR_tmp;
01154   }
01155   if (innerSegment){
01156     n = _linkedSegments->append(*inner);
01157     SigmaK = SigmaK_cache;
01158     SigmaRR = SigmaRR_cache;
01159     SigmaKRR = SigmaKRR_cache;
01160     SigmaKKRR = SigmaKKRR_cache;
01161     chi2_kappa = Min_chi2;
01162     
01163     if (n > 1) return (new FTTrack(*_linkedSegments,SigmaK/(2*n-1),chi2_kappa));
01164   }else{
01165     // allow only 3, 4, 5 axial segments in one track
01166     /*n = (*inner)->wireHits().length();
01167       _linkedSegments->clear();
01168       _linkedSegments->append(*inner);
01169       if(n > 10) return (new FTTrack(*_linkedSegments, SegK, Min_chi2));*/
01170     return NULL;
01171   }
01172   //if (fabs(SigmaK/(2*n-1)) > 1.2/minPt) return NULL;
01173   return NULL;
01174   
01175 }

void FTFinder::linkAxialSegments_step ( FTList< FTSegment * > &  InnerSegments,
FTList< FTSegment * > &  OuterSegments,
FTList< FTSegment * > &  Connected,
float  maxDphi,
float  maxChi2 
) [private]

Definition at line 1252 of file FTFinder.cxx.

References FTList< T >::append(), Bes_Common::DEBUG, FTList< T >::first(), IMagneticFieldSvc::getReferField(), genRecEmupikp::i, FTSegment::innerBoundHits(), ganga-rec::j, FTWire::layer(), FTLayer::layerId(), FTList< T >::length(), M_PI, m_pmgnIMF, FTSegment::outerBoundHits(), FTList< T >::remove(), and FTSegment::wireHits().

Referenced by linkAxialSuperLayer234(), and linkAxialSuperLayer910().

01256 {
01257   IMessageSvc *msgSvc;
01258   Gaudi::svcLocator()->service("MessageSvc", msgSvc);
01259   MsgStream log(msgSvc, "FTFinder");
01260 
01261   int n = InnerSegments.length();
01262   int m = OuterSegments.length();
01263   for (int i = 0; i^n; i++){
01264      FTSegment * inner = InnerSegments[i];
01265 #ifndef OnlineMode
01266      //     log<<MSG::DEBUG<<"linking: "<<endreq;
01267      //     inner->printout();
01268 #endif
01269      const FTLayer & in_outerBound = inner->outerBoundHits().first()->layer();
01270      float in_outerPhi = inner->outgoingPhi();
01271      float min_Dphi = M_PI/2;
01272      int   min_Dphi_index = -1;
01273      for (int j = 0; j^m; j++) {
01274        FTSegment * outer = OuterSegments[j];
01275 #ifndef OnlineMode
01276        //       log<<MSG::DEBUG<<"segment: "<<j<<endreq;
01277        //       outer->printout();
01278 #endif
01279        float D_phi = fabs(in_outerPhi - outer->incomingPhi());
01280        if (D_phi > M_PI) D_phi = 2*M_PI - D_phi;
01281        if (D_phi > min_Dphi) continue;
01282        float inX   = inner->incomingX();
01283        float inY   = inner->incomingY();
01284        float outX  = outer->outgoingX();
01285        float outY  = outer->outgoingY();
01286        float in_r  = inner->innerBoundHits().first()->layer().r();
01287        float out_r = outer->outerBoundHits().first()->layer().r();
01288        float allK = 2.*(-1. / 2.99792458 /m_pmgnIMF->getReferField())*(inY*outX-inX*outY) /
01289          (in_r*out_r*sqrt((inX-outX)*(inX-outX)+(inY-outY)*(inY-outY)));
01290        //float cache_in  = ((inner->kappa() + outer->kappa() + allK)/3.0 - inner->kappa())/in_r;
01291        float cache_in  = ((outer->kappa() + allK)/3.0 - inner->kappa()*2/3.0)/in_r;
01292        float cache_out = ((inner->kappa() + allK)/3.0 - outer->kappa()*2/3.0)/out_r;
01293        float cache_all = ((inner->kappa()+outer->kappa())/3.0-allK*2/3.0)*2.0/(in_r+out_r);
01294        float chi2_z = cache_in*cache_in + cache_out*cache_out + cache_all*cache_all;
01295        log<<MSG::DEBUG<<"D_phi: "<< D_phi <<" chi2_z: "<< chi2_z <<" maxChi2: " <<maxChi2 <<endreq;
01296        if (chi2_z > maxChi2) continue;
01297        min_Dphi = D_phi;
01298        min_Dphi_index = j;
01299      }
01300      if (min_Dphi_index < 0) continue;
01301      log<<MSG::DEBUG<<"min_Dphi: "<< min_Dphi <<endreq;
01302      FTSegment * outer = OuterSegments[min_Dphi_index];
01303      const FTLayer & out_innerBound = outer->innerBoundHits().first()->layer();
01304      switch (out_innerBound.layerId() - in_outerBound.layerId()) {
01305        case 1:
01306          if (min_Dphi > maxDphi) continue;
01307          break;
01308        case 2:
01309          if (min_Dphi > maxDphi*1.5) continue;
01310          break;
01311        case 3:
01312          if (min_Dphi > maxDphi*2.25) continue;
01313          break;
01314        default:
01315          continue;
01316      }
01317      inner->connect_outer(outer->wireHits(), outer->outerBoundHits());
01318      inner->update();
01319      Connected.append(inner);
01320      n = InnerSegments.remove(i);
01321      delete outer;
01322      m = OuterSegments.remove(min_Dphi_index);
01323      log<<MSG::DEBUG<<"DONE!!"<<endreq;
01324   }
01325   return;
01326 }

void FTFinder::linkAxialSuperLayer234 ( FTList< FTSegment * > &  inner_segments  )  [private]

Definition at line 1178 of file FTFinder.cxx.

References MdcParameter::_chi2_1, MdcParameter::_chi2_2, MdcParameter::_D_phi1, MdcParameter::_D_phi2, _superLayer, FTList< T >::append(), FTList< T >::clear(), IMagneticFieldSvc::getReferField(), genRecEmupikp::i, ganga-rec::j, FTList< T >::length(), linkAxialSegments_step(), M_PI, m_pmgnIMF, param, FTList< T >::remove(), and FTSuperLayer::segments().

Referenced by mkTrackList().

01179 {
01180   FTList<FTSegment *>  _segments34(10);
01181   FTList<FTSegment *>& SuperLayer3Segments = _superLayer[3].segments();
01182   FTList<FTSegment *>& SuperLayer4Segments = _superLayer[4].segments();
01183   linkAxialSegments_step(SuperLayer3Segments, SuperLayer4Segments,
01184                          _segments34, param->_D_phi2, param->_chi2_2);
01185   _segments34.append(SuperLayer3Segments);
01186   SuperLayer3Segments.clear();
01187 
01188   FTList<FTSegment *>& SuperLayer2Segments = _superLayer[2].segments();
01189   linkAxialSegments_step(SuperLayer2Segments, _segments34,
01190                          inner_segments, param->_D_phi1, param->_chi2_1);
01191   inner_segments.append(_segments34);
01192 
01193   //zoujh: connect the 2&4 superlayers leap over 3
01194   int n = SuperLayer2Segments.length();
01195   int m = SuperLayer4Segments.length();
01196   for (int i = 0; i^n; i++) {
01197     FTSegment * inner = SuperLayer2Segments[i];
01198     //inner->printout();
01199     float in_outerPhi = inner->outgoingPhi();
01200     for (int j = 0; j^m; j++) {
01201       FTSegment * outer = SuperLayer4Segments[j];
01202       //      outer->printout();
01203       float out_innerPhi = outer->incomingPhi();
01204       float D_phi = fabs(in_outerPhi - out_innerPhi);
01205       if (D_phi > M_PI) D_phi = 2*M_PI - D_phi;
01207       if (D_phi > M_PI/12.5) continue;
01208       float inX   = inner->outgoingX();
01209       float inY   = inner->outgoingY();
01210       float outX  = outer->incomingX();
01211       float outY  = outer->incomingY();
01212       float in_r  = inner->outerBoundHits().first()->layer().r();
01213       float out_r = outer->innerBoundHits().first()->layer().r();
01214       float GapK = 2.*(-1. / 2.99792458 /m_pmgnIMF->getReferField())*(inY*outX-inX*outY) /
01215           (in_r*out_r*sqrt((inX-outX)*(inX-outX)+(inY-outY)*(inY-outY)));
01216       //float cache_in = ((inner->kappa()+outer->kappa()+GapK)/3.0 - inner->kappa())/in_r;
01217       float cache_in  = ((outer->kappa()+GapK)/3.0 - inner->kappa()*2.0/3.0)/in_r;
01218       float cache_out = ((inner->kappa()+GapK)/3.0 - outer->kappa()*2.0/3.0)/out_r;
01219       float cache_gap = ((inner->kappa()+outer->kappa())/3.0-GapK*2.0/3.0)*2.0/(in_r+out_r);
01220       float chi2_z = cache_in*cache_in + cache_out*cache_out + cache_gap*cache_gap;
01221       if (chi2_z > param->_D_phi1) continue;
01223       inner->connect_outer(outer->wireHits(),outer->outerBoundHits());
01224       inner->update();
01225       inner_segments.append(inner);
01226       n = SuperLayer2Segments.remove(i);
01227       m = SuperLayer4Segments.remove(j);
01228       delete outer;
01229       break;
01230     }
01231   }
01232   inner_segments.append(SuperLayer2Segments);
01233   SuperLayer2Segments.clear();
01234   inner_segments.append(SuperLayer4Segments);
01235   SuperLayer4Segments.clear();
01236 }

void FTFinder::linkAxialSuperLayer910 ( FTList< FTSegment * > &  outer_segments  )  [private]

Definition at line 1239 of file FTFinder.cxx.

References MdcParameter::_chi2_3, MdcParameter::_D_phi3, _superLayer, FTList< T >::append(), FTList< T >::clear(), linkAxialSegments_step(), param, and FTSuperLayer::segments().

Referenced by mkTrackList().

01240 {
01241   FTList<FTSegment *>& SuperLayer9Segments = _superLayer[9].segments();
01242   FTList<FTSegment *>& SuperLayer10Segments = _superLayer[10].segments();
01243   linkAxialSegments_step(SuperLayer9Segments, SuperLayer10Segments,
01244                          outer_segments, param->_D_phi3, param->_chi2_3);
01245   outer_segments.append(SuperLayer9Segments);
01246   SuperLayer9Segments.clear();
01247   outer_segments.append(SuperLayer10Segments);
01248   SuperLayer10Segments.clear();
01249 }

void FTFinder::makeMdst ( void   )  [private]

make Mdst_charged/trk/trk_fit table from reconstruted tracks

Definition at line 1686 of file FTFinder.cxx.

References _tracks, Helix::dr(), Helix::dz(), g_dr, g_dz, g_kappa, g_ncell, g_ntrk, g_p, g_phi, g_phi0, g_pt, g_px, g_py, g_pz, g_tanl, g_theta, g_vx, g_vy, g_vz, genRecEmupikp::i, ganga-rec::j, Helix::kappa(), FTList< T >::length(), m_pz, Helix::momentum(), Helix::phi0(), Helix::tanl(), v, and Helix::x().

01687 {
01688   //  static const double pi_mass(0.13956995);
01689   const int nTrks = _tracks.length();
01690   int Ntable(0);
01691   
01692   for (int i = 0; i<nTrks; i++){
01693 
01694     const FTTrack & trk = * _tracks[i];
01695     FTList<FTSegment *> &axialSegments = trk.axial_segments(); 
01696     FTList<FTSegment *> &stereoSegments = trk.stereo_segments(); 
01697     int axialSegmentsN = axialSegments.length();  
01698     int stereoSegmentsN = stereoSegments.length();  
01699     for (int i = 0; i < axialSegmentsN ; i++) {
01700         //FTSuperLayer& superLayer= axialSegments[i]->superLayer();
01701         FTList<FTWire *> &wires = axialSegments[i]->wireHits();   
01702         int wiresN = wires.length();
01703         for (int j=0; j < wiresN; j++) {
01704             //int id = wires[j]->localId();
01705             g_ncell->fill(wires[j]->getWireId());
01706         }
01707     }
01708 
01709     for (int i = 0; i < stereoSegmentsN ; i++) {
01710         //FTSuperLayer& superLayer = stereoSegments[i]->superLayer();
01711         FTList<FTWire *> &wires = stereoSegments[i]->wireHits();
01712         int wiresN = wires.length();
01713         for (int j=0; j < wiresN; j++) {
01714             //int id = wires[j]->localId();
01715             g_ncell->fill(wires[j]->getWireId());
01716         }
01717     }
01718       
01719     const Helix& h = * trk.helix();
01720     if (h.tanl() < -9000.) continue;
01721 
01722     Ntable++;
01723     Hep3Vector p(h.momentum());
01724     HepPoint3D v(h.x());    
01725     //float m_charge = (h.kappa() > 0) ? 1. : -1.;
01726     float m_px = p.x();
01727     g_px[Ntable-1] = p.x();
01728     float m_py = p.y();
01729     g_py[Ntable-1] = p.y();
01730     float m_pz = p.z();
01731     g_pz[Ntable-1] = p.z();
01732     g_p[Ntable-1] = p.mag();
01733     g_phi[Ntable-1] = atan2(m_py, m_px);
01734 
01735     g_dr[Ntable-1] = h.dr();
01736     g_phi0[Ntable-1] = h.phi0();
01737     g_kappa[Ntable-1] = h.kappa();
01738     g_pt[Ntable-1] = 1/fabs(h.kappa());
01739     g_dz[Ntable-1] = h.dz();
01740     g_tanl[Ntable-1] = h.tanl();
01741     g_theta[Ntable-1] = atan2(1/fabs(h.kappa()),(double)(m_pz));
01742     g_vx[Ntable-1] = v(0);
01743     g_vy[Ntable-1] = v(1);
01744     g_vz[Ntable-1] = v(2);
01745   }  
01746   g_ntrk = Ntable;
01747 
01748 }

StatusCode FTFinder::makeTds ( void   )  [private]

output tracking results into TDS

Definition at line 1758 of file FTFinder.cxx.

References Helix::a(), FTTrack::axial_segments(), zav::chisq(), Lpav::chisq(), Bes_Common::DEBUG, Helix::Ea(), Bes_Common::FATAL, g_naxialhit, g_nhit, g_nstereohit, FTTrack::helix(), genRecEmupikp::i, FTList< T >::length(), FTTrack::lpav(), RawDataUtil::MdcChargeChannel(), Lpar::phi(), Helix::pivot(), boss::pos, EventModel::Recon::RecMdcHitCol, EventModel::Recon::RecMdcTrackCol, FTTrack::stereo_segments(), Helix::tanl(), tracks(), MdcID::wire_id(), and FTTrack::Zav().

Referenced by event().

01759 {
01760   IMessageSvc *msgSvc;
01761   Gaudi::svcLocator()->service("MessageSvc", msgSvc);
01762   MsgStream log(msgSvc, "FTFinder");
01763 
01764   IDataProviderSvc* eventSvc = NULL;
01765   Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
01766 
01767   if (eventSvc) {
01768      //log << MSG::DEBUG << "makeTds:event Svc has been found" << endreq;
01769   } else {
01770      log << MSG::FATAL << "makeTds:Could not find eventSvc" << endreq;
01771     return StatusCode::FAILURE ;
01772   }
01773 
01774   RecMdcTrackCol* trkcol = new RecMdcTrackCol;   
01775   RecMdcHitCol* hitcol = new RecMdcHitCol;
01776 
01777   //make RecMdcTrackCol
01778 #ifndef OnlineMode
01779   log << MSG::DEBUG << "beginning to make RecMdcTrackCol" <<endreq; 
01780 #endif
01781   int ntrk = tracks().length(); 
01782   int trkid=0;   
01783   for (int i =0; i < ntrk; i++) {
01784     RecMdcTrack* trk = new RecMdcTrack;
01785     FTTrack* fttrk = tracks()[i];
01786 
01787 #ifndef OnlineMode    
01788     //    fttrk->printout();
01789 #endif
01790 
01791     if (fttrk->helix()->tanl() < -9000.){
01792       log << MSG::DEBUG << "deleted trackId = " << i+1 << " due to tanl = " << fttrk->helix()->tanl() << endreq;   
01793       delete trk;       
01794       continue;
01795     }
01796     //    int trackindex = i;
01797     HepPoint3D pos = fttrk->helix()->pivot();
01798     int charge = -1;
01799     HepVector m_a(5,0);
01800     m_a = fttrk->helix()->a();
01801     m_a[2]=-m_a[2];
01802     HepSymMatrix m_ea = fttrk->helix()->Ea();
01803     float fiterm = fttrk->lpav().phi(77.0);
01804     float chi2lpav =  fttrk->lpav().chisq();
01805     float chi2zav = fttrk->Zav().chisq();
01806      
01807 // note: this alg itself can not provide error matrix,so m_ea above is empty;
01808 //       the following error matrix values are based on BESII results      
01809 //       the values of online Bhabha events are multiplied by factor 10 
01810 //                          wangdy 20050418
01811      m_ea[0][0] = 0.0085;
01812      m_ea[1][1] = 0.000011;
01813      m_ea[2][2] = 0.0018;
01814      m_ea[3][3] = 1.2;
01815      m_ea[4][4] = 0.00026;
01816      m_ea[1][0] = m_ea[0][1] = -0.00029;
01817      m_ea[2][0] = m_ea[0][2] = charge*0.004;
01818      m_ea[2][1] = m_ea[1][2] = charge*0.00012;
01819      m_ea[3][0] = m_ea[0][3] = -0.017;
01820      m_ea[3][1] = m_ea[1][3] = 0.0;
01821      m_ea[3][2] = m_ea[2][3] = 0.0;
01822      m_ea[4][0] = m_ea[0][4] = 0.0;
01823      m_ea[4][1] = m_ea[1][4] = 0.0;
01824      m_ea[4][2] = m_ea[2][4] = 0.0;
01825      m_ea[4][3] = m_ea[3][4] = -0.018;
01826      
01827     trk->setTrackId(trkid);
01828     trk->setHelix(m_a);
01829     trk->setPivot(pos);
01830     trk->setError(m_ea);
01831     trk->setFiTerm(fiterm);
01832     trk->setChi2(chi2lpav+chi2zav);
01833 #ifndef OnlineMode
01834     log <<MSG::DEBUG << " trackId = " << i  << endreq;   
01835     log <<MSG::DEBUG <<"fast-tracking  kappa "<<m_a[2]
01836         <<"   fast-tracking tanl "<<m_a[4]
01837         <<endreq;
01838     log <<MSG::DEBUG <<"push_backed kappa "<<trk->helix(2)
01839         <<"   push_backed tanl "<< trk->helix(4)
01840         <<endreq;
01841 
01842     log << MSG::DEBUG << "beginning to make hitlist and RecMdcHitCol " <<endreq;
01843 #endif
01844 
01845     HitRefVec  hitrefvec;
01846 
01847     int hitindex = 0;    
01848 
01849     //axial segments part
01850     FTList<FTSegment *>&  seglist_ax = fttrk->axial_segments();
01851     int nseg_ax = seglist_ax.length();
01852     int ntrackhits = 0;
01853     for (int iseg_ax = 0; iseg_ax < nseg_ax; iseg_ax++) {
01854       FTList<FTWire *>& hitlist_ax = seglist_ax[iseg_ax]->wireHits();
01855       int nhitlist_ax = hitlist_ax.length();
01856       ntrackhits += nhitlist_ax;
01857       for( int ihit_ax = 0; ihit_ax < nhitlist_ax; ihit_ax++,hitindex++) {
01858         FTWire wire_ax = *(hitlist_ax[ihit_ax]);
01859         double  dd = wire_ax.distance();
01860         double  adc = RawDataUtil::MdcChargeChannel(wire_ax.getAdc());
01861         double  tdc = wire_ax.time();
01862         double  chi2 = wire_ax.getChi2();
01863         const Identifier mdcid = MdcID::wire_id(wire_ax.layer().layerId(),wire_ax.localId());
01864 
01865         RecMdcHit*  hit = new RecMdcHit;
01866         hit->setId(hitindex);
01867         hit->setDriftDistLeft( dd );
01868         hit->setDriftDistRight( dd );
01869         hit->setAdc( adc );
01870         hit->setTdc( tdc );
01871         hit->setMdcId( mdcid );
01872         hit->setChisqAdd( chi2 );
01873 #ifndef OnlineMode
01874         log << MSG::DEBUG << "Hit DriftDistLeft " << hit->getDriftDistLeft() << endreq;     
01875         log << MSG::DEBUG << "MDC Hit ADC " << hit->getAdc() << endreq;
01876         log << MSG::DEBUG << "Hit MDC  Identifier " << hit->getMdcId() << endreq;     
01877         log << MSG::DEBUG << "Hit Chisq " << hit->getChisqAdd() << endreq;     
01878 #endif
01879         hitcol->push_back(hit);
01880         SmartRef<RecMdcHit> refhit(hit);
01881         hitrefvec.push_back(refhit);
01882       }
01883     }
01884 
01885     //stereo segments part
01886     FTList<FTSegment *>&  seglist_st = fttrk->stereo_segments();
01887     int nseg_st = seglist_st.length();
01888     int ntrackster = 0;
01889     
01890     for (int iseg_st = 0; iseg_st < nseg_st; iseg_st++) {
01891       FTList<FTWire *>& hitlist_st = seglist_st[iseg_st]->wireHits();
01892       int nhitlist_st = hitlist_st.length();
01893       ntrackhits += nhitlist_st;
01894       ntrackster += nhitlist_st;
01895       for( int ihit_st = 0; ihit_st < nhitlist_st; ihit_st++,hitindex++) {
01896         FTWire wire_st = *(hitlist_st[ihit_st]);
01897         double  dd = wire_st.distance();
01898         //double  adc = wire_st.getAdc();
01899         double  adc = RawDataUtil::MdcChargeChannel(wire_st.getAdc());
01900         double  tdc = wire_st.time();    
01901         double  chi2 = wire_st.getChi2();
01902         const Identifier mdcid = MdcID::wire_id(wire_st.layer().layerId(),wire_st.localId());
01903 
01904         RecMdcHit*  hit = new RecMdcHit;
01905         hit->setId(hitindex);
01906         hit->setDriftDistLeft( dd );
01907         hit->setDriftDistRight( dd );
01908         hit->setAdc( adc );
01909         hit->setTdc( tdc); 
01910         hit->setMdcId( mdcid );
01911         hit->setChisqAdd( chi2 );
01912 #ifndef OnlineMode
01913         log << MSG::DEBUG << "Z Hit DriftDistLeft " << hit->getDriftDistLeft() << endreq;     
01914         log << MSG::DEBUG << "Z MDC Hit ADC " << hit->getAdc() << endreq;
01915         log << MSG::DEBUG << "Z Hit MDC  Identifier " << hit->getMdcId() << endreq;     
01916         log << MSG::DEBUG << "Z Hit Chisq " << hit->getChisqAdd() << endreq;     
01917 #endif
01918         hitcol->push_back(hit);
01919         SmartRef<RecMdcHit> refhit(hit);
01920         hitrefvec.push_back(refhit);
01921       } 
01922     }
01923     trk->setNhits(ntrackhits);
01924     trk->setNster(ntrackster);
01925     trk->setVecHits(hitrefvec);   
01926     trkcol->push_back(trk);
01927     trkid++;
01928 #ifndef OnlineMode
01929     g_naxialhit->fill((float)(ntrackhits-ntrackster), 1.0);
01930     g_nstereohit->fill((float)ntrackster, 1.0);
01931     g_nhit->fill((float)ntrackhits, 1.0);
01932 #endif
01933   } 
01934 
01935   IDataManagerSvc *dataManSvc = dynamic_cast<IDataManagerSvc*> (eventSvc); 
01936   DataObject *aTrackCol;
01937   eventSvc->findObject("/Event/Recon/RecMdcTrackCol",aTrackCol);
01938   if(aTrackCol != NULL) {
01939     dataManSvc->clearSubTree("/Event/Recon/RecMdcTrackCol");
01940     eventSvc->unregisterObject("/Event/Recon/RecMdcTrackCol");
01941   }
01942   DataObject *aRecHitCol;
01943   eventSvc->findObject("/Event/Recon/RecMdcHitCol",aRecHitCol);
01944   if(aRecHitCol != NULL) {
01945     dataManSvc->clearSubTree("/Event/Recon/RecMdcHitCol");
01946     eventSvc->unregisterObject("/Event/Recon/RecMdcHitCol");
01947   }
01948 
01949   //register RecMdcHitCol
01950   StatusCode hitsc;
01951   hitsc = eventSvc->registerObject("/Event/Recon/RecMdcHitCol", hitcol);
01952   if( hitsc.isFailure() ) {
01953     log << MSG::FATAL << "Could not register RecMdcHitCol" << endreq;
01954     return hitsc;
01955   }
01956 #ifndef OnlineMode
01957   log << MSG::DEBUG << "RecMdcHitCol registered successfully!" <<endreq;
01958 
01959   RecMdcTrackCol::iterator bef = trkcol->begin();
01960   for( ; bef != trkcol->end(); bef++) {
01961     log <<MSG::DEBUG <<" registered kappa"<<(*bef)->helix(2)
01962         <<"   registered tanl"<< (*bef)->helix(4)
01963         <<endreq;    
01964   }
01965 #endif
01966 
01967   //register RecMdcTrackCol
01968   StatusCode trksc;
01969   trksc = eventSvc->registerObject("/Event/Recon/RecMdcTrackCol", trkcol);
01970   if( trksc.isFailure() ) {
01971     log << MSG::FATAL << "Could not register RecMdcHit" << endreq;
01972     return trksc; 
01973   }
01974 #ifndef OnlineMode
01975   log << MSG::DEBUG << "RecMdcTrackCol registered successfully!" <<endreq;
01976   
01977   //check the result:RecMdcHitCol   
01978   SmartDataPtr<RecMdcHitCol> newhitCol(eventSvc,"/Event/Recon/RecMdcHitCol");
01979   if (!newhitCol) {
01980     log << MSG::FATAL << "Could not find RecMdcHit" << endreq;
01981     return( StatusCode::FAILURE);
01982   }
01983   log << MSG::DEBUG << "Begin to check RecMdcHitCol"<<endreq;
01984   RecMdcHitCol::iterator iter_hit = newhitCol->begin();
01985   for( ; iter_hit != newhitCol->end(); iter_hit++){ 
01986     log << MSG::DEBUG << "retrieved MDC Hit:"
01987         << "   DDL " <<(*iter_hit)->getDriftDistLeft()
01988         << "   DDR " <<(*iter_hit)->getDriftDistRight()
01989         << "   ADC " <<(*iter_hit)->getAdc() << endreq;
01990   }
01991   
01992   //check the result:RecMdcTrackCol   
01993   SmartDataPtr<RecMdcTrackCol> newtrkCol(eventSvc,"/Event/Recon/RecMdcTrackCol");
01994   if (!newtrkCol) { 
01995     log << MSG::FATAL << "Could not find RecMdcTrackCol" << endreq;
01996     return( StatusCode::FAILURE);
01997   }
01998   log << MSG::DEBUG << "Begin to check RecMdcTrackCol"<<endreq; 
01999   RecMdcTrackCol::iterator iter_trk = newtrkCol->begin();
02000    for( ; iter_trk != newtrkCol->end(); iter_trk++){
02001      log << MSG::DEBUG << "retrieved MDC track:"
02002          << "Track Id: " << (*iter_trk)->trackId()
02003          << "   Pivot: " << (*iter_trk)->poca()[0] << " "
02004          << (*iter_trk)->poca()[1] << " " << (*iter_trk)->poca()[2] 
02005          << endreq ;
02006      
02007      /*<< "Phi0: " << (*iter_trk)->getFi0() << "   Error of Phi0 "
02008        << (*iter_trk)->getError()(2,2) << endreq
02009        /<< "kappa: " << (*iter_trk)->getCpa() << "   Error of kappa "
02010        << (*iter_trk)->getError()(3,3) << endreq
02011           << "Tanl: " << (*iter_trk)->getTanl() << "   Error of Tanl "
02012           << (*iter_trk)->getError()(5,5) << endreq      
02013           << "Chisq of fit: "<< (*iter_trk)->getChisq()
02014           << "   Phi terminal: "<< (*iter_trk)->getFiTerm()
02015           << endreq
02016           << "Number of hits: "<< (*iter_trk)->getNhits()
02017           << "   Number of stereo hits " << (*iter_trk)->getNster()
02018           << endreq;*/
02019      
02020      log << MSG::DEBUG << "hitList of this  track:" << endreq;
02021      HitRefVec gothits = (*iter_trk)->getVecHits();
02022      HitRefVec::iterator it_gothit = gothits.begin();
02023      for( ; it_gothit != gothits.end(); it_gothit++){
02024        log << MSG::DEBUG << "hits Id: "<<(*it_gothit)->getId()
02025            << "   hits DDL&DDR " <<(*it_gothit)->getDriftDistLeft()
02026            << "   hits MDC IDentifier " <<(*it_gothit)->getMdcId()
02027            << endreq     
02028            << "   hits TDC " <<(*it_gothit)->getTdc()  
02029            << "   hits ADC " <<(*it_gothit)->getAdc() << endreq;
02030      } 
02031      
02032    }
02033 #endif
02034    
02035    return StatusCode::SUCCESS;
02036 }

void FTFinder::mkTrack3D ( void   )  [private]

create 3D track list

Definition at line 1329 of file FTFinder.cxx.

References _superLayer, _tracks, FTList< T >::append(), Bes_Common::DEBUG, genRecEmupikp::i, ganga-rec::j, FTList< T >::length(), s, FTSuperLayer::segments(), and t().

01329                        {
01330   IMessageSvc *msgSvc;
01331   Gaudi::svcLocator()->service("MessageSvc", msgSvc);
01332   MsgStream log(msgSvc, "FTFinder");
01333   
01334   int n = _tracks.length();
01335   // select segment candidate and cache sz
01336   FTList<FTSegment *> multi_trk_cand(20);
01337   for (int i=8; i>=0 ; i-- ){
01338     //if (i==2 || i==3 || i==4) continue;
01339     if (i == 4) i -= 3;
01340     FTList<FTSegment *> & segments = _superLayer[i].segments();
01341     int m = segments.length();
01342     for (int j = 0; j^m; j++){
01343       FTSegment * s = segments[j];
01344 #ifndef OnlineMode
01345         s->printout();
01346 #endif
01347       int nTrack = 0;
01348       FTTrack * t;
01349       for (int k = 0; k^n; k++){
01350 #ifndef OnlineMode
01351         log<<MSG::DEBUG<<"coupling to track: " << k <<endreq;
01352         //_tracks[k]->printout();
01353 #endif
01354         if (s->update3D(_tracks[k])){ // calculate s and z
01355           t = _tracks[k];
01356           nTrack++;
01357         }
01358       }
01359       switch(nTrack){
01360       case 0:
01361         continue;
01362       case 1:
01363         t->append_stereo_cache(s);
01364         break;
01365       default:
01366         multi_trk_cand.append(s);
01367         break;
01368       }
01369     }
01370     // whose relation between this is unique
01371     for (int j = 0; j^n; j++) _tracks[j]->updateSZ();
01372   }
01373   // link segments by tanLambda & dz
01374   for (int i = 0; i^n; i++) _tracks[i]->linkStereoSegments(); 
01375   n = multi_trk_cand.length();
01376   for (int i = 0; i^n; i++) multi_trk_cand[i]->linkStereoSegments();
01377 }

void FTFinder::mkTrackList ( void   )  [private]

create track list

Definition at line 922 of file FTFinder.cxx.

References _axialSegCollect, _linkedSegments, _tracks, FTList< T >::append(), FTTrack::axial_segments(), FTTrack::chi2_kappa_tmp(), Bes_Common::DEBUG, genRecEmupikp::i, ganga-rec::j, FTList< T >::length(), linkAxialSegments(), linkAxialSuperLayer234(), linkAxialSuperLayer910(), n2, FTSegment::printout(), FTList< T >::replace(), FTTrack::setFTFinder(), and tracks().

Referenced by event().

00923 {
00924 
00925   IMessageSvc *msgSvc;
00926   Gaudi::svcLocator()->service("MessageSvc", msgSvc);
00927 
00928   MsgStream log(msgSvc, "FTFinder");
00929 
00930   FTTrack ** tracks = (FTTrack **)malloc( 6 * sizeof(FTTrack *));
00931   int * Nsame = (int *)malloc( 6 * sizeof(int));
00932   int ntrack_cand = 0;
00933   int i,j,k,l;
00934 
00935   //for (int i =0; i < tracks().lenght(); i++) {
00936   //  FTTrack* fttrk = tracks()[i];
00937   //  fttrk->setFTFinder(this);
00938   //}
00939 
00940   FTList<FTSegment *> inner_segments(10);
00941   FTList<FTSegment *> outer_segments(10);
00942 
00943   linkAxialSuperLayer234(inner_segments);
00944   linkAxialSuperLayer910(outer_segments);
00945 
00946   _axialSegCollect.append(inner_segments);
00947   _axialSegCollect.append(outer_segments);
00948 
00949   int innerN = inner_segments.length();
00950   int outerN = outer_segments.length();
00951 
00952   log << MSG::DEBUG << innerN <<" segments in inner axial layers!"<<endreq;
00953   log << MSG::DEBUG << outerN <<" segments in outer axial layers!"<<endreq;
00954 
00955   for (l = 0; l^innerN; l++){
00956     if (inner_segments[l]->track()) continue;
00957     FTSegment *inner = inner_segments[l];
00958     FTTrack *track_cand = NULL;
00959 
00960 #ifndef OnlineMode
00961     inner->printout();
00962 #endif
00963     
00964     if(outerN==0){ 
00965       track_cand = linkAxialSegments(&inner, NULL);
00966       if(!track_cand) continue;
00967       _linkedSegments = new FTList<FTSegment *>(5);
00968       //      track_cand->printout();
00969       // append this to _tracks
00970       FTList<FTSegment *>& segments = track_cand->axial_segments();
00971       int n=segments.length();
00972       for (i = 0; i < n; i++){
00973         segments[i]->track(track_cand);
00974       }
00975       _tracks.append(track_cand);
00976       track_cand->setFTFinder(this);
00977       ntrack_cand++;
00978       continue;
00979     }
00980     
00981     for(k = 0; k^outerN; k++) {
00982       if (outer_segments[k]->track()) { //already used
00983         if(k==outerN-1) {  //if the last outer segment
00984           if (inner_segments[l]->track()) continue;   //inner segment never used
00985           track_cand = linkAxialSegments(&inner, NULL);
00986           if(!track_cand) continue;
00987           _linkedSegments = new FTList<FTSegment *>(5);
00988           // append this to _tracks
00989           FTList<FTSegment *>& segments = track_cand->axial_segments();
00990           int n=segments.length();
00991           for (i = 0; i < n; i++){
00992             segments[i]->track(track_cand);
00993           }
00994           _tracks.append(track_cand);
00995           track_cand->setFTFinder(this);
00996           ntrack_cand++;
00997         }
00998         continue;
00999       }
01000 
01001       FTSegment *outer = outer_segments[k];      
01002       track_cand = linkAxialSegments(&inner, &outer);
01003 
01004       if (!track_cand ){  // link failed
01005         if( k == outerN-1 ) { //if the last outer segment
01006           if (inner_segments[l]->track()) continue;  //inner segment never used
01007           track_cand = linkAxialSegments(&inner, NULL);
01008         }
01009         if(!track_cand) continue;
01010       }
01011       //  else {
01012       //    innerN = inner_segments.remove(l);
01013       //    outerN = outer_segments.remove(k);
01014       //  }
01015       //track_cand->printout();      
01016 
01017       ntrack_cand++;
01018       _linkedSegments = new FTList<FTSegment *>(5);
01019       
01020       //compair this to appended track candidate
01021       
01022       FTList<FTSegment *>& segments = track_cand->axial_segments();
01023       int n = segments.length();
01024       
01025       //compare this to the appended track candidate
01026       if(inner_segments[l]->track()) { //already used
01027         FTTrack * trk_tmp = inner_segments[l]->track();
01028         int nTrks = _tracks.length();
01029         int cache_i=0;
01030         for (i = 0; i^nTrks; i++){
01031           if (_tracks[i] == trk_tmp){
01032             cache_i = i;
01033             break;
01034           }
01035         }
01036         FTList<FTSegment *> & segments2 = trk_tmp->axial_segments();
01037         int n2 = segments2.length();
01038         if(n >= n2 && track_cand->chi2_kappa_tmp() < trk_tmp->chi2_kappa_tmp()){
01039           // swap this and appended one
01040           for (i = 0; i < n2; i++){
01041             segments2[i]->track(NULL);
01042           }        
01043           for (i = 0; i < n; i++){
01044             segments[i]->track(track_cand);
01045           }
01046           _tracks.replace(cache_i,track_cand);
01047           track_cand->setFTFinder(this);
01048           delete trk_tmp;
01049         }else{
01050           delete track_cand;
01051         }
01052       }else{
01053         // append this
01054         for (i = 0; i < n; i++){
01055           segments[i]->track(track_cand);
01056         }
01057         _tracks.append(track_cand);
01058         track_cand->setFTFinder(this);
01059       }
01060     } // end of loop of outerN
01061   } //end of loop innerN
01062   
01063   free(tracks);
01064   free(Nsame);
01065 
01066 #ifndef OnlineMode
01067   int n=_tracks.length();
01068   for(int i=0; i<n; i++){
01069     FTList<FTSegment *> & segments = _tracks[i]->axial_segments(); 
01070     log << MSG::DEBUG <<" loop connected axial track: " << i <<endreq;  
01071     int l=segments.length();    
01072     for(int j=0; j<l; j++){
01073       segments[j]->printout();
01074     }
01075   }
01076 #endif
01077 
01078 }

StatusCode FTFinder::registT0 ( void   )  [private]

void FTFinder::setAlgorithmPointer ( Algorithm  )  [inline]

returns FTFinder pointer

Definition at line 233 of file FTFinder.h.

References m_algorithm.

Referenced by MdcFastTrkAlg::initialize().

00233                                            {
00234   m_algorithm = alg;
00235 }

void FTFinder::setBunchtime ( double  bunchtime  )  [inline]

set bunchtime for MC events

Definition at line 85 of file FTFinder.h.

References _bunchtime.

Referenced by MdcFastTrkAlg::initialize().

00085 {_bunchtime=bunchtime;};

void FTFinder::setT0cal ( double  t0cal  )  [inline]

set crude mdc time calibconst (~200 ns) for t0 calculation

Definition at line 87 of file FTFinder.h.

References _t0cal.

Referenced by MdcFastTrkAlg::initialize().

00087 {_t0cal=t0cal;};

FTSuperLayer * FTFinder::superLayer ( int  id  )  const [inline]

returns superlayer

Definition at line 196 of file FTFinder.h.

References _superLayer.

Referenced by begin_run(), and FTTrack::r_phiFit().

00196                                 {
00197   return _superLayer + id;
00198 }

float FTFinder::t2x ( const FTLayer l,
const float  t 
) const [inline]

convert t to x

Definition at line 221 of file FTFinder.h.

References MdcParameter::_xtCoEff, FTLayer::csize(), param, and x.

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

00222 {
00223   float x = (t>0.0f) ?((param->_xtCoEff))*sqrt(t*l.csize()) : 0.0f;
00224   if ( x > 0.47f*l.csize() ){
00225     x = 0.0004f*t + 0.47f*l.csize()*(1.0f-0.0004f*0.47f/((param->_xtCoEff)*(param->_xtCoEff)));
00226   }
00227 
00228   return x;
00229 }

void FTFinder::term (  ) 

terminator

Definition at line 319 of file FTFinder.cxx.

References MdcParameter::_doIt, _layer, _linkedSegments, _superLayer, _tracks, _wire, clear(), and param.

Referenced by MdcFastTrkAlg::finalize().

00320 {
00321   if (param->_doIt) clear();
00322   delete &_tracks;
00323   delete _linkedSegments;
00324   if (!param->_doIt) return;
00325   free(_wire);
00326   free(_layer);
00327   free(_superLayer);
00328 }

FTList< FTTrack * > & FTFinder::tracks ( void   )  const [inline]

returns track list

Definition at line 202 of file FTFinder.h.

References _tracks.

Referenced by makeTds(), and mkTrackList().

00202                           {
00203   return _tracks;
00204 }

int FTFinder::updateMdc ( void   )  [private]

unpack RAWCDC and create wire-hit

Definition at line 665 of file FTFinder.cxx.

References _widbase, _wire, abs, FTSuperLayer::appendHit(), cos(), Bes_Common::DEBUG, eventNo, expflag, Bes_Common::FATAL, FTWireHit, g_eventNo, g_hitmap, g_ncellMC, g_ntrkMC, g_phi0MC, g_ptMC, g_pxMC, g_pyMC, g_pzMC, g_theta0MC, IRawDataProviderSvc::getMdcDigiVec(), MdcID::layer(), m_particleTable, m_rawDataProviderSvc, RawDataUtil::MdcCharge(), RawDataUtil::MdcTime(), msgSvc(), pid, runNo, FTLayer::superLayer(), w, Bes_Common::WARNING, and MdcID::wire().

Referenced by event().

00665                        {
00666   IMessageSvc *msgSvc;
00667   Gaudi::svcLocator()->service("MessageSvc", msgSvc);
00668 
00669   MsgStream log(msgSvc, "FTFinder");
00670 
00671   IDataProviderSvc* eventSvc = NULL;
00672   Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
00673 
00674 
00675   if (eventSvc) {
00676      //log << MSG::INFO << "Could find event Svc" << endreq;
00677   } else {
00678      log << MSG::FATAL << "Could not find Event Header" << endreq;
00679     return 0;
00680   }
00681 
00682 
00683   // Part 1: Get the event header, print out event and run number
00684 
00685   SmartDataPtr<Event::EventHeader> eventHeader(eventSvc,"/Event/EventHeader");
00686   if (!eventHeader) {
00687     log << MSG::FATAL << "Could not find Event Header" << endreq;
00688     return( StatusCode::FAILURE);
00689   }
00690   log << MSG::DEBUG << "MdcFastTrkAlg: retrieved event: " << eventHeader->eventNumber()  << "  run: " <<  eventHeader->runNumber() << endreq;
00691   eventNo = eventHeader->eventNumber();
00692   runNo = eventHeader->runNumber();
00693   if(runNo>0) expflag=1;
00694   else  expflag=0;
00695   int digiId;
00696 
00697 #ifndef OnlineMode
00698   g_eventNo = eventHeader->eventNumber();
00699 
00700   // Part 2: Retrieve MC truth
00701    SmartDataPtr<McParticleCol> mcParticleCol(eventSvc,"/Event/MC/McParticleCol");
00702    if (!mcParticleCol) {
00703     log << MSG::WARNING << "Could not find McParticle" << endreq;
00704    // return( StatusCode::FAILURE);
00705    }
00706    else{
00707      McParticleCol ::iterator iter_mc = mcParticleCol->begin();
00708      digiId = 0;
00709      int ntrkMC = 0;
00710      int charge = 0;
00711      for (;iter_mc != mcParticleCol->end(); iter_mc++, digiId++) {
00712        log << MSG::DEBUG << "MDC digit No: " << digiId << endreq;
00713        log << MSG::DEBUG
00714            << " particleId = " << (*iter_mc)->particleProperty ()
00715            << endreq;
00716        int  statusFlags = (*iter_mc)->statusFlags();
00717        int  pid = (*iter_mc)->particleProperty();
00718        if(pid >0) {
00719          if(m_particleTable->particle( pid )){ 
00720            charge = (int)m_particleTable->particle( pid )->charge();
00721          }
00722        } else if ( pid <0 ) {
00723          if(m_particleTable->particle( -pid )){
00724            charge = (int)m_particleTable->particle( -pid )->charge();
00725            charge *= -1;
00726          }
00727        } else {
00728          log << MSG::WARNING << "wrong particle id, please check data" <<endreq;
00729        }
00730        
00731        if(charge==0 || abs(cos((*iter_mc)->initialFourMomentum().theta()))>0.93) continue; 
00732        
00733        g_theta0MC[ntrkMC] = (*iter_mc)->initialFourMomentum().theta();
00734        g_phi0MC[ntrkMC] = (*iter_mc)->initialFourMomentum().phi();
00735        g_pxMC[ntrkMC] = (*iter_mc)->initialFourMomentum().px();
00736        g_pyMC[ntrkMC] = (*iter_mc)->initialFourMomentum().py();
00737        g_pzMC[ntrkMC] = (*iter_mc)->initialFourMomentum().pz();
00738        g_ptMC[ntrkMC] = 0.001 * sqrt(g_pxMC[ntrkMC]*g_pxMC[ntrkMC] + g_pyMC[ntrkMC]*g_pyMC[ntrkMC]);
00739        ntrkMC++;
00740      }
00741      g_ntrkMC = ntrkMC;
00742    }
00743 #endif
00744 
00745 #ifdef MultiThread
00746    //Part 3: Retrieve MDC digi
00747     SmartDataPtr<MdcDigiCol> mdcDigiVec(eventSvc,"/Event/Digi/MdcDigiCol");
00748     if (!mdcDigiVec) {
00749      log << MSG::FATAL << "Could not find MDC digi" << endreq;
00750      return( StatusCode::FAILURE);
00751     }
00752    MdcDigiCol::iterator iter1 = mdcDigiVec->begin();
00753    digiId = 0;
00754    Identifier mdcId;
00755    int layerId;
00756    int wireId;
00757    for (;iter1 != mdcDigiVec->end(); iter1++, digiId++) {
00758 #else
00759    //--use RawDataProvider to get MdcDigi
00760    //  bool m_dropRecHits=true;//or false 
00761    MdcDigiVec mdcDigiVec = m_rawDataProviderSvc->getMdcDigiVec();
00762    MdcDigiVec::iterator iter1 = mdcDigiVec.begin();
00763    digiId = 0;
00764    Identifier mdcId;
00765    int layerId;
00766    int wireId;
00767    for (;iter1 != mdcDigiVec.end(); iter1++, digiId++) {
00768 #endif
00769      mdcId = (*iter1)->identify();
00770      layerId = MdcID::layer(mdcId);
00771      wireId = MdcID::wire(mdcId);
00772 #ifndef OnlineMode
00773      log << MSG::DEBUG << "MDC digit No: " << digiId << endreq;
00774      log << MSG::DEBUG
00775          << " time_channel = " << RawDataUtil::MdcTime((*iter1)->getTimeChannel())
00776          << " charge_channel = " << RawDataUtil::MdcCharge((*iter1)->getChargeChannel())
00777          << " layerId = " << layerId 
00778          << " wireId = " << wireId
00779          << endreq;
00780 #endif
00781 
00782         const int localwid = wireId; 
00783         const int wid = localwid + _widbase[layerId];
00784 
00785 #ifndef OnlineMode
00786        g_ncellMC->fill((float)wid, 1.0);
00787 #endif
00788         //... skip invalid wireID's
00789         if (wid < 0 || wid > 6795) continue;
00790         FTWire & w = *(_wire + wid);
00791         float tdc =  RawDataUtil::MdcTime((*iter1)->getTimeChannel());
00792         float adc =  RawDataUtil::MdcCharge((*iter1)->getChargeChannel());
00793 
00794 #ifndef OnlineMode
00795         if (eventNo == 466)  {
00796              g_hitmap[0]->fill(w.x(), w.y());
00797         }
00798 
00799         if (eventNo == 538)  {
00800              g_hitmap[1]->fill(w.x(), w.y());
00801         }
00802 
00803         if (eventNo == 408)  {
00804              g_hitmap[2]->fill(w.x(), w.y());
00805         }
00806 
00807         if (eventNo == 499)  {
00808              g_hitmap[3]->fill(w.x(), w.y());
00809         }
00810 
00811         if (eventNo == 603)  {
00812              g_hitmap[4]->fill(w.x(), w.y());
00813         }
00814 
00815         if (eventNo == 938)  {
00816              g_hitmap[5]->fill(w.x(), w.y());
00817         }
00818 #endif
00819         // tdc/adc calibration
00820         //new tdc include drift time and flight time
00821         float time = tdc-sqrt(w.x()*w.x()+w.y()*w.y())/30;
00822         w.time(time);
00823         w.wireId(wid);
00824         w.setAdc(adc); 
00825  
00826         //... check adc validation
00827         const FTLayer & lyr = w.layer();
00828 
00829         //... save to the array
00830         //w.distance(time*40*0.0001);  //original
00831         w.distance(0.0); //by X.-R. Lu
00832         w.setChi2(999);
00833         w.state(FTWireHit);
00834         FTSuperLayer & sup = (FTSuperLayer &) lyr.superLayer();
00835         sup.appendHit(&w);
00836    }
00837    
00838    return 1;
00839 }

Hep3Vector FTFinder::vertex ( void   )  const

returns event primary vertex

Definition at line 1641 of file FTFinder.cxx.

References _vx, _vy, and _vz.

01641                           {
01642   return Hep3Vector(_vx,_vy,_vz);
01643 }

int FTFinder::VertexFit ( int  z_flag  )  [private]

finds event primary vertex

Definition at line 1469 of file FTFinder.cxx.

References _tracks, _vx, _vy, _vz, zav::a(), FTList< T >::append(), zav::b(), zav::chisq(), cos(), exp(), genRecEmupikp::i, ganga-rec::j, FTList< T >::length(), zav::nc(), pivot, sin(), VertexFit2D(), w, and weight.

Referenced by event().

01470 {
01471   _vx = 0.;
01472   _vy = 0.;
01473   _vz = 0.;
01474   if (!z_flag){
01475     return VertexFit2D();
01476   }
01477   int n = _tracks.length();
01478   if (n < 2){
01479     _vx = -99999.;
01480     _vy = -99999.;
01481     _vz = -99999.;
01482     return 0;
01483   }
01484   FTList<float> px(10);
01485   FTList<float> py(10);
01486   FTList<float> pz(10);
01487   FTList<float> dx(10);
01488   FTList<float> dy(10);
01489   FTList<float> dz(10);
01490   FTList<float> pmag2(10);
01491   FTList<float> weight(10);
01492   FTList<float> weight_z(10);
01493   FTList<float> sigma2_r(10);
01494   FTList<float> sigma2_z(10);
01495   
01496   for (int i = 0; i < n; i++){
01497     const Lpav & la = _tracks[i]->lpav();
01498     if (la.nc() <= 3) continue;
01499     const zav & za = _tracks[i]->Zav();
01500     if(za.nc() > 2 && za.b() > -900){
01501       pmag2.append(1+za.b()*za.b());
01502       pz.append(za.a());
01503       dz.append(za.b());
01504       sigma2_z.append(za.chisq()/(za.nc()-2));
01505       weight_z.append(exp(-(za.chisq()/(za.nc()-2))));
01506     }else{
01507       continue;
01508     }     
01509 
01510     HepVector a = la.Hpar(pivot);
01511     
01512     const float dr_i = a(1);
01513     const float px_i = - std::sin(a(2));
01514     const float py_i = std::cos(a(2));
01515 
01516     px.append(px_i);
01517     py.append(py_i);
01518     dx.append(dr_i*py_i);
01519     dy.append(-dr_i*px_i);
01520     sigma2_r.append(std::sqrt(la.chisq())/(la.nc()-3));
01521     weight.append(exp(-(std::sqrt(la.chisq())/(la.nc()-3))));
01522   }
01523   
01524   n = dx.length();
01525   if (n < 2){
01526     _vx = -9999.;
01527     _vy = -9999.;
01528     _vz = -9999.;
01529     return 0;
01530   }
01531 
01532   FTList<float> vtx_x(20);
01533   FTList<float> vtx_y(20);
01534   FTList<float> vtx_z(20);
01535   FTList<float> weight2(20);
01536   FTList<float> weight2_z(20);
01537   FTList<float> vtx_chi2(20);
01538   unsigned n_vtx(0);
01539   for (int i = n - 1; i; i--){
01540     for (int j = 0; j < i; j++){
01541       // min. chi2 fit w/ line approximation
01542       const float pij_x = py[i]*pz[j]-pz[i]*py[j];
01543       const float pij_y = pz[i]*px[j]-px[i]*pz[j];
01544       const float pij_z = px[i]*py[j]-py[i]*px[j];
01545 
01546       if (pij_x == 0.0f && pij_y == 0.0f && pij_z == 0.0f ) continue;
01547 
01548       const float sr = sigma2_r[i]+sigma2_r[j]; 
01549       const float sz = sigma2_z[i]+sigma2_z[j];
01550 
01551       const float ddx = dx[i]-dx[j];
01552       const float ddy = dy[i]-dy[j];
01553       const float ddz = dz[i]-dz[j];
01554 
01555       const float pij_mag2 = pij_x*pij_x/(sr*sz)+pij_y*pij_y/(sr*sz)+pij_z*pij_z/(sr*sr);
01556 
01557       const float d_i = (pij_x*(py[j]*ddz-pz[j]*ddy)/(sr*sz)+
01558                          pij_y*(pz[j]*ddx-px[j]*ddz)/(sr*sz)+
01559                          pij_z*(px[j]*ddy-py[j]*ddx)/(sr*sr))/pij_mag2;
01560 
01561       const float d_j = (pij_x*(py[i]*ddz-pz[i]*ddy)/(sr*sz)+
01562                          pij_y*(pz[i]*ddx-px[i]*ddz)/(sr*sz)+
01563                          pij_z*(px[i]*ddy-py[i]*ddx)/(sr*sr))/pij_mag2;
01564 
01565       const float vtx_x_i = dx[i] + px[i]*d_i;
01566       const float vtx_y_i = dy[i] + py[i]*d_i;
01567       const float vtx_z_i = dz[i] + pz[i]*d_i;
01568 
01569       const float vtx_x_j = dx[j] + px[j]*d_j;
01570       const float vtx_y_j = dy[j] + py[j]*d_j;
01571       const float vtx_z_j = dz[j] + pz[j]*d_j;
01572 
01573       const float weight_ij = weight[i]+weight[j];
01574       vtx_x.append((weight[j]*vtx_x_i + weight[i]*vtx_x_j)/weight_ij);
01575       vtx_y.append((weight[j]*vtx_y_i + weight[i]*vtx_y_j)/weight_ij);
01576       vtx_z.append((weight_z[j]*vtx_z_i + weight_z[i]*vtx_z_j)/(weight_z[i]+weight_z[j]));
01577       
01578       weight2.append(exp(-sr));
01579       weight2_z.append(exp(-sz));
01580       vtx_chi2.append(((vtx_x_i-vtx_x_j)*(vtx_x_i-vtx_x_j)+(vtx_y_i-vtx_y_j)*(vtx_y_i-vtx_y_j))/sr +
01581                       (vtx_z_i-vtx_z_j)*(vtx_z_i-vtx_z_j)/sz);
01582       n_vtx++;
01583     }
01584   }
01585   n = vtx_chi2.length();
01586   float S_weight(0.0f);
01587   float S_weight_z(0.0f);
01588   for (int i = 0; i != n; i++){
01589     if (vtx_chi2[i] > 10.) continue;
01590     float w(std::exp(-vtx_chi2[i]));
01591     _vx += vtx_x[i]*weight2[i]*w;
01592     _vy += vtx_y[i]*weight2[i]*w;
01593     _vz += vtx_z[i]*weight2_z[i]*w;
01594     S_weight += weight2[i]*w;
01595     S_weight_z += weight2_z[i]*w;
01596   }
01597   int rtn_flag = 0;
01598   if (S_weight <= 0.){
01599     _vx = -9999.;
01600     _vy = -9999.;
01601   }else{
01602     _vx /= S_weight;
01603     _vy /= S_weight;
01604     rtn_flag = 1;
01605   }
01606   if (!z_flag) return rtn_flag;
01607   if (S_weight_z <= 0.){
01608     _vz = -9999.;
01609   }else{
01610     _vz /= S_weight_z;
01611     rtn_flag++;
01612   }
01613   return rtn_flag;
01614 }

int FTFinder::VertexFit2D (  )  [private]

finds event primary vertex from 2D tracks

Definition at line 1380 of file FTFinder.cxx.

References _tracks, _vx, _vy, _vz, FTList< T >::append(), cos(), exp(), genRecEmupikp::i, ganga-rec::j, FTList< T >::length(), pivot, sin(), and weight.

Referenced by VertexFit().

01381 {
01382   int nTrks = _tracks.length();
01383   if (nTrks < 2){
01384     _vx = -99999.;
01385     _vy = -99999.;
01386     _vz = -99999.;
01387     return 0;
01388   }
01389   FTList<float> px(10);
01390   FTList<float> py(10);
01391   FTList<float> dx(10);
01392   FTList<float> dy(10);
01393   FTList<double> weight(10);
01394   for (int i = 0; i < nTrks; i++){
01395     const Lpav & la = _tracks[i]->lpav();
01396     HepVector a = la.Hpar(pivot);
01397     
01398     const float dr_i = a(1);
01399     if (fabs(a(1)) > 1.5) continue;
01400     const float px_i = - sin(a(2));
01401     const float py_i = cos(a(2));
01402 
01403     //const float dx_i = dr_i*py_i;
01404     //const float dy_i = -dr_i*px_i;
01405 
01406     float weight_i = la.chisq()/(la.nc()*0.02);
01407 
01408     px.append(px_i);
01409     py.append(py_i);
01410     dx.append(dr_i*py_i);
01411     dy.append(-dr_i*px_i);
01412     weight.append(exp(-weight_i*weight_i));
01413   }
01414   if (dx.length() < 2){
01415     _vx = -99999.;
01416     _vy = -99999.;
01417     _vz = -99999.;
01418     return 0;
01419   }
01420   double S_weight = 0.;
01421   for (int i = dx.length() - 1; i; i--){
01422     const float px_i = px[i];
01423     const float py_i = py[i];
01424     const float dx_i = dx[i];
01425     const float dy_i = dy[i];
01426     const float weight_i = weight[i];
01427     for (int j = 0; j < i; j++){
01428       const float px_j = px[j];
01429       const float py_j = py[j];
01430       //const float weight_j = weight[j];
01431       
01432       const float ddx = dx[j] - dx_i;
01433       const float ddy = dx[j] - dy_i;
01434     
01435       const float tmp_par = px_i*py_j - px_j*py_i;
01436       const float par = (py_j*ddx-px_j*ddy)/tmp_par;
01437 
01438       double weight_ij = weight_i*weight[j];
01439       S_weight += weight_i*weight[j];
01440       if (tmp_par==0 ||
01441           par < -0.5 || (py_i*ddx-px_i*ddy)/tmp_par < -0.5 ||
01442           fabs((px_i*px_j + py_i*py_j)/
01443                sqrt((px_i*px_i+py_i*py_i)*(px_j*px_j+py_j*py_j)))>0.86){
01444         _vx += (dx_i+0.5*ddx)*weight_ij;
01445         _vy += (dy_i+0.5*ddy)*weight_ij;
01446       }else{
01447         _vx += (dx_i+par*px_i)*weight_ij;
01448         _vy += (dy_i+par*py_i)*weight_ij;
01449       }
01450     }
01451   }
01452 
01453   int rtn_flag = 0;
01454   if (S_weight == 0.){
01455     _vx = -99999.;
01456     _vy = -99999.;
01457     _vz = -99999.;
01458   }else{
01459     _vx /= S_weight;
01460     _vy /= S_weight;
01461     _vz = -99999.;
01462     rtn_flag = 1;
01463   }
01464   return rtn_flag;
01465 
01466 }

float FTFinder::x2t ( const FTLayer l,
const float  x 
) const [inline]

convert x to t

Definition at line 214 of file FTFinder.h.

References MdcParameter::_xtCoEff, FTLayer::csize(), and param.

Referenced by CorrectEvtTiming().

00215 {
00216   return (x*x) / (param->_xtCoEff * param->_xtCoEff *l.csize());
00217 }


Member Data Documentation

FTList<FTSegment *> FTFinder::_axialSegCollect [private]

Definition at line 177 of file FTFinder.h.

Referenced by clear(), and mkTrackList().

double FTFinder::_bunchtime [private]

Definition at line 183 of file FTFinder.h.

Referenced by getTestime(), and setBunchtime().

int FTFinder::_ExpNo [private]

Definition at line 181 of file FTFinder.h.

Referenced by begin_run().

FTLayer* FTFinder::_layer [private]

Definition at line 173 of file FTFinder.h.

Referenced by begin_run(), and term().

FTList<FTSegment *>* FTFinder::_linkedSegments [private]

Definition at line 176 of file FTFinder.h.

Referenced by linkAxialSegments(), mkTrackList(), and term().

int FTFinder::_RunNo [private]

Definition at line 182 of file FTFinder.h.

Referenced by begin_run().

FTSuperLayer* FTFinder::_superLayer [private]

Definition at line 174 of file FTFinder.h.

Referenced by begin_run(), clear(), event(), linkAxialSuperLayer234(), linkAxialSuperLayer910(), mkTrack3D(), superLayer(), and term().

double FTFinder::_t0cal [private]

Definition at line 184 of file FTFinder.h.

Referenced by getTestime(), and setT0cal().

FTList<FTTrack *>& FTFinder::_tracks [private]

Definition at line 175 of file FTFinder.h.

Referenced by clear(), CorrectEvtTiming(), event(), findBestVertex(), makeMdst(), mkTrack3D(), mkTrackList(), term(), tracks(), VertexFit(), and VertexFit2D().

double FTFinder::_vx [private]

Definition at line 178 of file FTFinder.h.

Referenced by clear(), event(), findBestVertex(), vertex(), VertexFit(), and VertexFit2D().

double FTFinder::_vy [private]

Definition at line 179 of file FTFinder.h.

Referenced by clear(), event(), findBestVertex(), vertex(), VertexFit(), and VertexFit2D().

double FTFinder::_vz [private]

Definition at line 180 of file FTFinder.h.

Referenced by clear(), findBestVertex(), vertex(), VertexFit(), and VertexFit2D().

int FTFinder::_widbase[43] [private]

Definition at line 191 of file FTFinder.h.

Referenced by begin_run(), and updateMdc().

FTWire* FTFinder::_wire [private]

Definition at line 172 of file FTFinder.h.

Referenced by begin_run(), getWireId(), term(), and updateMdc().

int FTFinder::eventNo

Definition at line 158 of file FTFinder.h.

Referenced by begin_run(), and updateMdc().

float FTFinder::evtTiming

Definition at line 163 of file FTFinder.h.

Referenced by clear(), event(), FTTrack::r_phi2Fit(), FTTrack::r_phi3Fit(), FTTrack::r_phi4Fit(), FTTrack::r_phiReFit(), and FTTrack::s_zFit().

int FTFinder::expflag

Definition at line 160 of file FTFinder.h.

Referenced by begin_run(), getTestime(), and updateMdc().

int FTFinder::i_rPhiFit

Definition at line 166 of file FTFinder.h.

Referenced by event().

Algorithm* FTFinder::m_algorithm [private]

Definition at line 87 of file FTFinder.h.

Referenced by setAlgorithmPointer().

HepPDT::ParticleDataTable* FTFinder::m_particleTable [private]

Definition at line 186 of file FTFinder.h.

Referenced by init(), and updateMdc().

IMagneticFieldSvc* FTFinder::m_pmgnIMF [private]

Definition at line 188 of file FTFinder.h.

Referenced by FTFinder(), linkAxialSegments(), linkAxialSegments_step(), and linkAxialSuperLayer234().

IRawDataProviderSvc* FTFinder::m_rawDataProviderSvc [private]

Definition at line 187 of file FTFinder.h.

Referenced by init(), and updateMdc().

int FTFinder::m_total_trk [private]

Definition at line 185 of file FTFinder.h.

MdcParameter * FTFinder::param = MdcParameter::instance() [static, private]

Definition at line 190 of file FTFinder.h.

Referenced by begin_run(), event(), init(), linkAxialSegments(), linkAxialSuperLayer234(), linkAxialSuperLayer910(), t2x(), term(), and x2t().

const HepPoint3D FTFinder::pivot

Definition at line 164 of file FTFinder.h.

Referenced by findBestVertex(), FTTrack::r_phi2Fit(), FTTrack::r_phi3Fit(), FTTrack::r_phi4Fit(), FTTrack::r_phiFit(), FTTrack::r_phiReFit(), FTTrack::s_zFit(), VertexFit(), and VertexFit2D().

int FTFinder::runNo

Definition at line 159 of file FTFinder.h.

Referenced by begin_run(), and updateMdc().

float FTFinder::t0Estime

Definition at line 161 of file FTFinder.h.

Referenced by event(), and getTestime().

int FTFinder::tEstFlag

Definition at line 167 of file FTFinder.h.

Referenced by event(), and getTestime().

FTList<float> FTFinder::tEstime[10]

Definition at line 168 of file FTFinder.h.

Referenced by clear(), event(), and getTestime().

float FTFinder::Testime

Definition at line 165 of file FTFinder.h.

float FTFinder::tOffSet

Definition at line 162 of file FTFinder.h.

Referenced by getTestime().


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