00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __CINT__
00014 #include "RooGlobalFunc.h"
00015 #endif
00016 #include "RooRealVar.h"
00017 #include "RooDataSet.h"
00018 #include "RooGaussian.h"
00019 #include "RooConstVar.h"
00020 #include "RooPolynomial.h"
00021 #include "RooAddPdf.h"
00022 #include "TCanvas.h"
00023 #include "TAxis.h"
00024 #include "RooPlot.h"
00025 #include "RooMsgService.h"
00026
00027 using namespace RooFit ;
00028
00029
00030 void rf506_msgservice()
00031 {
00032
00033
00034
00035
00036 RooRealVar x("x","x",-10,10) ;
00037 RooRealVar m("m","m",0,-10,10) ;
00038 RooRealVar s("s","s",1,-10,10) ;
00039 RooGaussian gauss("g","g",x,m,s) ;
00040
00041
00042 RooRealVar p0("p0","p0",0.01,0.,1.) ;
00043 RooPolynomial poly("p","p",x,p0) ;
00044
00045
00046 RooRealVar f("f","f",0.5,0.,1.) ;
00047 RooAddPdf model("model","model",RooArgSet(gauss,poly),f) ;
00048
00049 RooDataSet* data = model.generate(x,10) ;
00050
00051
00052
00053
00054
00055
00056
00057 RooMsgService::instance().Print() ;
00058 cout << endl ;
00059
00060
00061
00062
00063
00064
00065
00066 RooMsgService::instance().Print() ;
00067 cout << endl ;
00068
00069
00070 RooMsgService::instance().getStream(1).addTopic(Integration) ;
00071
00072
00073 RooAbsReal* igauss = gauss.createIntegral(x) ;
00074 igauss->Print() ;
00075
00076
00077 cout << endl ;
00078 RooMsgService::instance().Print() ;
00079 cout << endl ;
00080
00081
00082 RooMsgService::instance().getStream(1).removeTopic(Integration) ;
00083
00084
00085
00086
00087
00088
00089
00090 RooMsgService::instance().addStream(DEBUG,Topic(Tracing),ClassName("RooGaussian")) ;
00091
00092
00093 model.fitTo(*data,Verbose(kTRUE)) ;
00094
00095
00096 RooMsgService::instance().reset() ;
00097
00098
00099
00100
00101 RooMsgService::instance().addStream(DEBUG,Topic(Tracing),OutputFile("rf506_debug.log")) ;
00102
00103
00104 model.fitTo(*data,Verbose(kTRUE)) ;
00105
00106
00107 RooMsgService::instance().reset() ;
00108
00109
00110
00111
00112
00113
00114
00115 RooMsgService::instance().addStream(DEBUG,Topic(LinkStateMgmt)) ;
00116 RooMsgService::instance().Print("v") ;
00117
00118
00119 RooAbsArg* gprime = gauss.cloneTree() ;
00120 gprime->Print() ;
00121
00122
00123 RooMsgService::instance().reset() ;
00124
00125
00126
00127 }