#include <SelectionDefinitions.h>
Definition at line 254 of file SelectionDefinitions.h.
truncatedMean_pos::truncatedMean_pos |
( |
double |
limit | ) |
|
|
inline |
Definition at line 261 of file SelectionDefinitions.h.
264 std::vector<double> trunc_mean;
266 double truncate_high = 1 -
fLimit;
271 for(
auto &&vec : vecs_dEdX){
273 std::vector<double> help_vec;
278 trunc_mean.push_back(-9999.);
283 std::vector<double> temp_vec;
284 for (
double d : vec) {
288 temp_vec.push_back(
d);
290 for (
double d : temp_vec) {
295 if (temp_vec.empty()) {
296 trunc_mean.push_back(-9999.);
300 sort(temp_vec.begin(), temp_vec.end());
304 i_low = rint ( temp_vec.size()*
fLimit);
305 i_high = rint( temp_vec.size()*truncate_high);
309 for(
int i = i_low; i < i_high; i++){
310 if (temp_vec[i] < 0) {
311 std::cout <<
"added " << temp_vec[i] <<
" " << i <<
std::endl;
313 help_vec.push_back(temp_vec[i]);
318 trunc_mean.push_back(accumulate(help_vec.begin(), help_vec.end(), 0.0) / help_vec.size());
319 if (trunc_mean.back() < 0 && trunc_mean.back() != -9999. && trunc_mean.back() != -999.) {
320 std::cout << accumulate(help_vec.begin(), help_vec.end(), 0.0) <<
" " << help_vec.size() <<
std::endl;
321 std::cout << temp_vec.size() <<
" " << i_low <<
" " << i_high <<
std::endl;
322 for (
size_t i = 0; i < help_vec.size(); ++i) {
323 std::cout <<
"\t" << help_vec[i] <<
std::endl;
QTextStream & endl(QTextStream &s)
double truncatedMean_pos::fLimit |
|
private |
The documentation for this class was generated from the following file: