19 TTree*
t = (TTree*)f.Get(
"data");
20 t->SetBranchAddress(
"E_GeV", &E);
21 t->SetBranchAddress(
"Weight", &W);
23 for (
int i = 0;
i < t->GetEntriesFast();
i++){
25 fList.push_back(std::pair<Double_t, Double_t>(E, W));
44 for (
unsigned int i = 0;
i <
fList.size();
i++){
45 if (
fList[
i].first > energy)
53 std::pair<Double_t, Double_t> ew1, ew2;
57 std::cout <<
"-W- PndMvdRadDamList::Interpolate: Energy is lower than list values" << std::endl;
62 std::cout <<
"-W- PndMvdRadDamList::Interpolate: Energy is bigger than list values" << std::endl;
68 return ew1.second + (ew2.second - ew1.second)/(ew2.first - ew1.first) * (energy - ew1.first);
PndMvdRadDamList(TString fileName)
std::vector< std::pair< Double_t, Double_t > > fList
Double_t GetWeight(Double_t energy)
ClassImp(PndMvdRadDamList)
virtual ~PndMvdRadDamList()
Double_t Interpolate(Double_t energy, Int_t index)
Int_t FindClosestEnergyIndex(Double_t energy)