#include #include #include #include #include #include #include #include #include #include #include double ff_lt(double* x, double* par) { double lt2 = x[0]*x[0]; // l_t^2 double& mg = par[0]; // m_g,min double& mu = par[1]; // \mu return x[0] * log(1. + lt2/(exp(1.0) * mg*mg)) / pow(lt2 + mu*mu, 2); } int main(int argc, char **argv) { int nthreads = atoi(argv[1]); std::cout << "running with " << nthreads << " threads\n"; int rseed = 438468301; double mg = 0.3, mu = 0.4; const int Ncasc = 10000; omp_set_num_threads(nthreads); ROOT::EnableThreadSafety(); // initializing the TF1 objects for all threads TF1* flt [nthreads]; for(int i=0; iSetParameters(mg, mu); double lt = flt[thread_id]->GetRandom(); } // end parallel loop return 0; }