CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoVertex/KalmanVertexFit/interface/VertexFitterResult.h

Go to the documentation of this file.
00001 #ifndef VertexFitterResult_H
00002 #define VertexFitterResult_H
00003 
00004 #include <string>
00005 // #include "Vertex/VertexRecoAnalysis/interface/NumberOfSharedTracks.h"
00006 // #include "CommonReco/PatternTools/interface/RefittedRecTrack.h"
00007 #include "DataFormats/VertexReco/interface/Vertex.h"
00008 #include "RecoVertex/VertexPrimitives/interface/TransientVertex.h"
00009 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
00010 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
00011 #include "SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h"
00012 #include "SimTracker/TrackAssociation/interface/TrackAssociatorByChi2.h"
00013 
00014 #include <vector>
00015 
00024 class VertexFitterResult {
00025 public:
00026 
00027 //   typedef std::vector<const TkSimTrack*>     SimTrackCont;
00028   typedef std::vector<reco::TransientTrack>             TTrackCont;
00029 
00030   VertexFitterResult(const int maxTracks = 100, TrackAssociatorByChi2 *associator = 0);
00031   ~VertexFitterResult();
00032 
00033   void fill(const TransientVertex & recv, const TrackingVertex * simv = 0, 
00034             reco::RecoToSimCollection *recSimColl = 0,
00035             const float &time = 0);
00036 
00037   void fill(const TransientVertex & recVertex, const TTrackCont & recTrackV,
00038             const TrackingVertex * simv = 0, 
00039             reco::RecoToSimCollection *recSimColl = 0, const float &time = 0);
00040 
00041 
00042   const float* simVertexPos() const {return simPos;}
00043   const float* recVertexPos() const {return recPos;}
00044   const float* recVertexErr() const {return recErr;}
00045   const int* trackInformation() const {return tracks;}
00046   const float* chi2Information() const {return chi;}
00047   const int* vertexPresent() const {return &vertex;}
00048   const float* time() const {return &fitTime;}
00049   void reset();
00050   const int* numberSimTracks() {return &numberOfSimTracks;}
00051   const int* numberRecTracks() {return &numberOfRecTracks;}
00052 // This array contains, for each SimTrack, the index of the associated RecTrack
00053   const int* simTrack_recIndex() {return recIndex;}
00054 // This array contains, for each RecTrack, the index of the associated simTrack
00055   const int* recTrack_simIndex() {return simIndex;}
00056   const float* recTrackWeight() {return trackWeight;}
00057   const float* recParameters (const int i) const
00058   {
00059     if ( i<0 || i>=5 )  return 0;
00060     return recPars[i];
00061   }
00062   const float* refParameters (const int i) const
00063   {
00064     if ( i<0 || i>=5 )  return 0;
00065     return refPars[i];
00066   }
00067   const float* simParameters (const int i) const
00068   {
00069     if ( i<0 || i>=5 )  return 0;
00070     return simPars[i];
00071   }
00072   const float* recErrors (const int i) const
00073   {
00074     if ( i<0 || i>=5 )  return 0;
00075     return recErrs[i];
00076   }
00077   const float* refErrors (const int i) const
00078   {
00079     if ( i<0 || i>=5 )  return 0;
00080     return refErrs[i];
00081   }
00082 
00083 private:
00084 
00085 //   typedef std::vector<const TkSimTrack*> SimTrkCont;
00086 // 
00087   void fillParameters (const reco::TrackBase::ParameterVector& perigee, float* params[5],
00088                         int trackNumber);
00089 //   void fillErrors (const reco::TrackBase::CovarianceMatrix& perigeeCov, float* errors[5],
00090 //                      int trackNumber);
00091   void fillParameters (const PerigeeTrajectoryParameters & ptp, float* params[5],
00092                         int trackNumber);
00093   void fillErrors (const PerigeeTrajectoryError & pte, float* errors[5],
00094                         int trackNumber);
00095 
00096 private:
00097 //   class RecTrackMatch{
00098 //     public:
00099 //       RecTrackMatch(const RecTrack & aRecTrack):theRecTrack(aRecTrack){}
00100 //       ~RecTrackMatch(){}
00101 //       bool operator() (const RecTrack & theRefTrack) {
00102 //         const RefittedRecTrack* refTa = dynamic_cast <const RefittedRecTrack*>(theRefTrack.tTrack());
00103 //      return ((refTa!=0) && theRecTrack.sameAddress(refTa->originalTrack()));
00104 // //       return theRecTrack.sameAddress(theRefTrack);
00105 // //   TrackAssociator * recTa = const_cast < TrackAssociator *> (vtxAssocFact.trackAssociator());
00106 // //        return theRecTrack.sameAddress(theRefTrack.originalTrack());
00107 //       }
00108 //     private:
00109 //       const RecTrack & theRecTrack;
00110 //   };
00111 
00112   // NumberOfSharedTracks numberOfSharedTracks;
00113 
00114   TrackAssociatorByChi2 * associatorForParamAtPca;
00115 
00116   float simPos[3];
00117   float recPos[3];
00118   float recErr[3];
00119   float chi[3];
00120   int tracks[3];
00121   int vertex; // 0x1 is Sim, 0x10 is Rec
00122   float fitTime;
00123 
00124   int theMaxTracks;
00125   float* simPars[5];
00126   float* recPars[5];
00127   float* refPars[5];
00128   float* recErrs[5];
00129   float* refErrs[5];
00130   int numberOfRecTracks, numberOfSimTracks;
00131   float* trackWeight;
00132   int *simIndex, *recIndex;
00133 
00134 };
00135 #endif
00136