1. General ---------- a. Setup -------- Most of the software lives under a directory tree called `local'. On the SGI cluster, this is /d0sgif/data0/snyder/local; the environment variable `LOCAL' is expected to be set to this path. On the challenges, it's under /home/snyder/local. On fnald0, the tree is in bnl3_3:[tmp296.snyder.local], and on the alpha cluster, it is in prj$root322:[top_6.ljets-fitting.sss.local]. On the VMS clusters, the rooted logicals `local_root' and `local$root' are expected to point to these directories. The directories under this root which are used when running programs are as follows: bin - Executables and scripts. data - Misc. data files. rcp - RCP files. Other directories are used only when building programs: include - C, C++, and Fortran headers. lib - linkable libraries. makedefs - Common make and mms definitions. pbd - PBD files for packages defined in libraries. The relevant setups i do are: d0sgi: setenv LOCAL /d0sgif/data0/snyder/local setenv local $LOCAL setenv zebfor_inc $LOCAL/include set path = ($LOCAL/bin $path) d0ch: setenv LOCAL /home/snyder/local setenv local $LOCAL setenv zebfor_inc $LOCAL/include set path = ($LOCAL/bin $path) fnald0: $ def/trans=conc local_root bnl3_3:[tmp296.snyder.local.] $ def/trans=conc local$root bnl3_3:[tmp296.snyder.local.] $ setup freeware d0tng: $ def/trans=conc local_root DABR01$DKB300:[PRJ322.TOP_6.LJETS-FITTING.SSS.LOCAL.] $ def/trans=conc local$root dabr01$dkb300:[prj322.top_6.ljets-fitting.sss.local.] $ @user1:[snyder.zebfor]setup_zebpp b. Sources ---------- Sources are organized into two trees, called `tools' and `anasrc'. The master copies of the sources are on the SGI cluster in the CVS repository ~snyder/CVSROOT. Working copies are typically kept extracted under ~snyder/tools and ~snyder/anasrc. When sources are exported to other systems, they are placed under: ~snyder (d0ch) bnl3_3:[tmp296.snyder] (fnald0) prj$root322:[top_6.ljets-fitting.sss] (d0tng) The source modules are: tools/cvstools - Utilities to help manage CVS repositories. tools/d0strings - Utilities for calling between C and Fortran. tools/libiberty - The GNU `liberty' utility library, plus some additional local utilities which didn't fit elsewhere. tools/makedefs - Common make and mms definitions. tools/matrix - C++ matrix and linear algebra classes. tools/ntawk - `gawk' modified to read ntuples. tools/oleo - The GNU oleo spreadsheet, with some local modifications. tools/xcvs - CVS modified so that the client will run on VMS. tools/zebfor - The zebfor Zebra preprocessor. tools/zebutil - The zebstruc utility. (Others not ported yet.) anasrc/analib - Misc. routines used by analysis code. anasrc/isrfsr-like - Determine likelihood of jet permutations. anasrc/likefit - Max. likelihood fitter. anasrc/newun - A udst unpacker which doesn't eat up huge tracts of address space. anasrc/resfunc - Evaluate resolution functions for the likelihood fitter. anasrc/top - DST -> ntuple maker. anasrc/topfit - 2C kinematic fitter. anasrc/topmc_util - Utilities for analyzing MC top events. fitter/makeres - Files used for generating and testing resolution functions. dspack - dspack development tree. Most modules have both a Makefile and descrip.mms. Note that on the SGIs, GNU make (gmake) must be used. c. Overview ----------- A sketch of the procedure used for the analysis is as follows. 1. Process (u)DSTs to make ntuples. The ntuples are filtered with a loose 3-jet criterion. 2. Convert the ntuples into ASCII files to be fed into the mass fitter. The `ultraloose' cuts are applied at this time. 3. Run the mass fitter, generating a second set of ntuples. 4. Make resolution histograms from the MC mass fits for various cuts and store in hbook files. 5. Extract the fitted masses for data and MC into ASCII files for input to the likelihood fitter. 6. With the data, do the final likelihood fits. The final cuts get applied here. With the MC, do ensemble tests. 2. top_d0user ------------- This program converts standard D0 event data into ntuple form suitable for further analysis. a. Basic usage (VMS). --------------------- Setup (for MC samples): $ @local_root:[bin]top_d0user "" "" "" mc Setup (for collider data): $ @local_root:[bin]top_d0user "" "" "" default Running: $ @local_root:[bin]run [] The file .list should contain a list of input files to process. The ntuple will end up in .ntup. (But if the parameter was specified, the ntuple name is changed to -.ntup.) If is "true", then events will only be written to the ntuple if the following are satisfied: lep pt > 15 >= 3 jets with et > 15 and |eta| < 2.5. If is blank (specify as `""'), all events will be written to the ntuple. lets one override individual RCP parameters for a specific run. For new inclusive Herwig MC, the following is used: "showerlib t!select_muons t!\stop!\start jet_params_rcpe!isa_cone_size 0.5!\stop!\start e_params_rcpe!relax_eid_cuts t" For ej candidates: "n_jets_min 0!do_run_select f" For mj candidates: "n_jets_min 0!select_muons t!select_electrons f!do_run_select f" etc. For further discussion, see section (d) on individual samples. To run a debug version, use @local_root:[bin]rundeb instead of @local_root:[bin]run. b. Basic usage (unix) --------------------- top_d0user.csh "" "" "" MC or top_d0user.csh "" "" "" DEFAULT toprun [] Differences: doesn't get a default .list extension. Use `|' instead of `!' to separate RCP variables. c. Ntuple contents ------------------ Note: For a number of blocks, the same code is run using both reco-level objects and parton level objects. The convention for those variables is that the reco-level variables and blocks all start with `d', and the parton-level ones all start with `i'. If there is no MC information in the event, the `i' blocks are not created. hotinfo: Results from hot_cell_in_jet. njfound[0,65535]:i ! Number of jets returned from hot_cell_in_jet. hotex:r ! Total hot cell Et, returned by hot_cell_in_jet. hotey:r hmet2:r ! Cal met, with hot cells added back in. hmet3:r ! Mu-corrected met, with hot cells added back in. cleanemc: Standard cleanem calorimeter vbls for best em cluster. DUMMY ECLUS ETCLUS CHISQ CAL_ETA EM3XCOG EM3YCOG EM3ZCOG EMFRAC CORECLUS DISP SIG53 E_FISO1 E_FISO2 ET_FISO1 ET_FISO2 ETA_CLUS PHI_CLUS THETA_CL D_CRACK NCELLS NCELLTHR E_ISO1 E_ISO2 ET_ISO1 ET_ISO2 CIRCEM3 CIRCALL SPRDEM3 SPRDALL cleanemt: Standard cleanem tracking vbls for best em cluster. NZTRAKS NTRKCONE DIFFPHI DIFFTHET PHI_TRK THE_TRK XPT_TRK YPT_TRK ZPT_TRK RDPHI DZ_DR MATCHSIG CDCMIP FDCMIP VTXMIP TRD_LIKE TRD_LEFF TRD_INFO TRD_MEAN XY_IMP Z_IMPACT TRD_ACC TRD_EFF FLGCD RHVTXW RHCDCW NHVTXXY NHVTX3D NHCDCXY NHCDC3D NHCDCZS NATRD1 NATRD2 NATRD3 NCTRD1 NCTRD2 NCTRD3 NCLOUD em: Information about EM clusters. First set of vbls calculated for best EM cluster. trdeff:r ! Result from trd_analysis. deteta_e:r ! (not filled in) elike:r ! Electron likelihood. likeerr[-100,100]:i ! Error code from ELIKE. zvtx_em:r ! ZVTX_EM returned from em_mvtxvar. em_etzv(4):r ! EM_ETZV returned from em_mvtxvar. em_thzv(4):r ! TH_ETZV returned from em_mvtxvar. n_em[0,4]:i ! Number of EM clusters. tighte(n_em):l ! Passed tight ele cuts? pt0_em(n_em):r ! Uncorrected pt phi0_em(n_em):r ! Uncorrected phi eta0_em(n_em):r ! Uncorrected eta dmass: Moldy old mass analysis. dm_t1_2:r ! Masses defined by Serban's find_tops2. dm_t2_2:r dm_wh:r ! Hadronic W mass. dm_b:r ! Leptonic-side b mass. dm_bh:r ! Hadronic-side b mass. deta_wh:r ! Hadronic W eta. deta_b:r ! Leptonic-side b eta. deta_bh:r ! Hadronic-side b eta. ddm_t:r ! m_t1_2 - m_t2_2. imass: Parton-level counterpart to dmass. mcevt: Some quantities computed from parton-level info. iwmass:r ! +W mass from ISAJ banks. iwmmass:r ! -W mass from ISAJ banks. nisrpart[0,31]:i ! Number of ISR ISAQ's above jet cut. nisrpjet[0,15]:i ! Number of PJETs solely from ISR. pjtype(7)[-1,6]:i ! Pjet types: ! 1 : B from +top ! 2 : B from -top ! 3 : From Had W ! 4 : ISR ! 5 : Unclassified etaisr:r ! Mean |eta| of ISR pjets (some versions omitted | |). etanoisr:r ! Mean |eta| of non-ISR pjets (some versions omitted | |). ns_b1[0,15]:i ! Number of pjets associated with B from +top. ns_b2[0,15]:i ! Number of pjets associated with B from -top. m_b1:r ! Mass of B from +top. m_b2:r ! Mass of B from -top. pt_b1:r ! Pt of B from +top. pt_b2:r ! Pt of B from +top. pt_t:r ! +Top pt from ISAJ banks. pt_tb:r ! -Top pt from ISAJ banks. kt_x:r ! Sum of top Pt's, x component. kt_y:r ! Sum of top Pt's, y component. mu: Information on isolated muon. meloss_e:r ! Expected E loss meloss_2:r ! E loss in 0.2 cone meloss_4:r ! E loss in 0.4 cone meloss_6:r ! E loss in 0.6 cone ifw4[0,10]:i ! IFW4 flag muisol:r ! meloss_4 - meloss_2 deteta_m:r ! Muon detector eta mucuts:i:16 ! (Not used) drnew_m:r ! DR from mujets_get_recalc_isolation. ptrnew_m:r ! PTrel from mujets_get_recalc_isolation. mu_ipbv:r ! Bend-view impact parameter. mu_ipnb:r ! Non-bend-view impact parameter. dmut: Mutag information. dn_tag[0,3]:i ! number of tags found did_tag(n_tag)[-20,20]:i ! isajet id of tag bank dpt_tag(n_tag):r ! Pt of tag mu deta_tag(n_tag):r ! eta of tag mu dphi_tag(n_tag):r ! phi of tag mu ddr_tag(n_tag):r ! dr between tag and nearest jet dppt_tag(n_tag):r ! pperp between tag and nearest jet delos_tag(n_tag):r ! expected energy loss in calorimeter imut: Parton-level counterpart to dmut. nu: Information on missing Et. signu2:r ! SigEt for cal MET. signu3:r ! SigEt for mu-correctet MET. pt_nu0:r ! Uncorrected cal MET. phi_nu0:r ! Uncorrected cal MET phi. eta_nu0:r ! Uncorrected cal MET eta. draja: Variables used in Raja's H-matrix analysis. dnj_wp[0,20]:i ! Number of jets along W direction. drs_w_wp:r drs_b_wp:r drs_p_wp:r dmj_wp:r ! Total mass of jets in W direction. dnj_wm[0,20]:i ! Number of jets opposite W. drs_w_wm:r drs_b_wm:r drs_p_wm:r dmj_wm:r ! Total mass of jets opposite W. iraja: Parton-level counterpart to draja. dshape: All of these use 0.5-cone jets with et>15 and |eta|<2. W is as defined by prell_scale_leptons. dspher:r ! Sphericity, jets only daplan:r ! Aplanarity, jets only dspherw:r ! Sphericity, jets + W daplanw:r ! Aplanarity, jets + W dspherb:r ! Sphericity, jets + W + beam daplanb:r ! Aplanarity, jets + W + beam dspherc:r ! Sphericity, jets only, COM frame daplanc:r ! Aplanarity, jets only, COM frame dsphercw:r ! Sphericity, jets + W, COM frame daplancw:r ! Aplanarity, jets + W, COM frame dsphercb:r ! Sphericity, jets + W + beam, COM frame daplancb:r ! Aplanarity, jets + W + beam, COM frame doopln:r ! Total jet activity perp. to plane formed by leading two jets dooplnw:r ! Total jet + W activity perp. to plane formed by leading two jets ishape: Parton-level counterpart to dshape. dtopana1, dtopana2: Major kinematic values (except for jets). dz_vert:r ! Primary Z-vertex. dn_e[0,7]:i ! Number of electrons. dn_reale[0,7]:i ! Number of real electrons (i.e., not counting jets used ! to fake electrons for QCD background studies). dn_pho[0,7]:i ! Number of photons. dpt_e(n_e):r ! Pt of electrons. deta_e(n_e):r ! Eta of electrons. dphi_e(n_e):r ! Phi of electrons. dn_mu[0,15]:i ! Number of muons. dpt_mu:r ! Pt of isol. muon. deta_mu:r ! Eta of isol. muon. dphi_mu:r ! Phi of isol. muon ddr_mu:r ! DR between isol. muon and nearest jet. dpper_mu:r ! Pperp between isol. muon and nearest jet. dpt_nu2:r ! Cal MET. dphi_nu2:r ! Cal MET phi. deta_nu2:r ! Cal MET eta. dpt_nu3:r ! Mu-corrected MET. dphi_nu3:r ! Mu-corrected MET phi. deta_nu3:r ! Mu-corrected MET eta. dpt_nu:r ! Selected MET. deta_nu:r ! Selected MET eta. dphi_nu:r ! Selected MET phi. dpt_lep:r ! Selected lepton pt. deta_lep:r ! Selected lepton eta. dphi_lep:r ! Selected lepton phi. did_lep[-20,99]:i ! Selected lepton isajet id. daeta_l:r ! Selected lepton |eta|. dieta_l[-40,40]:i ! Selected lepton ieta. dn_jets[0,31]:i ! Number of jets with |eta| < 2. dn_jetsc[0,31]:i ! Number of jets with |eta| < 2 and et > 15. dn_jetsa[0,31]:i ! Number of jets with |eta| < 2.5. dn_jetsn[0,13]:i ! Number of jets in ntuple. ddrl_jt(n_jetsn):r ! DR between lepton and jets. dht:r ! Ht. (Jets only, |eta| < 2, et > 15.) dht4:r ! Ht from top four jets only. dhtc:r ! Ht from jets with |eta| < 1. det_e:r ! Ht / (scalar sum of jet energies) dm_jt12:r ! Mass of leading two jets. dm_jts:r ! Mass of all jets. dpts_lep:r ! Scaled lepton from prell_scale_leptons. dpts_nu:r ! Scaled met from prell_scale_leptons. dtot_m:r ! Mass of jets + W. dspher2:r ! 2D sphericity of jets + W. dspher3:r ! 3D sphericity of jets + W. dplan:r ! Planarity of jets + W. dkt_x:r ! Sum of jets, nu, lepton. dkt_y:r ! ... dfound_w:l ! False if prell_scale_leptons returns an error. dpt_w:r ! Pt of W (defined by prell_scale_leptons). dpz_w:r ! Pz of W. dmt_w:r ! Mt of W. dphi_w:r ! Phi of W. deta_w:r ! Eta of W. dm_z:r ! Dilepton mass. dpt_z:r ! Dilepton Pt. dphi_z:r ! Dilepton phi. dphi_ax:r ! Angle of dilepton bisector. dqz:r dreason:i:16 ! Bitmask of failed cuts. itopana1, itopana2: Parton-level counterpart to dtopana1, dtopana2. top_evt: Global event info. trigbit1:i ! Trigger mask, packed 16 bits/variable. trigbit2:i ! ... filtbit1:i ! Filter mask, packed 16 bits/variable. filtbit2:i ! ... filtbit3:i ! ... filtbit4:i ! ... filtbit5:i ! ... filtbit6:i ! ... filtbit7:i ! ... filtbit8:i ! ... trigmask:i ! Mask for specific trigger names. ! 0 = em_jet ! 1 = em_1_max or em_1_high filtmask:i ! Mask for specific filter names. ! 0 = ele_jet_max ! 1 = ele_max ! 2 = ele_jet n:i ! Ordinal number of event in this job. evonum:i ! Event number. evinum1:i ! Trigger number. evinum2:i ! ... runno:i ! Run number. isareac[0,20]:i ! Type of reaction for top MC: ! 0 = not ttbar ! 1 = all jets ! 2 = ejets ! 3 = mujets ! 4 = taujets ! 5 = ee ! 6 = emu ! 7 = etau ! 8 = mumu ! 9 = mutau ! 10 = tautau xsect:r ! Cross section from ISAE weight:r ! Weight from ISAE mblnk:l ! Microblank flag. mrbs:l ! MRBS flag. hotsum:r ! Scalar hot cell sum from GLOB. hotvsum:r ! Vector hot cell sum from GLOB. lum:r ! Luminosity. miflag[0,4]:i ! Flag from multiple_interaction_tool. shot:l ! True if event fails top_event_cleanup. calsumet:r ! EC Et sum + CC Et sum from GLOB. calsume:r ! E sum from GLOB. dtri: Results from triangle_cut. dmetcut:r ! METCUT, returned from triangle_cut. daplcut:r ! APLCUT, returned from triangle_cut. detatcut(2):r ! ETATCUT, returned from triangle_cut. dhtcut:r ! HTCUT, returned from triangle_cut. dokcut:l ! OKCUT, returned from triangle_cut. dprobtri:r ! PROBTRI, returned from triangle_cut. ! Special case: For event 92126,21544, the value ! is multiplied by 1e4 (if it was less than 1e4). doktri:l ! OKTRI, returned from triangle_cut. dtrinnpb:r ! TRINNPB, returned from triangle_trin_zb_2v dtrinnpu:r ! TRINNPU, returned from triangle_trin_zb_4v_4 dtriarg(7):r ! TRIARG, returned from triangle_args dht2:r ! same as triarg(6) dmtl4j:r ! MTL4J, returned from triangle_top_masses dhoodln:r ! HOODLN, returned from triangle_top_masses dtriltb(7):r ! TRILTB, returned from triangle_cut. itri: Parton-level counterpart to dtri. vert: Vertex information. nvert[0,4]:i ! Number of vertices. zv(nvert):r ! Z-vertex values. id_vert(nvert):i ! Vertex IDs. zfit: Z->mumu fit results. zft_chi2:r ! Zfit chisq. zft_prob:r ! Zfit probability. sk2_mu:r ! Sigma kappa^2 for isol. muon. sk2_tag:r ! Sigma kappa^2 for tag. smet_xx:r ! Met error matrix elements. smet_yy:r ! ... smet_xy:r ! ... Jets: A number of different jet algorithms are stored. Each uses a block of the same format. Each algorithm is identified by a single character; that is designated below by `X'. The name of the block is `jetsX'. For the 0.5-cone jets, sometimes the jet Et's will be negative. This means that the jet has |eta| > 2. All algorithms have a |eta| < 2.5 cut imposed. Some fields are not filled in for parton-level jets. jetsX: n_Xj[0,12]:i ! Number of jets. id_Xj(n_Xj):i ! ISAJET ID of jet. et_Xj(n_Xj):r ! Et ( = sqrt(ptx^2 + pty^2)) of jet. phi_Xj(n_Xj):r ! Phi. eta_Xj(n_Xj):r ! Eta. msq_Xj(n_Xj):r ! Squared mass ( = E^2 - P^2) et0_Xj(n_Xj):r ! Uncorrected Et. typ_Xj(n_Xj)[0,127]:i ! Type for fitter. Uses ASCII encoding: ! 'b' : Leptonic-side b ! 'B' : Hadronic-side b ! 'w', 'W': Hadronic W ! 'i' : ISR ! '.' : No info or unclassifiable. rms_Xj(n_Xj):r ! RMS width. emf_Xj(n_Xj):r ! EM fraction. etj_Xj(n_Xj):r ! Associated JNEP Et. tag_Xj(n_Xj):r ! Index of associated mu tag. bndx_Xj[0,100]:i ! Index of tagged jet with smallest tag index. Here are the jet type codes (defined in jet_params.rcp): 3 - 0.3 cone 5 - 0.5 cone 7 - 0.7 cone n - nearest neighbor m - matching between 0.7 and 0.5 cone jets s - matching between 0.7 and 0.5 cone jets using jet_match_05_07. i - PJETs. q - ISAQ particles. j - ISAJ quarks (excluding top) and gluons. d. Information on specific samples. ----------------------------------- - New Herwig ttbar MC samples. These samples are run on the VMS clusters. The RCP options used are "showerlib t!select_muons t!\stop!\start jet_params_rcpe!isa_cone_size 0.5!\stop!\start e_params_rcpe!relax_eid_cuts t" These jobs are submitted using the procedure usr$root:[snyder.top]subljets.com; i.e., @subljets 160a This will read the file list from the online cluster, and generate a ntuple in a scratch directory with the name topljetshw160sa.ntup These ntuples are then copied to the SGI cluster in the directory /d0sgif/data0/snyder/top/ntup/newhw This is done for the following samples: 110a, 120a, 130a, 135a, 140a, 145a, 150a, 150f, 155a, 155f, 160a, 160f, 162a, 165a, 165f, 168a. 170a, 170f, 172a, 175a, 175f, 178a, 180a, 180f, 182a, 185a, 185f, 190a, 190f, 195a, 200a, 205a, 210a, 220a, 230a Several additional variations are also present. lj170snz1, lj170snz2 170 GeV top, processed through noisy + full geant with 1 & 2 additional interactions. ljets170-058 170 GeV top, with buggy 5.8 Herwig ljets170-58f 170 GeV top, with bug-fixed 5.8 Herwig topljetshw170sa-norms Same as topletshw170sa, but with RMS correction turned off in cafix. - Isajet ttbar MC samples. These samples are run on the VMS clusters. The RCP options used are "showerlib t!select_muons t!\stop!\start jet_params_rcpe!isa_cone_size 0.5!\stop!\start e_params_rcpe!relax_eid_cuts t" The jobs are submitted using the procedure usr$root1:[snyder.top]subjob.com; i.e., @subjob w4l60mw0na The ntuples are made in a scratch directry and are copied to /d0sgif/data0/snyder/top/ntup/newis This is done for the following samples: - New Vecbos MC samples. These samples are run on the VMS clusters. The RCP options used are "showerlib t!select_muons t!\stop!\start jet_params_rcpe!isa_cone_size 0.5!\stop!\start e_params_rcpe!relax_eid_cuts t" The jobs are submitted using the procedure usr$root1:[snyder.top]subjob.com; i.e., @subjob w4l60mw0na The ntuples are made in a scratch directry and are copied to /d0sgif/data0/snyder/top/ntup/newvb This is done for the following samples: w3l70ajhwa - 3 jets, avg. jet scale, herwig w3l70ajhwf w4l60aj0na - 4 jets, avg. jet scale, isajet w4l60aj0nf w4l60ajhwa - 4 jets, avg. jet scale, herwig w4l60ajhwf w4l60mw0na - 4 jets, MW scale, isajet w4l60mw0nf w4l60mw0nl w4l60mw0ns w4l60mwhws - 4 jets, MW scale, herwig we4jetn5 - old vecbos we4jetn6 wm4jetn3 - ej QCD background sample This sample is run on the alpha cluster. It is made from the back_ejets sample prepared by Serban by processing it with electron candidates treated as good electrons. The following RCP options are used: "fake_electrons t!pt_nu_min 10" This sample is generated by usr$root1:[snyder.top]back_ejets.com. The resulting ntuple, back_ejets.ntup, is copied to /d0sgif/data0/snyder/top/ntup/newqcd - mj QCD background sample This sample is run on the alpha cluster. It is made from the mj QCD background stream by treating a nonisolated muon as the primary muon. The following RCP options are used: "select_muons t!fake_muons t" In addition, the special RCP file usr$root1:[snyder.top]mujets_mu_select-nonisol.rcp is used. This sample is generated by usr$root1:[snyder.top]mjbkg.com. The resulting ntuple, mjbkg.ntup, is copied to /d0sgif/data0/snyder/top/ntup/newqcd - Candidate samples. The candidates samples are constructed on the fnald0 cluster. First, a list of candidate events passing a loose selection is made into uDSTs. Ntuples are then made from these uDSTs. The lists of files used to make the uDSTS are in usr$root2:[snyder.top]jul96-ej-candsu.list and jul96-mj-candsu.list. These are candidate events which pass either the ultraloose selection or the cross section analysis selection. These are converted to uDSTS using the procedure usr$root2:[snyder.top]jul96-make_udst.com. The uDSTs are written as bnl3_3:[tmp296.snyder.top.candidates.udst]jul96-ej-candsu.udst and bnl3_3:[tmp296.snyder.top.candidates.udst]jul96-mj-candsu.udst These uDSTs are then converted to ntuples via the procedure usr$root2:[snyder]nov96-candidates.com. The RCP options used are "n_jets_min 0!do_run_select f" for the ej candidates and "n_jets_min 0!select_muons t!select_electrons f!do_run_select f" for the mj candidates. This produces the ntupes nov96-ej-cands.ntup nov96-mj-cands.ntup These resulting ntuples are copied to /d0sgif/data0/snyder/top/ntup 3. make_fitter_input -------------------- The next step is to convert the ntuples into ascii files which can be read by the mass fitting program. This is done with a ntawk script called make_fitter_input. a. Invocation ------------- On unix systems, make_fitter_input may be run using ntawk -f $LOCAL/bin/make_fitter_input (On the SGI cluster, simply using `make_fitter_input' should also work.) On the VMS systems, do `setup freeware' to define the `ntawk' symbol, then use ntawk -f local_root:[bin]make_fitter_input (nb. There may be some ntuples which the unix version can process which the vms version cannot. I had to increase the PAWC size at one point to get one sample to work, but that change has not yet been propagated back to the copies on the VMS clusters.) The specification follows the ntawk convention of #. The ntuples generated by top_d0user use an id of `1', so it suffices to append `#1' to the filename. Output is written to stdout. The recognized are as follows: ej : Select ej channel events. ejm : Select ej+tag channel events. mj : Select mj channel events. mjm : Select mj+tag channel events. jmf : Accept only faked electrons. top : Accept only (MC) events which were actually e+jets or mu+jets. data : Make main ring, hot cell, photon, and event cleanup cuts. dumpall : Make no cuts; output all events in ntuple. dumpall_with_lep : Output all events with a lepton > 10 GeV; make no other cuts. pnut3 : Always output the muon-corrected met (default is to output calorimeter met). fudge : Apply an additional jet correction at this point. Not currently functional. remove_ele : If the primary electron is within the DR cone of a jet, subtract it off from the jet. isajet : Use parton-level quantities (default is reco-level quantities). match7 : Try to use 0.7-cone jets if they match with 0.5-cone jets. jet_eta_cut=X : Eta cut to use when counting jets. (Default=2.) jet_thresh_notag=X : Jet Et threshold to use when counting jets in untagged channels. (Default=15.) jet_thresh_tag=X : Jet Et threshold to use when counting jets in tagged channels. (Default=20.) nocontour : Do not make mjm channel contour cut. nometcut : Do not make met cuts. nozftcut : Do not make Z-fitter cut for mjm channel. b. Cuts ------- (see below) c. Output file format --------------------- Each event is described by a series of lines. Each line consists of a two-character tag, followed by some number of data fields. Each event should be followed by a blank line (including the last event in a file). A below has the format x y z E. The tags which have been defined are listed below. ev Identify the event. el mu Describe the primary lepton. One or the other of these tags should appear, but not both. nu Missing Et. ta Tag muon. (Optional.) k1 k2 k3 Outputs from triangle_cut. k4 Scaled lepton quantities from prell_scale_leptons. k5 is a string containing h - Event has a hot cell in a jet. m - Event is a MRBS event. g - Event has a photon. If the string is empty, this tag may be omitted. k6 nj_15_2_5 - Number of 0.5 cone jets with Et>15 and |eta|<2.5. nj_15_2 - Number of 0.5 cone jets with Et>15 and |eta|<2. nj_20_2 - Number of 0.5 cone jets with Et>20 and |eta|<2. k7 eta_w - Reconstructed W eta. sk2_mu - Sigma of 1/p for muon. smet_xx, smet_yy, smet_xy - Missing Et error matrix. k8 Energy loss in calorimeter for tag muon. k9 From triangle_cut. ka From triangle_cut. hX Header for a series of jets. X depends on the type of jet; the codes should match those defined above: 3 - 0.3 cone 5 - 0.5 cone 7 - 0.7 cone n - nearest neighbor m - matching between 0.7 and 0.5 cone jets s - matching between 0.7 and 0.5 cone jets using jet_match_05_07. i - PJETs. q - ISAQ particles. j - ISAJ quarks (excluding top) and gluons. is the number of jets which follow. The absolute value of is the index in the list of the tagged jet (0 if none). The sign is positive if the tag sign matches that of the primary lepton, negative otherwise. (Caution: in MC events, the parton-level version of the primary lepton will be used to define its sign.) is a series of one character per jet, giving the best guess as to the identity of the jet. (Available in MC only, of course.) b - leptonic b B - hadronic b w, W - hadronic W i - ISR . - Can't tell. jX Jet four-vectors. These jets will have had cafix corrections, but no other corrections. ------------------------------------------------------------------------------ Mass fit ntuple definition ! $Id: topfit_ntup.def,v 1.36 1997/03/20 18:35:45 snyder Exp $ evnum:i ! Event number. passno:i ! Incremented by one every time the event number appears ! to have wrapped around. runno:i ! Run number. evinum1:i ! Trigger number. evinum2:i ! ... njets[0,20]:i ! Number of jets used for fit (usually 4). njets0[0,20]:i ! Number of jets in input event. ncomb_save = 5 ! `all' ! Results for the best ncomb_save permutations. (No extra selection.) ! Sorted in order of increasing chisq. nperm[0,ncomb_save]:i ! Number of saved permutations. mt(nperm):r ! Fitted top mass. chisq(nperm):r ! Fit chisq. < 0 implies fit didn't converge. kt(nperm):r ! Kt from fit. weight(nperm):r ! Inv. mass of ttbar pair. (Obsolete, use m_tt instead.) ! (If hadronic W constraint is turned off, contains ! the pre-fit W mass defined by taking the ! second-highest jet on the hadronic side as the b-jet.) iwt(nperm):r ! Probability for isr and fsr jets. ! (Only useful if njets>4.) mwhad(nperm):r ! Mass of hadronic W before fit. ! (If hadronic W constraint is turned off, contains ! W mass defined by taking the highest jet on the ! hadronic side as the b-jet.) utmass(nperm):r ! Top mass before fitting. Average of leptonic ! and hadronic sides. If the equation for the ! neutrino z-component initial value has real solns, ! then this should be the same as the hadronic-side mass. sigm(nperm):r ! Error in mt from doing error propagation of the ! resolutions of the measured variables. px1(nperm):r ! Momentum fractions of initial state partons. px2(nperm):r ! ... perm(nperm):i ! Packed permutation id. ! Written in octal (3 bits/digit), each digit gives ! the assignment of one jet. ! Most significant digit -> highest Et jet. ! Digit codes: ! 1 -> leptonic b ! 2 -> hadronic b ! 3, 4 -> hadronic W ! 5 -> isr pt_t(nperm):r ! Average pT of ttbar pair. m_tt(nperm):r ! Invariant mass of ttbar pair. bl(nperm):r ! (leptonic b) dot (lepton) eta_t1(nperm):r ! eta of leptonic t eta_t2(nperm):r ! eta of hadronic t mavg:r ! Chisq-weighted average of best three perms. mavgall:r ! Chisq-weighted average of all perms. ! `all, minuit' ! Results for the best ncomb_save permutations, using the minuit-based ! fitter. (No extra selection.) Only filled if the minuit option ! was turned on. ! Sorted in order of increasing chisq. ! Variable definitions are the same as for the corresponding variables ! for `all' above. mnperm[0,ncomb_save]:i mmt(nperm):r mchisq(nperm):r mkt(nperm):r mweight(nperm):r miwt(nperm):r mmwhad(nperm):r mutmass(nperm):r msigm(nperm):r mpx1(nperm):r mpx2(nperm):r mperm(nperm):i mpt_t(nperm):r mm_tt(nperm):r mbl(nperm):r meta_t1(nperm):r meta_t2(nperm):r mmavg:r ! `semicorrect' ! Results for the best semicorrect permutation. ! A semicorrect permutation has the jets assigned to the correct tops ! (but the assignment of jets to the hadronic W may be wrong.) ! May not be filled in if the correct permutation cannot be uniquely ! determined. ! Variable definitions are the same as for the corresponding variables ! for `all' above. smt:r schisq:r skt:r sweight:r siwt:r smwhad:r sutmass:r ssigm:r ! `isalike' (Should probably be considered obsolete.) ! Based on chiil = chisq + isajet_like; isajet_like is MC-based ! likelihood for jet perm based on work of MS. ! Sorted in order of increasing chiil. ! Except where noted, Variable definitions are the same as ! for the corresponding variables for `all' above. inperm[0,ncomb_save]:i ! Number of saved permutations. ilchisq(inperm):r ! See `all' above. ilchiil(inperm):r ! See `all' above. ilmt(inperm):r ! See `all' above. ilsigm(inperm):r ! See `all' above. ilutmas(inperm):r ! See `all' above. ilmwhad(inperm):r ! See `all' above. illepb(inperm):r ! Leptonic b factor of isajet_like. ilhadb(inperm):r ! Hadronic b factor of isajet_like. ilnwjt(inperm):r ! Hadronic W factor of isajet_like. ilisr(inperm):r ! ISR factor of isajet_like. ! `correct' (`no permutation') ! Results for the correct permutation. ! May not be filled in if the correct permutation cannot be uniquely ! determined. ! Except where noted, variable definitions are the same as ! for the corresponding variables for `all' above. nmt:r nchisq:r nkt:r nweight:r niwt:r nmwhad:r nutmass:r nsigm:r nchiil:r ! chisq + isajet_like. (See `isalike' above.) nillepb:r ! Leptonic b factor of isajet_like. nilhadb:r ! Hadronic b factor of isajet_like. nilnwjt:r ! Hadronic W factor of isajet_like. nilisr:r ! ISR factor of isajet_like. npx1:r npx2:r npt_t:r nm_tt:r neta_t1:r neta_t2:r nbl:r ! `correct' (`no permutation'), using minuit-based fitter. ! Results for the correct permutation. ! May not be filled in if the correct permutation cannot be uniquely ! determined. ! Will not be filled unless minuit option is turned on when running. ! Variable definitions are the same as for the corresponding variables ! for `all' above. nmmt:r nmchisq:r nmkt:r nmweight:r nmiwt:r nmmwhad:r nmutmass:r nmsigm:r nmpx1:r nmpx2:r nmpt_t:r nmm_tt:r nmeta_t1:r nmeta_t2:r nmbl:r ! `wrong' ! Results for the best wrong permutation. ! A wrong permutation is one which is not even semicorrect. ! May not be filled in if the correct permutation cannot be uniquely ! determined. ! Variable definitions are the same as for the corresponding variables ! for `all' above. wmt:r wchisq:r wkt:r wweight:r wiwt:r wmwhad:r wutmass:r wsigm:r ! `unmerged' ! Results for the best ncomb_save permutations in which there was ! no merging of FSR jets. For the 4-jet case, this is the same ! as `all' above. ! Sorted in order of increasing chisq. ! Variable definitions are the same as for the corresponding variables ! for `all' above. unperm[0,ncomb_save]:i umt(unperm):r uchisq(unperm):r ukt(unperm):r uweight(unperm):r uiwt(unperm):r umwhad(unperm):r uutmass(unperm):r usigm(unperm):r umavg:r ! `btag' ! Results for the best ncomb_save permutations in which the tagged ! jet was used as a b. (Not filled if there was no tag.) ! Sorted in order of increasing chisq. ! Variable definitions are the same as for the corresponding variables ! for `all' above. bnperm[0,ncomb_save]:i bmt(bnperm):r bchisq(bnperm):r bkt(bnperm):r bweight(bnperm):r biwt(bnperm):r bmwhad(bnperm):r butmass(bnperm):r bsigm(bnperm):r bpx1(bnperm):r bpx2(bnperm):r bperm(bnperm):i bpt_t(bnperm):r bm_tt(bnperm):r bbl(bnperm):r beta_t1(bnperm):r beta_t2(bnperm):r bmavg:r ! `siGned btag' ! Results for the best ncomb_save permutations in which the tagged ! jet was used as a b, with the correct sign as indicated by the sign ! of the tag. (Not filled if there was no tag.) ! Sorted in order of increasing chisq. ! Variable definitions are the same as for the corresponding variables ! for `all' above. gnperm[0,ncomb_save]:i gmt(gnperm):r gchisq(gnperm):r gkt(gnperm):r gweight(gnperm):r giwt(gnperm):r gmwhad(gnperm):r gutmass(gnperm):r gsigm(gnperm):r gmavg:r ! `four' ! Results for the best permutation using only the top four jets. ! Variable definitions are the same as for the corresponding variables ! for `all' above. fmt:r fchisq:r fkt:r fweight:r fiwt:r fmwhad:r futmass:r fsigm:r ! `limited ISR' ! Results for the best ncomb_save permutations in which the top three ! jets are not ISR. Same as `all' above for the 4-jet case. ! Sorted in order of increasing chisq. ! Variable definitions are the same as for the corresponding variables ! for `all' above. lnperm[0,ncomb_save]:i lmt(lnperm):r lchisq(lnperm):r lkt(lnperm):r lweight(lnperm):r liwt(lnperm):r lmwhad(lnperm):r lutmass(lnperm):r lsigm(lnperm):r lmavg:r ! Pull quantities for correct jet permutation. ! Not filled if a correct permutation can't be uniquely defined. n_book_measured = 23 n_book_unmeasured = 1 mpull(n_book_measured):r ! Measured vbls upull(n_book_unmeasured):r ! Unmeasured vbls (not really meaningful). ! Parameters of input event (before fit). ntup_maxjets = 6 e_l:r ! Lepton. pt_l:r ! ... eta_l:r ! ... phi_l:r ! ... pt_nu:r ! Neutrino (without any scaling). phi_nu:r ! ... njetsn[0,ntup_maxjets]:i ! Number of jets. e_j(njetsn):r ! Jets. If scaling was requested, they're scaled, ! but neither of the FH corrections have been applied. et_j(njetsn):r eta_j(njetsn):r phi_j(njetsn):r fet_j(njetsn):r ! Et of this jet after fit, for best chisq permutation. ! (Includes FH corrections.) typ_j(njetsn):r ! MC-derived jet type code. ! 0=lepb, 1=hadb, 2,3=hadw, 4=isr, -1=don't know ktx:r ! Event kT (without FH corrections). kty:r ! ... pt_tag:r ! Parameters of tag muon. eta_tag:r ! ... phi_tag:r ! ... edep_tag:r ! Calorimeter energy deposition. tag_ndx:i ! Index of corresponding jet. ! ! Some global kinematic variables. ! ht:r ! Ht, recalculated, using jets > 15 GeV. aplan:r ! Aplanarity of jets, recalculated, using jets > 15 GeV. htu:r ! Ht, recalculcated, using all jets. aplanu:r ! Aplanarity of jets, recalculated, using all jets. hts:r ! Saved Ht (should match xsect definition). aplans:r ! Saved aplanarity of jets. aplanws:r ! Saved aplanarity of jets + W (should match xsect defn). mtot:r ! Total invariant mass of event. ! (No FH corrections, all jets, neutrino z-momentum ! set to zero.) mtot1:r ! Total invariant mass of event. ! (No FH corrections, all jets, neutrino z-momentum ! set to solve for W mass.) metcut:r ! triangle_cut: Missing Et. aplcut:r ! triangle_cut: Aplanarity. htcut:r ! triangle_cut: Ht. etatcut(2):r ! triangle_cut: Eta of tops. okcut:l ! triangle_cut: True if event passed old hard cut. probtri(1):r ! triangle_cut: D_LB. oktri(1):l ! triangle_cut: True if (untagged) event passes LB cut. pts_lep:r ! triangle_cut: Rescaled lepton pT. pts_nu:r ! triangle_cut: Rescaled neutrino pT. xgamma:l ! True if event contains a photon. mrbs:l ! True if event had main ring activity (MRBS). hotcell:l ! True if event had a hot cell in a jet (hmet != met). nj15_2_5:i ! Number of jets with Et>15, |eta|<2.5. nj15_2:i ! Number of jets with Et>15, |eta|<2. nj20_2:i ! Number of jets with Et>20, |eta|<2. eta_w:r ! Eta of W (defined from rescaled quantities). zvert:r ! Primary z-vertex of event. trinnpb:r ! triangle_cut: `biased' NN discriminant. trinnpu:r ! triangle_cut: `unbiased' NN discriminant. D_NN. mtl4j:r ! triangle_cut: Fast fitter result. ht2:r ! triangle_cut: HT2. n_triarg_save = 7 triarg(n_triarg_save):r ! triangle_cut: Variables saved from triangle_args. ! ! Parameters of objects after fit, for best chisq permutation. ! fet_l:r ! Lepton fphi_l:r ! ... feta_l:r ! ... fmsq_l:r ! ... (square of the invariant mass) fet_nu:r ! Neutrino fphi_nu:r ! ... feta_nu:r ! ... fmsq_nu:r ! ... fet_lb:r ! Leptonic b-jet. fphi_lb:r ! ... feta_lb:r ! ... fmsq_lb:r ! ... fet_hb:r ! Hadronic b-jet. fphi_hb:r ! ... feta_hb:r ! ... fmsq_hb:r ! ... fet_w1:r ! First W jet. fphi_w1:r ! ... feta_w1:r ! ... fmsq_w1:r ! ... fet_w2:r ! Second W jet. fphi_w2:r ! ... feta_w2:r ! ... fmsq_w2:r ! ... ! ! Results from fixed mass fits (with extra mass constraint). ! Only filled in if fixed fits were turned on when running. ! ntup_maxfixedfits = 20 nfix[0,ntup_maxfixedfits]:i fixchisq(nfix):r ! ! These correspond to the variables above without the leading `s', ! except that if jet scaling was requested, these have been recalculated ! with the scaled jets. ! shts:r saplanws:r smetcut:r saplcut:r shtcut:r sokcut:l setatcut(2):r sprobtri(1):r soktri(1):l spts_lep:r spts_nu:r snj15_2_5:i snj15_2:i snj20_2:i seta_w:r strinnpb:r strinnpu:r smtl4j:r sht2:r striarg(n_triarg_save):r ------------------------------------------------------------------------------ Applying cuts to base ntuples. ------------------------------ To apply cuts to the base ntuples, within PAW, the following procedure can be used. cut 58 (runno=92126.and.evonum=21544) cut 59 (runno=95653.and.evonum=10822) cut 51 (dpts_lep+dpts_nu)>=60 cut 53 dn_pho=0.and.dn_jetsc>=4.and..not.$59 cut 54 $53.and.($51.and.abs(deta_w)<2).or.$58 Do `uwfunc ntup.inc' Call ulcuts.for(0). (See below.) UL cuts: ulcuts([chan].).and.$53 PR cuts (untagged channels): ulcuts([chan].).and.$54 LB cuts (untagged channels): ulcuts([chan].).and.$54.and.doktri If you're just looking at MC, cuts 58 and 59 may be ommitted. real function ulcuts (chan_in) C---------------------------------------------------------------------- C- C- Purpose and Methods : C- C- UL cuts _except_ for jet cut. C- chan_in = 1,2,3,4 = ej, ejm, mj, mjm. C- chan_in = -1 or -2 for ej QCD background. C- C- Returned value : C- Inputs : C- Outputs : C- Controls: C- C- Created 7-JAN-1997 scott snyder C- C---------------------------------------------------------------------- IMPLICIT NONE real chan_in include 'ntup.inc' real deg_25 integer chan integer tag_ndx logical ulflag logical jmf_flag real phidiff external phidiff logical mu_jets_mutag_etcut external mu_jets_mutag_etcut C---------------------------------------------------------------------- deg_25 = 25*3.1415926/180. jmf_flag = .false. ulcuts = 0 chan = chan_in if (chan .eq. 0) return if (chan .lt. 0) then jmf_flag = .true. chan = - chan endif c ! e_quality_cuts if (jmf_flag .and. did_lep .ne. 99) then return endif c ! event_quality_cuts if (.not. jmf_flag) then if (mblnk) return if (shot) return if (chan .eq. 1 .or. chan .eq. 2) then if (dn_e .gt. 1) return else if (dn_e .gt. 0) return endif endif tag_ndx = 0 if (bndx_5j .gt. 0) then tag_ndx = tag_5j(bndx_5j) if (dpt_tag(tag_ndx) .le. 4) tag_ndx = 0 endif ulflag = .false. c ! kin_cuts if (chan .eq. 1) then c ! ej ulflag = dpt_e(1) .gt. 20 .and. & abs(deta_e(1)) .lt. 2 .and. & dpt_e(2) .lt. 20 .and. & tag_ndx .eq. 0 .and. & hmet2 .gt. 25 else if (chan .eq. 2 .and. & tag_ndx .ge. 1 .and. tag_ndx .le. 3) then c ! ejm ulflag = dpt_e(1) .gt. 20 .and. & abs(deta_e(1)) .lt. 2 .and. & dpt_e(2) .lt. 20 .and. & hmet3 .gt. 20 .and. & (hmet3 .gt. 35 .or. & abs(phidiff(dphi_nu3 - dphi_tag(tag_ndx))) .gt. & deg_25) else if (chan .eq. 3) then c ! mj ulflag = dpt_mu .gt. 15 .and. & tag_ndx .eq. 0 .and. & hmet2 .gt. 20 .and. hmet3 .gt. 20 else if (chan .eq. 4 .and. & tag_ndx .ge. 1 .and. tag_ndx .le. 3) then c ! mjm ulflag = dpt_mu .gt. 15 .and. & zft_prob .lt. 0.01 .and. & hmet2 .gt. 20 .and. hmet3 .gt. 20 .and. & mu_jets_mutag_etcut (tag_ndx, dpt_nu3, & dpt_mu, dpt_tag(tag_ndx), & dphi_mu, dphi_tag(tag_ndx), & dphi_nu3) endif if (ulflag) then ulcuts = 1 endif 999 RETURN END logical function mu_jets_mutag_etcut (tag_ndx, dpt_nu3, & dpt_mu, dpt_tag, & dphi_mu, dphi_tag, & dphi_nu3) C---------------------------------------------------------------------- C- C- Purpose and Methods : C- C- Returned value : C- Inputs : C- Outputs : C- Controls: C- C- Created 7-JAN-1997 scott snyder C- C---------------------------------------------------------------------- IMPLICIT NONE integer tag_ndx real dpt_nu3, dpt_mu, dpt_tag, dphi_mu, dphi_tag, dphi_nu3 real deg_90, deg_170 real phimu, delphi real phidiff external phidiff C---------------------------------------------------------------------- deg_90 = 90*3.1415926/180. deg_170 = 170*3.1415926/180. if (dpt_mu .gt. dpt_tag) then phimu = dphi_mu else phimu = dphi_tag endif delphi = abs (phidiff (phimu - dphi_nu3)) mu_jets_mutag_etcut = delphi .lt. deg_170 .and. & abs (delphi - deg_90) / deg_90 .lt. (dpt_nu3 / 45.) 999 RETURN END real function phidiff (xx) implicit none real xx, x real pi data pi/3.1515926/ x = xx do while (x .gt. pi) x = x - 2 * pi enddo do while (x .lt. -pi) x = x + 2 * pi enddo phidiff = x return end Likelihood fit -------------- nb. The original sources for most of the programs mentioned here are under ~snyder/anasrc/likefit. There are two inputs to the likelihood fit: the resolution histograms and the events to be fit. Resolution histograms: ---------------------- A set of resolution histograms is described by a RCP; LIKE_RCP should point to this file. These are in ~snyder/fitter/makeres/rcp on the sgi cluster, and usually in /spool6/snyder/resrcp on d0cha. This RCP file points to a hbook file containing the actual histograms; on the sgi cluster, these are in /d0sgif/data0/snyder/top/reshists; on d0cha, they're put in the same directory as the RCP files. The primary RCP files used for the analysis are like-shxpr5b2-2d.rcp for LB, and like-shxpr5bv10-2d.rcp for NN. Here are some of the relevant RCP parameters. (These can all be overridden with command line switches.) hbook_file_name: The hbook file containing the resolution histograms. hbook_directory: The RZ directory in the hbook file to use. The resolution histograms are made for a group of `sets', corresponding to different channels. There's `ej', `ejm', `tag', `notag', etc. The one normally used for the analysis is `all', and consists of all channels combined together. Each set consists of a set of histograms. A set is described by several RCP arrays, of the form `_'. If this parameter doesn't exist, `default_' will be used instead. _masses: The input top masses for which the signal histograms were made. _ids: Hbook ids for signal histograms. In 1-1 correspondence with the associated _masses array. _backg_ids: The set of background histograms. Backgrounds are identified by their index in this array. Assignments: ! 1: old vb (hbase + 1) ! 2: qcd (hbase + 2) ! 3: mw-is (hbase + 3) ! 4: aj-is (hbase + 4) ! 7: mw-hw (hbase + 7) ! 8: aj-hw (hbase + 8) Note about assignment of histogram numbers: For signal histograms, the numbers are + + . is: 12000: ej 13000: ejm 14000: mj 15000: mjm 16000: untagged 17000: tagged 18000: all is: 0: 1d, unweighted histogram. 200: 1d weighted histogram. 400: 2d histogram. 600: 2d histogram, unfolded into a 1d histogram. (This is what is used for the current analysis.) Some other parameters: qcd_frac 0.22 Used when constructing the background. wt_bin_width 200 The width of the 2d histogram along the mass axis. cut 'p' Each input event has a set of 1-character tags designating which cuts it passes. This specifies a cut to apply when reading events. `p' is the precuts. chisq_cut 10 Specifies a cut to make on the 2C fit chisq when reading events. This is in addition to the above cut. weight_nr 5 Each input event has a vector of weights associated with it. This specifies which weight to use for the 2d binning. The weights are: 1: probtri 2: trinnpb * trinnpu 3: top_prob_func (trinnpb * trinnpu) (Serban's likelihood fcn) 4: trinnpu 5: Flag specifying whether or not the LB cut was passed. n_wt_bins -2 Specify the binning along the weight axis. If 0: a 1d fit. If < 0: Use abs(n_wt_bins), equally spaced from 0 to 1. If > 0: Use n_wt_bins; take bin edges from the bin_edges array. Special case: if n_wt_bins == 6 and bin_edges not present, use Strovink binning. bin_edges Array giving weight bin edges when nonuniform. The other RCP parameters are really only relevant for the old 1d fits. Both the likelihood RCP file and the hbook file are generated automatically from a more compact format. The original input files are in ~snyder/fitter/makeres/res. The script in ~snyder/fitter/makeres/res2kumac (which uses /d0sgif/data0/snyder/local/bin/res2kumac.awk) converts the .res files into a .rcp file and a .kumac file. The .kumac is then run to make the .hst4 file. Likelihood fit event input (mass dumps): ---------------------------------------- The event data read by the likelihood fitter is in the form of an ascii file, one event per line. The general format of the data illustrated by the example below (but most pieces can be omitted if they're not being used): (184.11,0.069 197.83,2.035 215.16,2.740)#ejm@141.458[0.637041 0.802283 0.900059 0.888436 1]$phl The text in parentheses gives the fit mass and chisq for the first several permutations, in order of increasing chisq. Following the `#' is the name of the channel of this event. Following the `@' is the Ht of this event. Inside the brackets is a vector of weights for this event. Assignments are: 1: probtri 2: trinnpb * trinnpu 3: top_prob_func (trinnpb * trinnpu) (Serban's likelihood fcn) 4: trinnpu 5: Flag specifying whether or not the LB cut was passed. Following the `$' is a set of characters specifying which cuts this event passed. Assignments: p: Passed precuts. l: Passed LB cut. n: Passed NS cut (cross section cut). h: Passed precuts + (tag or probtri > 0.43). (LB with Ht2 cut removed.) The script /d0sgif/data0/snyder/bin/make-masses-dump constructs these files from the mass fit ntuples. It assumes that the mass fit ntuples are under ~/top/massfits and that the output should be written to ~/top/massdumps. It is run like: make-masses-dump samples channel intag outtag subdir ndouble opts SAMPLES is a comma-separated list of base names of input samples. CHANNEL and INTAG further specify the input samples; for a given basename BASE, the file used is ~/top/massfits/SUBDIR/stmassINTAG-BASE-CHAN.ntup and the output file is ~/top/massdumps/SUBDIR/massesOUTTAG-BASE-CHAN.dump NDOUBLE gives the number of times the events in the file are doubled. The default is 3. After the doubling, the events in the file are shuffled to randomize the ordering. The scripts used to process the data are in ~snyder/fitter/mmd. `makedumps-hx5', `makedumps-hx5a', `makedumps-hx5b', `makedumps-hx5c' process the herwig signal. They process the four channels for each sample using make-masses-dump, writing the output in /d0sgif/data0/snyder/top/massdumps/cone5/newhw. Then, they combine the four channels into a single file using the script make-randmixture. The output files from this are in the same directory, but can be distinguished by the lack of a -CHAN suffix. The backgrounds were made with makedumps-bg5. This processes the qcd background in cone5/newqcd and the various vecbos backgrounds in cone5/newvb in the same manner as the signal. The vecbos and qcd backgrounds are then merged; the output files are in /d0sgif/data0/snyder/top/massdumps/cone5/newbg. The one used for the standard analysis is `masses4pr-5-bkg-ajhw.dump'. Many of these files have been copied to d0cha in /spool6/snyder/massdumps. Running the likelihood fit for an ensemble test: ------------------------------------------------ The general idea: One specifies the samples to be read and the composition of the ensemble by command line arguments. One typically specifies a signal sample and a background sample. The samples made have mixtures appropriate for the precuts; additional cuts can be made by specifying the -cut parameter. There should be a symbolic link LIKE_RCP in the working directory pointing to the RCP file to be used. One should always specify the options `-set all -force -dobay'. This forces the fitter to use the `all' resolution histogram set, and to use the `Bayesian' likelihood function. Other options particularly relevant for ensemble tests: (This is not an exhaustive list. Also, the RCP parameters can be overridden from the command line; i.e., `-cut=l'.) -mean=NB_MEAN -sig=NB_SIG -fit_ns_mean=NS_MEAN -fit_ns_sig=NS_SIG Put a constraint on the number of signal and background events in the fit. These are normally omitted, corresponding to no constraint. -group=N Use N events per experiment. -loop -max=N By default, the fitter will stop when hitting the end of one of the input samples. This says to go back to the beginning of a file when the end is reached, and to stop after fitting N experiments. -n_avg=N The number of permutations which should be averaged. Defaults to 1 (i.e., use the best one). -outf=FNAME Where to dump a trace of each fit. -ntup=NTUP Where to write the output ntuple. The input samples are typically specified like this: SIGNALNAME#b BACKGROUNDNAME#r where is a number. This says to pick events from SIGNALNAME from a binomial distribution with mean , and to pick the remainder from BACKGROUNDNAME such that the total matches that specified by the -group switch. The input samples can also be specified as SIGNALNAME#p BACKGROUNDNAME#p to pick them from Poisson distributions with the specified means. I usually run the ensemble tests on d0cha; the big collection of scripts is in ~snyder/fitter/liketests. For example, the `standard' ensemble tests for the 78-event 1:2 ensembles are in the files liketests-shxpr5b2-2d-b[1-4] and liketests-shxpr5bv10-2d-b[1-4]. These use the script fitensemble.pl in the same directory for constructing the argument lists. Ntuple format: -------------- Here are the fields of the ntuple written by the fitter. nmeas:r ! Number of events in experiment. like:r ! Minimum -lnL value. int2:r ! (not used) pbackg:r ! Relative probability of all background (not normally calculated). conf:r ! Confidence limit for rejecting all background hypothesis (not normally calculated). bins:i ! Number of nonempty bins in fit. ! Table of results of fits to the likelihood points. ! The algorithms in this table are as follows (defined by the ordering ! in Like_Fit::final_fits in likefit.cc): ! ! 1: quadratic fit with 7 points. ! 2: Take weighted average of mt distribution. ! 3: quadratic fit with 3 points. ! 4: quadratic fit with 5 points. ! 5: quadratic fit with 9 points. ! 6: quadratic fit with 11 points. ! 7: cubic fit with 5 points. ! 8: cubic fit with 7 points. ! 9: cubic fit with 9 points. ! 10: cubic fit with 11 points. ! 11: `simple average'. Like 2, but doesn't account for differences ! in spacing of the input points. ! ! The `standard' algorithm is 5. ! nreslt_save = 12 nreslts[0,nreslt_save]:i mt(nreslts):r ! Central value. mt_hi(nreslts):r ! Lower error estimate. mt_lo(nreslts):r ! Upper error estimate. ns(nreslts):r ! Number of signal events. ns_sig(nreslts):r ! Estimated error. nb(nreslts):r ! Number of background events. nb_sig(nreslts):r ! Estimated error. chisqch(nreslts):r ! Chisq change when refit with all background. badflag(nreslts):i ! If nonzero, fit either runs into one of the ! edges of the MC range, or has the wrong ! curvature. chisq(nreslts):r ! Chisq for polynomial fit. ! Table of M, lnL, sig(lnL) points. nlike_max = 50 nlike[0,nlike_max]:i mass(nlike):r lnl(nlike):r siglnl(nlike):r