Start j2c fresh on 101006 following instructions in http://www-d0.fnal.gov/Run2Physics/ckm/d0_private/bgv/aa/stand_alone_root.htm ----------------------------------------------------------------------------- mkdir Jpsi_phi cd Jpsi_phi setup D0RunII p16.05.02 kinit -f do only once: setup d0cvs cvs co AATrack # always use the head version from CVS! ln -fs /d0dist/dist/packages/CLHEP/R-04-09-15 AA/CLHEP #new step AATrack/script/init.sh # puts all stand alone AA code in Jpsi_phi Jpsi_phi/j2c.cpp is my driving program for the root analysis To put my code in Jpsi_phi: tar xvf j2c_111006.tar # or whatever the latest date is To compile the program, do: setup D0RunII p16.05.02 (Obviously, it needs to be done only once per session) touch j2c.cpp (so compiler thinks it has to be recompiled) AATrack/script/makeSelf.sh j2c (Should be done each time when you modify your program) #this example creates the list of files to process and then runs: ls /prj_root/1008/ckm_write/bgv/data/muinc/f14.03.00_03010131/* > files AA/exe/j2c files To process events using event lists: #This example uses the event list of B->mu D* X events cp /prj_root/1008/ckm_write/bgv/evt/muDstar-std/f14.03-1 elist AA/exe/j2c elist To submit: cluesow -l cput=35:00:00 -l mem=500M rsubmit.sh IT ALL WORKED! To make a tar file of everything I use for the B^0_s -> Jpsi phi analysis: tar cvf j2c_111006.tar README.txt Makefile rsubmit.sh j2c.cpp BH_*.cpp BH_*.hpp\ LOG_jpsi_phi_131006.txt ************************************************************************** Muon variables: AA/src/Muo.hpp Track variables: AA/src/Ptl.hpp Example of looping through muons: AA/phy/selectMuo.cpp Information on bana: http://www-d0.fnal.gov/Run2Physics/ckm/d0_private/bgv/aa/links.htm Accessing solpol and torpol: see AA/src/Field.cpp Example of looping through muons: AA/phy/selectMuo.cpp How to access primary vertex: Ptl.hpp, Ptl.cpp ************************************************************************** myMuonCand1.pt = ptl1->pt(); myMuonCand1.phi = 0.0; myMuonCand1.eta = ptl1->eta(); myMuonCand1.ptot = ptl1->ptot(); myMuonCand1.q = ptl1->q(); myMuonCand1.ip1 = ptl1->imp(1); myMuonCand1.ip2 = ptl1->imp(2); myMuonCand1.nCFT = ptl1->nCFT(); myMuonCand1.nSMT = ptl1->nSMT(); myMuonCand1.vip1 = ptl1->vimp(1,1); myMuonCand1.vip2 = ptl1->vimp(2,2); myMuonCand1.nseg = pmu1->nseg(); AA.cpp: if(fabs(imp(1))>0.2) ok = false; AA.cpp: if(fabs(imp(1))>0.2) ok = false; AA.cpp: if(fabs(imp(2)-xv(3)) < 0.1 && countPV > 0) ok = false; So it apears that imp(1) is the impact parameter of the track with respect to the beam in cm, while imp(2) is the z of closest aproach to the beam. (?) ******************************************************** In main: bookHist() calls bookHistROOT() defines bFile j2c.root and bTree bTree. selectJ2c() loops over Jpsi, if(mjpsi<2.80 || mjpsi>3.35) continue, ptl1 and ptl2 are the two muons, loops over pairs of tracks (excluding the two muons) (all have pT > 0.4, > 2 SMT hits, opposite charge, all 4 tracks from same vertex vrt, find primary vertex pv, combine ptl3 and ptl4 into one particle jkst, obtain mass asuming mjkpi1, mjkpi2, mjkk, mjpipi, isolation: pT of other particles with dR < 0.5 = sum, iso = jkst.ptot()/(jkst.ptot() + sum), particles from B: lstTag = ptl1, ptl2, ptl3, ptl4 tag returns d: sign of d gives the sign of flavor larger |d| correspond to a better flavor tag selection of Bs->J/psi phi. ************************* Includes: BH_functions.cpp // in j2c.cpp: defines functions used by BH BH_instantiate_histos.hpp // instantiates histos and counters BH_initialize_histos.cpp // in main before loop: initializes histos and counters BH_fill_histos.cpp // in selectJ2c: fills histos and updates counters BH_write_histos.cpp // in saveHist: writes histos and counters