#include "profast.h" #include "THnSparse.h" #include "TVector3.h" #include using namespace std; void profast(long hist1, long hist2, float x, float y, float z, float px, float py, float pz, float en, float* ans) { Double_t prob = 0; if ( fabs(z)<=21. && fabs(x)<=4.6 && fabs(y)<=4.6 ) { TVector3 vec(px,py,pz); Double_t theta = vec.Theta()*57.29578; Double_t t = sqrt( x*x + y*y); Double_t xarr[4] = {t, z, theta, en}; THnSparse* table = 0; if (theta>45. && theta<65.) table = (THnSparse*)hist2; else table = (THnSparse*)hist1; if (table) { Long_t bin = table->GetBin(xarr); prob = table->GetBinContent(bin,0); } else { Error("gemc/profast","Pointer to histogram is NULL"); } } (*ans) = prob; }