Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

AlVertexFitter.cpp

Go to the documentation of this file.
00001 #include "AlVertexFitter.h"
00002 
00004 //
00005 // Base class for vertex fitters
00006 //
00007 // 11/01  K. Huettmann
00008 //
00010    
00011 bool AlVertexFitter::doFit(AlephCollection<QvecBase*>& track_collection,
00012                            AlUserTrack& motherTrack, AlUsrVertex& endVertex) const {
00013  
00014   vector<Helix> vTracks;
00015   Helix tempT;
00016 
00017   // get geometrical track data
00018   AlephCollection<QvecBase*>::iterator Iqv;
00019   for (Iqv = track_collection.begin(); Iqv < track_collection.end(); Iqv++) {
00020     tempT.setTrackParameters(*Iqv);
00021     vTracks.push_back(tempT);
00022   }    
00023 
00024   // call the vertex fit routine using a specific algorithm 
00025   HepLorentzVector track4V; 
00026   Hep3Vector vertex3V;
00027   HepSymMatrix covTrack;
00028   HepSymMatrix covVertex;
00029   HepMatrix corrVertexTrack;
00030   float chi2; 
00031   bool failed = _algo->getResult(vTracks, track4V, covTrack,  
00032                                  vertex3V, covVertex, corrVertexTrack, chi2);
00033   
00034   if (! failed ) { 
00035     if (chi2 < 0.) {
00036       failed = ! failed;
00037     } else {
00038     // set vertex information
00039     endVertex.setA4V(vertex3V.x(), vertex3V.y(), vertex3V.z(), 0.);
00040     endVertex.setEM(covVertex);  
00041     endVertex.setCHIF((double) chi2);  
00042     
00043     // set mother track information and vertex-track relationships
00044     motherTrack.setA4V(track4V);                
00045     motherTrack.setEndVertex(& endVertex);
00046     motherTrack.setEM_kin(covTrack); 
00047     motherTrack.setCorrMatrix(corrVertexTrack);
00048 
00049     for (Iqv = track_collection.begin(); Iqv < track_collection.end(); Iqv++) 
00050       motherTrack.addDaughter(*Iqv);
00051     }
00052   }
00053 
00054   return failed;
00055   
00056 }

Generated at Wed Jun 18 17:19:11 2003 for ALPHA++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001