Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:24

0001 #ifndef SMS_H
0002 #define SMS_H
0003 
0004 #include <cmath>
0005 #include <cstdlib>
0006 #include <vector>
0007 #include <algorithm>
0008 #include <iostream>
0009 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0010 
0011 /**
0012  * Class to compute the SMS location estimator The SMS estimator is the mean
0013  * value of a set of observations with Small Median of Squared distances.
0014  */
0015 
0016 class SMS {
0017 public:
0018   enum SMSType { None = 0, Interpolate = 1, Iterate = 2, Weighted = 4 };
0019   /**
0020    *  Constructor.
0021    *  \param tp What specific kind of SMS algorithm do you want?
0022    *  \param q  What fraction of data points are considered for the
0023    *  "next step"?
0024    */
0025   SMS(SMSType tp = (SMSType)(Interpolate | Iterate | Weighted), float q = 0.5);
0026 
0027   GlobalPoint location(const std::vector<GlobalPoint>&) const;
0028   GlobalPoint location(const std::vector<std::pair<GlobalPoint, float> >&) const;
0029 
0030 private:
0031   SMSType theType;
0032   float theRatio;
0033 };
0034 
0035 #endif /* def SMS */