00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef TBuilder_FLAG_
00014 #define TBuilder_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/THelixFitter.h"
00027
00028 class TTrack;
00029 class TMLink;
00030 class TMLine;
00031 class TSegment;
00032
00034 class TBuilder {
00035
00036 public:
00038 TBuilder(const std::string & name,
00039 float maxSigma,
00040 float maxSigmaStereo,
00041 float salvageLevel,
00042 float szSegmentDistance,
00043 float szLinkDistance,
00044 unsigned fittingFlag);
00045
00047 virtual ~TBuilder();
00048
00049 public:
00051 const std::string & name(void) const;
00052
00054 void dump(const std::string & message = std::string(""),
00055 const std::string & prefix = std::string("")) const;
00056
00058 TTrack * buildRphi(const AList<TMLink> &) const;
00059 TTrack * buildRphi(const AList<TSegment> &) const;
00060 TTrack * buildStereoNew(const TTrack & t,
00061 AList<TSegment> & goodSegments,
00062 AList<TSegment> & badSegments) const;
00063 TTrack * buildStereo(const TTrack & t, AList<TSegment> &) const;
00064 TTrack * buildStereo(TTrack & t,
00065 TMLine & l,
00066 const AList<TMLink> & links) const;
00067 TTrack * buildStereoOld(TTrack & t,
00068 const AList<TMLink> & allLinks,
00069 const AList<TMLink> & isolatedLinks) const;
00070 TTrack * build(TTrack & t, const TMLine & l) const;
00071
00073 void salvage(TTrack & t, AList<TMLink> & hits) const;
00074 void salvage(TTrack & t, AList<TSegment> & segments) const;
00075
00077 TMLine * initialLine(const TTrack &, AList<TSegment> &) const;
00078 TMLine * initialLineOld(const TTrack &, AList<TSegment> &) const;
00079 TMLine * initialLine1(const TTrack &,
00080 const AList<TSegment> &,
00081 const AList<TMLink> &) const;
00082 TMLine * initialLine2(const TTrack &, const AList<TMLink> &) const;
00083
00084 AList<TMLine> searchInitialLines(unsigned nSuperLayers) const;
00085 AList<TMLine> searchLines6(void) const;
00086 AList<TMLine> searchLines5(void) const;
00087 AList<TMLine> searchLines4(void) const;
00088 AList<TMLine> searchLines3(void) const;
00089 AList<TMLine> searchLines2(void) const;
00090 AList<TMLine> searchLines1(void) const;
00091 TMLine searchLine(const TMLine & initialLine) const;
00092
00093 AList<TSegment> selectStereoSegment(const TMLine & line,
00094 const AList<TSegment> & list,
00095 const AList<TMLink> & szList) const;
00096 void removeFarSegment(const TMLine &,
00097 AList<TSegment> &,
00098 AList<TMLink> &) const;
00099
00100 private:
00102
00103
00105 bool initializeForStereo(const TTrack &,
00106 const AList<TSegment> &,
00107 const AList<TSegment> &) const;
00108
00110 unsigned stereoQuality(const AList<TMLink> & links) const;
00111
00112 private:
00113 std::string _name;
00114 THelixFitter _fitter;
00115 const float _maxSigma;
00116 const float _maxSigmaStereo;
00117 const float _salvageLevel;
00118 const float _szSegmentDistance;
00119 const float _szLinkDistance;
00120
00121 private:
00122 unsigned _minNLinksForCircle;
00123 unsigned _minNCores;
00124
00125 private:
00126 mutable AList<TMLink> _allLinks;
00127 mutable AList<TMLink> _links[6];
00128 mutable AList<TMLink> _forLine;
00129 mutable unsigned _nSuperLayers;
00130 mutable unsigned _nHits[5];
00131 };
00132
00133
00134
00135 #ifdef TBuilder_NO_INLINE
00136 #define inline
00137 #else
00138 #undef inline
00139 #define TBuilder_INLINE_DEFINE_HERE
00140 #endif
00141
00142 #ifdef TBuilder_INLINE_DEFINE_HERE
00143
00144 inline
00145 const std::string &
00146 TBuilder::name(void) const {
00147 return _name;
00148 }
00149
00150 #endif
00151
00152 #undef inline
00153
00154 #endif