37 |
|
int ibin; |
38 |
|
string mcjzb; |
39 |
|
vector<float> sigmas; |
40 |
+ |
string plotfilename; |
41 |
|
}; |
42 |
|
|
43 |
|
void* compute_one_upper_limit_wrapper(void* data) { |
44 |
|
isThreadActive=true; |
45 |
|
limit_args* args = (limit_args*) data; |
46 |
|
std::cout << "Thread to compute limits has been started" << std::endl; |
47 |
< |
args->sigmas=compute_one_upper_limit(args->mceff,args->toterr,args->ibin,args->mcjzb); |
47 |
> |
args->sigmas=compute_one_upper_limit(args->mceff,args->toterr,args->ibin,args->mcjzb,args->plotfilename,true); |
48 |
|
std::cout << "Thread to compute limits has finished" << std::endl; |
49 |
|
isThreadActive=false; |
50 |
|
return NULL; // oder in C++: return 0;// Damit kann man Werte zurückgeben |
51 |
|
} |
52 |
|
|
53 |
< |
void do_limit_wrapper(float mceff,float toterr,int ibin,string mcjzb,vector<float> &sigmas) { |
53 |
> |
void do_limit_wrapper(float mceff,float toterr,int ibin,string mcjzb,vector<float> &sigmas,string plotfilename) { |
54 |
|
pthread_t limitthread; |
55 |
< |
limit_args limargs={mceff,toterr,ibin,mcjzb,sigmas}; |
55 |
> |
limit_args limargs={mceff,toterr,ibin,mcjzb,sigmas,plotfilename}; |
56 |
|
pthread_create( &limitthread, NULL, compute_one_upper_limit_wrapper, (void*) &limargs); |
57 |
|
int counter=0; |
58 |
|
sleep(1); //waiting a second for the process to become active |
198 |
|
if(!systematicsonly&&!efficiencyonly) { |
199 |
|
dout << "Calculating limit now for "<<massgluname<<"="<<mglu<<" , "<<massLSPname<<"="<<mlsp <<endl; |
200 |
|
vector<float> sigmas; |
201 |
< |
do_limit_wrapper(mceff,toterr,ibin,mcjzb,sigmas); |
201 |
> |
string plotfilename=(string)(TString((scansample.collection)[0].samplename)+TString(massgluname)+TString(any2string(mglu))+TString("__")+TString(massLSPname)+TString(any2string(mlsp))); |
202 |
> |
do_limit_wrapper(mceff,toterr,ibin,mcjzb,sigmas,plotfilename); |
203 |
|
cout << "back in " << __FUNCTION__ << endl; |
204 |
|
if(sigmas[0]>-0.5) { // negative sigmas are the error signature of do_limit_wrapper, so we want to exclude them. |
205 |
|
limitmap->Fill(mglu,mlsp,sigmas[0]); |