28 virtual Double_t
fit(std::vector<Event*>&
v) = 0;
49 Double_t
fit(std::vector<Event*>&
v)
54 for(
unsigned int i=0;
i<v.size();
i++)
86 Double_t
fit(std::vector<Event*>&
v)
89 if(v.size()==0)
return 0;
90 std::vector<Double_t> residuals(v.size());
93 for(
unsigned int i=0;
i<v.size();
i++)
100 int median_loc = (residuals.size()-1)/2;
103 if(residuals.size()%2 != 0)
105 std::nth_element(residuals.begin(), residuals.begin()+median_loc, residuals.end());
106 return residuals[median_loc];
112 std::nth_element(residuals.begin(), residuals.begin()+median_loc, residuals.end());
113 Double_t low = residuals[median_loc];
114 std::nth_element(residuals.begin()+median_loc+1, residuals.begin()+median_loc+1, residuals.end());
115 Double_t high = residuals[median_loc+1];
116 return (high + low)/2;
120 int id(){
return 2; }
146 Double_t
fit(std::vector<Event*>&
v)
154 for(
unsigned int i=0;
i<v.size();
i++)
167 int id(){
return 3; }
172 std::vector<Double_t> residuals(v.size());
175 for(
unsigned int i=0;
i<v.size();
i++)
181 std::sort(residuals.begin(), residuals.end());
182 unsigned int quantile_location = whichQuantile*(residuals.size()-1);
183 return residuals[quantile_location];
203 Double_t
fit(std::vector<Event*>&
v)
209 Double_t SUMbottom = 0;
211 for(
unsigned int i=0;
i<v.size();
i++)
218 return SUMtop/SUMbottom;
221 int id(){
return 4; }
Double_t fit(std::vector< Event * > &v)
virtual Double_t fit(std::vector< Event * > &v)=0
virtual Double_t target(Event *e)=0
Double_t fit(std::vector< Event * > &v)
double calculateQuantile(std::vector< Event * > &v, double whichQuantile)
Double_t fit(std::vector< Event * > &v)
Double_t target(Event *e)
Double_t target(Event *e)
virtual std::string name()=0
Double_t target(Event *e)
Double_t fit(std::vector< Event * > &v)
Double_t target(Event *e)