00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef MDCSEGGROUPER_H
00029 #define MDCSEGGROUPER_H
00030
00031 template <class T> class HepAList;
00032 class MdcDetector;
00033 class MdcSeg;
00034 class MdcTrack;
00035 class TrkExchangePar;
00036 class TrkContext;
00037
00038
00039 class MdcSegGrouper {
00040
00041 public:
00042 virtual ~MdcSegGrouper();
00043 protected:
00044
00045 MdcSegGrouper(const MdcDetector *gm, int nDeep, int debug);
00046
00047 public:
00048 int nextGroup(MdcSeg **segGroup, bool printit);
00049 int updateGap();
00050 void resetGap(int nGap);
00051 virtual void resetComb(const MdcSeg *seed) = 0;
00052 virtual MdcTrack* storePar(MdcTrack* trk, double parms[2], double chisq,
00053 TrkContext&, double trackT0) =0;
00054 int nPly() const {return nDeep;}
00055
00056
00057 virtual int incompWithSeg(const MdcSeg *refSeg, const MdcSeg *testSeg) = 0;
00058 virtual int incompWithGroup(MdcSeg **segGroup, const MdcSeg *testSeg,
00059 int iply) = 0;
00060 int combineSegs(MdcTrack*&, MdcSeg *seed, TrkContext&, double trackT0,
00061 double maxSegChisqO, int combineByFitHits=0);
00062 void transferHits(MdcTrack *track, int nSegs, MdcSeg **segGroup);
00063 void dumpSegList();
00064 double calcParBySegs(MdcSeg **segGroup, double seedAngle[2], int nToUse, double& qual, int& nSegFit, double param[2]);
00065 double calcParByHits(MdcSeg **segGroup, int nToUse, const TrkExchangePar &par,double& qual, int& nSegFit, double param[2], double Bz);
00066
00067 protected:
00068 int nDeep;
00069 int nPlyFilled;
00070 int *currentSeg;
00071 int *firstGood;
00072 int *firstBad;
00073 bool **isValid;
00074
00075
00076
00077 HepAList<MdcSeg> **combList;
00078 const MdcDetector *_gm;
00079 HepAList<MdcSeg> *segList;
00080
00081
00082
00083
00084
00085
00086
00087
00088 bool *leaveGap;
00089 int nNull;
00090 int maxNull;
00091 int *gapCounter;
00092
00093 bool lTestGroup;
00094 bool lTestSingle;
00095
00096 int _debug;
00097
00098 void resetSegCounters();
00099
00100
00101 private:
00102
00103 MdcSegGrouper& operator= (const MdcSegGrouper&);
00104 MdcSegGrouper(const MdcSegGrouper &);
00105 };
00106
00107 #endif