Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

HoughLine.h

Go to the documentation of this file.
00001 #ifndef HoughLine_h
00002 #define HoughLine_h
00003 
00004 #include "NueAna/ParticlePID/ParticleFinder/Managed/ManagedCluster.h"
00005 
00006 #include <vector>
00007 #include <math.h>
00008 #include "TObject.h"
00009 class HoughLine : public TObject
00010 {
00011         public:
00012                 HoughLine();
00013                 ~HoughLine();
00014 
00015                 HoughLine(double theta, double r, double offset_t, double offset_z);
00016                 void SetHoughParams(double theta, double r, double offset_t, double offset_z);
00017                 
00018                 double GetExpectedT(double z);
00019 
00020                 void Reset();
00021                 
00022                 void ResetHits(int keep_bounds=0);
00023                 
00024                 void AddCluster(Managed::ManagedCluster *cl);
00025         
00026                 std::vector<int> cluster_id;
00027         
00028                 double sum_e;
00029                 double start_z;
00030                 double start_t;
00031                 double end_z;
00032                 double end_t;
00033                 int ncluster;
00034                 
00035                 double theta;
00036                 double r;
00037                 double offset_t;
00038                 double offset_z;
00039                 double phi;
00040                 double chi2;
00041  
00042                 int primary;
00043  
00044         private:
00045         
00046                 ClassDef(HoughLine,1);
00047 };
00048 
00049 
00050 
00051 /*
00052 
00053 
00054 bool CompareChi2(const HoughLine & l,const HoughLine &r)
00055 {
00056         return l.chi2/l.ncluster > r.chi2/r.ncluster;
00057 }       
00058 
00059 
00060 bool CompareT(const HoughLine & l,const HoughLine &r)
00061 {
00062         if(fabs(l.start_t-r.start_t)<0.0001)
00063         {
00064                 if(fabs(l.end_t-r.end_t)<0.0001)
00065                 {
00066                         return CompareChi2(l,r);
00067                 }
00068                 return l.end_t<r.end_t;
00069         }
00070         
00071         return l.start_t<r.start_t;
00072         
00073 }
00074 
00075 
00076 bool CompareLength(const HoughLine & l,const HoughLine &r)
00077 {
00078         if(fabs(l.start_z-r.start_z)<0.0001)
00079         {
00080                 if(fabs(l.end_z-r.end_z)<0.0001)
00081                 {
00082                         return CompareT(l,r);
00083                 }
00084 
00085                 return l.end_z<r.end_z;
00086         }
00087         
00088         return l.start_z<r.start_z;
00089         
00090 }
00091 
00092 bool CompareTotalEnergy(const HoughLine & l,const HoughLine &r)
00093 {
00094         return l.sum_e > r.sum_e;
00095 }
00096 
00097 bool CompareForwardAndClusters(const HoughLine & l,const HoughLine &r)
00098 {
00099         if(l.ncluster == r.ncluster)
00100         {
00101                 //are they the same number of planes?
00102                 if(fabs(l.end_z-l.start_z + r.start_z -r.end_z)/0.06 < 1)
00103                 {               
00104                         //return the most forward one
00105                         return l.start_z>r.start_z;
00106                 }
00107                 //select the shortest one
00108                 return l.end_z-l.start_z > r.end_z-r.start_z;
00109                 
00110         }
00111         
00112         return l.ncluster < r.ncluster;
00113         
00114 }
00115 */
00116 
00117 extern "C" {
00118         bool CompareLength(const HoughLine & l,const HoughLine &r);
00119         bool CompareForwardAndClusters(const HoughLine & l,const HoughLine &r);
00120         bool CompareTotalEnergy(const HoughLine & l,const HoughLine &r);
00121         bool CompareChi2(const HoughLine & l,const HoughLine &r);
00122         bool CompareT(const HoughLine & l,const HoughLine &r);
00123 }
00124 
00125 
00126 #endif
00127 

Generated on Mon Feb 15 11:06:47 2010 for loon by  doxygen 1.3.9.1