CDF II
CDF KITS
source navigation ]
diff markup ]
identifier search ]
freetext search ]
file search ]
 
Architecture: i386 ]
Version: 4.10.4 ] [ 4.10.5 ] [ 4.8.4 ] [ 4.8.4l3s ] [ 4.8.5 ] [ 4.9.0 ] [ 4.9.1 ] [ 4.9.1.hpt3 ] [ 4.9.1hpt3 ] [ 4.9.1top1 ] [ 5.0.0 ] [ 5.1.0 ] [ 5.1.0beamonly ] [ 5.1.1 ] [ 5.2.0 ] [ 5.3.0 ] [ 5.3.1 ] [ 5.3.1dsp ] [ 5.3.3 ] [ 5.3.3_nt ] [ 5.3.4 ] [ 6.1.1 ] [ 6.1.1b ] [ 6.1.2 ] [ 6.1.3 ] [ 6.1.4 ] [ 6.1.4int3 ] [ 6.1.4mc ] [ 6.1.4mc_a ] [ 6.1.6 ] [ development ]

001 #ifndef  VERTEXFITTER_HH
002 #define  VERTEXFITTER_HH  ($Id: VertexFitter.hh,v 1.26 2003/04/12 15:55:09 wgw Exp $)
003 
004 //*****************************************************************************
005 // File:      VertexFitter.hh
006 //-----------------------------------------------------------------------------
007 // Type:      vertex fitting routine
008 // Class:     VertexFitter
009 // Language:  Standard C++
010 // Package:   VertexAlg
011 // Project:   CDF Run II Offline Software Upgrade
012 // OrigAuth:  Hartmut Stadie( and all authors of the fortran code for RunI)
013 // Company:   IEKP Karlsruhe
014 //=============================================================================
015 // RCS Current Revision Record
016 // ----------------------------------------------------------------------------
017 // $Source: /cdf/code/cdfcvs/run2/VertexAlg/VertexAlg/VertexFitter.hh,v $
018 // $Revision: 1.26 $
019 // $Date: 2003/04/12 15:55:09 $
020 // $Author: wgw $
021 // $State: Exp $
022 // $Locker:  $
023 //*****************************************************************************
024 //=============================================================================
025 // Declarations and Definitions
026 //=============================================================================
027 #include <math.h>
028 #include <vector>
029 #include <sstream>
030 
031 #ifndef VERTEXALG_STANDALONE
032 #include "TrackingObjects/Tracks/CdfTrack.hh"
033 #include "TrackingObjects/Storable/CdfTrackColl.hh"
034 #include "TrackingObjects/Storable/CdfTrackView.hh"
035 #else
036 #include "Stntuple/obj/TStnTrack.hh" 
037 #endif
038 #include "VertexAlg/ExpandedTrack.hh"
039 #include "CLHEP/Matrix/Matrix.h"
040 #include "CLHEP/Matrix/SymMatrix.h"
041 #include "CLHEP/Matrix/Vector.h"
042 #include "CLHEP/Geometry/Point3D.h"
043 #include "CLHEP/Vector/LorentzVector.h" 
044 
045 #ifndef VERTEXALG_STANDALONE
046 class MaterialIntegrator;
047 #endif
048 
049 
050 //*****************************************************************************
051 // Class definition
052 //*****************************************************************************
053 class VertexFitter
054 {
055 //=============================================================================
056 // Class public section
057 //=============================================================================
058 public:
059   enum ErrorCodes
060     {
061       NotEnoughTracksAtBegin = 1001,
062       NotEnoughTracksAfterExpansion,
063       NotEnoughTracksAfterPruning0
064     };
065 
066   VertexFitter(); 
067   ~VertexFitter();
068   //setter 
069   void setVertex(const HepVector& vertex);
070   void setVertexCovarianceMatrix(const HepSymMatrix& error);
071   void setCotScale(double cotscale);
072   void setSiScale(double siscale);
073   void setSiZ0Scale(double siz0scale);
074 #ifndef VERTEXALG_STANDALONE  
075   void newTracks(int ntracks, CdfTrack_clnk *tracks);
076   void newTracks(int ntracks, CdfTrack_clnk *tracks, double *masses);
077   void newTracks(const CdfTrackView&);
078   void newTracksRefitSi(const CdfTrackView&);
079   void newTracks(CdfTrackView*);
080   void setMaterialIntegrator(MaterialIntegrator* integrator) { _integrator = integrator;}
081 #else
082   void newTracks(int,TStnTrack**);
083 #endif
084   void setTrackMasses(double*);
085   int  useUnusedTracks(double zcut = -1);
086   
087   //getter
088 #ifndef VERTEXALG_STANDALONE  
089   CdfTrackView* usedTracks() const;//get the used tracks
090   CdfTrackView* unusedTracks() const;//get the tracks dropped during the fit
091 #endif
092   int ntracks() const;
093   HepPoint3D vertex() const;//returns the pointer to the vertex coord.
094   HepSymMatrix vertexCovarianceMatrix() const;
095   // returns the pointer to vertex error matrix 
096   double chi2() const;// returns the Chi2 of the fit
097   HepLorentzVector momentum() const;
098   // returns the four momentum of the reconstructed particle
099   Hep3Vector threemomentum() const;
100   double mass() const;//mass of the reconstructed particle
101   int charge() const;//its charge
102   int ndof() const;//Number of degrees of freedom
103   
104   //functions
105   int diufit();//starts the fit
106   int diuvtx();//constraint fit 
107   int vxgtpr(unsigned int minn = 5, bool combine = false , double maxtrackchi2 = 3.5 * 3.5, 
108              double zcut = -1, bool dosteering = true);
109   // function to calculate the chi2 wrt to the vertex stored in fitter. You have to do
110   // setVertex and setVertexCovarianceMatrix first!
111 #ifndef VERTEXALG_STANDALONE 
112   double chi2wrtVertex(const CdfTrack_clnk &track, bool trackusedinfit = false);
113 #else
114   double chi2wrtVertex(TStnTrack *track, bool trackusedinfit = false);
115 #endif
116   // Algorithm for primary vertex finding 
117   
118   void clear();
119 #if PRUNING_DEBUGTRACE
120   std::string getDebug() const {return _dbos.str();}
121   void resetDebug() { _dbos.str(""); return;}
122 protected:
123   std::ostringstream _dbos; // debug output
124 #endif
125 //=============================================================================
126 // Class private section
127 //=============================================================================
128 private:
129   static const int MAXCHI;
130   typedef std::vector<ExpandedTrack*> TrackVec;
131   typedef std::vector<ExpandedTrack*>::iterator TrackVecIter;
132   typedef std::vector<ExpandedTrack*>::const_iterator TrackVecConstIter;
133   //data members
134   HepVector _vertex;//Array for x,y,z position of intersection
135   HepSymMatrix _covout;// Array of the covariance matrix of vertex
136   HepVector _xin;
137   HepSymMatrix _covxin;
138   int _ndof;//Number of degrees of freedom 
139    //vector with track and residuals
140   TrackVec _track;
141   TrackVecIter _endused;
142   int _idim;//number of track dimensions
143   double _radius;
144   int _iexp;
145   double _chi2;
146   int _mode;
147   bool _first;
148   double _cotscale;
149   double _siz0scale;
150   double _siscale;
151   int  _errorCode;
152 #ifndef VERTEXALG_STANDALONE
153   MaterialIntegrator* _integrator;
154 #endif
155   //private functions 
156   int vxfit0(TrackVecIter begin,TrackVecIter end,bool);
157   int vxfit1(TrackVecIter begin,TrackVecIter end,bool);
158   double chi2wrtVertex(ExpandedTrack* t, bool trackusedinfit = false, bool dontexpand = false);
159   int prune0(int minn, double maxtrackchi2,bool combine);
160   int prune1(int minn, double maxtrackchi2,bool combine);
161   //functions for TrackVec:
162   static bool trackLargerResid(const ExpandedTrack* t,const ExpandedTrack* s) { return t->_resid > s->_resid;}
163   static void trackDelete(ExpandedTrack* t) { delete t;}
164   class TrackZCut
165   {
166   private:
167     double _zcut;
168     double _x;
169     double _y;
170     double _z;
171     double _zerr2;
172     bool _offset;
173   public:
174     TrackZCut(double zcut, double zvertex, double zerr2);
175     TrackZCut(double zcut, double xvertex, double yvertex, double zvertex, double zerr2);
176     bool operator()(const ExpandedTrack* track);
177   };  
178   class NotTrackZCut
179   {
180   private:
181     double _zcut;
182     double _x;
183     double _y;
184     double _z;
185     double _zerr2;
186     bool _offset;
187   public:
188     NotTrackZCut(double zcut, double zvertex, double zerr2);
189     NotTrackZCut(double zcut, double xvertex, double yvertex, double zvertex, double zerr2);
190     bool operator()(const ExpandedTrack* track);
191   };  
192   class TrackResidCut
193   {
194   private:
195     double _maxresid;
196   public:
197     TrackResidCut(double maxresid);
198     bool operator()(const ExpandedTrack* track);
199   };
200   
201 
202 };
203 
204 #include "VertexAlg/VertexFitter.icc"
205 
206 #endif

source navigation ] diff markup ] identifier search ] freetext search ] file search ]

This page was automatically generated by the LXR engine.
The LXR team
Valid HTML 4.01!

Send problems or questions to cdfcode@fnal.gov