Hbb CxAOD Framework Memo (private)

General Information

MC validation/request

  • JO location : SVN link
  • Step 0 : Check lastest caches :Link
  • check JO by script (not working now?) /cvmfs/atlas.cern.ch/repo/sw/Generators/MC15JobOptions/latest/bin/checkjos
  • Step 1 : Validate/check the results. log.generate file (CPU time and any error).
  • Step 2 : validate EVNT file using TruthD3PD/TruthDAOD
source /afs/cern.ch/atlas/software/dist/AtlasSetup/scripts/asetup.sh 21.2.6.0,AthDerivation
*work version : 21.2.6.0
* Truth D3PD does not work in v21...? Truth AOD is o.k.
Reco_tf.py --inputEVNTFile ${OUTDIR}/${INPUT} --outputDAODFile=$OUTPUT --reductionConf TRUTH1 
example : 
setupATLAS
asetup AtlasProduction,19.2.5.21
Generate_tf.py --inputGeneratorFile=$INPUTFILE --ecmEnergy=13000 --runNumber=$RUNNUMBER --firstEvent=$FIRSTEV --randomSeed=$INDEX --jobConfig= MC15JobOptions/MC15....py--outputEVNTFile=$OUTPUT --skipEvents=0
  • Step 4 : Check output in logParser.py (All should be blue or green color..)

Generator Filter Study

CxAOD Maker

CxAODReader

Quick Start (Git, CMake)

* checkout master branch and compile

> setupATLAS
> mkdir <working dir>
> cd <working dir>
> source /afs/cern.ch/user/v/vhbbframework/public/CxAODBootstrap_VHbb/scripts/getMaster.sh origin/master          CxAODFramework_branch_master_21.2.79_1    1           1
* If all setup fine, my setup
> cd run 
> cp /data/data10/zp/tatsuya/AnalysisArea/ZHanalysis/CxAODana/localsetup.sh .
(need to modify directory)
> ./localsetup.sh 

* Everytime I logged in

cd build
setupATLAS
lsetup asetup
release=`cat ../source/CxAODBootstrap_VHbb/bootstrap/release.txt`
echo "release=$release"
asetup AnalysisBase,$release,here
source x86_64-slc6-gcc62-opt/setup.sh 

  • Compile
cd build
  • if added new file
cmake ../source 
if modified...

cmake --build .
source */setup.sh 

cd ../run

CxAOD Reader Contents (Tips)

  • Remake yield file
In the directory of CxAOD, 
python count_Nentry_SumOfWeight.py 0 0 1

  • CxAOD samples can be collected from eos
root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/phys-higgs/HSG5/Run2/VH//
  • Important packages for CxAOD-based analysis
    • FrameworkExe/data/framework-read.cfg : configuration of hsg5frameworkReadCxAOD
    • FrameworkExe/util/hsg5frameworkReadCxAOD.cxx : main function
    • FrameworkSub/ : contain yield file and x-sec file
    • CxAODReader_VHbb/ : main source of event selection and histogram making
    • CxAODTools_VHbb/ : object extraction etc

Plotting tool (git version)

git clone ssh://git@gitlab.cern.ch:7999/CxAODFramework/PlottingTool.git
git clone ssh://git@gitlab.cern.ch:7999/CxAODFramework/TransformTool.git
rc find_packages
rc compile_pkg TransformTool

Stat Framework (WS maker)

Setup

Step 1 (Basic Setup)

svn co svn+ssh://svn.cern.ch/reps/atlasphys-hsg5/Physics/Higgs/HSG5/Limits/InputPreparation/WSMaker/trunk WSMaker
cd WSMaker
source setup.sh
gmake -j5
mkdir inputs

  • Need to change your preferred analysis type in setup.sh!!!

Step 2 (Make Specific Input)

./SplitInputs -r Run2 -indir inputs -v <Version>
  • Specify original input files in inputConfigs and Version (e.g. SMVH_LHCP17_MVA_v05)
  • indir : Specify the directory placed original input files (e.g. ln -s ../VHbbInputs) (may need to modify SplitInputs.C)
  • After run this script, "version" directory including input files are made under inputs dir (specify final discriminant in inputConfigs text file e.g. TwoLepton LiverpoolBmham/LimitHistograms.VH.llbb.13TeV.LiverpoolBmham.v65.root mBBMVA,mva)...
  • Check input root file in inputs

Step 3 (Run some jobs)

python scripts/VHbbRun2/launch_default_jobs.py test
  • modify several options in launch_default_jobs.py... (InputVersion, doCutBase,...). -> job config files are created in configs/ (check it is correct)
  • Run!!

How to fit

Truth DAOD Study

Truth DAOD Production

Link First, setup AtlasDerivation framework
asetup 20.1.8.3,AtlasDerivation,gcc48,here

Make EVNT file to DAOD file via Reco_tf.py!!.
Option : TRUTH0, TRUTH1, TRUTH2, TRUTH3
Reco_tf.py --inputEVNTFile evnt.pool.root --outputDAODFile test.pool.root --reductionConf TRUTH1
*TRUTH1 option is sufficient in truth analysis. It is including TruthParticle, TruthJets

Truth DAOD Analysis

  • Useful packages for truth analysis
    • First setup
git clone https://gitlab.cern.ch/bnachman/truth_lite.git
cd truth_lite/
source truth_lite/scripts/install.sh
  • setup data file in the framework
Example :
mkdir data
ln -s /afs/cern.ch/user/b/bnachman/work/public/truth_tutorial/DAOD_TRUTH3.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad_fixed.root data/ttbar.root
mkdir filelists
echo data/ttbar.root > filelists/ttbar.txt
setup-sample.py -n ttbar -f filelists/ttbar.txt ttbar
  • Main useful code truth_lite/Root/dump_truth3_info.cxx Edit as you like (Read truthparticle and AntiKtTruthJet) in execute()
  • Edit truth_lite/share/config/minimal.py to use dump_truth3_info.cxx
  auto my_truth_particle  =  Retrieve<xAOD::TruthParticleContainer>(event, "TruthParticles");
  auto my_truth_jets = Retrieve<xAOD::JetContainer>(event, "AntiKt4TruthJets");

  for (const auto &truthpar: *my_truth_particle){
    std::cout << "Truth Particle PDGID=" << truthpar->pdgId() << " Status=" << truthpar->status() << " barcode=" << truthpar->barcode()
              << " pt=" << truthpar->pt()/1000 << " eta=" << truthpar->eta() << " phi=" << truthpar->phi() << " m=" << truthpar->m() << endl;
  }

  //Small R jets                                                                                                                                                                                     
  for (const auto &jet: *my_truth_jets) {
    std::cout << "Small R jet: pT = " << jet->p4().Pt()/1000. << " GeV, isbjet? " << jet->auxdata<int>("GhostBHadronsFinalCount") << std::endl;
  }

  • Compile and Run
rc compile truth_lite
run.py -c minimal ttbar(example) --nevents 10(example)

DxAOD production/udpate

General Setup (not necessary I think.... while atlas athena package is cloned...)

> setupATLAS
> lsetup git python
*** Need to fork ***
git clone https://:@gitlab.cern.ch:8443/[YOUR_USER_NAME]/athena.git
cd athena
git remote add upstream https://:@gitlab.cern.ch:8443/atlas/athena.git

DxAOD Setup and development

mkdir <my_area>
setupATLAS
# use today’s nightly
asetup AthDerivation,21.2,r2017-XX-XX
lsetup git python
git atlas init-workdir https://:@gitlab.cern.ch:8443/atlas/athena.git

cd <my_area>/athena
git fetch upstream
# the following only if you want to branch and checkout a package
git checkout -b 21.2-HIGG5PFlowJets-2017-XX-XX upstream/21.2 --no-track
git atlas addpkg DerivationFrameworkHiggs
********* Edit relevant (e.g. HIGG2D4.py) files **********
cd ..
mkdir build
cd build
cmake ../athena/Projects/WorkDir
make -j
cd ..
mkdir run
cd run
source ../build/x86_64-slc6-gcc62-opt/setup.sh
# example of running the code
Reco_tf.py --inputAODFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/DerivationFrameworkART/AOD.12169019._004055.pool.root.1 --outputDAODFile mctest.root --reductionConf HIGG2D4 --preExec 'rec.doApplyAODFix.set_Value_and_Lock(True);from BTagging.BTaggingFlags import BTaggingFlags;BTaggingFlags.CalibrationTag = "BTagCalibRUN12-08-40"' --passThrough True --maxEvents 100
** need to change input file**

Commit change...

1) find modified files
git status

2) add to git list of files to commit
git add <all the modified files ..> 

3) commit
git commit

4) push to your repository fork 
git push -u origin 21.2-HIGG5PFlowJets-2017-11-15

5) request merging with 21.2
Paste the link you get into your browser On the GitLab page:
Select 21.2 as the destination for your merge request
Make sure you add “21.2” and “Derivations” to the list of labels (also add “urgent”..)
Click “Submit”

DxAOD analysis (EventLoop)

Start up

*If setup is already done...
> setupATLAS
> cd ../build
> asetup --restore
> source */setup.sh

Link

-- TatsuyaMasubuchi - 2015-10-25

Topic attachments
I Attachment History Action Size Date Who Comment
Texttxt CMakeLists.txt r1 manage 2.2 K 2018-03-15 - 12:39 TatsuyaMasubuchi CMAKLists exmaples from Nitta-kun
PDFpdf git_tutorial_groupcontacts.pdf r1 manage 83.5 K 2017-11-15 - 23:42 TatsuyaMasubuchi  
Edit | Attach | Watch | Print version | History: r34 < r33 < r32 < r31 < r30 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r34 - 2019-08-30 - TatsuyaMasubuchi
 
    • 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