BTagging LF Augmentation Tool


Due to slimming some truth information is lost after derivation level so a tool to obtain N-particles and N-tracks relevant to FTAG light-flavour calibration has been developed.This tool augments the jets with these counts for Ks, Lambda, s-hadrons, photon conversions, material interactions and fakes so that they are accessible after derivation.

The code for this can be found here.


This tool was developed for LF calibration studies so currently only exists in FTAG1 for EMTopo and EMPFlow and was tested on one set of di-jet samples, an example of a slice from this sample is


There is no reason this tool shouldn't work for other samples but take care to check enough truth information is accessible that the definitions are still valid, especially for fakes. If your number of fakes are unusually high then it is likely it is failing to find necessary truth information. This tool will only crash if no b-tag object is found.

No additional cuts are applied by this tool.

Accessing Truth Augmentation Information

Accessors for these are in bold next to definition. Output DAODs will have new branches for these augmentations formatted as <jetcontainer>_BTagging<CDI-Date>AuxDyn.<accessor> so for example if you wanted the number of hard-scatter tracks for AntiKt4EMPFlow you would need:


Object Definitions

This tool only looks at tracks from three low-level b-tag algorithms: SV1, IP3D and JetFitter. Care has been taken to prevent double counting tracks that may appear from more than one of these.

Photon Conversion

A electron or positron with only one parent, the parent has to be a photon. This augmentation has two decorations:

  1. Number of tracks associated with a photon conversion (Conversion)
  2. Number of photons (nConversion)


Once again a few decorators exist for this augmentation

  1. K-short: pi+ or pi- with Kshort as a parent
    • Number of tracks associated with a K-short (K_short)
    • Number of K-short particles (nK_short)
  2. Lambda: proton or pi- with a Lambda parent
    • Number of tracks associated with a Lambda (Lambda)
    • Number of Lambda particles (nLambda)
  3. s-Hadrons: K-short, Lambda(0), Sigma(0) Sigma(_), Sigma(-), Xi(0), Xi(-), Omega(-) or K-long
    • Number of tracks associated with a s-hadron (s_hadron)
    • Number of s-hadron particles (ns_hadron)

Material Interactions

If the track truth barcode > 200 000 && no decay in flight && no photon conversion && no strange hadron then it is defined as a material interaction (MatInt)


Fake tracks have been divided into three relevent sub-categories

  1. Hard-scatter tracks: truth link && TruthMatchProb > 0.5 (HS)
  2. Hard-scatter fakes: truth link && TruthMatchProbb < 0.5 (FakeHS)
  3. Pile-Up: No truth link (NTruthLink)
NOTE: Pile-up is the category that requires special care as any track without a truth link will end up in this augmentation. This is as samples are generally set-up, the only truth links missing should be pile-up but this is not true for all samples.

Setting Up Tool

For general setup options and tips see derivationframework. This tool is off by default in FTAG1 and needs to be set to true in

Local Use

Not recommended except for testing or debugging purpose as this will take a long time for any sample size larger than ~100.

Example of the run command: --preExec 'rec.doApplyAODFix.set_Value_and_Lock(True);from BTagging.BTaggingFlags import BTaggingFlags;BTaggingFlags.CalibrationTag "BTagCalibRUN12-08-49";BTaggingFlags.Do2019Retraining=True' --maxEvents '100' --inputAODFile '/eos/user/c/cbasson/qfTask/mc16_13TeV.361024.Pythia8EvtGen_A14NNPDF23LO_jetjet_JZ4W.merge.AOD.e3668_s3126_r10211_r10210/AOD.12873589._000919.pool.root.1' --outputDAODFile 'outputHighPt.pool.root' --reductionConf 'FTAG1'


For full sample runs this is the recommended method. It's not ideal for testing as it can take some time to get your jobs back. An example is below. Be sure your outFile name matches in all instances.

source ../build/x86_64-slc6-gcc62-opt/
pathena --trf " --preExec 'rec.doApplyAODFix.set_Value_and_Lock(True);from BTagging.BTaggingFlags import BTaggingFlags;BTaggingFlags.CalibrationTag =\"BTagCalibRUN12-08-49\";BTaggingFlags.Do2019Retraining=True' --inputAODFile %IN --outputDAODFile fullv9.pool.root --reductionConf FTAG1" --extOutFile DAOD_FTAG1.fullv9.pool.root --nFilesPerJob=10 --nFiles=1 --inDS user.cbasson:user.cbasson.mc16_13TeV.361024.Pythia8EvtGen_A14NNPDF23LO_jetjet_JZ4W.merge.AOD.e3668_s3126_r10211_r10210_der1581602230 --outDS user.cbasson.DerivationFwk.fullv9


For quick checks - only recommended for small samples or local tests - you can turn on VERBOSE level and get the number of counts for each decoration and check they are non-zero

 if (numPhotonConTracks != 0) {
      ATH_MSG_VERBOSE("No. of photon conversion tracks: " << numPhotonConTracks);

-- CandiceRuthBasson - 2020-07-02

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r4 - 2020-07-22 - CandiceRuthBasson
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

  • Edit
  • Attach
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.
Ideas, requests, problems regarding TWiki? Send feedback