TWiki
>
LHCb Web
>
CpBhh
>
CpBhhDev
>
FitPage
(2008-05-13,
AlessioSarti
)
(raw view)
E
dit
A
ttach
P
DF
---+!! Fit Page These pages contain the information about the B2hh CP Fit. Detailed information about the technical issues related to the fit implementation are discussed. ---++++!! [[https://twiki.cern.ch/twiki/bin/view/LHCb/CpBhhDev][B to hh Page]] %TOC% ---++ Documentation An useful overview of technicalities related to Likelihood fits can be found in [[https://uimon.cern.ch/twiki/bin/view/LHCbPhysics/LikelihoodFitting][this very nice page]] maintained by G.Raven. This page contains as well code examples for various fits. Detailed documentation on B2hh Fit code is contained in this web page. ---++ Fit Strategy The B to hh events selected as outlined in [[http://][here]] are used in a combined mass,time fit to extract the direct and mixing CP asymmetries. All the 8 B to hh data samples are fitted simultaneously: the PID information can be either used to select different samples or directly into the fit (see below in the fit documentation how to perform simultaneous or separate fits). The resulting CP informations are combined using U-spin symmetry in order to measure the CKM angle gamma. ---++ Fit Code The fit code has been written using the [[http://roofit.sourceforge.net/][RooFit]] package provided in [[http://root.cern.ch/][ROOT]]. The unbinned extended maximum likelihood fit is performed on the combined PDF of mass and time for signal and background events. ---+++ How to get the code. The Fit code is kept under a cvs project. The project can be browsed by looking in [[http://isscvs.cern.ch/cgi-bin/cvsweb.cgi/?cvsroot=B2hhFit][this]] page. To get the code you should follow the instructions below. * First of all you should set the CVS variables. Example below is given for the tcsh shell. * Outside cern/lxplus * setenv CVS_RSH ssh * setenv CVSROOT :ext:isscvs.cern.ch:/local/reps/B2hhFit * On lxplus * setenv CVSROOT :kserver:isscvs.cern.ch:/local/reps/B2hhFit * Then you can get the tag you want. * cvs co -r <tagname> [[http://isscvs.cern.ch/cgi-bin/cvsweb.cgi/?cvsroot=B2hhFit][B2hhFit]] ---+++ Informations on the recommended tags Detailed information on available tags is given below: * v6r0 : %RED% *Latest tag. Recommended.* %ENDCOLOR% . Contains the code of the Sim Fit validated. * v5r3 : Contains: Fixed approach for tagging categories. Different per event proper time error for signal and background. Priors on CP parameters have been removed. %BLUE%We did left ONLY a prior on the mistag.%ENDCOLOR% * v5r2 : First tag with working sim fit. Requires patched code. * v5r0 : This tag can be used to perform separate Bs and Bd fits. Does not require patched code. Perform variable plots and likelihood scans. Sim fit still does not work. * v3r4 : First fit version that implements per event Proper time error on separate fits. Sim fit does not work. ---+++ How to compile/run the code. Instructions on how to compile the code are given below: * On 'your' laptop/desktop * First of all you should check for libRooFit.so, libMathCore.so and libMathMore.so in you root library distribution. If you do not have them you should recompile ROOT having enabled those libraries using the ./configure --enable=roofit --enable=mathcore --enable=mathmore syntax. * Then you properly set the ROOT variables: * ROOTSYS : sould point to your local ROOT installation * LD_LIBRARY_PATH should point to $ROOTSYS/lib * PATH should contain $ROOTSYS/bin * Then you compile ROOT by: ./configure --enable=roofit; make; make install * Then you are ready to compile the code issuing the command %BLUE%'gmake FitCode'%ENDCOLOR% in your [[http://isscvs.cern.ch/cgi-bin/cvsweb.cgi/?cvsroot=B2hhFit][B2hhFit]] directory * On lxplus * First of all you should set directly the ROOT environment variables: * setenv ROOTSYS /afs/cern.ch/sw/lcg/external/root/5.18.00/slc4_amd64_gcc34/root * setenv LD_LIBRARY_PATH .:$ROOTSYS/lib:/afs/cern.ch/sw/lcg/external/GSL/1.8/slc3_ia32_gcc323/lib . *You need to add also the path to your working directory!* * set path=($ROOTSYS/bin $path) * Then you're ready to compile the code using %BLUE%'gmake FitCode'%ENDCOLOR% * On CNAF site * You just need to set properly the ROOT variables and then you're ready to compile. * setenv ROOTSYS /opt/exp_software/lhcb_user/software/root/v5.18.00/root * setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:/afs/cern.ch/sw/lcg/external/GSL/1.8/slc4_ia32_gcc34/lib . *You should add also the path to your working directory* * set path=($ROOTSYS/bin $path) * Then you're ready to compile the code using %BLUE%'gmake FitCode'%ENDCOLOR% Instructions on how to run the code are given below. The [[http://isscvs.cern.ch/cgi-bin/cvsweb.cgi/?cvsroot=B2hhFit][B2hhFit]] package contains the directory 'tools' : you can find there some useful perl scripts that can be used to submit jobs for different use cases. The package contains also a 'ganga' directory that contains templates and a macro for job submission on the grid via ganga and Dirac. The details of the three typical user cases are listed below, as well as a quick description of the two perl script that can be used to run fits or systematics studies. * Before starting. * The job submission on local or batch machines is handled by a perl script named 'SubFit.pl'.This script needs to be properly customized to your code configuration in order to work properly. The customization can be done by editing the script and settings the following variables to your specific needs. %RED% *Note that all paths need to be absolute path in order to be properly understood when running batch jobs!* %ENDCOLOR% * $scratch = should point to a directory where you want to dump the output * $softdir = should point to the directory where the B2hhFit fit code is kept * $optdir = should point to the directory where you want to dump the option files used to run a given fit * Running jobs on local machine (interactively) * To run a single job you can try the following syntax: tools/SubFit.pl -int -dl -run BD -flag myTestDb * Submitting jobs to LSF * To run a single job under a batch system (lxplus or cnaf) you can try the following syntax: tools/SubFit.pl -q <queue> -run BD - flag myQueueBd * Submitting jobs to LCG (using ganga, Dirac) * First of all you need to customize the ganga/MyRooFit.txt template file to your code setup. * After that you log into ganga, then you 'load' the template MyRooFit.txt and you submit the job. ---+++ Current Fit options The fit configuration is kept in two different files. The first one: config/myConfs.txt contains the instructions on which type of fit you're going to run. The second one config/config.txt contains the default values for the parameters that are going to be used in the fit. ---++++ Fit configuration * Running configurations. Main configuration (input directories, output directories, output flagging, signal + background approach, time and mass approach, analytical integration) can be performed in the config/myConfs.txt file: * Fit strategy (perform a simple mass fit or a combined mass*time fit) is controlled by the flag : doTimeAndMass [0 = only mass fit, 1 mass*time fit (default)] * Fit strategy (perform a simple signal events fit or adding also bkg events) is controlled by the flag : doSigPlBack [0 = only signal evts, 1 sig + bkg (default)] * Analytical integration is controlled by the flag: doAnaPdf [0 = use RooFormulaVar and RooGenericPdf, 1 use compiled class (default)] * The generation of control plots (variables and likelihood scans) is controlled by the variable: doPlots [0 = no plots are created, 1 plots are made (default)] * The execution of the fit is controlled by the flag : doFit [0 = no fit performed. Only data is generated (if specified), 1 fit is performed (default)] * The printout level is controlled by the variable: debugLevel [0 = lowest printout level, 1 debugging information is added (default)] * Output files can be flagged with the string provided set in %RED% *#outFlag* <string> %ENDCOLOR% variable * Input files have path relative to the one specified in the %RED *#inDir* <path> %ENDCOLOR% variable. * Input files have path relative to the one specified in the %RED *#outDir* <path> %ENDCOLOR% variable. * Different Fit approaches are implemented [to configure this option using the perl script use the -run option]: * Running a Bd fit: in this case only the PDFs for Bd decays are going to be used in the fit. Three different data set are generated/read and used to build three likelihood variables that are simultaneously minimized. To select this option you should set the %RED% #runMode variable to *BD* in the file myConfs.txt %ENDCOLOR% * Running a Bs fit: in this case only the PDFs for Bs decays are going to be used in the fit. Three different data set are generated/read and used to build three likelihood variables that are simultaneously minimized. To select this option you should set the %RED% #runMode variable to *BS* in the file myConfs.txt %ENDCOLOR% * Running a simultaneous fit: in this case all the PDFs for Bd and Bs decays are going to be used in the fit. Only one data set is generated/read and used to build the likelihood variable that is minimized. To select this option you should set the %RED%#runMode variable to *Sim* in the file myConfs.txt %ENDCOLOR% * Different Proper time resolution models * Gaussian resolution: to use this approach you should set %RED% *doTimErPerEv* variable to *0* in config/myConfs.txt %ENDCOLOR% file. [default option] * Gaussian resolution with per event error: to use this approach you should set %RED% *doTimErPerEv* variable to *1* in config/myConfs.txt %ENDCOLOR% file. The information on the per event error is used to generate a RooHistPdf and can be taken from: * a generated Gaussian distribution: to use this approach you should set %RED% *doProvidePEe* variable to *1* in config/myConfs.txt %ENDCOLOR% file. Mean ans sigma can be set in the config/config.txt file. * a generated Landau distribution: to use this approach you should set %RED% *doProvidePEe* variable to *2* in config/myConfs.txt %ENDCOLOR% file. MPV and 'sigma' can be set in config/config.txt file. * a provided file: to use this approach you should set %RED% *doProvidePEe* variable to *0* in config/myConfs.txt %ENDCOLOR% file. [default option] File name should be "data/B2pipiPTerr.root". * Different data output * Data set can be 'persisted' into root files or ascii files * Different mistag approaches: * Fitting a mistag parameter inside the RooBDecay model [default option]. The mistag parameter can be be set in the config/config.txt file. * Providing a mistag information: to use this approach you should set %RED% *doOmegaPerEv* variable to *1* in config/myConfs.txt %ENDCOLOR% file. The file that contains the omega information can be specified by setting the variable %RED% #omeFile to *data/omega.txt* in the file config/myConfs.txt %ENDCOLOR%. * Performing a fit in tagging categories. ---++++ Parameters configuration ---++ Fit Studies * Tagging studies * [[http://indico.cern.ch/conferenceDisplay.py?confId=3709][M. Calvi talk]] at the Flavour Tagging Meeting 06/09/06 * Proper time studies -- Main.asarti - 06 Jul 2007
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r9
<
r8
<
r7
<
r6
<
r5
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r9 - 2008-05-13
-
AlessioSarti
Log In
LHCb
LHCb Web
LHCb Web Home
Changes
Index
Search
LHCb webs
LHCbComputing
LHCb FAQs
LHCbOnline
LHCbPhysics
LHCbVELO
LHCbST
LHCbOT
LHCbPlume
LHCbRICH
LHCbMuon
LHCbTrigger
LHCbDetectorAlignment
LHCbTechnicalCoordination
LHCbUpgrade
Public webs
Public webs
ABATBEA
ACPP
ADCgroup
AEGIS
AfricaMap
AgileInfrastructure
ALICE
AliceEbyE
AliceSPD
AliceSSD
AliceTOF
AliFemto
ALPHA
Altair
ArdaGrid
ASACUSA
AthenaFCalTBAna
Atlas
AtlasLBNL
AXIALPET
CAE
CALICE
CDS
CENF
CERNSearch
CLIC
Cloud
CloudServices
CMS
Controls
CTA
CvmFS
DB
DefaultWeb
DESgroup
DPHEP
DM-LHC
DSSGroup
EGEE
EgeePtf
ELFms
EMI
ETICS
FIOgroup
FlukaTeam
Frontier
Gaudi
GeneratorServices
GuidesInfo
HardwareLabs
HCC
HEPIX
ILCBDSColl
ILCTPC
IMWG
Inspire
IPv6
IT
ItCommTeam
ITCoord
ITdeptTechForum
ITDRP
ITGT
ITSDC
LAr
LCG
LCGAAWorkbook
Leade
LHCAccess
LHCAtHome
LHCb
LHCgas
LHCONE
LHCOPN
LinuxSupport
Main
Medipix
Messaging
MPGD
NA49
NA61
NA62
NTOF
Openlab
PDBService
Persistency
PESgroup
Plugins
PSAccess
PSBUpgrade
R2Eproject
RCTF
RD42
RFCond12
RFLowLevel
ROXIE
Sandbox
SocialActivities
SPI
SRMDev
SSM
Student
SuperComputing
Support
SwfCatalogue
TMVA
TOTEM
TWiki
UNOSAT
Virtualization
VOBox
WITCH
XTCA
Welcome Guest
Login
or
Register
Cern Search
TWiki Search
Google Search
LHCb
All webs
Copyright &© 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback