StandardHistFactoryPlotsWithCategories
This is a standard demo that can be used with any ROOT file prepared in the standard way. You specify:
- name for input ROOT file
- name of workspace inside ROOT file that holds model and data
- name of ModelConfig that specifies details for calculator tools
- name of dataset
With default parameters the macro will attempt to run the standard hist2workspace example and read the ROOT file that it produces.
The macro will scan through all the categories in a simPdf find the corresponding observable. For each category, it will loop through each of the nuisance parameters and plot
- the data
- the nominal model (blue)
- the +Nsigma (red)
- the -Nsigma (green)
You can specify how many sigma to vary by changing nSigmaToVary. You can also change the signal rate by changing muVal.
The script produces a lot plots, you can merge them by doing:
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf `ls *pdf`
Processing /mnt/build/workspace/root-makedoc-v608/rootspi/rdoc/src/v6-08-00-patches/tutorials/roostats/StandardHistFactoryPlotsWithCategories.C...
void StandardHistFactoryPlotsWithCategories(const char* infile = "",
const char* workspaceName = "combined",
const char* modelConfigName = "ModelConfig",
const char* dataName = "obsData"){
double nSigmaToVary=5.;
double muVal=0;
bool doFit=false;
const char* filename = "";
if (!strcmp(infile,"")) {
filename = "results/example_combined_GaussExample_model.root";
if (!fileExist) {
#ifdef _WIN32
cout << "HistFactory file cannot be generated on Windows - exit" << endl;
return;
#endif
cout <<"will run standard hist2workspace example"<<endl;
gROOT->ProcessLine(
".! prepareHistFactory .");
gROOT->ProcessLine(
".! hist2workspace config/example.xml");
cout <<"\n\n---------------------"<<endl;
cout <<"Done creating example input"<<endl;
cout <<"---------------------\n\n"<<endl;
}
}
else
filename = infile;
if(!file ){
cout <<"StandardRooStatsDemoMacro: Input file " << filename << " is not found" << endl;
return;
}
if(!w){
cout <<"workspace not found" << endl;
return;
}
if(!data || !mc){
cout << "data or ModelConfig was not found" <<endl;
return;
}
if(doFit){
}
int nPlotsMax = 1000;
cout <<" check expectedData by category"<<endl;
cout <<"Is a simultaneous PDF"<<endl;
} else {
cout <<"Is not a simultaneous PDF"<<endl;
}
if(doFit) {
return;
}
int nPlots=0;
if(!simPdf){
}
} else {
cout <<
"on type " << tt->
GetName() <<
" " << endl;
if(strcmp(var->
GetName(),
"Lumi")==0){
cout <<"working on lumi"<<endl;
} else{
}
if(strcmp(var->
GetName(),
"Lumi")==0){
cout <<"working on lumi"<<endl;
} else{
}
if(strcmp(var->
GetName(),
"Lumi")==0){
cout <<"working on lumi"<<endl;
} else{
}
if(strcmp(var->
GetName(),
"Lumi")==0){
cout <<"working on lumi"<<endl;
} else{
}
++nPlots;
}
}
}
} else
for(
int i=0; i<list->
GetSize(); ++i){
}
}
- Author
- Kyle Cranmer
Definition in file StandardHistFactoryPlotsWithCategories.C.