77 #define alpha_Low "-5" 78 #define alpha_High "5" 79 #define NoHistConst_Low "0" 80 #define NoHistConst_High "2000" 91 namespace HistFactory{
93 HistoToWorkspaceFactory::HistoToWorkspaceFactory() :
119 while(fRowTitle.find(
"\\ ")!=string::npos){
120 int pos=fRowTitle.find(
"\\ ");
121 fRowTitle.replace(pos, 1,
"");
123 pFile = fopen ((filePrefix+
"_results.table").c_str(),
"a");
138 cout <<
"processing hist " << hist->
GetName() << endl;
140 cout <<
"hist is empty" << endl;
142 string highStr =
"inf";
143 for(
Int_t i=lowBin; i<highBin; ++i){
144 std::stringstream str;
145 std::stringstream range;
148 range<<
"["<<hist->
GetBinContent(i+1) <<
"," << low <<
"," << highStr <<
"]";
150 range<<
"["<< low <<
"," << high <<
"]";
151 cout <<
"for bin N"+str.str() <<
" var " << prefix+str.str()+
" with range " << range.str() << endl;
155 if(! (productPrefix.empty() || systTerm.empty()) )
156 proto->
factory((
"prod:"+productPrefix+str.str()+
"("+prefix+str.str()+
","+systTerm+
")").c_str() );
170 for(
Int_t i=lowBin; i<highBin; ++i){
171 std::stringstream str;
178 for(
int i=lowBin; i<highBin; ++i){
179 for(
int j=0; j<highBin-lowBin; ++j){
181 Cov(i,j) =
sqrt(mean(i));
189 floating, mean, Cov);
191 proto->
import(constraint);
193 likelihoodTermNames.push_back(constraint.GetName());
199 vector<string> sourceName,
string prefix,
string productPrefix,
string systTerm,
200 int lowBin,
int highBin, vector<string>& likelihoodTermNames){
208 for(
unsigned int j=0; j<lowHist.size(); ++j){
209 std::stringstream str;
217 string command=(
"Gaussian::alpha_"+sourceName.at(j)+
"Constraint(alpha_"+sourceName.at(j)+
",nom_"+sourceName.at(j)+
"[0.,-10,10],1.)");
218 cout << command << endl;
219 likelihoodTermNames.push_back( proto->
factory( command.c_str() )->
GetName() );
220 proto->
var((
"nom_"+sourceName.at(j)).c_str())->setConstant();
221 const_cast<RooArgSet*
>(proto->
set(
"globalObservables"))->add(*proto->
var((
"nom_"+sourceName.at(j)).c_str()));
230 for(
Int_t i=lowBin; i<highBin; ++i){
231 std::stringstream str;
235 vector<double> low, high;
236 for(
unsigned int j=0; j<lowHist.size(); ++j){
237 low.push_back( lowHist.at(j)->GetBinContent(i+1) );
238 high.push_back( highHist.at(j)->GetBinContent(i+1) );
239 cout <<
"for "+prefix+
" bin "+str.str()+
" creating linear interp of nominal " << nominal->
GetBinContent(i+1)
240 <<
" in parameter " << sourceName.at(j)
241 <<
" between " << low.back() <<
" - " << high.back()
242 <<
" about " << 100.*
fabs(low.back() - high.back() )/nominal->
GetBinContent(i+1) <<
" % error" 253 proto->
factory((
"prod:"+productPrefix+str.str()+
"("+prefix+str.str()+
","+systTerm+
")").c_str() );
260 string overallNorm_times_sigmaEpsilon ;
262 vector<EstimateSummary::NormFactor> norm=es.
normFactor;
264 for(vector<EstimateSummary::NormFactor>::iterator itr=norm.begin(); itr!=norm.end(); ++itr){
265 cout <<
"making normFactor: " << itr->name << endl;
267 std::stringstream range;
268 range<<
"["<<itr->val<<
","<<itr->low<<
","<<itr->high<<
"]";
272 if(!prodNames.empty()) prodNames+=
",";
274 varname=itr->name+
"_"+channel;
279 proto->
factory((varname+range.str()).c_str());
283 cout <<
"WARNING: Const attribute to <NormFactor> tag is deprecated, will ignore."<<
284 " Instead, add \n\t<ParamSetting Const=\"True\">"<<varname<<
"</ParamSetting>\n"<<
285 " to your top-level XML's <Measurment> entry"<< endl;
289 overallNorm_times_sigmaEpsilon = es.
name+
"_"+channel+
"_overallNorm_x_sigma_epsilon";
290 proto->
factory((
"prod::"+overallNorm_times_sigmaEpsilon+
"("+prodNames+
","+sigmaEpsilon+
")").c_str());
293 if(!overallNorm_times_sigmaEpsilon.empty())
294 return overallNorm_times_sigmaEpsilon;
301 map<
string,pair<double,double> > systMap,
302 vector<string>& likelihoodTermNames, vector<string>& totSystTermNames){
308 totSystTermNames.push_back(prefix);
311 vector<double> lowVec, highVec;
312 for(map<
string,pair<double,double> >::iterator it=systMap.begin(); it!=systMap.end(); ++it){
318 string command=(
"Gaussian::"+prefix+it->first+
"Constraint("+prefix+it->first+
",nom_"+prefix+it->first+
"[0.,-10,10],1.)");
319 cout << command << endl;
320 likelihoodTermNames.push_back( proto->
factory( command.c_str() )->
GetName() );
321 proto->
var((
"nom_"+prefix+it->first).c_str())->setConstant();
322 const_cast<RooArgSet*
>(proto->
set(
"globalObservables"))->add(*proto->
var((
"nom_"+prefix+it->first).c_str()));
328 std::stringstream lowhigh;
329 double low = it->second.first;
330 double high = it->second.second;
331 lowVec.push_back(low);
332 highVec.push_back(high);
335 if(systMap.size()>0){
337 LinInterpVar interp( (interpName).c_str(),
"", params, 1., lowVec, highVec);
350 int lowBin,
int highBin, vector<string>& syst_x_expectedPrefixNames,
351 vector<string>& normByNames){
355 for(
Int_t i=lowBin; i<highBin; ++i){
356 std::stringstream str;
358 string command=
"sum::"+totName+str.str()+
"(";
361 for(
unsigned int j=0; j<syst_x_expectedPrefixNames.size();++j){
362 command+=prepend+normByNames.at(j)+
"*"+syst_x_expectedPrefixNames.at(j)+str.str();
366 cout <<
"function to calculate total: " << command << endl;
367 proto->
factory(command.c_str());
372 vector<string>& likelihoodTermNames){
377 for(
Int_t i=lowBin; i<highBin; ++i){
378 std::stringstream str;
381 string command(
"Poisson::"+prefix+str.str()+
"("+obsPrefix+str.str()+
","+expPrefix+str.str()+
",1)");
385 cout <<
"Poisson Term " << command << endl;
389 likelihoodTermNames.push_back( temp->GetName() );
398 TTree*
tree =
new TTree();
402 for(
Int_t i=lowBin; i<highBin; ++i){
403 std::stringstream str;
406 cout <<
"expected number of events called: " << expPrefix << endl;
412 cout <<
"setting obs"+str.str()+
" to expected = " << exp->
getVal() <<
" check: " << obs->
getVal() << endl;
415 obsForTree[i] = exp->
getVal();
416 tree->Branch((obsPrefix+str.str()).c_str(), obsForTree+i ,(obsPrefix+str.str()+
"/D").c_str());
419 cout <<
"problem retrieving obs or exp " << obsPrefix+str.str() << obs <<
" " << expPrefix+str.str() << exp << endl;
427 obsForTree =
nullptr;
431 cout <<
"in customizations" << endl;
432 string pdfName(pdfNameChar);
433 map<string,string>::iterator it;
434 string edit=
"EDIT::customized("+pdfName+
",";
436 for(it=renameMap.begin(); it!=renameMap.end(); ++it) {
437 cout << it->first +
"=" + it->second << endl;
438 edit+=precede + it->first +
"=" + it->second;
443 proto->
factory( edit.c_str() );
450 string pdfName(pdfNameChar);
455 string edit=
"EDIT::newSimPdf("+pdfName+
",";
457 string lastPdf=pdfName;
459 unsigned int numReplacements = 0;
460 unsigned int nskipped = 0;
461 map<string,double>::iterator it;
464 for(it=gammaSyst.begin(); it!=gammaSyst.end(); ++it) {
466 if(! proto->
var((
"alpha_"+it->first).c_str())){
473 double relativeUncertainty = it->second;
474 double scale = 1/
sqrt((1+1/
pow(relativeUncertainty,2)));
477 proto->
factory(
Form(
"beta_%s[1,0,10]",it->first.c_str()));
478 proto->
factory(
Form(
"y_%s[%f]",it->first.c_str(),1./
pow(relativeUncertainty,2))) ;
479 proto->
factory(
Form(
"theta_%s[%f]",it->first.c_str(),
pow(relativeUncertainty,2))) ;
480 proto->
factory(
Form(
"Gamma::beta_%sConstraint(beta_%s,sum::k_%s(y_%s,one[1]),theta_%s,zero[0])",
485 it->first.c_str())) ;
501 proto->
factory(
Form(
"PolyVar::alphaOfBeta_%s(beta_%s,{%f,%f})",it->first.c_str(),it->first.c_str(),-1./scale,1./scale));
513 editList+=precede +
"alpha_"+it->first+
"Constraint=beta_" + it->first+
"Constraint";
516 editList+=precede +
"alpha_"+it->first+
"=alphaOfBeta_"+ it->first;
526 if(numReplacements%10 == 0 && numReplacements+nskipped!=gammaSyst.size()){
527 edit=
"EDIT::"+lastPdf+
"_("+lastPdf+
","+editList+
")";
531 cout <<
"Going to issue this edit command\n" << edit<< endl;
532 proto->
factory( edit.c_str() );
535 cout <<
"\n\n ---------------------\n WARNING: failed to make EDIT\n\n" << endl;
541 for(it=uniformSyst.begin(); it!=uniformSyst.end(); ++it) {
542 cout <<
"edit for " << it->first <<
"with rel uncert = " << it->second << endl;
543 if(! proto->
var((
"alpha_"+it->first).c_str())){
544 cout <<
"systematic not there" << endl;
551 proto->
factory(
Form(
"beta_%s[1,0,10]",it->first.c_str()));
552 proto->
factory(
Form(
"Uniform::beta_%sConstraint(beta_%s)",it->first.c_str(),it->first.c_str()));
553 proto->
factory(
Form(
"PolyVar::alphaOfBeta_%s(beta_%s,{-1,1})",it->first.c_str(),it->first.c_str()));
564 cout <<
"alpha_"+it->first+
"Constraint=beta_" + it->first+
"Constraint" << endl;
565 editList+=precede +
"alpha_"+it->first+
"Constraint=beta_" + it->first+
"Constraint";
567 cout <<
"alpha_"+it->first+
"=alphaOfBeta_"+ it->first << endl;
568 editList+=precede +
"alpha_"+it->first+
"=alphaOfBeta_"+ it->first;
570 if( proto->
pdf((
"alpha_"+it->first+
"Constraint").c_str()) && proto->
var((
"alpha_"+it->first).c_str()) )
571 cout <<
" checked they are there" << proto->
pdf((
"alpha_"+it->first+
"Constraint").c_str()) <<
" " << proto->
var((
"alpha_"+it->first).c_str()) << endl;
573 cout <<
"NOT THERE" << endl;
576 if(numReplacements%10 == 0 && numReplacements+nskipped!=gammaSyst.size()){
577 edit=
"EDIT::"+lastPdf+
"_("+lastPdf+
","+editList+
")";
582 proto->
factory( edit.c_str() );
585 cout <<
"\n\n ---------------------\n WARNING: failed to make EDIT\n\n" << endl;
595 for(it=logNormSyst.begin(); it!=logNormSyst.end(); ++it) {
596 cout <<
"edit for " << it->first <<
"with rel uncert = " << it->second << endl;
597 if(! proto->
var((
"alpha_"+it->first).c_str())){
598 cout <<
"systematic not there" << endl;
604 double relativeUncertainty = it->second;
605 double kappa = 1+relativeUncertainty;
609 double scale = relativeUncertainty;
613 proto->
factory(
Form(
"beta_%s[1,0,10]",it->first.c_str()));
614 proto->
factory(
Form(
"kappa_%s[%f]",it->first.c_str(),kappa));
615 proto->
factory(
Form(
"Lognormal::beta_%sConstraint(beta_%s,one[1],kappa_%s)",
618 it->first.c_str())) ;
619 proto->
factory(
Form(
"PolyVar::alphaOfBeta_%s(beta_%s,{%f,%f})",it->first.c_str(),it->first.c_str(),-1./scale,1./scale));
631 cout <<
"alpha_"+it->first+
"Constraint=beta_" + it->first+
"Constraint" << endl;
632 editList+=precede +
"alpha_"+it->first+
"Constraint=beta_" + it->first+
"Constraint";
634 cout <<
"alpha_"+it->first+
"=alphaOfBeta_"+ it->first << endl;
635 editList+=precede +
"alpha_"+it->first+
"=alphaOfBeta_"+ it->first;
637 if( proto->
pdf((
"alpha_"+it->first+
"Constraint").c_str()) && proto->
var((
"alpha_"+it->first).c_str()) )
638 cout <<
" checked they are there" << proto->
pdf((
"alpha_"+it->first+
"Constraint").c_str()) <<
" " << proto->
var((
"alpha_"+it->first).c_str()) << endl;
640 cout <<
"NOT THERE" << endl;
643 if(numReplacements%10 == 0 && numReplacements+nskipped!=gammaSyst.size()){
644 edit=
"EDIT::"+lastPdf+
"_("+lastPdf+
","+editList+
")";
649 proto->
factory( edit.c_str() );
652 cout <<
"\n\n ---------------------\n WARNING: failed to make EDIT\n\n" << endl;
661 edit=
"EDIT::newSimPdf("+lastPdf+
","+editList+
")";
663 proto->
factory( edit.c_str() );
668 combined_config->
SetPdf(*newOne);
671 cout <<
"\n\n ---------------------\n WARNING: failed to make EDIT\n\n" << endl;
677 pFile = fopen ((filename).c_str(),
"w");
688 fprintf(
pFile,
"\\\\ \\hline \n" );
700 fprintf(
pFile,
" \\\\\n");
711 if (summary.empty() ) {
712 Error(
"MakeSingleChannelModel",
"vector of EstimateSummry is empty - return a nullptr");
719 string channel=summary[0].channel;
720 cout <<
"\n\n-------------------\nStarting to process " << channel <<
" channel" << endl;
729 RooArgSet likelihoodTerms(
"likelihoodTerms");
730 vector<string> likelihoodTermNames, totSystTermNames,syst_x_expectedPrefixNames, normalizationNames;
732 string prefix, range;
737 if (summary.at(0).name==
"Data") {
740 cout <<
"Will use expected (\"Asimov\") data set" << endl;
749 std::stringstream lumiStr;
752 proto->
factory((
"Lumi"+lumiStr.str()).c_str());
753 cout <<
"lumi str = " << lumiStr.str() << endl;
755 std::stringstream lumiErrorStr;
758 proto->
factory((
"Gaussian::lumiConstraint(Lumi,"+lumiErrorStr.str()+
")").c_str());
760 proto->
defineSet(
"globalObservables",
"nominalLumi");
761 likelihoodTermNames.push_back(
"lumiConstraint");
762 cout <<
"lumi Error str = " << lumiErrorStr.str() << endl;
768 vector<EstimateSummary>::iterator it = summary.begin();
769 for(; it!=summary.end(); ++it){
770 if(it->name==
"Data")
continue;
772 string overallSystName = it->name+
"_"+it->channel+
"_epsilon";
773 string systSourcePrefix =
"alpha_";
776 likelihoodTermNames, totSystTermNames);
778 overallSystName=
AddNormFactor(proto, channel, overallSystName, *it, doRatio);
780 TH1* nominal = it->nominal;
781 if(it->lowHists.size() == 0){
782 cout << it->name+
"_"+it->channel+
" has no variation histograms " <<endl;
783 string expPrefix=it->name+
"_"+it->channel+
"_expN";
784 string syst_x_expectedPrefix=it->name+
"_"+it->channel+
"_overallSyst_x_Exp";
786 syst_x_expectedPrefixNames.push_back(syst_x_expectedPrefix);
787 }
else if(it->lowHists.size() != it->highHists.size()){
788 cout <<
"problem in "+it->name+
"_"+it->channel
789 <<
" number of low & high variation histograms don't match" << endl;
792 string constraintPrefix = it->name+
"_"+it->channel+
"_Hist_alpha";
793 string syst_x_expectedPrefix = it->name+
"_"+it->channel+
"_overallSyst_x_HistSyst";
795 constraintPrefix, syst_x_expectedPrefix, overallSystName,
797 syst_x_expectedPrefixNames.push_back(syst_x_expectedPrefix);
803 normalizationNames.push_back(
"Lumi" );
805 normalizationNames.push_back( it->normName);
812 syst_x_expectedPrefixNames, normalizationNames);
820 if(summary.at(0).name!=
"Data"){
822 cout <<
" using asimov data" << endl;
825 cout <<
" using input data histogram" << endl;
830 for(
unsigned int i=0; i<systToFix.size(); ++i){
833 else cout <<
"could not find variable " << systToFix.at(i) <<
" could not set it to constant" << endl;
838 for(
unsigned int i=0; i<likelihoodTermNames.size(); ++i){
840 likelihoodTerms.
add(* (proto->
arg(likelihoodTermNames[i].c_str())) );
844 proto->
defineSet(
"likelihoodTerms",likelihoodTerms);
847 cout <<
"-----------------------------------------"<<endl;
848 cout <<
"import model into workspace" << endl;
850 "product of Poissons accross bins for a single channel",
854 proto_config->
SetPdf(*model);
880 if (ch_names.empty() || chs.empty() ) {
881 Error(
"MakeCombinedModel",
"Input vectors are empty - return a nullptr");
884 if (chs.size() < ch_names.size() ) {
885 Error(
"MakeCombinedModel",
"Input vector of workspace has an invalid size - return a nullptr");
889 map<string, RooAbsPdf*> pdfMap;
890 vector<RooAbsPdf*> models;
894 for(
unsigned int i = 0; i< ch_names.size(); ++i){
895 string channel_name=ch_names[i];
897 if (ss.str().empty()) ss << channel_name ;
898 else ss <<
',' << channel_name ;
902 models.push_back(model);
903 globalObs.
add(*ch->
set(
"globalObservables"));
906 pdfMap[channel_name]=
model;
910 cout <<
"\n\n------------------\n Entering combination" << endl;
918 combined->
import(globalObs);
919 combined->
defineSet(
"globalObservables",globalObs);
924 cout <<
"-----------------------------------------"<<endl;
925 cout <<
"create toy data for " << ss.str() << endl;
927 const RooArgSet* obsN = chs[0]->set(
"obsN");
931 for(
unsigned int i = 1; i< ch_names.size(); ++i){
934 simData->
append(*simData_ch);
941 cout <<
"\n\n----------------\n Importing combined model" << endl;
944 cout <<
"check pointer " << simPdf << endl;
946 for(
unsigned int i=0; i<
fSystToFix.size(); ++i){
951 cout <<
"setting " <<
fSystToFix.at(i) <<
" constant" << endl;
953 else cout <<
"could not find variable " <<
fSystToFix.at(i) <<
" could not set it to constant" << endl;
961 combined_config->
SetPdf(*simPdf);
963 combined->
import(*combined_config,combined_config->
GetName());
1000 cout <<
"\n\n---------------" << endl;
1001 cout <<
"---------------- Doing "<< channel <<
" Fit" << endl;
1002 cout <<
"---------------\n\n" << endl;
1014 while((params_obj=params_itr->
Next())){
1033 fOut_f->mkdir(channel.c_str())->mkdir(
"Summary")->cd();
1056 delete frame;
delete c1;
1075 for(
int i=0; i<curve_N; i++){
1076 double f=curve_x[i];
1079 y_arr_nll[i]=nll->getVal();
1086 delete [] y_arr_nll;
1116 TLine * line90 =
new TLine(xmin,2.71/2.,xmax,2.71/2.);
1118 TLine * line95 =
new TLine(xmin,3.84/2.,xmax,3.84/2.);
1126 if(! file)
return file;
1129 for(vector<string>::iterator itr=names.begin(); itr != names.end(); ++itr){
1130 if( ! path.empty() ) path+=
"/";
1133 if( ! ptr ) ptr=file->
mkdir((*itr).c_str());
1139 if(! file)
return file;
1142 if( ! ptr ) ptr=file->
mkdir(name.c_str());
virtual RooAbsReal * createNLL(RooAbsData &data, const RooLinkedList &cmdList)
Construct representation of -log(L) of PDFwith given dataset.
virtual Double_t getMin(const char *name=0) const
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
TIterator * createIterator(Bool_t dir=kIterForward) const
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg(), const RooCmdArg &arg10=RooCmdArg()) const
Plot (project) PDF on specified frame.
void MakeTotalExpected(RooWorkspace *proto, std::string totName, std::string, std::string, int lowBin, int highBin, std::vector< std::string > &syst_x_expectedPrefixNames, std::vector< std::string > &normByNames)
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
A RooCurve is a one-dimensional graphical representation of a real-valued function.
virtual Double_t getMax(const char *name=0) const
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void EditSyst(RooWorkspace *proto, const char *pdfNameChar, std::map< std::string, double > gammaSyst, std::map< std::string, double > uniformSyst, std::map< std::string, double > logNormSyst)
cout << "in edit, gammamap.size = " << gammaSyst.size() << ", unimap.size = " << uniformSyst.size() << endl;
void SetStatColor(Color_t color=19)
void SetObsToExpected(RooWorkspace *proto, std::string obsPrefix, std::string expPrefix, int lowBin, int highBin)
RooCmdArg LineColor(Color_t color)
virtual void SetWorkspace(RooWorkspace &ws)
void addObject(TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a generic object to this plot.
RooCmdArg PrintLevel(Int_t code)
RooProdPdf is an efficient implementation of a product of PDFs of the form.
HistoToWorkspaceFactory()
Double_t getVal(const RooArgSet *set=0) const
RooCmdArg Minos(Bool_t flag=kTRUE)
R__EXTERN TStyle * gStyle
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
std::string AddNormFactor(RooWorkspace *, std::string &, std::string &, EstimateSummary &, bool)
RooAbsReal * function(const char *name) const
Retrieve function (RooAbsReal) with given name. Note that all RooAbsPdfs are also RooAbsReals...
virtual TDirectory * mkdir(const char *name, const char *title="")
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
void SetTitle(const char *name)
Set the title of the RooPlot to 'title'.
RooAbsArg * arg(const char *name) const
Return RooAbsArg with given name. A null pointer is returned if none is found.
RooCmdArg RecycleConflictNodes(Bool_t flag=kTRUE)
void PrintCovarianceMatrix(RooFitResult *result, RooArgSet *params, std::string filename)
void ProcessExpectedHisto(TH1 *hist, RooWorkspace *proto, std::string prefix, std::string productPrefix, std::string systTerm, double low, double high, int lowBin, int highBin)
Iterator abstract base class.
std::string fFileNamePrefix
void SetCanvasColor(Color_t color=19)
Bool_t importClassCode(const char *pat="*", Bool_t doReplace=kFALSE)
Inport code of all classes in the workspace that have a class name that matches pattern 'pat' and whi...
virtual void SetMinimum(Double_t minimum=-1111)
Set minimum value of Y axis.
Double_t getErrorLo() const
void SetFrameFillColor(Color_t color=1)
virtual void SetName(const char *name="")
Set graph name.
void FormatFrameForLikelihood(RooPlot *frame, std::string XTitle=std::string("#sigma / #sigma_{SM}"), std::string YTitle=std::string("-log likelihood"))
RooCmdArg LineStyle(Style_t style)
double pow(double, double)
std::vector< std::string > fSystToFix
virtual void SetPdf(const RooAbsPdf &pdf)
Set the Pdf, add to the the workspace if not already there.
void LinInterpWithConstraint(RooWorkspace *proto, TH1 *nominal, std::vector< TH1 *> lowHist, std::vector< TH1 *> highHist, std::vector< std::string > sourceName, std::string prefix, std::string productPrefix, std::string systTerm, int lowBin, int highBin, std::vector< std::string > &likelihoodTermNames)
RooConstVar represent a constant real-valued object.
std::stringstream fResultsPrefixStr
void AddEfficiencyTerms(RooWorkspace *proto, std::string prefix, std::string interpName, std::map< std::string, std::pair< double, double > > systMap, std::vector< std::string > &likelihoodTermNames, std::vector< std::string > &totSystTermNames)
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
void SetPadBorderMode(Int_t mode=1)
void SetCanvasBorderMode(Int_t mode=1)
void SetPadColor(Color_t color=19)
void setConstant(Bool_t value=kTRUE)
virtual void SetMaximum(Double_t maximum=-1111)
Set maximum value of Y axis.
void Customize(RooWorkspace *proto, const char *pdfNameChar, std::map< std::string, std::string > renameMap)
Bool_t defineSet(const char *name, const RooArgSet &aset, Bool_t importMissing=kFALSE)
Define a named RooArgSet with given constituents.
void AddMultiVarGaussConstraint(RooWorkspace *proto, std::string prefix, int lowBin, int highBin, std::vector< std::string > &likelihoodTermNames)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
RooDataSet is a container class to hold unbinned data.
RooCategory represents a fundamental (non-derived) discrete value object.
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name) ...
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
RooCmdArg Import(const char *state, TH1 &histo)
Multivariate Gaussian p.d.f.
RooCmdArg Index(RooCategory &icat)
Namespace for the RooStats classes.
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
TDirectory * Mkdir(TDirectory *file, std::string name)
TDirectory * Makedirs(TDirectory *file, std::vector< std::string > names)
RooCurve * getCurve(const char *name=0) const
Return a RooCurve pointer of the named object in this plot, or zero if the named object does not exis...
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Describe directory structure in memory.
void append(RooDataSet &data)
Add all data points of given data set to this data set.
void AddPoissonTerms(RooWorkspace *proto, std::string prefix, std::string obsPrefix, std::string expPrefix, int lowBin, int highBin, std::vector< std::string > &likelihoodTermNames)
RooWorkspace * MakeCombinedModel(std::vector< std::string >, std::vector< RooWorkspace *>)
std::vector< NormFactor > normFactor
void FitModel(RooWorkspace *, std::string, std::string, std::string, bool=false)
RooRealVar * var(const char *name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found...
RooWorkspace * MakeSingleChannelModel(std::vector< RooStats::HistFactory::EstimateSummary > summary, std::vector< std::string > systToFix, bool doRatio=false)
Mother of all ROOT objects.
RooFactoryWSTool & factory()
Return instance to factory tool.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Bool_t import(const RooAbsArg &arg, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg())
Import a RooAbsArg object, e.g.
RooAbsRealLValue * getPlotVar() const
void SetTitleFillColor(Color_t color=1)
virtual RooAbsReal * createProfile(const RooArgSet ¶msOfInterest)
Create a RooProfileLL object that eliminates all nuisance parameters in the present function...
virtual TObject * Next()=0
A Graph is a graphics object made of two arrays X and Y with npoints each.
const RooArgSet * set(const char *name)
Return pointer to previously defined named set with given nmame If no such set is found a null pointe...
virtual TDirectory * GetDirectory(const char *namecycle, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory using apath.
virtual RooFitResult * fitTo(RooAbsData &data, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none())
Fit PDF to given dataset.
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save Pad contents in a file in one of various formats.
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual void SetGlobalObservables(const RooArgSet &set)
specify the global observables
virtual const char * GetName() const
Returns name of object.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
std::string FilePrefixStr(std::string)
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset...
virtual ~HistoToWorkspaceFactory()
Double_t getErrorHi() const
Double_t correlation(const RooAbsArg &par1, const RooAbsArg &par2) const
Bool_t isConstant() const
The RooWorkspace is a persistable container for RooFit projects.
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
virtual const char * GetTitle() const
Returns title of object.