1 |
yilmaz |
1.1 |
|
2 |
|
|
#ifndef __RHOGetter__h__
|
3 |
|
|
#define __RHOGetter__h__
|
4 |
|
|
|
5 |
|
|
#include <vector>
|
6 |
|
|
|
7 |
|
|
static double rhoBins[11] = {-5,-4,-3,-2,-1,0,1,2,3,4,5};
|
8 |
|
|
|
9 |
|
|
double getRho(double eta, const std::vector<double> rhos){
|
10 |
|
|
int j = 0;
|
11 |
|
|
double deta = 99;
|
12 |
|
|
for(unsigned int i = 0; i < rhos.size() ; ++i){
|
13 |
|
|
double d = fabs(eta-rhoBins[i]);
|
14 |
|
|
if(d < deta){
|
15 |
|
|
deta = d;
|
16 |
|
|
j = i;
|
17 |
|
|
}
|
18 |
|
|
}
|
19 |
|
|
return rhos[j];
|
20 |
|
|
|
21 |
|
|
/*
|
22 |
|
|
for(unsigned int i = 0; i < rhos.size()-1 ; ++i){
|
23 |
|
|
if(eta > rhoBins[i]) j = i+1;
|
24 |
|
|
}
|
25 |
|
|
double r = rhos[j-1]*fabs(eta - rhoBins[j]) + rhos[j]*fabs(eta - rhoBins[j-1]);
|
26 |
|
|
r /= fabs(rhoBins[j]-rhoBins[j-1]);
|
27 |
|
|
return r;
|
28 |
|
|
*/
|
29 |
|
|
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
#endif
|
33 |
|
|
|