BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcTrkRecon/include/MdcTrkRecon/MdcSegGrouper.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: MdcSegGrouper.h,v 1.8 2017/04/10 07:48:39 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();
43
44protected:
45 // constructor
46 MdcSegGrouper( const MdcDetector* gm, int nDeep, int debug );
47
48public:
49 int nextGroup( MdcSeg** segGroup, bool printit );
50 int updateGap();
51 void resetGap( int nGap );
52 virtual void resetComb( const MdcSeg* seed ) = 0;
53 virtual MdcTrack* storePar( MdcTrack* trk, double parms[2], double chisq, TrkContext&,
54 double trackT0 ) = 0;
55 int nPly() const { return nDeep; }
56
57 // Tests for incompatible segments:
58 virtual int incompWithSeg( const MdcSeg* refSeg, const MdcSeg* testSeg ) = 0;
59 virtual int incompWithGroup( MdcSeg** segGroup, const MdcSeg* testSeg, int iply ) = 0;
60 int combineSegs( MdcTrack*&, MdcSeg* seed, TrkContext&, double trackT0, double maxSegChisqO,
61 int combineByFitHits = 0 );
62 void transferHits( MdcTrack* track, int nSegs, MdcSeg** segGroup );
64 double calcParBySegs( MdcSeg** segGroup, double seedAngle[2], int nToUse, double& qual,
65 int& nSegFit, double param[2] ); // yzhang 2011-05-06
66 double calcParByHits( MdcSeg** segGroup, int nToUse, const TrkExchangePar& par, double& qual,
67 int& nSegFit, double param[2], double Bz );
68 void setNoInner( bool noInnerFlag ) { _noInner = noInnerFlag; }
69
70protected:
71 int nDeep; //== maxPly; number of slayers to be combined
72 int nPlyFilled; // # of plies with non-null seg lists for this seed/axial trk
73 int* currentSeg; //(HepAList index)
74 int* firstGood; //( " ") permits skipping unrelated segs
75 int* firstBad;
76 bool** isValid;
77 // isValid[iply][iseg] -- seg is compatible with seed (a seg may be between
78 // firstGood and firstBad, and still be bad -- e.g. may not match in curv)
79
81 const MdcDetector* _gm;
83 // segList[islayer]: holds list of segs for finding. For axial slayers,
84 // this is a list of all segs in the slayer, in phi0 order; for stereo,
85 // it is a list only of ones compatible with current axial track
86 // For simplicity, array length is # slayers in chamber; ones in wrong
87 // view(s) left empty
88 // combList[iply]: current set of lists of segs. For axial, does not
89 // include list for seed slayer
90 // The following all manage inclusion of gaps in group
91 bool* leaveGap; // leaveGap[ipy] => currently leaving out this ply
92 int nNull; // # plies currently left out of group (should start at zero)
93 int maxNull; // nNull <= maxNull
94 int* gapCounter;
95
96 bool lTestGroup; // check whether each seg is compat. with preceeding group
97 bool lTestSingle; // chech whether compat. with seed
98
99 int _debug;
100
102 bool _noInner;
103
104private:
105 // Preempt
106 MdcSegGrouper& operator=( const MdcSegGrouper& );
108};
109
110#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()