TrackCalib Package

TrackCalib wass created as tool for creating tracking efficiency correction tables allowing for user-defined track-quality cuts, binning and variable combinations. It also allows to check 1D- and 2D-efficiency dependencies for many variables. The name and idea was shamelessly stolen from PIDCalib.

Questions of comments regarding the TrackCalibTool contact authors michael.kolpin@cernNOSPAMPLEASE.ch and renata.kopecnan@cernNOSPAMPLEASE.ch. More general information regarding tracking efficiencies can be found in the Tracking efficiencies twiki. Also see the Tutorial talk at A&S week, 06.04.2017

TrackCalib setup instructions

TrackCalib is now integrated in Urania. To get Urania, standart setup is used:

lb-dev Urania/v7r0
cd UraniaDev_v7r0
git lb-use Urania
git lb-checkout Urania/master TrackCalib

make configure
make

More detailed instructions can be found in the Git4LHCb twiki.

TrackCalib running instructions

In order to run the TrackCalib package, a bash shell needs to be loaded

./run bash --norc

The package is run from the Urania folder.

Minimal preparation script execution:

python TrackCalib/scripts/CreateTrackEffTables.py "2016_25ns"

This loops over both MC and Data, all three methods (Long, Velo and T), creates a reduced tuple (with multiplicity weights), fits in the default binning, and create plots of the results. The year_conditions define the dataset used. It is possible to also run this step-by-step or to add other options.

Valid year/conditions strings: are "2015_50ns"=(EM), ="2015_25ns", "2015_5TeV" and "2016_25ns"

Running step-by-step

The three sub-scripts can be run separately by specifying:

--Prepare: only runs the Prepare script, reducing the dataset to specified variables, weighting MC in multiplicity, and applying additional matching criteria

--Fit: creates the efficiency fits in a given set of variables, mode, and method with an earlier created tuple

--Plot: Plots the efficiencies from the fit, and creates data/MC correction tables in all 2D variables

Additional options

There are several additional options. Either they are global or they affect the sub-scripts only, as listed below:

Global options

-v: verbose printout

-vROOT: sets ROOT printout level to kInfo, default: kFatal

-mode "MC/Data": specify to only run over Data or MC; default: both

-simVer "SimXYZ": defines the Sim version of the MC; default: Sim09b

-method "<method1>,<method2>": specify method to use, separate by comma; default: Long, T, and Velo

-variables "<var1>,<var2>,<var3>": additional variables for which the efficiency dependency is evaluated; default: P, ETA, nPVs, nSPDHits

-variables2D "<var1>-<var2>,<var3>-<var4>": additional sets of 2D variables for which the efficiency dependency is evaluated. Minus connects the variables within a set, comma separates sets; default: P-ETA

-polarity "MagUp/MagDown": specify to run only over MagUp or MagDown. Does not affect the Prepare script

Hence, for example to run over 2016 collision data only, use Long and Velo methods for PT and ETA with GhostProb '&lt' 0.5, run:

python TrackCalib/scripts/CreateTrackEffTables.py "2016_25ns" -mode "Data" -method "Long, Velo" -variables "PT,ETA" -binning "PT:0,1000,5000" -variables2D "PT-ETA" -matchCrit "Probe: GhostProb<0.5;Global:GhostProb<0.5"

Note that the -matchCrit is listed in the Prepare options. This example might be useful to check the effect of looser cut on GhostProb on PT and ETA on data. Note that since PT is not a default variable (P and ETA are), binning in PT needs to be specified. For more information about the binning option see Fit options.

'Prepare' script options

Prepare.py runs over the master tuple for the given data taking conditions/Sim version, applies additional selection cuts and reweights MC in nSPDHits. The outputfile is local at tuples/trackEffTuple_Data/MC_conditions(_simVer).root

-noWeight: set to disable reweighting MC to fit the Data multiplicity

-weightVar: reweighting MC to fit the Data multiplicity in the weighting variable; default = "nSPDHits"

-cuts "Probe:<cut1,cut2,cut3>;Tag:<cut4>;Global:<cut6,cut7>": Define additional cuts applied to the probe/tag muon as well as global cuts (e.g. Jpsi cuts, runNumber, etc.). Separate individual cuts by comma, categories by semicolon

-matchCrit "Probe:<criterion1,criterion2>;Global:<criterion3>": Define tighter matching criterion (when is an event considered efficient), e.g. Matched_GhostProb < 0.3, separation as above

-maxEntries 1234567: Sets the maximum number of events used per method and charge. Needed to limit memory consumption of fit script; default: 4.e7

As an example, running Prepare script over MC only, Sim08h with 100.000 entries using only T-station method without multiplicity reweighting requires the following command:

python TrackCalib/scripts/CreateTrackEffTables.py "2015_50ns" -mode "MC" -simVer "Sim08h" -noWeight -method "T" -maxEntries "100.000 --Prepare

This allowes for a quicker check of the efficiencies in different MC samples.

'Fit' script

Executes a simultaneous fit to matched and failed events in each variable and bin to evaluate efficiency. It also creates a separate ROOT file for each variable, containing fitted distributions and efficiency histogram. Output should be checked (at least) for convergence and reasonable data description. Output files are created at results/conditions/(simVer)/trackEffData/MC_variable_method.root

-binning "<var1>:<binborder1>,<binborder2>,<binborder3>;<var2>:<binborder4>,...": binning scheme used for the customised variables defined as above. Bin borders separated by comma, variable+binning sets by semicolon.

-simFit "True/False": controls the use of a simultaneous fit to matched and failed events to evaluate efficiency. Should be set to False for binnings/datasets with low statistics; default: True

-binnedFit: Sets the use of a binned fit to evaluate efficiency. Should be set to True for datasets with large statistics; default: False

-binsInFit 123: Sets the number of bins in the fit; default: 100

As an example, the following command runs the Fit script for both MC and 2016 data, using Long method for PT and ETA with bins of PT 0MeV-1000MeV-5000MeV and standard ETA bins using binned fits:

python TrackCalib/scripts/CreateTrackEffTables.py "2016_25ns" -variables "PT,ETA" -binning "PT:0,1000,5000" -binnedFit --Fit

'Plot' script

This script uses the results of previous Fit script, plots all 1D efficiencies and compares data with MC. It also creates the data/MC ratio for 2D variables and saves the ratio as a ROOT file (meaning it creates the correction tables). It also combines the results from Velo and T station methods (called combined). As the final step it combines the combined method with Long method (called final). For 2016 results, the T-station method is not fully functional for now , so use only Long method as an input for your analysis! The plots and tables are stored in plots/conditions_simVer/.

-vartitles "<var1>:<vartitle1>;<var2>:<vartitle2>": defines the axis title for the custom variables as defined above, standard TLatex synthax can be used

-maxError: Sets the maximal acceptable error for the efficiencies; default: 0.03. If the error is >maxError, the efficiency is set to 1 +- 5%

-maxDeviation: Sets the maximal deviation of the efficiency from 1; default: 0.3. If the deviation is >maxDeviation, the efficiency is set to 1 +- 5%

-ignoreBins "<var1>-<var2>:<bin1var1>-<bin1var2>,<bin2var1>-<bin2var2>,...": Sets which variable bins should be set to 1+-5%; default: P-ETA:1-2,5-1. Given bins are set to 1 +- 5%

In order to set the efficiency to 1+-5% in the first bin of PT-ETA as well as in any bin that has the efficiency error larger than 2%, run:

python TrackCalib/scripts/CreateTrackEffTables.py "2016_25ns" -variables2D "PT-ETA" -vartitles "PT:P_{T} [MeV]" -ignoreBins "PT-ETA:1-1" -maxError 0.02 --Plot

Adding global variables

Note that adding non-standard global variables requires manual changes in Prepare.py.

Standard global variables are:

totCandidates, nTracks, nLongTracks, nTTTracks, nVeloTracks, nPVs, nSPDHits, nVeloClusters, nITClusters, nOTClusters, nTTClusters, nRich1Hits, nRich2Hits, nMuonTracks, matched, Polarity

In case of any doubt contact the authors.

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 2017-11-08 - RenataKopecna1
 
    • 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-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback