Harvard Top Analysis Code Instructions


Index


Overview

This code was generated to run over TopNtuples using an object-oriented framework. The idea is to make a mini-AC++ environment which has modules placed in a class hierarchy.

The TopNtuplePlots class provides much functionality. It is a virtual class intended to be derived from. It provides flow control for each job. The flow of control is shown here:







Classes can derive from TopNtuplePlots and override the "PassCuts" and "Process" methods (as well as "BookHistograms" and "WriteHistograms"). The real power here comes in when you create a class to perform event selection (i.e. overrides "PassCuts"), and then tertiary classes derive from that class and override the "Process" method. That way, the exact same state is preserved in the "Process" methods for different classes. This is useful for making histograms of different quantities using the same event selection, etc.

The current class hierarchy is shown here:


Obtaining the Code

newrel -t 5.3.3_nt test_topntplots
cd test_topntplots
addpkg BTagObjects btag_matrix_winter05
addpkg JetUser jetCorr04b
gmake BTagObjects.lib LINK_SHARED_ROOT=yes
gmake JetUser.lib LINK_SHARED_ROOT=yes

setenv CVSROOT /data/harv11/a/cvsroot
cvs checkout TopNtuplePlots
cp shlib/$BFARCH/*.so TopNtuplePlots
cd TopNtuplePlots/Chains
gmake
cd ..
gmake LINKS
gmake
ln -sf goodrun_em_mu_si_v7_ignorecmx_303.list goodrun_em_mu_si_v7_ignorecmx.list
ln -sf goodrun_em_mu_nosi_v7_ignorecmx_303.list goodrun_em_mu_nosi_v7_ignorecmx.list 

Data File Locations

                        Note: all files are located in /data/harvX/Y/Top533Strips
                        where X = 11,12,14,15,etc,
                              Y = a,b,c,d,etc

Species                       File Loc. File ID                                                                 Chain File
--------------------------------------------------------------------------------------------------------------------------------------------------------
Data
----
bhel0d/bhmu0d                   11/b    data_strip_tem_jetcorr04_updated032205_533_nt5.root                     ChainData_533_nt_5

Top Monte Carlo
---------------
ttopel (pythia 178)             11/b    ttopel_strip_tem_jetcorr04_updated022305_533_nt_5.root                  ChainTopMonteCarlo_ttopel_533_nt_5
ttophl (herwig 178)             11/b    ttophl_strip_533_nt_5.root                                              ChainTopMonteCarlo_ttophl_533_nt_5
ttop5r (pythia 178, less ISR)   11/b    ttop5r_strip_533_nt_5.root                                              ChainTopMonteCarlo_ttop5r_533_nt_5
ttop7r (pythia 178, more ISR)   11/b    ttop7r_strip_533_nt_5.root                                              ChainTopMonteCarlo_ttop7r_533_nt_5
ttop9r (pythia 178, less FSR)   11/b    ttop9r_strip_533_nt_5.root                                              ChainTopMonteCarlo_ttop9r_533_nt_5
ttopar (pythia 178, more FSR)   11/b    ttopar_strip_533_nt_5.root                                              ChainTopMonteCarlo_ttopar_533_nt_5
ttopch (herwig 170)             12/e    ttopch_strip_tem_jetcorr04_updated032205_533_nt_5.root                  ChainTopMonteCarlo_ttopch_533_nt_5
ttopdh (herwig 173)             12/e    ttopdh_strip_tem_jetcorr04_updated032205_533_nt_5.root                  ChainTopMonteCarlo_ttopdh_533_nt_5
ttophh (herwig 183)             12/e    ttophh_strip_tem_jetcorr04_updated032205_533_nt_5.root                  ChainTopMonteCarlo_ttophh_533_nt_5
ttopih (herwig 185)             12/d    ttopih_strip_tem_jetcorr04_updated032205_533_nt_5.root                  ChainTopMonteCarlo_ttopih_533_nt_5


EW and Single Top MC
--------------------
WW         (pythia)             11/b    ww_strip_tem_jetcorr04_updated022305_533_nt_5.root                      ChainWW_533_nt_5
WZ         (pythia)             11/b    wz_strip_tem_jetcorr04_updated022305_533_nt_5.root                      ChainWZ_533_nt_5
ZZ         (pythia)             11/b    zz_strip_tem_jetcorr04_updated022305_533_nt_5.root                      ChainZZ_533_nt_5
Ztauta     (pythia)             11/b    ztautau_strip_tem_jetcorr04_updated022305_533_nt_5.root                 ChainZtautau_533_nt_5
SingleTopT (pythia)             11/b    singletopt_strip_matched_tem_jetcorr04_updated022305_533_nt_5.root      ChainSingleTopT_533_nt_5
SingleTopS (pythia)             11/b    singletops_strip_tem_jetcorr04_updated022305_533_nt_5.root              ChainSingleTopS_533_nt_5

W+HF Samples
------------
W->enu + BB + 0p (Alpgen)       11/b    wenubb0p_strip_tem_jetcorr04_updated022305_533_nt_5.root                ChainWenubb0p_533_nt_5
W->enu + BB + 1p (Alpgen)       11/b    wenubb1p_strip_tem_jetcorr04_updated022305_533_nt_5.root                ChainWenubb1p_533_nt_5
W->enu + BB + 2p (Alpgen)       11/b    wenubb2p_strip_tem_jetcorr04_updated022305_533_nt_5.root                ChainWenubb2p_533_nt_5
W->munu+ BB + 0p (Alpgen)       11/b    wmunubb0p_strip_tem_jetcorr04_updated022305_533_nt_5.root               ChainWmunubb0p_533_nt_5
W->munu+ BB + 1p (Alpgen)       11/b    wmunubb1p_strip_tem_jetcorr04_updated022305_533_nt_5.root               ChainWmunubb1p_533_nt_5
W->munu+ BB + 2p (Alpgen)       11/b    wmunubb2p_strip_tem_jetcorr04_updated022305_533_nt_5.root               ChainWmunubb2p_533_nt_5
W->enu + CC + 0p (Alpgen)       11/b    wenucc0p_strip_tem_jetcorr04_updated022305_533_nt_5.root                ChainWenucc0p_533_nt_5
W->enu + CC + 1p (Alpgen)       11/b    wenucc1p_strip_tem_jetcorr04_updated022305_533_nt_5.root                ChainWenucc1p_533_nt_5
W->enu + CC + 2p (Alpgen)       11/b    wenucc2p_strip_tem_jetcorr04_updated022305_533_nt_5.root                ChainWenucc2p_533_nt_5
W->munu+ CC + 0p (Alpgen)       11/b    wmunucc0p_strip_tem_jetcorr04_updated022305_533_nt_5.root               ChainWmunucc0p_533_nt_5
W->munu+ CC + 1p (Alpgen)       11/b    wmunucc1p_strip_tem_jetcorr04_updated022305_533_nt_5.root               ChainWmunucc1p_533_nt_5
W->munu+ CC + 2p (Alpgen)       11/b    wmunucc2p_strip_tem_jetcorr04_updated022305_533_nt_5.root               ChainWmunucc2p_533_nt_5
W->enu + C + 0p (Alpgen)        11/b    wenuc0p_strip_tem_jetcorr04_updated022305_533_nt_5.root                 ChainWenuc0p_533_nt_5
W->enu + C + 1p (Alpgen)        11/b    wenuc1p_strip_tem_jetcorr04_updated022305_533_nt_5.root                 ChainWenuc1p_533_nt_5
W->enu + C + 2p (Alpgen)        11/b    wenuc2p_strip_tem_jetcorr04_updated022305_533_nt_5.root                 ChainWenuc2p_533_nt_5


Steps To Get Cross Section

To calculate the cross section, you need to do perform the following steps (pretty much in order):
  1. Run LeptonPlots over all the species you are interested in. This will create a strip file for later use (stripped at the pretag level, before kinematic vetos).
  2. Run Efficiency over all species. Here you can use the stripped file. Do for both Ht > 0, Mt > 0 and Ht > 200, Mt > 20.
  3. Run QcdPlots over data and ttbar MC to get Non-W stuff. Here you can use the stripped file. Do for both Ht > 0, Mt > 0 and Ht > 200, Mt > 20.
  4. Run ApplyMistag over all species. Here you can use the stripped file. Do for both Ht > 0, Mt > 0 and Ht > 200, Mt > 20.
  5. Run Efficiency with MLM matching = 0, 1, 2 for all W+HF species. Here you can use the stripped file. Do for both Ht > 0, Mt > 0 and Ht > 200, Mt > 20.
  6. Data:
    1. Cut and paste event counts from LeptonPlots into data file. Do for both optimized and unoptimized.
  7. Monte Carlo Derived:
    1. To create a file for MC species in the Ana subdirectory, run PrintEfficiency_ForAnaObj.C. This will give the majority of information for MC backgrounds. Do for both optimized and unoptimized.
    2. Run PrintFbcp.C to get the PhiE factors. Cut and paste into the file for that species. Do for both optimized and unoptimized.
    3. Cut and paste acceptance output from LeptonPlots into the file for that species. Do for both optimized and unoptimized.
    4. Run Macros/ModifyAcc.C on output of HtMt files. This will give the acceptance modification due to the optimization. Cut and paste output into the file for that species.
  8. Mistags:
    1. Cut and paste the information from ApplyMistag output into data file. Do for both optimized and unoptimized.
  9. NonW:
    1. Cut and paste the information from QcdPlots output into data file. Do for both optimized and unoptimized.
  10. W+HF:
    1. Run the different MLM matched types (1=inclusive, 2=exclusive). These can be run over the stripped files. Do for both optimized and unoptimzed.
    2. Run PlotEfficiencyMLM_ForAnaObj.C on opt and unopt files. This will create W+HF txt files in the Ana subdirectory.
    3. Run StitchMLM from Ana subdirectory. This will stitch the various W+HF samples together for exclusive matching. Do for both opt and unopt analyses.
    4. Run PlotEff.C to print out event tag rates to txt files for that species.
  11. Run TestXS. The options are:
    Usage: ./TestXS < identifier> < correct_pretags> < exclusive_mlm_matching>
     < ttbar_xs=6.1> < ttbar_xs_err=0.0> < ignore_sf_errors=false> < use_3.5jets=false> < jes_sys=+-1>
     < use_ht_mt=true> < expand_iso_reg_tags=false> < use_162> < cem,cmup,cmx,all>  < ttbar_input=ttopel>
    
    You need to specify an identifier which will be put onto all files:
    < correct_pretags> = 1 (to correct and iterate) or = 0 (to use xs = 6.1). Deprecated. Always use 1
    < exclusive_mlm_matching> = 1 (for exclusive) or = 0 (for inclusive)
    < ttbar_xs> set to xs for iteration.
    < ttbar_xs_err> deprecated. = 0.0 always
    < ignore_sf_errors> deprecated. = 0 always
    < use_3.5jets> = 1 for 3.5 jet bin, = 0 for full analysis
    < jes_sys> = 0 (no sys), +1 (+1 sigma) -1 (-1 sigma)
    < use_ht_mt> = 1 (opt) = 0 (unopt)
    < expand_iso_reg_tags> = 0 (use default Qcd regions), = 1 (expand so they touch)
    < use_162> = 0 (use DQM v7.0) = 1 (use DQM v4.0)
    < cem,cmup,cmx,all> Set to run over one trigger.
    < ttbar_input> Set to run over a different ttop* sample (like ttophl or whatever)
    
  12. Run Macros/FitNJets.C to fit the njets spectrum. Note that if the xs input is different than the output, you need to change the legend by hand.
  13. To make a nice tarball of everything, run
    perl compilelatex.pl < identifier> 4
    
    Then do
    mkdir < identifier>
    mv *< identifier>*.* < identifier>
    cd < identifier>
    
Then you should have a file < identifier>.tgz which contains lots of plots and postscript files.

Enjoy!
Salvatore Rappoccio
Last modified: Fri Aug 5 15:45:34 CDT 2005