Introduction

  • This page describes the data samples, selections, analysis framework for the WH(->WW) Run 2 analysis

Info

References

MC samples and data

MC samples

Data

  • data 15,16,17,18

Ntuple Production

Release 21 framework

How to run the production:

First time setup

  • This section describes how to set up this code for the first time using release 21 of ATLAS analysis software
  • Please run these commands only once and then exit shell:
      $ mkdir -p ~/testarea/AnpProd21
      $ cd ~/testarea/AnpProd21
      $ mkdir build run source
      $ cd source
      $ git clone https://:@gitlab.cern.ch:8443/ustc/PhysicsAnpProd.git
      $ cd ../
      $ source source/PhysicsAnpProd/macros/setup/first_setup_rel21.sh
      $ cd source
      $ source setup_atlas_analysis_release.sh
      $ acm compile
      $ exit
  • If "git clone" above fails outside CERN, please try getting CERN Kerberos ticket first:
      $ kinit -f -r7d -A $USER@CERN.CH 

On Every Login

  • To restore a previous setup, simply navigate to your working directory and :
      $ cd source
      $ source setup_atlas_analysis_release.sh

Run Test WH Ntuple

  • Run the test job with MC samples on lxplus:
      $ athena $TestArea/../source/PhysicsAnpProd/share/PhysicsAnpProd_ReadxAODr21.py -c "inputDir='/afs/cern.ch/work/h/heng/public/workspace/data/WH_DxAOD_samples/Rel.21/mc16_13TeV.345327.PowhegPythia8EvtGen_NNPDF3_AZNLO_WpH125J_MINLO_lvWWlvlv.deriv.DAOD_HIGG3D1.e5823_s3126_r9364_p3639';EvtMax=100;dumpSG=False;PRWConfig='/afs/cern.ch/work/h/heng/public/workspace/PRWConfigFiles/MergedConfigFiles/prw.merged.root'" &>log& tail -f log

  • Run the test job with MC samples on ui:
      $ athena $TestArea/../source/PhysicsAnpProd/share/PhysicsAnpProd_ReadxAODr21.py -c "inputDir='/lustre/AtlUser/liheng/data/WH_DxAOD_samples_mc16a';EvtMax=100;dumpSG=False;PRWConfig='/lustre/AtlUser/liheng/WH/PRWConfigFiles/MergedConfigFiles/HWW_merged_prw_config_mc16a_FS_v1.root'" &>log& tail -f log
  • Please add following to -c if run a job with data:
     $ IS_DATA=True 

Selections:

Analysis Framework

Release 21 framework

How to run the analysis:

First time setup

  • This section describes how to set up this code for the first time using release 21 of ATLAS analysis software
  • Please run these commands only once and then exit shell:
      $ mkdir -p ~/testarea/AnpWH
      $ cd ~/testarea/AnpWH
      $ mkdir build run source
      $ cd source
      $ git clone https://:@gitlab.cern.ch:8443/ustc/Physics/PhysicsAnpWH.git
      $ source PhysicsAnpWH/macros/setup/first_setup_rel21.sh
      $ acm compile
      $ exit
  • If "git clone" above fails outside CERN, please try getting CERN Kerberos ticket first:
      $ kinit -f -r7d -A $USER@CERN.CH 

On Every Login

  • To restore a previous setup, simply navigate to your working directory and :
      $ cd source
      $ source setup_atlas_analysis_release.sh

Run Test WH Analysis

  • Run the test job on lxplus:
      $ python $TestArea/../source/PhysicsAnpWH/macros/runWH.py /afs/cern.ch/work/h/heng/public/workspace/ntuples/WHWW/job_0010_345327_out.root -n 100 -o WH345327.root &>runWHlog& tail -f runWHlog
  • Run the test job on ui:
      $ python $TestArea/../source/PhysicsAnpWH/macros/runWH.py /lustre/AtlUser/liheng/whNtuples/WHZH/Run_345327_ntuple.root -n 100 -o WH345327.root &>runWHlog& tail -f runWHlog
  • Get the cutflows and stack plots
      $ python $TestArea/../source/PhysicsAnpWH/macros/plotCand.py MC_Hists/* --data-file=Data_Hists/data1516.root --xsec-list=$TestArea/../source/PhysicsAnpWH/data/plot/xsec_list.txt --get-regions --counts-dir=Counts --config-path=$TestArea/../source/PhysicsAnpWH/data/plot/plot_stack_wh_wz_2l.txt -r -s --do-fixrange --ilumi=36074.56 --draw-region -o plots &>stack.log& tail -f stack.log

where the "MC_Hists" should contain the histograms from MC, "Data_Hists/data1516.root" should be the histogram root file from data.

Example of Add a Class, Read Events and Save to Histogram

1. Create STXS class
    void Config(const Registry &reg);  # called at configure

    bool Init(); # called in initialization

    void Save(TDirectory *dir); # called once before event loop

    void Exec();  # called for each event 
   
    void Done(); # called after eventloop finished

  • Set fReco in Config(const Registry &reg), then you can fetch each event by calling fReco->GetVec(), it returns a vector of event. For each event, you can get informations such as objects collections.

2. Fill Histogram

  • Now you can calculate variable in exec and fill the histogram by calling event.AddVar() method
    event.AddVar(Var::NElec,           elecs.size());
    event.AddVar(Var::NTruthElec, truthElecs.size());
  • Make sure your variable exists in VarDef.h and VarDef.cxx, if not, add them.
3. Register your Class and Histogram in python configure.
In file RunWH.py or you can create a new macro similar like it (RunSTXS.py). add
    prep_stxs    = getSTXS       ('STXS', options,prep_cand) 
and
    prep_algs += [prep_stxs] 
in function prepareJobConfig() to register your algorithm class. also in prepareJobConfig() add
     plot_algs += [getPlotCand('%s_%s'     %("cand", "stxs"),       prep_cand, options)]
and
    plot_cand.SetKey('KeyHist',    'PlotSTXS')
in getPlotCand() to register your histogram.
  • Last step, you need create a xml file, which specifics the histograms you want produce. (PhysicsAnpWH/config/wh/)
<?xml version="1.0" ?>
<histograms>

    <dirbase dirs="PlotSTXS" />

    <hist key="NElec" name="" title="">
        <Xaxis bin="10" min="-0.5" max="9.5" title="Number of electrons" />
    </hist>
    <hist key="NTruthElec" name="" title="">
        <Xaxis bin="10" min="-0.5" max="9.5" title="Number of truth electrons" />
    </hist>

</histograms>
  • compile the new class
        acm clean
        acm compile
  • run STXS algorithm class by:
    $ python $TestArea/../source/PhysicsAnpWH/macros/runSTXS.py

ToDo list

  • Ntuple production:
    • for data 2017, 2018; mc 16d, mc 16e
  • Analysis:
    • ?
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r12 - 2019-10-15 - 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