00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #ifndef ALGFITTRACK3_H
00013 #define ALGFITTRACK3_H
00014 #include <map>
00015
00016 #include "Algorithm/AlgBase.h"
00017 #include "RecoBase/AlgReco.h"
00018 #include "RecoBase/AlgTrack.h"
00019 #include "Validity/VldContext.h"
00020
00021 #include "TMatrixD.h"
00022 #include "TObjArray.h"
00023 #include "TFile.h"
00024 #include "TTree.h"
00025 #include "TH1F.h"
00026
00027
00028 using namespace std;
00029
00030 typedef map<int,double> IntDoubleMap;
00031 typedef map<int,int> IntIntMap;
00032
00033
00034 class AlgFitTrack3 : public AlgBase, public AlgReco, public AlgTrack
00035 {
00036
00037 public:
00038 AlgFitTrack3();
00039 virtual ~AlgFitTrack3();
00040 virtual void RunAlg(AlgConfig &ac, CandHandle &ch, CandContext &cx);
00041 virtual void Trace(const char *c) const;
00042
00043
00044
00045 private:
00046 void CleanUp();
00047
00048 Int_t fParmMaxIterate;
00049 Double_t fParmMisalignmentError;
00050
00051
00052 IntDoubleMap fRangeThisPlane;
00053 IntDoubleMap fDistanceFromStart;
00054 IntDoubleMap fTheta0i;
00055 IntDoubleMap fThicknessi;
00056 IntDoubleMap fSwamU;
00057 IntDoubleMap fSwamV;
00058 IntDoubleMap fSwamdU;
00059 IntDoubleMap fSwamdV;
00060 IntDoubleMap fErrorOnMeasure;
00061 IntDoubleMap fMeasuredU;
00062 IntDoubleMap fMeasuredV;
00063 IntDoubleMap fActualZ;
00064
00065
00066 Int_t fFirstPlane;
00067 Int_t fLastPlane;
00068 Int_t fLowestPlane;
00069 Int_t fHighestPlane;
00070 Int_t fDirection;
00071
00072 Int_t fIsNaturalP0;
00073 Double_t fMomFromRange;
00074 Int_t fCharge;
00075 Double_t fZ0;
00076 Double_t fU0;
00077 Double_t fV0;
00078 Double_t fdUdZ0;
00079 Double_t fdVdZ0;
00080 Double_t fP0;
00081
00082 Int_t fLastCharge;
00083 Double_t fLastZ0;
00084 Double_t fLastU0;
00085 Double_t fLastV0;
00086 Double_t fLastdUdZ0;
00087 Double_t fLastdVdZ0;
00088 Double_t fLastP0;
00089
00090 Double_t fDP0;
00091 Double_t fDU0;
00092 Double_t fDV0;
00093 Double_t fDdUdZ0;
00094 Double_t fDdVdZ0;
00095
00096
00097
00098
00099 Double_t fChiSqU;
00100 Double_t fChiSqV;
00101
00102 Int_t fIterations;
00103 Int_t fSizeOfUWeightMatrix;
00104 Int_t fSizeOfVWeightMatrix;
00105 IntIntMap fReverseMapUIndex;
00106 IntIntMap fReverseMapVIndex;
00107
00108 Double_t CalculateD(int i, int k);
00109 Double_t CalculateP(int k, int n);
00110
00111 void FillWeightMatrix();
00112 void FillMatricesAandC();
00113 Double_t GetWiju(int row, int col);
00114 Double_t GetWijv(int row, int col);
00115 void InvertMatrixAndGetParams();
00116 void SwimAndFillMaps();
00117 int InitializeTrkClstList(const CandTrackHandle *track0);
00118
00119
00120 Int_t fTrackNum;
00121
00122
00123 TMatrixD *fUWeightMatrix;
00124 TMatrixD *fVWeightMatrix;
00125 TMatrixD fMatrixA;
00126 TMatrixD fMatrixC;
00127
00128 TObjArray fTrkClstList;
00129 VldContext *fMyVC;
00130
00131 TFile *fFile;
00132 TTree *fSillyTree;
00133 TH1F *fReasonsForNotFitting;
00134 TTree *fReasonsTree;
00135 Int_t fR_totalU;
00136 Int_t fR_totalV;
00137 Int_t fR_showerU;
00138 Int_t fR_showerV;
00139 Int_t fR_validU;
00140 Int_t fR_validV;
00141
00142
00143 Double_t fS_z;
00144 Double_t fS_measuredU;
00145 Double_t fS_measuredV;
00146 Double_t fS_swamU;
00147 Double_t fS_swamV;
00148 Int_t fS_isU;
00149
00150 ClassDef(AlgFitTrack3,2)
00151
00152 };
00153
00154 #endif // ALGFITTRACK3_H