19#include "MdcTrkRecon/MdcSegGrouperCsmc.h"
20#include "CLHEP/Alist/AList.h"
21#include "MdcGeom/BesAngle.h"
22#include "MdcGeom/MdcDetector.h"
23#include "MdcGeom/MdcSuperLayer.h"
24#include "MdcTrkRecon/GmsList.h"
25#include "MdcTrkRecon/MdcSeg.h"
26#include "MdcTrkRecon/MdcSegInfoCsmc.h"
27#include "MdcTrkRecon/MdcSegList.h"
28#include "MdcTrkRecon/MdcTrack.h"
29#include "MdcTrkRecon/mdcWrapAng.h"
30#include "TrkBase/TrkExchangePar.h"
43 for (
int j = 0; j <
nPly(); j++ ) {
isValid[j] = 0; }
51 for (
int isuper = 0; isuper <
_gm->nSuper(); isuper++ )
54 if ( inList->
count() == 0 )
continue;
70 for (
int iseg = 0; iseg < (int)
segList[isuper].length(); iseg++ )
74 segList[isuper].insert( inSeg, iseg );
78 if ( isInserted == 0 )
segList[isuper].append( inSeg );
92 if ( testSeg == 0 )
return 0;
99 double refPhi0 = refInfo->
phi0();
100 double testPhi0 = testInfo->
phi0();
101 double corrPhi0 =
mdcWrapAng( refPhi0, testPhi0 );
102 if ( refPhi0 - corrPhi0 > 6. * sigPhi0 )
return -1;
103 if ( corrPhi0 - refPhi0 > 6. * sigPhi0 )
105 if ( testPhi0 > refPhi0 )
return 1;
113 double refD0 = refInfo->
d0();
114 double testD0 = testInfo->
d0();
115 if ( fabs( refD0 - testD0 ) > 6. * sigD0 )
return -2;
134 for ( i = 0; i <
nDeep; i++ )
148 if ( seed != 0 ) seedSlay = seed->
superlayer();
152 thisSlay = thisSlay->next() )
154 bool noGoodYet =
true;
157 if ( thisSlay == seedSlay )
continue;
158 if ( thisSlay->whichView() != 0 )
continue;
162 if (
segList[islay - 1].length() != 0 )
164 for (
int i = 0; i < (int)
segList[islay - 1].length(); i++ )
173 if ( noGoodYet )
firstGood[iply] = i + 1;
175 else if ( invalid > 0 )
179 for (
int j = i; j < (int)
segList[islay - 1].length(); j++ )
isValid[iply][j] =
false;
217 return new MdcTrack(
_gm->nSuper(), par, chi2, context, t0 );
double mdcWrapAng(double phi1, double phi2)
GmsListLink * next() const
GmsListLink * first() const
unsigned int count() const
void resetComb(const class MdcSeg *)
MdcSegGrouperCsmc(const MdcDetector *gm, int debug)
void fillWithSegs(const MdcSegList *inSegs)
virtual MdcTrack * storePar(MdcTrack *trk, double parms[2], double chisq, TrkContext &, double trackT0)
virtual int incompWithSeg(const MdcSeg *refSeg, const MdcSeg *testSeg)
virtual int incompWithGroup(MdcSeg **segGroup, const MdcSeg *testSeg, int iply)
MdcSegGrouper(const MdcDetector *gm, int nDeep, int debug)
HepAList< MdcSeg > * segList
HepAList< MdcSeg > ** combList
void calcStraight(double phi, double slope, double rad, const double *inErr)
const GmsList * oneList(int slayIndex) const
const MdcSuperLayer * superlayer() const
MdcSegInfo * info() const
void setInfo(MdcSegInfo *ptr)
int whichView(void) const