You should use root version 5.34 or above. The input format for the analysis are the FHD3PDs which are a slimmed/skimmed version of the official TopD3PDs. You do NOT NEED RootCore or TopRootCore to run the code. The data and MC files are located on the grid and also replicated to MPPMU_LOCALGROUPDISK in Garching. It is recommended to run the analysis code on the machines at RZG in Garching (mppuiN.t2.rzg.mpg.de, N=1,2,3).

Getting the code

The analysis code is locate in the svn area:
You can either check out the trunk version
svn co svn+ssh://svn.cern.ch/reps/atlasinst/Institutes/MPI/HEC/analysis/FullHadronicTopAnalysis/trunk FullHadronicTopAnalysis
or a tagged version
svn co svn+ssh://svn.cern.ch/reps/atlasinst/Institutes/MPI/HEC/analysis/FullHadronicTopAnalysis/tags/FullHadronicTopAnalysis-12-00-01 FullHadronicTopAnalysis
The latest tagged version is normally the one to be used. If in doubt, contact us.

Compiling the code

To compile the code just type (don't forget to setup root before):
After that you will end up with an executable called FHAnalysisExe.exe.

Running the code

There are three main steps involved when running the local analysis. By simply typing ./FHAnalysisExe.exe you can run the code, but note that by default the first two steps are turned off; for the first time you will need to specify that you wish to run the first two steps by using two of several input parameters. These input parameters are used to steer the code (this list might get larger) and avoid having to re-compile just by turning options on or off. You can type
./FHAnalysisExe.exe -usage
to see the list:
  • Which steps to run: options specifying which of the three main steps you wish to run (again note that these must all be set to 1 for the first time):
    • -runAll: runs all steps of the analysis (this is how it should be run!), so turns on several of the separate steps below and runs in the correct order [0 or 1, default = 0]
    • -runAnalysisInitial: runs over all events in MC and data from the FHD3PDs input ntuples, does basic event selection (trigger, jet isolation cut, minimum number of required jets, etc.) as well as top reconstruction (the Min∆PhiTop method for now, but no cuts are done - just to have the top candidates in place). It is at this stage that the jet correction factors are applied (unless you specify in the input parameters -applyJetCFs 0 which keeps the original jet 4-vectors). NOTE: an input .txt file is required with the parton-level jet corrections even if they are not applied - this is for technical reasons, but we could change it in the future. (Approximate time = 40 min.) [0 or 1, default = 0]
    • -runAnalysisFinal: runs over the output from the -runInitial step above, does the final event selection (currently being optimized by Denis), does the ABCDEF method for background estimation, produces final combined plots as well as background-subtracted plots, and does a fit to the reconstructed mass distributions for the W and Top candidates. Several additional options are available for this step below, and more can be added later - otherwise they have to be changed in the code (FHAnalysisLoopFinal.C) and re-compiled. [0 or 1, default = 1]
    • -runMCSignalPreStep: runs over MC FHD3PD to obtain top and W widths (which are used for chi-squared top reconstruction). Also obtains b-tagging efficiencies vs jet eta in the case that this needs to be used for top reconstruction (not used currently). The widths are taken from gauss fits of W and top mass distributions where the jets are matched to quarks in the truth record. Output is a txt file which is later read in. [0 or 1, default = 1]
    • -runMCSignalMassVariation: runs over MC FHD3PD fast sim samples for 7 different generator mtop values. Output is txt file with slopes and intercepts of reconstructed mtop and R32 vs generator top mass which is used later on to interpret the result from the fit to the data distribution. [0 or 1, default = 1]
    • -runMCSignalTriggerPlots: runs over MC D3PD (meant to be the sample with NO pre-selection cuts applied) simply in order to produce trigger efficiency plots. [0 or 1, default = 1]
    • -runMCSignalFullPlots: runs over MC FHD3PD to produce a more exhaustive list of plots of jet kinematics. [0 or 1, default = 1]
    • -runPLCDerivation: runs over MC FHD3PD ntuple to derive jet parton-level correction factors for jets (as a function of reco jet energy and pseudorapidity). The output is a .txt file located in /files containing the jet energy and eta bin ranges as well as the actual correction factors. These are then later read in (if desired) and applied to jets in the analysis (NB: this does now not need to be run at all - it still can be but it is not considered part of the official analysis). Note that by default this really computes correction factors vs quark-level pT or E, and then uses numerical inversion to convert to corrections vs reco-level jet pT or E. [0 or 1, default = 0]

  • Specify inputs/outputs: options to specify names of input and output files to be used (all set by default, so do not have to be changed):
    • -inFileMC: input file path for MC (do not use together with -inFileTxt) [runInitial]
    • -inFileTxtCSMC: text file with COMMA SEPARATED input file paths for MC [runInitial]
    • -inFileTxtNLMC:text file with NEWLINE SEPARATED input file paths for MC [runInitial]
    • -inFileData: input file path for Data (do not use together with -inFileTxt) [runInitial]
    • -inFileTxtCSData: text file with COMMA SEPARATED input file paths for MC [runInitial]
    • -inFileTxtNLData: text file with NEWLINE SEPARATED input file paths for MC [runInitial]
    • -initialOutFile: initial program output file path (default: tTNtuple_InclTopRecoIndices(MC/Data)_nominal.root [runInitial]
    • -inFileFinalMC: input file path for final run MC (default: tTNtuple_InclTopRecoIndicesMC_nominal.root) [runFinal]
    • -inFileFinalData: input file path for final run Data (default: tTNtuple_InclTopRecoIndicesData_nominal.root) [runFinal]
    • -inFileJetCF: input txt file containing jet correction factors to be applied in final stage (default = files/JetCF_nominal.txt) [runFinal]
  • Additional options for final analysis: options to turn on/off several extra features in the final analysis (more are available but currently hard-coded):
    • -applySLBJetVeto: cut on top candidates with b-jet suspected to have decayed semileptonically [0 or 1, default = 1]
    • -applyJetPLCOption: apply parton-level correction factors to jet 4-vectors ["X","A","B", "C", "D", default = "X" which means not applied]
    • -sysType: string identifier for particular run (nominal or systematic) [default = "nominal"]

Examples of how to run the code

  • To run over everything with all four main steps steps - mc pre-step to get top and W widths, mc mass variation (to get slopes and intercepts), initial run (which does some extra pre-selection runs top reco as well), and final (to do ABCDEF method and produce final plots):
./FHAnalysisExe.exe -runAll 1 -inFileTxt FileLists/filelist_RZG_nominal.txt
  • To do the final stage only, but not re-do the mass variation, pre-step, etc., but turn off the b-jet veto (for instance):
./FHAnalysisExe.exe -runAnalysisFinal 1 -applySLBJetVeto 0

Getting the FHD3PDs directly from the grid to run locally

If you want to download the slimmed D3PDs yourself look for the dq2 keys:


The D3PDs have been produced for LC and EM jets. But the EM jets are not yet replicated to Garching (as of 5-FEB-2013).

Content of the analysis package

There are 4 files/classes in the package
  • physics.h/.C ... this is the base class to read the ntuple. It was created with root MakeClass mechanism and should not be edited.
  • physicsFinal.h/C ... same as above but is used to be able to read the input for the final stage (based on the output ntuple from the initial stage....)
  • FHAnalysisLoop.h/.C ... inherits from physics and implements the actual event loop. It can access all variables of the slimmed FHD3PD ntuple directly. This is where the base event selection and top reconstruction is done.
  • FHAnalysisLoopFinal.h/C ... inherits from physicsFinal and implements the final event loop. It also calls functions from the CombinedPlots helper class to produce final plots (with mc signal, data and the estimated background from the ABCDEF method) or background-subtracted plots
  • PlotStylesAndFits.h/C ... is a helper class for setting up 1d and 2d histograms, setting labels for plots, the fit functions used by various programs, etc.
  • PartonLevelJetCorrection.h/C ... is a larger bit of code containing everything needed to do the parton-level jet correction derivation (based on the iterative W method for light jets).
  • FHAnalysisExe.C ... the top level file implementing the main() method. It deals with the input and processes the command line arguements.
  • TopReco.h/.C ... this is a helper class to reconstruct the tops.
  • CombinedPlots.h/.C ... helper class to produce the final data plots / and data/MC comparison, ABCDEF plots, etc. It is called in FHAnalysisLoopFinal.
  • EventSelectionTools.h/.C ... all event selection is controlled here (except the pre-selection which is done at the slimming stage).
  • JetResponseResolution.h/.C ... under development (not a top priority - will be fixed later on to have jet response and resolution plots for b- and non-b-jets)
  • LorentzVectorTools.h/.C ... for operations on TLorentzVectors, or vectors of such objects as well as iterative look-up of jet PLC values when deriving or applying the parton-level jet corrections.
  • SignalPlotLoop.h/.C ... very large file (which should eventually be broken up...) which does all plots for MC signal including mass variation, jet kinematics, b-tagging, trigger, etc. The reason it's all in one file is that for each event it prepares vectors of all of the objects, does top reco, etc. so that that is all in place before filling various histos.

More info

For more info you can also checkout the talks from MPI hadronic top analysis meetings:
Meeting on 23 January 2013
Meeting on 11 January 2013

Example of Program Flow Outputs to Expect

  • 1. Running MC Pre-Step Produces the Following:
  • 2. Running MC Mass Variation Produces the Following (in addition to many many plots...):
  • 3. Running Initial Step (Data and MC): has no output other than root files in which one already has access to which jets have been selected to form tops, Ws, etc. This makes the next (final) step much faster.
  • 4. Final Step with ABCDEF Background-Estimation and Final Fits:
    • control plots such as jet pT but many others showing data/MC+bkgd agreement (for each, ABCDEF method was used to estimate bkgd) (Sample Output Final Data/MC Plot for Jet 1 pT)
    • control plots such as jet pT but many others (as above) but showing normalized shapes of distributions for different bins of ABCDEF observable 1 (to show if one should expect good performance or not from ABCDEF method) (Sample Output Bkgd Evolution Plot for Jet 1 pT)
    • qcd shape bin-by-bin extraction from ABCDEF method (for mtop, mW, R32 only) (Sample Output QCD Shape for mTop)
    • final data distribution or in this case bkgd-subtracted data distribution together with fit (for mtop and R32 only) (Sample Output Final Bkgd-Subtracted Distribution with Fit)
    • *final value of mTop and R32 (directly from fit to above distribution) is printed to screen, as well as the measured value of mtop which comes from converting this fitted value with the knowledge of the slope and intercept from the mass variation
Edit | Attach | Watch | Print version | History: r34 | r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r9 - 2014-01-28 - ThomasMcCarthy
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 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