BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-45/MdcTrkRecon/MdcSegGrouper.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: MdcSegGrouper.h,v 1.7 2011/05/16 06:52:13 zhangy Exp $
4//
5// Description:
6// Base class. This set of classes creates lists (by superlayer) of
7// track segments that are compatible with some hypothesis (currently,
8// either a seed segment for axial segments or an existing axial
9// track for stereo segments), along with the machinary to form
10// candidate groups of segments. The base class holds the lists and
11// handles the combinatorics, including allowing gaps, and provides
12// hooks for testing combinations on the fly.
13//
14// I don't know how it works, and I wrote it.
15//
16// Environment:
17// Software developed for the BaBar Detector at the SLAC B-Factory.
18//
19// Authors: Steve Schaffner
20//
21// Copyright (C) 1996 The Board of Trustees of
22//
23// History:
24// Migration for BESIII MDC
25// The Leland Stanford Junior University. All Rights Reserved.
26//------------------------------------------------------------------------
27
28#ifndef MDCSEGGROUPER_H
29#define MDCSEGGROUPER_H
30
31template <class T> class HepAList;
32class MdcDetector;
33class MdcSeg;
34class MdcTrack;
35class TrkExchangePar;
36class TrkContext;
37
38// Class interface //
39class MdcSegGrouper {
40
41public:
42 virtual ~MdcSegGrouper();
43protected:
44 // constructor
45 MdcSegGrouper(const MdcDetector *gm, int nDeep, int debug);
46
47public:
48 int nextGroup(MdcSeg **segGroup, bool printit);
49 int updateGap();
50 void resetGap(int nGap);
51 virtual void resetComb(const MdcSeg *seed) = 0;
52 virtual MdcTrack* storePar(MdcTrack* trk, double parms[2], double chisq,
53 TrkContext&, double trackT0) =0;
54 int nPly() const {return nDeep;}
55
56 // Tests for incompatible segments:
57 virtual int incompWithSeg(const MdcSeg *refSeg, const MdcSeg *testSeg) = 0;
58 virtual int incompWithGroup(MdcSeg **segGroup, const MdcSeg *testSeg,
59 int iply) = 0;
60 int combineSegs(MdcTrack*&, MdcSeg *seed, TrkContext&, double trackT0,
61 double maxSegChisqO, int combineByFitHits=0);
62 void transferHits(MdcTrack *track, int nSegs, MdcSeg **segGroup);
64 double calcParBySegs(MdcSeg **segGroup, double seedAngle[2], int nToUse, double& qual, int& nSegFit, double param[2]);//yzhang 2011-05-06
65 double calcParByHits(MdcSeg **segGroup, int nToUse, const TrkExchangePar &par,double& qual, int& nSegFit, double param[2], double Bz);
66
67protected:
68 int nDeep; //== maxPly; number of slayers to be combined
69 int nPlyFilled; //# of plies with non-null seg lists for this seed/axial trk
70 int *currentSeg; //(HepAList index)
71 int *firstGood; //( " ") permits skipping unrelated segs
72 int *firstBad;
73 bool **isValid;
74 // isValid[iply][iseg] -- seg is compatible with seed (a seg may be between
75 // firstGood and firstBad, and still be bad -- e.g. may not match in curv)
76
78 const MdcDetector *_gm;
80 // segList[islayer]: holds list of segs for finding. For axial slayers,
81 // this is a list of all segs in the slayer, in phi0 order; for stereo,
82 // it is a list only of ones compatible with current axial track
83 // For simplicity, array length is # slayers in chamber; ones in wrong
84 // view(s) left empty
85 // combList[iply]: current set of lists of segs. For axial, does not
86 // include list for seed slayer
87 // The following all manage inclusion of gaps in group
88 bool *leaveGap; //leaveGap[ipy] => currently leaving out this ply
89 int nNull; // # plies currently left out of group (should start at zero)
90 int maxNull; // nNull <= maxNull
91 int *gapCounter;
92
93 bool lTestGroup; // check whether each seg is compat. with preceeding group
94 bool lTestSingle; // chech whether compat. with seed
95
96 int _debug;
97
99
100
101private:
102 // Preempt
103 MdcSegGrouper& operator= (const MdcSegGrouper&);
105};
106
107#endif
virtual ~MdcSegGrouper()
int combineSegs(MdcTrack *&, MdcSeg *seed, TrkContext &, double trackT0, double maxSegChisqO, int combineByFitHits=0)
virtual void resetComb(const MdcSeg *seed)=0
MdcSegGrouper(const MdcDetector *gm, int nDeep, int debug)
void resetGap(int nGap)
void resetSegCounters()
virtual int incompWithSeg(const MdcSeg *refSeg, const MdcSeg *testSeg)=0
virtual int incompWithGroup(MdcSeg **segGroup, const MdcSeg *testSeg, int iply)=0
int nextGroup(MdcSeg **segGroup, bool printit)
double calcParBySegs(MdcSeg **segGroup, double seedAngle[2], int nToUse, double &qual, int &nSegFit, double param[2])
void transferHits(MdcTrack *track, int nSegs, MdcSeg **segGroup)
double calcParByHits(MdcSeg **segGroup, int nToUse, const TrkExchangePar &par, double &qual, int &nSegFit, double param[2], double Bz)
virtual MdcTrack * storePar(MdcTrack *trk, double parms[2], double chisq, TrkContext &, double trackT0)=0
void dumpSegList()