This is a instruction for sub-skim production using BToDlnuMiniUser Feb 10, 2005 K. Hamano A.Step by step to build executable for analysis-23 (release 14.5.5) 0. make sure you are on SL3 machine (yakut at SLAC). 1. create a test release > newrel -s $BFROOT/build// -t 14.5.5 BToDlnu_a23 2. srtpath and cond14boot > cd BToDlnu_a23 > srtpath > > cond14boot 3. check out workdir > addpkg workdir > cd workdir > gmake setup > cd .. 4. check out extra tags. On 21 Dec 2004, > addpkg KanBase V01-00-09-02 > addpkg EmcDataK V01-00-05 > addpkg BetaMini eac-041216 > addpkg BetaMiniData eac-041216 > addpkg BtaMiniDataK eac-041216 > addpkg BetaMiniModules > addpkg BetaMiniSequences > addpkg UsrDataK > addpkg SimpleComposition V00-00-30 > addpkg VtxCascade V02-03-04 > addpkg VtxFitter > addpkg workdir V00-04-16 > addpkg BetaCoreTools V00-02-12-02 6. check out PackageList and modify link_all_reco.mk > addpkg PackageList > emacs link_all_reco.mk & Add these lines just before BetaMiniUser PACKAGELIST += BToDlnuMiniUser ifneq ($(LINK_BToDlnuMiniUser),) LINKLISTDEPENDS += [LINK_BToDlnuMiniUser, $(LINK_BToDlnuMiniUser)] override LOADLIBES += -lBToDlnuMiniUser -include BToDlnuMiniUser/link_BToDlnuMiniUser.mk Add these lines just before BetaMiniUser PACKAGELIST += BToDlnuMiniUser ifneq ($(LINK_BToDlnuMiniUser),) LINKLISTDEPENDS += [LINK_BToDlnuMiniUser, $(LINK_BToDlnuMiniUser)] override LOADLIBES += -lBToDlnuMiniUser -include BToDlnuMiniUser/link_BToDlnuMiniUser.mk endif 7. Bug fix for composition sequences. Check out CompositionSequences and CompositionFactory and modify a. CompositionSequences/CompBToDlnuProdSequence.cc The parts of BchToDstarlnu_Elec and B0ToDstarlnu_Elec Change "CompBchToDlnuSelector" to "CompBchToDstarlnuSelector" and "CompB0ToDlnuSelector" to "CompB0ToDstarlnuSelector" b. CompositionFactory/CompBToDlnuSelector.cc Change this part // check sign if ( _rightSignOnly->value()) { // check charged D and lepton; first charged D, then neutral if (dsl.theD()->charge()*dsl.theLepton()->charge() == 1) return false; if (dsl.theD()->charge()==0 && dsl.theK()->charge()*dsl.theLepton()->charge() == -1) return false; if (dsl.theD()->charge()==0 && dsl.theK()->charge()==0 && // D0->K0s pi+ dsl.thePi1()->charge()*dsl.theLepton()->charge() == 1) return false; } to // check sign if ( _rightSignOnly->value()) { // check charged D and lepton; first charged D, then neutral if (dsl.theD()->charge()*dsl.theLepton()->charge() == 1) return false; if (dsl.theD()->charge()==0 && dsl.theK()->charge()*dsl.theLepton()->charge() == -1) return false; } 8. Bug fix for User Data. Check out UsrTools and modify UsrTools/UsrWriteBToDlnu.cc Cahnge this part const SemiLeptMode m2( 0 , 7 ); const SemiLeptMode n2( Dchlnu, DchKsPilnu ); _map.insert( mode_map::value_type( m1, n1 ) ); to const SemiLeptMode m2( 0 , 7 ); const SemiLeptMode n2( Dchlnu, DchKsPilnu ); _map.insert( mode_map::value_type( m2, n2 ) ); But, still cannot write cand level user data..... 9. compile and link (> gmake BToDlnuMiniUser.clean if needed) > gmake KanBase.lib > gmake EmcDataK.lib > gmake CompositionSequences.lib > gmake CompositionFactory.lib > gmake UsrTools.lib > gmake BToDlnuMiniUser.lib > gmake BToDlnuMiniUser.bin Note that do not compile BetaMini eac-041216, BetaMiniData eac-041216 and BtaMiniDataK eac-041216. These cause problems. 10. check the executable > ls bin/Linux... B. Running sub-skim production jobs. 1. Create sub-directories > cd workdir > mkdir log2 > mkdir tcl2 2. Go to workdir and copy required files > cp ~khamano/releases/BToDlnu_a23_14.5.5/workdir/myReskimJobs_S.tcl . > cp ~khamano/releases/BToDlnu_a23_14.5.5/workdir/mySubmitJob.csh . > cp ~khamano/releases/BToDlnu_a23_14.5.5/workdir/reskimedCollList.csh . > cp ~khamano/releases/BToDlnu_a23_14.5.5/workdir/tcl2/subJobs.csh . 3. Create tcl files and save output to a -splitruns.txt file > cd tcl2 For example, for BToDlnu-Run4-OnPeak-R14 dataset > BbkDatasetTcl -ds BToDlnu-Run4-OnPeak-R14 -t 40000 --splitruns | tee BToDlnu-Run4-OnPeak-R14-splitruns.txt > cd workdir 4. The locatiion for output collection is /work/awg/semilep/R14/data /work/awg/semilep/R14/mc You can check this location by > KanUserAdmin list /work/awg/semilep/R14 Actual location is /nfs/kan001/vol4//work/awg/semilep/R14 5. Modify mySubmitJob.csh set dataset = : name of dataset set nStart = : number of first tcl file you want to submit. Ususlly 1. set nStop = : number of last tcl file you want to submit. setenv MY_OUT_DIR : select data or mc To submit mySubmitJob.csh use subJobs.csh. Modify subJobs.csh to submit mySubmitJob.csh and change log file name, and > ./subJobs.csh 6. To submit a job without using a script Copy myReskimJob.tcl > cd workdir > cp ../BToDlnuMiniUser/myReskimJob.tcl . Modify myReskimJob.tcl and submit the job > bsub -C 0 -q kanga -o log2/Reskim_BToDlnu-Run4-OnPeak-R14-035.log "BToDlnuMiniApp myReskimJob.tcl" 7. To check the size of output collections > KanUserAdmin list -l /work/awg/semilep/R14/data > ls -l /nfs/kan001/vol4//work/awg/semilep/R14/data C. Merging 1. Copy these files > cd workdir > cp ~khamano/releases/BToDlnu_a23_14.5.5/workdir/reskimBookKeeping.csh . > cp ~khamano/releases/BToDlnu_a23_14.5.5/workdir/reskimedCollList.csh . > cp ~khamano/releases/BToDlnu_a23_14.5.5/workdir/subMergeJobs.csh . 2. Create Selection Rate file for book keeping. Modify reskimBookKeeping.csh set dataset = : name of dataset set nStart = : number of first collection. Usually 1. set nStop = : number of last collection. then, > ./reskimBookKeeping.csh This creates a bookkeeping file and input files for merge For example BToDlnu-Run3-OffPeak-R14_SelectionRate.txt Coll nDoubleTag nAddLepton nXGamma nInput 1 822 12397 4437 40000 2 871 12462 4431 40000 3 867 12405 4475 40000 4 789 12364 4507 40000 5 836 12403 4500 40000 6 853 12426 4440 40000 7 855 12457 4525 40000 8 829 12394 4526 40000 9 873 12454 4594 40000 10 812 12222 4494 40000 11 838 12329 4437 40000 12 848 12216 4489 40000 13 625 9293 3446 40000 total 10718 157822 57301 520000 3. Create input files for merge. Modify reskimedCollList.csh set dataset = : name of dataset set RESKIM = : location of input collections. set nStart = : number of first collection. Usually 1. set nStop = : number of last collection. set nCollAddLepton = : number of AddLepton collections to be merged into one. Usually 50. set nCollDoubleTag = : number of DoubleTag collections to be merged into one. Usually 300. set nCollBtoXGamma = : number of BtoXGamma collections to be merged into one. Usually 300. then, > ./reskimedCollList.csh This creates input files for merge, for emamle, BToDlnu-Run3-OffPeak-R14-Total_AddLepton1.txt /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-1 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-2 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-3 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-4 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-5 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-6 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-7 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-8 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-9 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-10 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-11 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-12 /work/awg/semilep/R14/data/BToDlnuAddLepton_BToDlnu-Run3-OffPeak-R14-13 4. Check those files and move to log2 > mv BToDlnu-Run3-OffPeak-R14* log2 Use subMergeJobs.csh to submit merge jobs. Modify subMergeJobs.csh set dataset = : name of dataset set collMod = : first one or two digit of output collection number. See below 5. set nStartAL = : number of first AddLepton input file you want to submit. Ususlly 1. set nStopAL = : number of last AddLepton input file you want to submit. set nStartDT = : number of first DoubleTag input file you want to submit. Ususlly 1. set nStopDT = : number of last DoubleTag input file you want to submit. set nStartXG = : number of first BtoXGamma input file you want to submit. Ususlly 1. set nStopXG = : number of last BtoXGamma input file you want to submit. then, > ./subMergeJobs.csh This script uses KanCopyUtil script to merge collections. "KanCopyUtil -i log2/BToDlnu-Run3-OffPeak-R14-Total_AddLepton.txt -o /work/awg/semilep/R14/data/BToDlnu_AddLepton_3101" 5. Name of merged collection may be Data: BToDlnu_AddLepton_3101 Meaning of 3101 part First digit: 1= Run1, 2= Run2, 3 = Rum3, and 4=Run4 Second digit: 0 = on peak, 1 = off peak Last two digits: collection number MC: BToDlnu_AddLepton_001235_3001 001235 shows this is a BpBm_generic MC B+B- 001235 B0B0bar 001237 ccbar 001005 uds 000998 tau+tau- 003429 3001 part First digit: 1= Run1, 2= Run2, 3 = Rum3, and 4=Run4 The other three digits: collection number D. Publishing 1. Create dataset text files containing merged collections to be added to the dataset. Create it in ~khamano/dsList. For example, [noric01] ~/dsList > ls BToDlnu-AddLepton-Run2-OffPeak-R14-Total BToDlnu-AddLepton-Run2-OnPeak-R14-Total BToDlnu-AddLepton-Run3-OffPeak-R14-Total BToDlnu-BtoXGamma-Run2-OffPeak-R14-Total BToDlnu-BtoXGamma-Run2-OnPeak-R14-Total BToDlnu-BtoXGamma-Run3-OffPeak-R14-Total BToDlnu-DoubleTag-Run2-OffPeak-R14-Total BToDlnu-DoubleTag-Run2-OnPeak-R14-Total BToDlnu-DoubleTag-Run3-OffPeak-R14-Total [noric01] ~/dsList > more BToDlnu-AddLepton-Run2-OnPeak-R14-Total /work/awg/semilep/R14/data/BToDlnu_AddLepton_2001 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2002 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2003 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2004 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2005 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2006 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2007 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2008 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2009 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2010 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2011 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2012 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2013 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2014 /work/awg/semilep/R14/data/BToDlnu_AddLepton_2015