Tools and macros for Background estimations:

In this Twiki we describes the tools that can be used to estimates all the backgrounds for the HWW analysis. Usually the inputs are just the latinos flat trees, however some background estimations require to go back to the initial skim files.

WJets estimation

The WJets background estimation consists of two steps. In the first one, the Fake and prompt rates are estimated from special skim files. In the second step, the lepton fake and prompt rate are applied to the tree containing loose-loose selected pairs and the per-event weights are calculated. The final output is a new loose-loose latino tree containing the wjets weight. The integral of the weights for all the event is the estimate of the WJets background.

Estimation of Fake and prompt rate

Muon Fake Rate

The code runs on PROOF on top of IFCA/OVIEDO ntuplas (generated on Latinos skim). There will be several people form IFCA/OVIEDO running this tool, so there will be always someone available to produce it. In case you need to implemented it, the main code, where the muon FR is computed is: MuonFR_HWW.C.

To follow the instructions on how to run it follow the README FILE. Also HERE you will find all the macros needed.

Electron Fake Rate

Muon/Electron Prompt Rate

-- Using T&P framework: The fitter for muons and electrons can be found here and here (contact Clara if doubts)

Production of the loose-loose tree and estimation of the final WJets weights:

The inputs that are required are a latinos tree of loose-loose pairs of leptons and a table of the fake/prompt rates for different bins of eta and pt. The former is obtained running the tree production as described here. In order to produce a loose-loose tree, instead of the default tight-tight one, one has to edit the WWAnalysis/AnalysisStep/test/step3/step3.py file and use "scenario5" for the input muon, electrons and soft muon collections. As defined in the wwMuons_cfi and wwElectrons_cfi, the scenario5 corresponds to the loose selection for both muons and electrons.

Once the loose-loose tree has been obtained from data, the next step is to check out the addWJetsWeights.C macro and edit it. What has to be changed by hand is the binning and the values of fake and prompt rate, which have to correspond to what calculated in the previous section.

After the editing, the macro has to be recompiled and can be executed as

addWJetsWeights("inputLooseLooseFile.root", true)

The second argument specify that the newly calculated weights have to be added to the loose-loose file provided in input. In this case, the input file will be modified. If one wants to run a test, printing out the weights without modifying the file, he/she can just lunch the macro using "false" as the second argument.

The new loose-loose tree with weights can then be used for WJets background estiamation. The sum of all the weights correspond to the expected yield from WJets background. Besides, one can produce the shape of observables as mll, mT, pt1,pt2,etc... for the WJets background just using this new latino tree as any other MC latino trees, except that each event has to be weighted.

In the current implementation, the name of the weight which is added to each entry of the tree is fake2W.

[Alicia] Just an independent code to run on top of the loose-loose file. It gives the result of Wjets for 0-jet and 1-jet bin tables (latex format) at WW level. It will be implemented also the Wjets estimation at different higgs masses. Maybe it would be possible to merge the table output into the Boris code, to be sure we are using the same FR/PR. CODE. README FILE

Closure test on same-sign events and MC

TO BE DOCUMENTED BY ALICIA

Top estimation

WW cross section estimation (Clara's code). After running the LatinosTreeScript.C, you have already all the histograms that allow you to run DataDrivenTopFinal.C. NOTE: for the top estimation the DR between the jet and the soft muon must be set to 0.3! (contact Clara if doubts)

UCSD: Using the tools outlined here: MiscUCSDScripts

python $te -w -P $data -l $lumi -f -i    $s3/mc4mva.txt $c0 --pickle > estimate_0j_$niceLumi.txt
python $te -w -P $data -l $lumi -f -i -1 $s3/mc4mva.txt $c0 --pickle > estimate_1j_$niceLumi.txt

The pickle is nice .. The first time you run the command, run it without pickle. It will store all of the data from the trees in the pickle file. Then, subsequent runnings can be done with the --pickle option and looping over the tree wont be necessary. This is nice when you already have all of the selections, you are just modifying the formulas at the end.

DY to ee/mm estimation

WW cross section estimation (Clara's code). After running the LatinosTreeScript.C, you have already all the histograms that allow you to run DataDrivenDYRescaledSameFlavourAll.C. You can choose the channel you want to study: MuMuChannel, EEChannel or SFChannel ( just mm+ee ). (contact Clara if doubts)

UCSD: Using the tools outlined here: MiscUCSDScripts, only the WW level estimates are currently working:

python $dye -w -f -P $data -l $lumi --pickle-file dyData.ww.0j.$niceLumi.pkl mc4mva.txt $c0 > dyData.ww.0j.$niceLumi.txt
python $dye -w -f -P $data -l $lumi --pickle-file dyData.ww.1j.$niceLumi.pkl mc4mva.txt $c1 > dyData.ww.1j.$niceLumi.txt

The pickle is nice .. The first time you run the command, run it without pickle. It will store all of the data from the trees in the pickle file. Then, subsequent runnings can be done with the --pickle option and looping over the tree wont be necessary. This is nice when you already have all of the selections, you are just modifying the formulas at the end.

DY to tau-tau estimation

Explanation of the method and first results:

presentation

The DY to tautau background estimation consists of taking DY to mumu events, replace each muon with a tau (MC), make tau decay and analyze the resultsas if it was a normal event. This embedding procedure has been performed with PF candidates.

The final output is a new latino tree containing the dytautau weight (mctruth).

WW estimation

TO BE FILLED IN

-- AndreaMassironi - 18 Dec 2013


This topic: Main > TWikiUsers > AndreaMassironi > LatinosTwiki > LatinosTools4BkgEstimations
Topic revision: r1 - 2013-12-18 - AndreaMassironi
 
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