BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
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 //
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);
63 void dumpSegList();
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 void setNoInner(bool noInnerFlag){_noInner = noInnerFlag;}
67
68protected:
69 int nDeep; //== maxPly; number of slayers to be combined
70 int nPlyFilled; //# of plies with non-null seg lists for this seed/axial trk
71 int *currentSeg; //(HepAList index)
72 int *firstGood; //( " ") permits skipping unrelated segs
73 int *firstBad;
74 bool **isValid;
75 // isValid[iply][iseg] -- seg is compatible with seed (a seg may be between
76 // firstGood and firstBad, and still be bad -- e.g. may not match in curv)
77
81 // segList[islayer]: holds list of segs for finding. For axial slayers,
82 // this is a list of all segs in the slayer, in phi0 order; for stereo,
83 // it is a list only of ones compatible with current axial track
84 // For simplicity, array length is # slayers in chamber; ones in wrong
85 // view(s) left empty
86 // combList[iply]: current set of lists of segs. For axial, does not
87 // include list for seed slayer
88 // The following all manage inclusion of gaps in group
89 bool *leaveGap; //leaveGap[ipy] => currently leaving out this ply
90 int nNull; // # plies currently left out of group (should start at zero)
91 int maxNull; // nNull <= maxNull
93
94 bool lTestGroup; // check whether each seg is compat. with preceeding group
95 bool lTestSingle; // chech whether compat. with seed
96
97 int _debug;
98
99 void resetSegCounters();
101
102
103private:
104 // Preempt
105 MdcSegGrouper& operator= (const MdcSegGrouper&);
107};
108
109#endif
int combineSegs(MdcTrack *&, MdcSeg *seed, TrkContext &, double trackT0, double maxSegChisqO, int combineByFitHits=0)
virtual void resetComb(const MdcSeg *seed)=0
void setNoInner(bool noInnerFlag)
Definition: MdcSegGrouper.h:66
int nPly() const
Definition: MdcSegGrouper.h:54
void resetGap(int nGap)
void resetSegCounters()
HepAList< MdcSeg > * segList
Definition: MdcSegGrouper.h:80
virtual ~MdcSegGrouper()
virtual int incompWithSeg(const MdcSeg *refSeg, const MdcSeg *testSeg)=0
virtual int incompWithGroup(MdcSeg **segGroup, const MdcSeg *testSeg, int iply)=0
bool ** isValid
Definition: MdcSegGrouper.h:74
int nextGroup(MdcSeg **segGroup, bool printit)
double calcParBySegs(MdcSeg **segGroup, double seedAngle[2], int nToUse, double &qual, int &nSegFit, double param[2])
const MdcDetector * _gm
Definition: MdcSegGrouper.h:79
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
HepAList< MdcSeg > ** combList
Definition: MdcSegGrouper.h:78
Definition: MdcSeg.h:42