/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/TrkReco/TrkReco-00-08-59-patch4-slc6tag/TrkReco/TTrackManager.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // $Id: TTrackManager.h,v 1.17 2012/05/28 05:16:29 maoh Exp $
00003 //-----------------------------------------------------------------------------
00004 // Filename : TTrackManager.h
00005 // Section  : Tracking
00006 // Owner    : Yoshi Iwasaki
00007 // Email    : yoshihito.iwasaki@kek.jp
00008 //-----------------------------------------------------------------------------
00009 // Description : A manager of TTrack information to make outputs as Reccdc_trk.
00010 //               See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
00011 //-----------------------------------------------------------------------------
00012 
00013 #ifndef TTRACKMANAGER_FLAG_
00014 #define TTRACKMANAGER_FLAG_
00015 
00016 #ifdef TRKRECO_DEBUG_DETAIL
00017 #ifndef TRKRECO_DEBUG
00018 #define TRKRECO_DEBUG
00019 #endif
00020 #endif
00021 
00022 #include <string>
00023 
00024 #define HEP_SHORT_NAMES
00025 #include "CLHEP/Alist/AList.h"
00026 #include "TrkReco/TUpdater.h"
00027 #include "TrkReco/THelixFitter.h"
00028 #include "TrkReco/TCosmicFitter.h"
00029 #include "MdcRecEvent/RecMdcTrack.h" 
00030 #include "MdcRecEvent/RecMdcHit.h" 
00031 class TMDCWireHit;
00032 class TTrack;
00033 //struct reccdc_trk;
00034 //struct reccdc_trk_add;
00035 //struct reccdc_mctrk;
00036 //struct rectrk;
00037 #include "MdcTables/MdcTables.h"
00038 #include "MdcTables/TrkTables.h"
00039 #include "RawDataProviderSvc/RawDataProviderSvc.h"
00040 
00041 class StatusCode;
00042 
00044 class TTrackManager : public TUpdater {
00045 
00046   public:
00048     TTrackManager();
00049 
00051     virtual ~TTrackManager();
00052 
00054     void dump(const std::string & message = std::string(""),
00055               const std::string & prefix = std::string("")) const;
00056 
00057   public:// to access information
00059     std::string name(void) const;
00060 
00062     std::string version(void) const;
00063 
00065     const AList<TTrack> & allTracks(void) const;
00066 
00068     const AList<TTrack> & tracks(void) const;
00069 
00071     const AList<TTrack> & tracks2D(void) const;
00072 
00074     const AList<TTrack> & tracksFinal(void) const;
00075 
00076   public:// parameters
00078     void fittingFlag(unsigned);
00079 
00081     double maxMomentum(double);
00082 
00084     int debugLevel(void) const;
00085     int debugLevel(int);
00086 
00087     //6para T0... Liuqg
00088     float paraT0(void) const;
00089 
00090   public:// track manipulations
00092     void clear(void);
00093 
00095     static bool goodTrack(const TTrack &, bool track2D = false);
00096 
00098     void append(AList<TTrack> & list);
00099     void append2D(AList<TTrack> & list);
00100 
00102     void refit(void);
00103 
00105     void finish(void);
00106 
00108     void movePivot(void);
00109 
00111     StatusCode  determineT0(unsigned level, unsigned nMaxTracks);
00112 
00114     void setCurlerFlags(void);
00115 
00117     void sortTracksByQuality(void);
00118     void sortTracksByPt(void);
00119 
00120   public:// table manipulations
00122     void clearTables(void) const;
00123 
00125     //yzhang changed 2010-01-12 
00126     //StatusCode makeTds(bool doClear = true, int tkStat = 0); 
00127      StatusCode makeTds(RecMdcTrackCol* trackList, RecMdcHitCol* hitList, int tkStat = 1, int runge=0, int cal=0);
00128     
00130     void saveTables(void);
00131 
00133     void saveMCTables(void) const;
00134 
00136     void sortBanksByPt(void) const;
00137 
00138   private:// table manipulations in private
00140     int copyTrack(TTrack & t,
00141                   MdcRec_trk ** r,
00142                   MdcRec_trk_add ** a) const;
00144     void swapReccdc(MdcRec_trk & cdc0,
00145                     MdcRec_trk_add & add0,
00146                     MdcRec_mctrk & mc0,
00147                     MdcRec_trk & cdc1,
00148                     MdcRec_trk_add & add1,
00149                     MdcRec_mctrk & mc1) const;
00150     void swapRectrk(MdcTrk & trk0, MdcTrk & tkr1) const;
00151     void tagReccdc(unsigned * id, unsigned n) const;
00152     void tagRectrk(unsigned * id, unsigned n) const;
00153 
00154   public:// functions for after trak
00156     void treatCurler(MdcTrk & curl, MdcRec_trk_add & cdc, unsigned flag) const;
00157 
00159     void determineIP(void);
00160 
00161   public:// hit manipulations
00163     void maskCurlHits(const AList<TMDCWireHit> & axial,
00164                       const AList<TMDCWireHit> & stereo,
00165                       const AList<TTrack> & tracks) const;
00166 
00168     static void maskBadHits(const AList<TTrack> &, float maxSigma2);
00169 
00171     void salvageAssociateHits(const AList<TMDCWireHit> &,
00172                               float maxSigma2);
00173 
00175     //    void addSvd(const int) const;
00176 
00177   private:// internal functions
00179     AList<TTrack> selectGoodTracks(const AList<TTrack> &,
00180                                    bool track2D = false) const;
00181     static bool checkNumberOfHits(const TTrack &, bool track2D = false);
00182 
00184     void nameTracks(void);
00185 
00187     float T0(unsigned n);
00188 
00190     float T0Fit(unsigned n);
00191     float minimum(float y0, float y1, float y2) const;
00192 
00193   public:// obsolete
00194     TMLink & divide(const TTrack & t, AList<TMLink> * l) const;
00195     TMLink & divideByIp(const TTrack & t, AList<TMLink> * l) const;
00196     void removeHitsAcrossOverIp(AList<TMLink> &) const;
00198     TTrack * closest(const AList<TTrack> &, const TMDCWireHit &) const;
00200     void salvage(const AList<TMDCWireHit> &) const;
00202     void mask(void) const;
00203     void maskNormal(TTrack &) const;
00204     void maskCurl(TTrack &) const;
00205     void maskOut(TTrack &, const AList<TMLink> &) const;
00206     void maskMultiHits(TTrack &) const;
00207     void merge(void);
00208 
00209 
00210     void
00211     sett0bes(double t0)  {
00212           t0bes = t0;
00213     }   
00214     
00215   private:
00216     IMagneticFieldSvc* m_pmgnIMF;
00217     RawDataProviderSvc * m_rawDataProviderSvc;
00218     double t0bes;
00219     int _debugLevel;
00220     double _maxMomentum;
00221     double _sigmaCurlerMergeTest;
00222     unsigned _nCurlerMergeTest;
00223 
00224     THelixFitter _fitter;
00225     THelixFitter _cFitter;
00226 
00227     AList<TTrack> _tracksAll;   // all tracks found by the finders
00228     AList<TTrack> _tracks;      // good 3D tracks determined by the mgr
00229     AList<TTrack> _tracks2D;    // good 2D tracks determined by the mgr
00230     AList<TTrack> _tracksFinal; // final tracks output to tables
00231 
00232     AList<TMLink> _associateHits;
00233 
00234     struct summary {
00235         unsigned _nEvents;
00236         unsigned _nTracks;
00237         unsigned _nTracksAll;
00238         unsigned _nTracks2D;
00239         unsigned _nTracksFinal;
00240         unsigned _nSuperMoms;
00241         unsigned _nToBeMerged;
00242         unsigned _nToBeMergedMoreThanTwo;
00243     };
00244     struct summary * _s;
00245 
00246     //t0 in 6 para helix fitting... Liuqg
00247     float _t0;
00248 };
00249 
00250 //-----------------------------------------------------------------------------
00251 
00252 #ifdef TRKRECO_NO_INLINE
00253 #define inline
00254 #else
00255 #undef inline
00256 #define TTRACKMANAGER_INLINE_DEFINE_HERE
00257 #endif
00258 
00259 #ifdef TTRACKMANAGER_INLINE_DEFINE_HERE
00260 
00261 inline
00262 std::string
00263 TTrackManager::name(void) const {
00264     return std::string("Track Manager");
00265 }
00266 
00267 inline
00268 const AList<TTrack> &
00269 TTrackManager::tracks(void) const {
00270     return _tracks;
00271 }
00272 
00273 inline
00274 const AList<TTrack> &
00275 TTrackManager::tracks2D(void) const {
00276     return _tracks2D;
00277 }
00278 
00279 inline
00280 const AList<TTrack> &
00281 TTrackManager::allTracks(void) const {
00282     return _tracksAll;
00283 }
00284 
00285 inline
00286 double
00287 TTrackManager::maxMomentum(double a) {
00288     return _maxMomentum = a;
00289 }
00290 
00291 inline
00292 int
00293 TTrackManager::debugLevel(void) const {
00294     return _debugLevel;
00295 }
00296 
00297 inline
00298 int
00299 TTrackManager::debugLevel(int a) {
00300     return _debugLevel = a;
00301 }
00302 
00303 inline
00304 void
00305 TTrackManager::fittingFlag(unsigned a) {
00306     if (a & 1) _fitter.sag(true);
00307     if (a & 2) _fitter.propagation(true);
00308     if (a & 4) _fitter.tof(true);
00309     if (a & 8) _fitter.freeT0(true);
00310 }
00311 
00312 inline
00313 const AList<TTrack> &
00314 TTrackManager::tracksFinal(void) const {
00315     return _tracksFinal;
00316 }
00317 
00318 inline
00319 float
00320 TTrackManager::paraT0(void) const {
00321   return _t0;
00322 }
00323 
00324 
00325 #endif
00326 
00327 #undef inline
00328 
00329 #endif /* TTRACKMANAGER_FLAG_ */

Generated on Tue Nov 29 23:14:18 2016 for BOSS_7.0.2 by  doxygen 1.4.7