Hi All,
I’ve created a function which takes arguments of type TString and Double_t which I would like to utilize in TThreads. I’ve been able to get the TThread examples from the ROOT tutorials page to work, but have not been able to figure out how to pass multiple variables and variables of different types to TThread. I’ve created this simple script to show proof of concept…any thoughts you can provide are greatly appreciated…thanks.
void *myFunction(TString Particle, Double_t Energy){
cout <<This thread is: " <<Particle <<" " <<Energy <<endl;
return 0;
}
void contrulFun(){
TThread *pionThread = new TThread(“pionThread”,myFunction,[NOT SURE HOW TO STRUCTURE ARGS]);
TThread *protonThread = new TThread(“pionThread”,myFunction,[NOT SURE HOW TO STRUCTURE ARGS]);
pionThread->Run();
protonThread->Run();
pionThread->Join();
protonThread->Join();
}