/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-45/MdcTrkRecon/MdcSegGrouper.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: MdcSegGrouper.h,v 1.7 2011/05/16 06:52:13 zhangy Exp $
00004 //
00005 // Description:
00006 //     Base class.  This set of classes creates lists (by superlayer) of 
00007 //      track segments that are compatible with some hypothesis (currently, 
00008 //      either a seed segment for axial segments or an existing axial 
00009 //      track for stereo segments), along with the machinary to form 
00010 //      candidate groups of segments.  The base class holds the lists and 
00011 //      handles the combinatorics, including allowing gaps, and provides 
00012 //      hooks for testing combinations on the fly.  
00013 //
00014 //      I don't know how it works, and I wrote it.
00015 //
00016 // Environment:
00017 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00018 //
00019 // Authors: Steve Schaffner
00020 //
00021 // Copyright (C)  1996  The Board of Trustees of  
00022 // 
00023 // History:
00024 //      Migration for BESIII MDC
00025 // The Leland Stanford Junior University.  All Rights Reserved.
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 // Class interface //
00039 class MdcSegGrouper {
00040 
00041 public:
00042   virtual ~MdcSegGrouper();
00043 protected:
00044   // constructor
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   // Tests for incompatible segments:
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]);//yzhang 2011-05-06 
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;   //== maxPly; number of slayers to be combined
00069   int nPlyFilled;  //# of plies with non-null seg lists for this seed/axial trk
00070   int *currentSeg;   //(HepAList index)
00071   int *firstGood;   //(  "        ") permits skipping unrelated segs 
00072   int *firstBad;  
00073   bool **isValid;
00074   // isValid[iply][iseg] -- seg is compatible with seed (a seg may be between 
00075   //    firstGood and firstBad, and still be bad -- e.g. may not match in curv)
00076 
00077   HepAList<MdcSeg> **combList; 
00078   const MdcDetector *_gm; 
00079   HepAList<MdcSeg> *segList;  
00080   // segList[islayer]: holds list of segs for finding.  For axial slayers, 
00081   //  this is a list of all segs in the slayer, in phi0 order; for stereo, 
00082   //  it is a list only of ones compatible with current axial track
00083   //  For simplicity, array length is # slayers in chamber; ones in wrong 
00084   //  view(s) left empty
00085   // combList[iply]: current set of lists of segs.  For axial, does not 
00086   //  include list for seed slayer
00087   // The following all manage inclusion of gaps in group
00088   bool *leaveGap;   //leaveGap[ipy] => currently leaving out this ply
00089   int nNull;  // # plies currently left out of group (should start at zero)
00090   int maxNull;  // nNull <= maxNull
00091   int *gapCounter; 
00092 
00093   bool lTestGroup;  // check whether each seg is compat. with preceeding group
00094   bool lTestSingle; // chech whether compat. with seed
00095 
00096   int _debug;
00097 
00098   void resetSegCounters();
00099 
00100 
00101 private:
00102   // Preempt 
00103   MdcSegGrouper&   operator= (const MdcSegGrouper&);
00104   MdcSegGrouper(const MdcSegGrouper &);
00105 };
00106 
00107 #endif

Generated on Tue Nov 29 23:13:33 2016 for BOSS_7.0.2 by  doxygen 1.4.7