Beispiel #1
0
# Condition to ensure acceptance function is always +ve definite.
# The first condition protects against the undefined nature of the
# function for times less than 0. Whereas the second condition
# ensures the 0.2 ps selection cut present in the sample is
# incorporated into the model.

# acceptance fn parameters: common to both DsK and Dsπ
turnon = RooRealVar('turnon', 'turnon', 1.5, 0.5, 5.0)
exponent = RooRealVar('exponent', 'exponent', 2., 1., 4.)
offset = RooRealVar('offset', 'offset', 0.0, -0.5, 0.5)
beta = RooRealVar('beta', 'beta', 0.04, 0.0, 0.10)

## Dsπ acceptance and pdf
dspi_acceptance = PowLawAcceptance('dspi_acceptance',
                                   'DsPi Power law acceptance', turnon, time,
                                   offset, exponent, beta)
DsPi_Model = RooEffProd('DsPi_Model', 'DsPi acceptance model B_{s}', Bdecay,
                        dspi_acceptance)

varlist += [turnon, exponent, offset, beta]
pdflist += [dspi_acceptance, DsPi_Model]

# fit to Dsπ only
print '=' * 5, ' 2-step fit: Dsπ ', '=' * 5
dspi_fitresult = DsPi_Model.fitTo(dsetlist[0], RooFit.Optimize(0),
                                  RooFit.Strategy(2), RooFit.Save(True),
                                  RooFit.NumCPU(1), RooFit.SumW2Error(True),
                                  RooFit.Offset(True), RooFit.Verbose(True))
dspi_fitresult.Print()
Beispiel #2
0
# Condition to ensure acceptance function is always +ve definite.
# The first condition protects against the undefined nature of the
# function for times less than 0. Whereas the second condition
# ensures the 0.2 ps selection cut present in the sample is
# incorporated into the model.

# acceptance fn parameters: common to both DsK and Dsπ
turnon = RooRealVar('turnon', 'turnon', 1.5, 0.5, 5.0)
exponent = RooRealVar('exponent', 'exponent', 2., 1., 4.)
offset = RooRealVar('offset', 'offset', 0.0, -0.5, 0.5)
beta = RooRealVar('beta', 'beta', 0.04, 0.0, 0.10)


## Dsπ acceptance and pdf
dspi_acceptance = PowLawAcceptance('dspi_acceptance',
                                   'DsPi Power law acceptance',
                                   turnon, time, offset, exponent, beta)
DsPi_Model = RooEffProd('DsPi_Model', 'DsPi acceptance model B_{s}',
                        Bdecay, dspi_acceptance)

varlist += [turnon, exponent, offset, beta]
pdflist += [dspi_acceptance, DsPi_Model]

# fit to Dsπ only
print '=' * 5, ' 2-step fit: Dsπ ', '=' * 5
dspi_fitresult = DsPi_Model.fitTo(dsetlist[0], RooFit.Optimize(0),
                                  RooFit.Strategy(2),
                                  RooFit.Save(True), RooFit.NumCPU(1),
                                  RooFit.SumW2Error(True),
                                  RooFit.Offset(True),
                                  RooFit.Verbose(True))
Beispiel #3
0
        RooFit.RecycleConflictNodes())


# retrieve acceptance functions
acceptance1 = workspace.function('acceptance_%s' % mode1) # DsK
acceptance2 = workspace.function('acceptance_%s' % mode2) # Dsπ

# Acceptance ratio FIXME: hardcoded ROOT file
rfile = TFile('data/acceptance-ratio-hists.root', 'read')
hcorr = rfile.Get('haccratio_cpowerlaw')

ardhist = RooDataHist('ardhist', 'DsK/DsPi acceptance ratio datahist',
                      RooArgList(time), RooFit.Import(hcorr, False))
accratio = RooHistFunc('accratio', 'DsK/DsPi acceptance ratio',
                       RooArgSet(time), ardhist)
cacceptance = PowLawAcceptance(acceptance2, 'cacceptance', accratio)
# cacceptance = PowLawAcceptance('cacceptance', 'Corrected Power law acceptance',
#                                turnon, time, offset, exponent, beta, accratio)

ratio = RooFormulaVar('ratio', '@0/@1', RooArgList(acceptance1, cacceptance))

tframe = time.frame(RooFit.Range('fullrange'), RooFit.Name('ptime'),
                    RooFit.Title('Acceptance ratio (0.2 - 10 ps)'))

acceptance1.plotOn(tframe, RooFit.LineColor(kBlue))
# acceptance2.plotOn(tframe, RooFit.LineColor(kRed))
# accratio.plotOn(tframe, RooFit.LineColor(kBlack))
cacceptance.plotOn(tframe, RooFit.LineColor(kRed))
ratio.plotOn(tframe, RooFit.LineColor(kGreen))
tframe.Draw()