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 ;
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;
430 cout <<
"in customizations" << endl;
431 string pdfName(pdfNameChar);
432 map<string,string>::iterator it;
433 string edit=
"EDIT::customized("+pdfName+
",";
435 for(it=renameMap.begin(); it!=renameMap.end(); ++it) {
436 cout << it->first +
"=" + it->second << endl;
437 edit+=precede + it->first +
"=" + it->second;
442 proto->
factory( edit.c_str() );
449 string pdfName(pdfNameChar);
454 string edit=
"EDIT::newSimPdf("+pdfName+
",";
456 string lastPdf=pdfName;
458 unsigned int numReplacements = 0;
459 unsigned int nskipped = 0;
460 map<string,double>::iterator it;
463 for(it=gammaSyst.begin(); it!=gammaSyst.end(); ++it) {
465 if(! proto->
var((
"alpha_"+it->first).c_str())){
472 double relativeUncertainty = it->second;
473 double scale = 1/
sqrt((1+1/
pow(relativeUncertainty,2)));
476 proto->
factory(
Form(
"beta_%s[1,0,10]",it->first.c_str()));
477 proto->
factory(
Form(
"y_%s[%f]",it->first.c_str(),1./
pow(relativeUncertainty,2))) ;
478 proto->
factory(
Form(
"theta_%s[%f]",it->first.c_str(),
pow(relativeUncertainty,2))) ;
479 proto->
factory(
Form(
"Gamma::beta_%sConstraint(beta_%s,sum::k_%s(y_%s,one[1]),theta_%s,zero[0])",
484 it->first.c_str())) ;
500 proto->
factory(
Form(
"PolyVar::alphaOfBeta_%s(beta_%s,{%f,%f})",it->first.c_str(),it->first.c_str(),-1./scale,1./scale));
512 editList+=precede +
"alpha_"+it->first+
"Constraint=beta_" + it->first+
"Constraint";
515 editList+=precede +
"alpha_"+it->first+
"=alphaOfBeta_"+ it->first;
525 if(numReplacements%10 == 0 && numReplacements+nskipped!=gammaSyst.size()){
526 edit=
"EDIT::"+lastPdf+
"_("+lastPdf+
","+editList+
")";
530 cout <<
"Going to issue this edit command\n" << edit<< endl;
531 proto->
factory( edit.c_str() );
534 cout <<
"\n\n ---------------------\n WARNING: failed to make EDIT\n\n" << endl;
540 for(it=uniformSyst.begin(); it!=uniformSyst.end(); ++it) {
541 cout <<
"edit for " << it->first <<
"with rel uncert = " << it->second << endl;
542 if(! proto->
var((
"alpha_"+it->first).c_str())){
543 cout <<
"systematic not there" << endl;
550 proto->
factory(
Form(
"beta_%s[1,0,10]",it->first.c_str()));
551 proto->
factory(
Form(
"Uniform::beta_%sConstraint(beta_%s)",it->first.c_str(),it->first.c_str()));
552 proto->
factory(
Form(
"PolyVar::alphaOfBeta_%s(beta_%s,{-1,1})",it->first.c_str(),it->first.c_str()));
563 cout <<
"alpha_"+it->first+
"Constraint=beta_" + it->first+
"Constraint" << endl;
564 editList+=precede +
"alpha_"+it->first+
"Constraint=beta_" + it->first+
"Constraint";
566 cout <<
"alpha_"+it->first+
"=alphaOfBeta_"+ it->first << endl;
567 editList+=precede +
"alpha_"+it->first+
"=alphaOfBeta_"+ it->first;
569 if( proto->
pdf((
"alpha_"+it->first+
"Constraint").c_str()) && proto->
var((
"alpha_"+it->first).c_str()) )
570 cout <<
" checked they are there" << proto->
pdf((
"alpha_"+it->first+
"Constraint").c_str()) <<
" " << proto->
var((
"alpha_"+it->first).c_str()) << endl;
572 cout <<
"NOT THERE" << endl;
575 if(numReplacements%10 == 0 && numReplacements+nskipped!=gammaSyst.size()){
576 edit=
"EDIT::"+lastPdf+
"_("+lastPdf+
","+editList+
")";
581 proto->
factory( edit.c_str() );
584 cout <<
"\n\n ---------------------\n WARNING: failed to make EDIT\n\n" << endl;
594 for(it=logNormSyst.begin(); it!=logNormSyst.end(); ++it) {
595 cout <<
"edit for " << it->first <<
"with rel uncert = " << it->second << endl;
596 if(! proto->
var((
"alpha_"+it->first).c_str())){
597 cout <<
"systematic not there" << endl;
603 double relativeUncertainty = it->second;
604 double kappa = 1+relativeUncertainty;
608 double scale = relativeUncertainty;
612 proto->
factory(
Form(
"beta_%s[1,0,10]",it->first.c_str()));
613 proto->
factory(
Form(
"kappa_%s[%f]",it->first.c_str(),kappa));
614 proto->
factory(
Form(
"Lognormal::beta_%sConstraint(beta_%s,one[1],kappa_%s)",
617 it->first.c_str())) ;
618 proto->
factory(
Form(
"PolyVar::alphaOfBeta_%s(beta_%s,{%f,%f})",it->first.c_str(),it->first.c_str(),-1./scale,1./scale));
630 cout <<
"alpha_"+it->first+
"Constraint=beta_" + it->first+
"Constraint" << endl;
631 editList+=precede +
"alpha_"+it->first+
"Constraint=beta_" + it->first+
"Constraint";
633 cout <<
"alpha_"+it->first+
"=alphaOfBeta_"+ it->first << endl;
634 editList+=precede +
"alpha_"+it->first+
"=alphaOfBeta_"+ it->first;
636 if( proto->
pdf((
"alpha_"+it->first+
"Constraint").c_str()) && proto->
var((
"alpha_"+it->first).c_str()) )
637 cout <<
" checked they are there" << proto->
pdf((
"alpha_"+it->first+
"Constraint").c_str()) <<
" " << proto->
var((
"alpha_"+it->first).c_str()) << endl;
639 cout <<
"NOT THERE" << endl;
642 if(numReplacements%10 == 0 && numReplacements+nskipped!=gammaSyst.size()){
643 edit=
"EDIT::"+lastPdf+
"_("+lastPdf+
","+editList+
")";
648 proto->
factory( edit.c_str() );
651 cout <<
"\n\n ---------------------\n WARNING: failed to make EDIT\n\n" << endl;
660 edit=
"EDIT::newSimPdf("+lastPdf+
","+editList+
")";
662 proto->
factory( edit.c_str() );
667 combined_config->
SetPdf(*newOne);
670 cout <<
"\n\n ---------------------\n WARNING: failed to make EDIT\n\n" << endl;
676 pFile = fopen ((filename).c_str(),
"w");
687 fprintf(
pFile,
"\\\\ \\hline \n" );
699 fprintf(
pFile,
" \\\\\n");
710 if (summary.empty() ) {
711 Error(
"MakeSingleChannelModel",
"vector of EstimateSummry is empty - return a nullptr");
718 string channel=summary[0].channel;
719 cout <<
"\n\n-------------------\nStarting to process " << channel <<
" channel" << endl;
728 RooArgSet likelihoodTerms(
"likelihoodTerms");
729 vector<string> likelihoodTermNames, totSystTermNames,syst_x_expectedPrefixNames, normalizationNames;
731 string prefix, range;
736 if (summary.at(0).name==
"Data") {
739 cout <<
"Will use expected (\"Asimov\") data set" << endl;
748 std::stringstream lumiStr;
751 proto->
factory((
"Lumi"+lumiStr.str()).c_str());
752 cout <<
"lumi str = " << lumiStr.str() << endl;
754 std::stringstream lumiErrorStr;
757 proto->
factory((
"Gaussian::lumiConstraint(Lumi,"+lumiErrorStr.str()+
")").c_str());
759 proto->
defineSet(
"globalObservables",
"nominalLumi");
760 likelihoodTermNames.push_back(
"lumiConstraint");
761 cout <<
"lumi Error str = " << lumiErrorStr.str() << endl;
767 vector<EstimateSummary>::iterator it = summary.begin();
768 for(; it!=summary.end(); ++it){
769 if(it->name==
"Data")
continue;
771 string overallSystName = it->name+
"_"+it->channel+
"_epsilon";
772 string systSourcePrefix =
"alpha_";
775 likelihoodTermNames, totSystTermNames);
777 overallSystName=
AddNormFactor(proto, channel, overallSystName, *it, doRatio);
779 TH1* nominal = it->nominal;
780 if(it->lowHists.size() == 0){
781 cout << it->name+
"_"+it->channel+
" has no variation histograms " <<endl;
782 string expPrefix=it->name+
"_"+it->channel+
"_expN";
783 string syst_x_expectedPrefix=it->name+
"_"+it->channel+
"_overallSyst_x_Exp";
785 syst_x_expectedPrefixNames.push_back(syst_x_expectedPrefix);
786 }
else if(it->lowHists.size() != it->highHists.size()){
787 cout <<
"problem in "+it->name+
"_"+it->channel
788 <<
" number of low & high variation histograms don't match" << endl;
791 string constraintPrefix = it->name+
"_"+it->channel+
"_Hist_alpha";
792 string syst_x_expectedPrefix = it->name+
"_"+it->channel+
"_overallSyst_x_HistSyst";
794 constraintPrefix, syst_x_expectedPrefix, overallSystName,
796 syst_x_expectedPrefixNames.push_back(syst_x_expectedPrefix);
802 normalizationNames.push_back(
"Lumi" );
804 normalizationNames.push_back( it->normName);
811 syst_x_expectedPrefixNames, normalizationNames);
819 if(summary.at(0).name!=
"Data"){
821 cout <<
" using asimov data" << endl;
824 cout <<
" using input data histogram" << endl;
829 for(
unsigned int i=0; i<systToFix.size(); ++i){
832 else cout <<
"could not find variable " << systToFix.at(i) <<
" could not set it to constant" << endl;
837 for(
unsigned int i=0; i<likelihoodTermNames.size(); ++i){
839 likelihoodTerms.
add(* (proto->
arg(likelihoodTermNames[i].c_str())) );
843 proto->
defineSet(
"likelihoodTerms",likelihoodTerms);
846 cout <<
"-----------------------------------------"<<endl;
847 cout <<
"import model into workspace" << endl;
849 "product of Poissons accross bins for a single channel",
853 proto_config->
SetPdf(*model);
879 if (ch_names.empty() || chs.empty() ) {
880 Error(
"MakeCombinedModel",
"Input vectors are empty - return a nullptr");
883 if (chs.size() < ch_names.size() ) {
884 Error(
"MakeCombinedModel",
"Input vector of workspace has an invalid size - return a nullptr");
888 map<string, RooAbsPdf*> pdfMap;
889 vector<RooAbsPdf*> models;
893 for(
unsigned int i = 0; i< ch_names.size(); ++i){
894 string channel_name=ch_names[i];
896 if (ss.str().empty()) ss << channel_name ;
897 else ss <<
',' << channel_name ;
901 models.push_back(model);
902 globalObs.
add(*ch->
set(
"globalObservables"));
905 pdfMap[channel_name]=
model;
909 cout <<
"\n\n------------------\n Entering combination" << endl;
917 combined->
import(globalObs);
918 combined->
defineSet(
"globalObservables",globalObs);
923 cout <<
"-----------------------------------------"<<endl;
924 cout <<
"create toy data for " << ss.str() << endl;
926 const RooArgSet* obsN = chs[0]->set(
"obsN");
930 for(
unsigned int i = 1; i< ch_names.size(); ++i){
933 simData->
append(*simData_ch);
940 cout <<
"\n\n----------------\n Importing combined model" << endl;
943 cout <<
"check pointer " << simPdf << endl;
945 for(
unsigned int i=0; i<
fSystToFix.size(); ++i){
950 cout <<
"setting " <<
fSystToFix.at(i) <<
" constant" << endl;
952 else cout <<
"could not find variable " <<
fSystToFix.at(i) <<
" could not set it to constant" << endl;
960 combined_config->
SetPdf(*simPdf);
962 combined->
import(*combined_config,combined_config->
GetName());
999 cout <<
"\n\n---------------" << endl;
1000 cout <<
"---------------- Doing "<< channel <<
" Fit" << endl;
1001 cout <<
"---------------\n\n" << endl;
1013 while((params_obj=params_itr->
Next())){
1032 fOut_f->mkdir(channel.c_str())->mkdir(
"Summary")->cd();
1055 delete frame;
delete c1;
1074 for(
int i=0; i<curve_N; i++){
1075 double f=curve_x[i];
1078 y_arr_nll[i]=nll->getVal();
1085 delete [] y_arr_nll;
1115 TLine * line90 =
new TLine(xmin,2.71/2.,xmax,2.71/2.);
1117 TLine * line95 =
new TLine(xmin,3.84/2.,xmax,3.84/2.);
1125 if(! file)
return file;
1128 for(vector<string>::iterator itr=names.begin(); itr != names.end(); ++itr){
1129 if( ! path.empty() ) path+=
"/";
1132 if( ! ptr ) ptr=file->
mkdir((*itr).c_str());
1138 if(! file)
return file;
1141 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 void SetName(const char *name)
Set the name of the TNamed.
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 and return a pointer to the created directory.
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)
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...
double norm(double *x, double *p)
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.