00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __CINT__
00013 #include "RooGlobalFunc.h"
00014 #endif
00015 #include "RooRealVar.h"
00016 #include "RooDataSet.h"
00017 #include "RooGaussModel.h"
00018 #include "RooDecay.h"
00019 #include "RooBMixDecay.h"
00020 #include "RooCategory.h"
00021 #include "RooBinning.h"
00022 #include "RooPlot.h"
00023 #include "TCanvas.h"
00024 #include "TH1.h"
00025 using namespace RooFit ;
00026
00027
00028 class TestBasic108 : public RooFitTestUnit
00029 {
00030 public:
00031 TestBasic108(TFile* refFile, Bool_t writeRef, Int_t verbose) : RooFitTestUnit("Non-standard binning in counting and asymmetry plots",refFile,writeRef,verbose) {} ;
00032 Bool_t testCode() {
00033
00034
00035
00036
00037
00038 RooRealVar dt("dt","dt",-20,20) ;
00039 RooRealVar dm("dm","dm",0.472) ;
00040 RooRealVar tau("tau","tau",1.547) ;
00041 RooRealVar w("w","mistag rate",0.1) ;
00042 RooRealVar dw("dw","delta mistag rate",0.) ;
00043
00044 RooCategory mixState("mixState","B0/B0bar mixing state") ;
00045 mixState.defineType("mixed",-1) ;
00046 mixState.defineType("unmixed",1) ;
00047 RooCategory tagFlav("tagFlav","Flavour of the tagged B0") ;
00048 tagFlav.defineType("B0",1) ;
00049 tagFlav.defineType("B0bar",-1) ;
00050
00051
00052 RooRealVar dterr("dterr","dterr",0.1,1.0) ;
00053 RooRealVar bias1("bias1","bias1",0) ;
00054 RooRealVar sigma1("sigma1","sigma1",0.1) ;
00055 RooGaussModel gm1("gm1","gauss model 1",dt,bias1,sigma1) ;
00056
00057
00058 RooBMixDecay bmix("bmix","decay",dt,mixState,tagFlav,tau,dm,w,dw,gm1,RooBMixDecay::DoubleSided) ;
00059
00060
00061
00062
00063
00064
00065 RooDataSet *data = bmix.generate(RooArgSet(dt,mixState,tagFlav),2000) ;
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 RooBinning tbins(-15,15) ;
00076
00077
00078 tbins.addUniform(60,-15,0) ;
00079
00080
00081 tbins.addUniform(15,0,15) ;
00082
00083
00084 RooPlot* dtframe = dt.frame(Range(-15,15),Title("dt distribution with custom binning")) ;
00085 data->plotOn(dtframe,Binning(tbins)) ;
00086 bmix.plotOn(dtframe) ;
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 RooBinning abins(-10,10) ;
00099
00100
00101 abins.addBoundary(0) ;
00102 abins.addBoundaryPair(1) ;
00103 abins.addBoundaryPair(2) ;
00104 abins.addBoundaryPair(3) ;
00105 abins.addBoundaryPair(4) ;
00106 abins.addBoundaryPair(6) ;
00107
00108
00109 RooPlot* aframe = dt.frame(Range(-10,10),Title("mixState asymmetry distribution with custom binning")) ;
00110
00111
00112 data->plotOn(aframe,Asymmetry(mixState),Binning(abins)) ;
00113
00114
00115 bmix.plotOn(aframe,Asymmetry(mixState)) ;
00116
00117
00118 aframe->SetMinimum(-1.1) ;
00119 aframe->SetMaximum(1.1) ;
00120
00121
00122
00123
00124 regPlot(dtframe,"rf108_plot1") ;
00125 regPlot(aframe,"rf108_plot2") ;
00126
00127 delete data ;
00128
00129 return kTRUE ;
00130 }
00131 } ;