/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Muc/MucRecEvent/MucRecEvent-00-02-52/MucRecEvent/MucRec2DRoad.h

Go to the documentation of this file.
00001 //$id$
00002 //
00003 //$log$
00004 
00005 /*
00006  *    2003/12/21   Zhengyun You      Peking University
00007  * 
00008  *    2005/02/24   Zhengyun You      Peking University
00009  *                 transplanted to Gaudi framework
00010  */
00011 
00012 #ifndef MUC_REC_2DROAD_H
00013 #define MUC_REC_2DROAD_H
00014 
00015 #include "GaudiKernel/ContainedObject.h"
00016 #include "GaudiKernel/SmartRef.h" 
00017 #include "GaudiKernel/ObjectVector.h"
00018 
00019 #include "MucRecEvent/MucRecHit.h"
00020 
00021 using CLHEP::Hep3Vector;       // forward declaration
00022 
00038 class MucRec2DRoad : virtual public ContainedObject  
00039 {
00040 public:
00041 
00043   MucRec2DRoad(const int &part = 0, 
00044                const int &seg  = 0, 
00045                const int &orient = 0,
00046                const float &xVertex = 0.0,
00047                const float &yVertex = 0.0,
00048                const float &zVertex = 0.0,
00049                const int &fittingMethod = 0);
00050   
00052   MucRec2DRoad &operator=(const MucRec2DRoad &orig);
00053   
00055   MucRec2DRoad(const MucRec2DRoad &source);
00056 
00058   ~MucRec2DRoad();
00059   
00061   void SetIndex(const int &index);
00062 
00064   void AttachHit(MucRecHit *hit);
00065 
00067   void AttachHitNoFit(MucRecHit *hit);
00068 
00071   void SetMaxNSkippedGaps(const int &nGaps);
00072 
00074   int SimpleFit(float &slope,      float &intercept,
00075                 float &sigmaSlope, float &sigmaIntercept,
00076                 float &chisq,      int &ndof);
00077 
00079   int SimpleFitNoCurrentGap(int currentgap,   float &slope,      float &intercept,
00080     float &sigmaSlope, float &sigmaIntercept,
00081     float &chisq,      int &ndof);
00082 
00084   //  This is a helper function for the Project methods.
00085   //  Give an estimated position (x,y,z) of the point to which we will
00086   //  project.
00087   int Fit(const float &x,
00088           const float &y,
00089           const float &z,
00090           float &slope,      float &intercept,
00091           float &sigmaSlope, float &sigmaIntercept,
00092           float &chisq,      int &ndof);
00093 
00095   void Project(const int &gap, float &x, float &y, float &z, float &x2, float &y2, float &z2);
00096 
00098   float WeightFunc(const float &chisq, const float &distance) const; 
00099 
00101   float WindowFunc(const float &chisq, const float &distance) const; 
00102 
00104   int GetIndex() const;
00105 
00107   int GetPart() const;
00108 
00110   int GetSeg() const;
00111   
00113   int GetOrient() const;
00114 
00116   void GetVertexPos(float &x, float &y, float &z) const;
00117   
00119   int GetLastGap() const;
00120 
00122   int GetNGapsWithHits() const;
00123 
00125   int GetTotalHits() const;
00126 
00128   int GetHitsPerGap(const int &gap) const;
00129   
00131   int GetMaxHitsPerGap() const;
00132 
00134   bool HasHitInGap(const int &gap) const;
00135   
00137   int GetNSharedHits(const MucRec2DRoad *road) const;
00138 
00140   float GetSlope() const;
00141 
00143   float GetIntercept() const;
00144 
00146   int GetDegreesOfFreedom() const;
00147 
00149   float GetReducedChiSquare() const;
00150 
00152   void GetSimpleFitParams(float &slope,      float &intercept,
00153                           float &sigmaSlope, float &sigmaIntercept,
00154                           float &chisq,      int &ndof) const;
00155 
00157   void GetSimpleFitParams(float &a,      float &b,  float &c, int &whichhalf,
00158                           float &sigmaa, float &sigmab, float &sigmac,
00159                           float &chisq,      int &ndof) const;
00160   bool GetQuadFitOk(){return m_QuadFitOK;}
00161 
00162   void GetPosSigma(float &possigma)const;
00163 
00165   MucRecHit *GetHit(const int &gap) const;
00166   
00168   float GetHitDistance(const MucRecHit *hit);
00169   
00171   float GetSearchWindowSize(const int &gap) const;
00172 
00174   bool HasHit(MucRecHit *hit) const;
00175 
00177   vector<Identifier> GetHitsID() const;
00178 
00179   vector<MucRecHit*> GetHits() const;
00180 
00182   void PrintHitsInfo() const;
00183 
00184 private:
00185 
00187   void CountHits();
00188 
00189   Hep3Vector m_VertexPos;    // Event vertex position.
00190   Hep3Vector m_VertexSigma;  // Uncertainty of event vertex position.
00191 
00192   int   m_Index;                 // uniquely identifies this road in the event
00193   int   m_Part;                  // Part in which the road was found.
00194   int   m_Seg;                   // Segment in which the road was found.
00195   int   m_Orient;                // orientation of hits attached to this road.
00196 
00197   float m_SimpleSlope;           // slope of fit with simple weights
00198   float m_SimpleIntercept;       // intercept of fit with simple weights
00199   float m_SimpleSlopeSigma;      // uncert. in slope of fit with simple weights
00200   float m_SimpleInterceptSigma;  // uncert. in intercept of fit with simple weights
00201   float m_SimplePosSigma;        // uncert. in pos of this 2D line with first gap of MUC
00202 
00203   
00204   float m_SimpleChi2;            // Chi-square of fit with simple weights
00205 
00206   float m_SimpleQuad_a;          //y = a*x*x + b*x +c
00207   float m_SimpleQuad_b;     
00208   float m_SimpleQuad_c;
00209   int   m_SimpleQuad_whichhalf;
00210   float m_SimpleQuad_aSigma;          //y = a*x*x + b*x +c
00211   float m_SimpleQuad_bSigma;     
00212   float m_SimpleQuad_cSigma;     
00213   int   m_fittingMethod;
00214 
00215 
00216   float m_Chi2;                  // Chi-square parameter of trajectory fit.
00217 
00218   int   m_SimpleDOF;             // degrees of freedom of fit with simple weights
00219   int   m_DOF;                   // Number of degrees of freedom of fit.
00220 
00221   int   m_MaxHitsPerGap;         // Max. number of hits attached in a single gap.
00222   int   m_LastGap;               // Last gap with attached clusters.
00223   int   m_TotalHits;             // Total number of hits attached.
00224   int   m_MaxNSkippedGaps;       // Max consecutive gaps allowed with no hits.
00225 
00226   bool  m_SimpleFitOK;           // If == true, we have a good "simple" fit.
00227   bool  m_FitOK;                 // If == true, we have a good fit.
00228   bool  m_QuadFitOK;
00229 
00230   vector<float> m_HitDistance;   // distance from best hit to road
00231   vector<MucRecHit*> m_pHits;    // Pointers to attached hits.
00232 };
00233 
00234 typedef ObjectVector<MucRec2DRoad> MucRec2DRoadContainer;
00235 
00236 #endif  /* MUC_REC_2DROAD_H */

Generated on Tue Nov 29 23:12:58 2016 for BOSS_7.0.2 by  doxygen 1.4.7