Blame view

src/ExternLib/els_calculate/els_calculate.hh 778 Bytes
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * Magnitude.hh
 *
 *  Created on: 31 oct. 2012
 *      Author: AKKA IS
 */

#ifndef MAGNITUDE_HH_
#define MAGNITUDE_HH_

#include <vector>

/**
 * @bried Compute the magnitude of el
 * @return  sqrtf(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]);
 */
typedef std::vector<float> FloatVector;
typedef const FloatVector& RCFloatVector;

FloatVector els_calculate(const std::vector<short>& ELS,const double& TimeCompres, const double& EnergyCompres,const std::vector<double>& vex_els_energy,unsigned int Angle)
{
	FloatVector lElsCalculate;
	for (unsigned int iEn = 0; iEn < 128; iEn++) {// 128 Energy Steps
		lElsCalculate.push_back(((double)ELS[iEn + Angle *128])/TimeCompres/EnergyCompres/vex_els_energy[iEn]);
	}
	return lElsCalculate;
}

#endif /* MAGNITUDE_HH_ */