I would like to use vectors in ROOT, and I fail somehow.
#include <vector>
#include "TMath.h"
#include "TVector.h"
Double_t calc_sigma (vector <int> array) {
Double _t sigma;
sigma = TMath::RMS(array.begin(), array.end()) ; //root does not recognize this.
return sigma;
}
int outside_function() {
float sigma;
vector<int> vec;
//I call calc_sigma () from above
sigma = calc_sigma( vec); //I fail here. Error : Function RMS(array.begin(),array.end()) is not defined in current scope
................
}
What was missing or wrong with the code? Many thanks