Initial setup on higgs

  • Commands to set up and compile code for the first time:
    $ ssh -XY
    $ export MyWorkArea=/higgs-data2/$USER/testarea/AnalysisTaus
    $ mkdir -p $MyWorkArea
    $ cd  $MyWorkArea
    $ kinit -f -r7d -A YOUR_CERN_USERNAME@CERN.CH

    $ svn co --username "YOUR_CERN_USERNAME" svn+ssh:// PhysicsNtuple/PhysicsTaus
    $ source PhysicsNtuple/PhysicsTaus/macros/setup/ "YOUR_CERN_USERNAME"

  • If you get errors with the "svn co" command, please try these commands instead:
    $ svn co svn+ssh:// PhysicsNtuple/PhysicsTaus
    $ source PhysicsNtuple/PhysicsTaus/macros/setup/ "YOUR_CERN_USERNAME"

Run analysis macro

  • Setup release:
    $ cd $MyWorkArea
    $ source

  • Run over 100k events to select analysis objects and make plots:
    $ cd PhysicsNtuple/PhysicsTaus
    $ python macros/ /higgs-data2/rustem/data/tth/multileptons_ntuple_run2/25ns_v4/Nominal/361510.root -o taus.root -n 100000

  • Run over full Z->tau tau sample (4.86 M events)
    $ python macros/ /higgs-data2/rustem/data/tth/multileptons_ntuple_run2/25ns_v4/Nominal/361510.root -o Ztautau10M.root

  • Print 20 raw ntuple events or 20 selected candidate events:
    $ python macros/ /higgs-data2/rustem/data/tth/multileptons_ntuple_run2/25ns_v4/Nominal/361510.root -n 20 --print-reco-event
    $ python macros/ /higgs-data2/rustem/data/tth/multileptons_ntuple_run2/25ns_v4/Nominal/361510.root -n 20 --print-cand-event

  • Make combined plots for different MC processes for all histograms contained in "plotEventsAlgs" or "plotEventsAlgs/elec" sub-directory:
    $  python macros/ taus.root -w -s -o plots --dir-path=plotEventAlgs
    $  python macros/ taus.root -w -s -o plots --dir-path=plotEventAlgs/elec
    $  python macros/ taus.root -w -s -o plots --dir-path=plotEventAlgs --hkey=N.* (plot only histograms containing 'N')

Code structure

Input data

  • Ntuples files are stored at: /higgs-data2/rustem/data/tth/multileptons_ntuple_run2/25ns_v4/Nominal/
  • Each file corresponds to a simulated physics process defined in: data/Xsection13TeV_tth_bkg_v1.txt
  • Flat event variables of the "nominal" tree are read into RecoEvent class
  • Vector branches are read into vector of objects inside RecoEvent class
    • "electron_*" stored as "RecoEvent::GetVec<RecElec>()"
    • "muon_*" stored as "RecoEvent::GetVec<RecMuon>()"
    • "m_tau_*" stored as "RecoEvent::GetVec<RecTau>()"
    • "m_jet_*" stored as "RecoEvent::GetVec<RecJet>()"
    • "m_truth_*" stored as "RecoEvent::GetVec<TruthPart>()"
  • Branch vector variables become object variables
    • "electron_pt" is stored as "Pt" in "RecoEvent::GetVec<RecElec>()"
    • "jet_flavor_weight_MV2c20" is stored as "BTagMV2c20" in "RecoEvent::GetVec<RecJet>()"

How to add new variables and histograms

  • To plot new variable:
    • Add a new histogram definition to config/PlotEvent.xml
    • Lower case "dilep_mll" is an example of the histogram booked explicitly using GetTH1 function
    • Upper case "Mll" is an example of the event variable plotted by the framework
      • Variables are added to an event or object with "AddVar(Cut::Mll, value)" function

How to add new cuts

  • Cuts are configured in python code: python/
  • Cuts are applied in C++ code: PrepCandEvent
  • To use a variable for cuts and plots:
    • It must be defined in these two files: PhysicsTau/CutVars.h and src/CutVars.cxx
    • It must be either read from ntuples OR
    • It must be added explicitly to CandEvent, RecElec, etc
      • "Cut::NLepton" is the example of the variable added explicitly and then used for plots and cuts

How to compile code and commit changes to SVN

  • To commit code updates to SVN:
    • Join this mailing list for users of Manchester Analysis Facility:
    • Please check that there are no * and M next to the same file after "svn status" command
    $ kinit -f -r7d -A YOUR_CERN_USERNAME@CERN.CH
    $ cd $TestArea/PhysicsNtuple/PhysicsTaus

    $ svn status -u
    $ svn commit -m 'commit message'

  • To recompile after changes to header files (PhysicsTaus/*.h) or source files (src/*.cxx)
    $ cd $TestArea/PhysicsNtuple/PhysicsTaus/cmt
    $ make -j QUICK=1

    $ qmake (pre-defined alias for the above two commands)

  • To recompile everything from scratch
    $ cd $TestArea/PhysicsNtuple/PhysicsTaus/cmt
    $ cmt bro rm -r ../x86_64-slc6-gcc*
    $ cmt bro make -j

  • To update all packages to SVN versions and recompile everything from scratch:
    $ cd $TestArea/PhysicsNtuple/PhysicsTaus
    $ source macros/setup/

Previous projects

Ntuples for prompt lepton identification with MVA (BDT):

  • Ntuple location:
$ ssh pc2013
$ ls -l /pc2013-data1/rustem/data/tth/btag-ntuples/btag_v8

  • Command to run over these ntuples:
$ python macros/ /pc2013-data1/rustem/data/tth/btag-ntuples/btag_v8 -o taus.root -n 100000 --trees=event

  • New test ntuple:
    • This ntuple uses branch names and variable names which can be different from previous version - please check!
    • Test ntuple with 20k events:
$ ssh higgs
$ ls -l /higgs-data2/rustem/data/tth/taus/ttbar-ntuples-dec16/

High mass MC samples



  • Z to di-tau sample (mc15a?):

  • To run over the high mass samples:
$ python macros/ /higgs-data2/rustem/taus_test_mc15_13TeV.342321.PowhegPythia8EvtGen_CT10_AZNLOCTEQ6L1_ggH700W20_tautauhh.root -o Htautauhh.root
$ python macros/ /higgs-data2/rustem/taus_test_mc15_13TeV.342320.PowhegPythia8EvtGen_CT10_AZNLOCTEQ6L1_ggH700W20_tautaulh.root -o Htautaulh.root
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r12 - 2016-12-16 - RustemOspanov
    • 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-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback