Code setup

Initial setup

  • Connect to pc2012 and obtain CERN kerberos ticket for SVN authentication:
    $ ssh -XY
    $ kinit -f -r7d -A YOUR_CERN_USER_NAME@CERN.CH

  • Commands to check out and compile code for the first time:
    $ mkdir -p /pc2012-data3/${USER}/testarea/MPhysProject
    $ cd /pc2012-data3/${USER}/testarea/MPhysProject

    $ svn co svn+ssh://
    $ source setup/
    $ ln -s PhysicsNtuple/PhysicsProject/macros/setup/ .

Setup on

  • Replace "pc2012-data3" with "higgs-data4"
  • Replace "pc2012 with "higgs"
  • Use this data path when running code below: /higgs-data4/rustem/data/tth/v4_mc_data

Run analysis example

  • Setup release:

    $ cd /pc2012-data3/${USER}/testarea/MPhysProject
    $ source

  • Run over 100k ttbar events to select simple analysis regions and make plots:
    $ tag="410000"; python $TestArea/PhysicsNtuple/PhysicsProject/macros/ /pc2012-data2/rupham/${tag}.root -n 100000 -o hist_${tag}.root
  • old Ntuples:
    $ tag="410000"; python $TestArea/PhysicsNtuple/PhysicsProject/macros/ /pc2012-data1/rustem/data/tth/25ns_MC_v2/${tag}.root -n 100000 -o hist_${tag}.root
  • oldest Ntuples:
    $ tag="410000"; python $TestArea/PhysicsNtuple/PhysicsProject/macros/ /pc2012-data3/rustem/data/tth/v4_mc_data/${tag}.root -n 100000 -o hist_${tag}.root

    $ python $TestArea/PhysicsNtuple/PhysicsProject/macros/ /pc2012-data3/rustem/data/tth/v4_mc_data/410000.root -n 50 --print-vars

  • How to make plots
    • Double click on canvas to advance to advance to a next plot
    • Plotting command:
       $ python macros/ hist_410000.root --rkey=.*nocut -o plots -s -w

Analysis flow

  • Top level module is ReadNtuple class
    • Reads ROOT ntuple
    • Creates RecoEvent which contains raw reconstructed objects: muons, electrons, jets and hadronic tau candidates
    • Creates and executes children algorithms that are described next
    • It should not be necessary to modify this class

  • PrepCand class creates candidate event
    • Select reconstructed objects using kinematic and particle identification information
    • Apply overlap removal between objects (eg electrons should not overlap with particle jets)
    • Create CandEvent to represent candidate event containing selected objects
    • It should not be necessary to modify this class

  • PrepTopEvent class computes analysis variables
    • Code for new CandEvent variables should be added here

  • PlotCand class plots variables stored with candidate event in a selected analysis region
    • Select candidate events with desired properties, for example: "2 leptons" OR "1 lepton and 1 hadronic tau"
    • Plot event variables defined in histogram files
    • It should not be necessary to modify this class

  • Analysis job is configured in python module python/
    • Mapping between variables in ROOT ntuples and variables used by this analysis code
    • Define flow of algorithms that will be executed for every event
    • Configuration for object selection to create CandEvent
    • Configuration for event selection to plot CandEvent variables
    • Changes to object and event selection should go here

How to create and plot a new event variable

  • Main analysis package is PhysicsProject - this is where all work should be done
    • Use "NJet" and "Mll" variables as an example.

Brief framework documentation

How to update code after initial setup

  • Check SVN status - make sure that there no conflicts (C):

    $ source $TestArea/ status

  • Update to server SVN:

    $ source $TestArea/ update

  • Recompile code (if no new files are added):

    $ source $TestArea/ light-compile

  • When new files are added, packages have to be rebuilt from scratch:

    $ source $TestArea/ compile

How to download new ntuples from CERN

  • Ntuples are stored on EOS mass storage at CERN
  • Latest version is v4 with small changes with respect to previous version
  • MC ntuples are organised by process id - described here
  • First copy ntuples to tmp area on lxplus and then copy them to Manchester

    $ ssh
    $ eos ls root://
    $ eos cp root:// /tmp/$USER/

To-do items

Analysis at CERN


    $ JOBPATH=/afs/${USER:0:1}/$USER/jobs
    $ mkdir -p $JOBPATH
    $ ls -al $JOBPATH

Batch commands

  • LXBATCH is made of tens of thousand computers managed using Platform Load Sharing Facility (LSF) software
  • Users can submit commands to these computers using special batch commands
  • User priority is balanced by LSF software - more jobs you run, less priority you get
  • These are simple batch commands
    $ ssh -XY
    $ bqueues -u $USER
    $ bsub /bin/ls -al
    $ bjobs 

Initial code setup

  • Setup usual PhysicsProject code on lxplus at this path: $HOME/testarea/MPhysProject
  • Check out batch helper scripts and auxiliary data:
    $ cd $TestArea/PhysicsNtuple/PhysicsProject
    $ svn co svn+ssh://
    $ svn co svn+ssh:// 
    $ svn co svn+ssh:// XsectionInput_tth_run2
    $ rm XsectionInput_tth_run2/update_xsection.cxx

Submit analysis jobs

  • Commands to submit analysis jobs ("--submit" actually submits jobs)
    $ source macros/ "" "-n 100000" "-first-plots"
    $ source macros/ "--submit" "-n 100000" "-first-plots"
    $ bjobs

Merge data files

  • Make sure that all jobs are completed: output of "bjobs" command should be empty
  • Merge data files:
    $ python batch/ $JOBPATH/hists-2016-03-16-first-plots/plots-data_v04

Make plots

  • Python command to make data and MC plots for "NJet" plots:
   $ source macros/ "$JOBPATH/hists-2016-03-16-first-plots" "--hkey=NJet.* --rkey=.* -w"

Paper references

ATLAS references

Edit | Attach | Watch | Print version | History: r16 < r15 < r14 < r13 < r12 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r14 - 2016-04-12 - RobinUpham
    • 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