Introduction

How to set up PhysicsAnpttH

  • This package is still under development.
  • If "git clone" above fails outside CERN, please try getting CERN Kerberos ticket first:
kinit -f -r7d -A $USER@CERN.CH

Note and Presentations

On release 20

Set up ttH analysis package

  • This section describes how to set up this code for the first time using release 20.7 of ATLAS analysis software
  • Please run these commands only once and then exit shell:
mkdir -p ~/testarea/AnpttH
cd ~/testarea/AnpttH
git clone https://:@gitlab.cern.ch:8443/ustc/PhysicsAnpttH.git
source PhysicsAnpttH /macros/setup/first_setup_rel20.sh
exit

Set up PhysicsAnpProd

  • ustc/PhysicsAnpProd is a standalone package that reads (D)xAOD and produces ROOT ntuples with flat or vector branches
  • This section describes how to set up this code for the first time using release 20.7 of ATLAS software
  • Please run these commands only once and then exit shell:
mkdir -p ~/testarea/AnpProd20
cd ~/testarea/AnpProd20
git clone https://:@gitlab.cern.ch:8443/ustc/PhysicsAnpProd.git
source PhysicsAnpProd /macros/setup/first_setup_rel20.sh
exit

Set up AnpBatch package for managing batch jobs

  • AnpBatch contains scripts that help with managing batch jobs at CERN and USTC
  • There are two main macros for managing jobs:
    • subCERN.py prepares shell scripts for individual jobs and to submit them to LXBATCH
    • procJob.py copies job's input files to local disk on worker node and copies output ROOT files
  • Commands to check out this package:
cd ~/testarea/
git clone https://:@gitlab.cern.ch:8443/ustc/AnpBatch.git

On release 21

Set up ttH analysis package

  • 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/AnpttH
cd ~/testarea/AnpttH
mkdir source build run
cd source/
git clone https://:@gitlab.cern.ch:8443/ustc/PhysicsAnpttH.git
source PhysicsAnpttH /macros/setup/first_setup_rel21.sh
exit

Set up PhysicsAnpProd

  • ustc/PhysicsAnpProd is a standalone package that reads (D)xAOD and produces ROOT ntuples with flat or vector branches
  • This section describes how to set up this code for the first time using release 21 of ATLAS software
  • Please run these commands only once and then exit shell:
mkdir -p ~/testarea/AnpProd21/source
cd ~/testarea/AnpProd21/source
git clone https://:@gitlab.cern.ch:8443/ustc/PhysicsAnpProd.git
source PhysicsAnpProd /macros/setup/first_setup_rel21.sh
exit

Work flow examples

Examples of run tth locally

Running locally will be helpful for test.

  • Step 0: setup environment.
cd ~/testarea/AnpBase20/
source setup_atlas_analysis_release.sh
  • Step 1: make mini-ntuple.
cd ${TestArea}/PhysicsAnpttH/
python macros/runttHMiniNtp.py ${path_of_input_ntuples} --do-flip-ntuple=2 --do-tau -o out_minintp.root -n 0

  • Step 2: event selection.
    • --do-Zincl: will select inclusive Z events.
    • --noTrigSF: without lepton trigger SF (for testing)
python macros/runttHPlot.py ${path_of_input_minintuples} --btag-wp=70 -o out.root -n 0

  • Step 3: make tables and stacked plots
    • This step needs both data and MC output root files from step 2.
    • --draw-region: Will show the name of control/signal region
    • --ilumi: luminosity
python macros/plotCand.py ${path_of_MC_dir} --data-file=${path_of_data.root}/data.root --xsec-list=data/plot/xsec_list.txt --get-regions --counts-dir=Counts --config-path=data/plot/plot_stack_2l.txt -r -s --do-fixrange --ilumi=79888.3 --draw-region -o plots

Examples of how to run tth validation work with branch jobs

Before you follow the instruction below, you have to set up your local environment.

cd ~/testarea/AnpBase20/
source setup_atlas_analysis_release.sh

Step 1: Generate mini-ntuples of Data and MC

Prepare input ntuples list:

  • subCERN.py will help us with preparing and dividing input Data/MC ntuples for each jobs.
  • The list of input Data/MC ntuples is needed.
  • ${tag} = data(or mc16)
python ../../macros/makeFileList.py /lustre/AtlUser/fuhe/NtpR21/HIGG8D1_v6/${tag} -o input_ntuples_R21_v06_${tag}.txt --dsid --match=.root

Prepare the script to submit batch jobs :

  • There is a shell script to prepare batch jobs with subCERN.py as an example.
  • The path of input and output files in this script should be changed to a local one.
vi macros/tth/runCERN_base20_tth.sh   # repleace the old path of ntuples with the new one.
source macros/tth/runUSTC_base20_tth.sh mini ${YOUR TAG}
Submit batch jobs:
cd ${TestArea}/PhysicsAnpttH/work/batch/tth/Mini/
source config-data-${YOUR TAG}/submit_all.sh
source config-mc16-${YOUR TAG}/submit_all.sh

Step 2: Make hist root files of Data and MC

Prepare input mini-ntuples list:

  • ${tag} = data(or mc16)
python ../../macros/makeFileList.py /lustre/AtlUser/fuhe/Mini/HIGG8D1_v6/${tag} -o input_ntuples_R21_v06_${tag}.txt --dsid --match=.root

Prepare the script to submit batch jobs :

  • The path of input and output files in this script should be changed to a local one.
vi macros/tth/runCERN_base20_tth.sh   # repleace the old path of mini-ntuples with the new one.
source macros/tth/runUSTC_base20_tth.sh hist ${YOUR TAG}
Submit batch jobs:
cd ${TestArea}/PhysicsAnpttH/work/batch/tth/Hist/
source config-data-${YOUR TAG}/submit_all.sh
source config-mc16-${YOUR TAG}/submit_all.sh

Step 3: Make stacked plots and tables

Using the outputs from the previous step. Data files need to be hadded into one file. MC can stay unhadded (But MC hist files with the same DSID should be hadded into one).

cd ${TestArea}/PhysicsAnpttH/work/batch/tth/Hist/out/tth_hist_${date}_Anp_data_${version}
hadd data.root job_0*
Make plots and tables.
python macros/plotCand.py ${path_of_MC_dir}/* --data-file=${path_of_data.root}/data.root --xsec-list=data/plot/xsec_list.txt --get-regions --counts-dir=Counts --config-path=data/plot/plot_stack_2l.txt -r -s -o plots

Plans for migrating old ttH code to PhysicsAnpttH

  • Migrate code to make mini-ntuples
    • Ask Rhys for commands to make mini-ntuples with the old code
  • Use new batch scripts to make new mini-ntuples
    • AnpBatch /macros
    • Example of using new batch script for RPC analysis
  • Migrate code to select control regions
  • Update code to make plots and tables
    • Plot making is already migrated by Rhys
  • Update this TWiki with complete instructions

Presentation

PLV_validate -- MCP-18-April PLV_WP -- MCP-09-May

Timeline

  • New PhysicsAnpttH code working with release 20.7 ntuples - mid-January
  • New PhysicsAnpttH code working with release 21 ntuples - late January to early February
  • Validate PromptLeptonIso/Veto with release 21 data/MC - February
  • Calibrate new muon working points - February to March
  • Study old variables with detailed truth for prompt and non-prompt leptons - March
  • Study new variables with detailed truth - April to July (possibly longer, depend on outcome)
  • Start physics analysis project - June

Fake Study

This study is devoted to improving the performance of the prompt lepton tagger (PromptLeptonVeto in release 21). We will start with a truth study of B decay with the ttbar MC sample from MUON5 derivation.

Make ntuples

Make list of input DxAOD: e.g.

 ${DAOD_path}= /lustre/AtlUser/fuhe/DAOD/MUON5/mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.deriv.DAOD_MUON5.e6337_e5984_s3126_r10201_r10210_p3584/ 

cd ~/testarea/AnpBatch
python macros/makeFileList.py ${DAOD_path} -o input_muon5_daod_new_v1.txt

Generate rel21 ntuples:

cd ~/testarea/AnpProd21/source
source setup_atlas_analysis_release.sh
cd PhysicsAnpProd
# modify runUSTC_prodntp.sh, to use the new input DxAOD
source runUSTC_prodntp.sh new_v1

Fill histograms with ntuples locally

For every reco-lepton that pass(without) tight isolation cut, if its truth parents or grandparents contain B meson will be tagged. Fill truth information of that B. For the moment, the ntuples avaliable are

 user.rroberts:user.rroberts.mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar.DAOD_MUON5.e5458_s3126_r9364_r9315_p3263.ntp_v1_out 
  • rm-match: remove the truth lepton that matched reco-lepton from B children.

python macros/runFakeStudy.py ntp_v3_test.root -o out.root -n 0 --rm-match

Make plots

Compare the selected B meson which has a non-prompt lepton that passed 'FixedCutTight' isolation with original B meson.

  • --logz: to make 2d histogram in logz scale
  • --local: to make SV study plots
python macros/plotFakeStudy.py out.root -s -o plots --ignore

LeptonTaggers Package

A tool that based on Athena can be used to decorate the DxAOD with Prompt Lepton Tagger output and input variables.

Instruction on developing on Athena

First time setup

mkdir LeptonTaggers
cd LeptonTaggers
mkdir build source run
cd build
setupATLAS
acmSetup --sourcedir=../source AthDerivation,21.2.51.0  
# AthDerivation,21.2.46.0 will forward JetTagNonPrompt to LeptonTaggers,
# so that you don't have to check out JetTagNonPrompt

After that, the next time you log in, you only have to do the following:

cd LeptonTaggers /build
acmSetup

Check out package

cd source
acm sparse_clone_project athena fuhe/athena   #init-workdir
cd athena
git checkout Add_NonPromptLeptonVertexingAlg_21.2 # checkout my work branch
# You can follow the latest athena repo by:
### git fetch upstream
### git checkout -b master-my-topic upstream/${release} --no-track
acm add_pkg athena/PhysicsAnalysis/AnalysisCommon/LeptonTaggers
acm compile

MUON5 derivation has already contained the JetTagNonpromptLepton package with PromptLeptonVeto since AthDerivation,21.2.40.0. To run the derivation you can use the command below:

cd run
ln -s /eos/user/f/fuhe/data/r21/Aod_test/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._002433.pool.root.1 .
Reco_tf.py --inputAODFile AOD.11182705._002433.pool.root.1 --outputDAODFile output.pool.root --reductionConf MUON5 --maxEvents 10

Instruction on developing locally

First time setup

mkdir -p LeptonTaggers/source
cd LeptonTaggers/source
git clone https://:@gitlab.cern.ch:8443/ustc/Physics/LeptonTaggers.git
git clone https://:@gitlab.cern.ch:8443/fuhe/DerivationFrameworkMuons.git
source LeptonTaggers/macros/setup/first_setup_rel21.sh

Next time setup

source setup_atlas_analysis_release.sh

Make MUON5 DxAOD

  • test 410470 MC AOD: /eos/user/f/fuhe/data/LeptonTagger/AOD/mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e6337_e5984_s3126_r9364_r9315
cd ../run
ln -s /eos/user/f/fuhe/data/LeptonTagger/AOD/mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e6337_e5984_s3126_r9364_r9315/AOD.14761208._002797.pool.root.1
Reco_tf.py --inputAODFile AOD.14761208._002797.pool.root.1 --outputDAODFile output.pool.root --reductionConf MUON5 --maxEvents 1000   &>log & tail -f log

Presentations

PromptLeptonVeto research and development

Prompt Lepton Tagger Questions

  • Light flavor(LF) fake for leptons.
    • Above ~10 GeV, muon LF fakes from pion/kaon decays are negligible.
    • Above ~10 GeV, LF fakes from jets mis-identified as electrons are suppressed quite well by electron LH. Isolation variables are also effective and already included with PLV.
    • In same sign WW VBS analysis, MC statistics are lacking.
    • Above ~10 GeV, rely on LH to reject LF fakes for electrons. Below ~10 GeV, need to be studied.

Ideas and plans (2018-12)

  • To apply a lower pT threshold to include more tracks. Start with 500 MeV first.
  • Try a larger cone size ($\Delta R(track, lepton) = 0.4$ in the past).
  • To see how many charged B children have been reconstructed as reco-tracks.
  • Training secondary vertex reconstruction algorithm or related variables with b-jets vs. prompt lepton samples.
  • To collect deeper layer information of calorimeter.

Ideas and plans (2019-02)

  • To select the reconstructed secondary vertices.
    • Suffer from pileup vertices, background primary vertices.
  • Understand the K0 cases: reconstruction or energy depository within the calorimeter.
    • New variable calErel may be helpful to this case.
    • Compared the different layer's energy of the calorimeter: no significant difference.
  • To study and understand why the fake non-prompt leptons passed PLV < -0.5 but failed FixedCutTight.
    • To use no-iso leptons for the training.

Ideas and plans (2019-03)

  • Background primary vertices suppression
    • Mainly from underline events and b jet hadronization.
    • Merged the 2-track vertex (chi2/ndof < 0.5) that close to each other (1 mm) to refit the tracks and get the merged vertex. USTC_Internal_meeting_15Mar
  • Removed the lepton itself from primary vertex reconstruction and refit the primary vertex.
  • Calculate the charge of the vertex: no significant difference.
  • StudyMisidWithPhysicsAnpttH

Recurrent Neural Networks

Open questions

  • Understand the truth matching of prompt/non-prompt for leptons and vertices
    • Consider removing the lepton near to the b-jet (or with a non-prompt vertex nearby) from the prompt category.
  • Study the probability of the tracks that not used for vertex reconstruction.
  • Understand why the distance between the Combined Vertex and Refitted Primary Vertex for prompt lepton is greater than 1 sigma (on average).
  • make the EventDisplay for the b-quack decay.
Edit | Attach | Watch | Print version | History: r58 < r57 < r56 < r55 < r54 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r58 - 2019-06-05 - FudongHe
 
    • 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