34
utorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II. Event Selection 1) Selection algorithm 2) Truth selection algorithm 3) Reconstruction tools 4) Event bookkeeping III. Event Dumping 1) dAOD making 2) Ntuple dumping

Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

Embed Size (px)

Citation preview

Page 1: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

Tutorial TopReco 26-FEB-2010

Event Selection… …and Event Dumping

A. Lleres, A. Lucotte

IN2P3-LPSC Grenoble

A. Lucotte / LPSC, CNRS/IN2P3

I. Context

II. Event Selection 1) Selection algorithm 2) Truth selection algorithm 3) Reconstruction tools 4) Event bookkeeping

III. Event Dumping 1) dAOD making 2) Ntuple dumping

Page 2: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

2Tutorial TopReco 26-FEB-2010

Event Selection in the full chain

Step 1: AOD Step 1: AOD dAOD : Object selection dAOD : Object selection

- Minimum event/object filtering

- dAOD contains one or several TopInputs containersTopInputs containers with all selected objects- It is the starting input to all top analyses (top pair, single-top,properties..)

Step 2: Event SelectionStep 2: Event Selection - Start from (default or new) TopInputs containerTopInputs container objects- Apply Overlap removal, re-compute mET - Filter events and produce selected TopEvents containers TopEvents containers - Produce Book keeping information - Reconstruct Composite objects - Compute final-states-dependent global variables, derived variables

Step 3: Event Dump and AnalysisStep 3: Event Dump and Analysis

- Dump selected TopEvents containersTopEvents containers into POOL files (D2PD)

- Dump selected TopEvents containersTopEvents containers into ROOT files (Ntuples)

- Transmit BookKeeping information into dumped files

Page 3: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

3Tutorial TopReco 26-FEB-2010

Event Selection in the full chain

Step 1: AOD Step 1: AOD dAOD : Object selection dAOD : Object selection

- Minimum event/object filtering

- dAOD contains one or several TopInputs containersTopInputs containers with all selected objects- It is the starting input to all top analyses (top pair, single-top,properties..)

Step 2: Event SelectionStep 2: Event Selection - Start from (default or new) TopInputs containerTopInputs container object- Apply Overlap removal, re-compute mET - Filter events and produce selected TopEvents containers TopEvents containers - Produce Book keeping information - Reconstruct Composite objects - Compute final states dependent global variables, derived variables

Step 3: Event Dump and AnalysisStep 3: Event Dump and Analysis

- Dump selected TopEvents containersTopEvents containers into POOL files (D2PD)

- Dump selected TopEvents containersTopEvents containers into ROOT files (Ntuples)

- Transmit BookKeeping information into dumped files

Central production

by the top group

centrally organized

by the subgroup

Central production

organized by the

subgroup / group

Page 4: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

4Tutorial TopReco 26-FEB-2010

Event Selection with TopInputAlgs…

Page 5: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

5Tutorial TopReco 26-FEB-2010

Event Selection

Event SelectionEvent Selection

Event selection can be performed with two independent packages that provides the user with generic tools to select event and reconstruct composite objects (W, Z, top quark…) :

TopCommissioning :TopCommissioning : Reconstruction/Top/TopCommissioning

TopInputsAlgsTopInputsAlgs : : Reconstruction/Top/TopInputsAlgs

TopEventSelectorTopEventSelector

see JR & Dustin

I will focus on this one

TopInputAlgsTopInputAlgs

TopEventBookKeepingToolTopEventBookKeepingTool

Page 6: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

6Tutorial TopReco 26-FEB-2010

Event Selection

Event SelectionEvent Selection

Event selection can be performed with two independent packages that provides the user with generic tools to select event and reconstruct composite objects (W, Z, top quark…) :

TopCommissioning :TopCommissioning : Reconstruction/Top/TopCommissioning

TopInputsAlgsTopInputsAlgs : : Reconstruction/Top/TopInputsAlgs

Event Selection with TopInputAlgsEvent Selection with TopInputAlgs

Event selection is done with TopEventSelectorsTopEventSelectors and TopEventBookKeepingToolTopEventBookKeepingTool

Input : TopInputs containerTopInputs container

Output: TopEvents containersTopEvents containers

BookKeeping containersBookKeeping containers

TopInputsAlgsTopInputsAlgs makes use of 3 main types of algorithms:

1) Selection algorithms : TopEventSelectionToolsTopEventSelectionTools

2) Truth Selection algorithms : TopTruthEventSelectionToolsTopTruthEventSelectionTools

3) Reconstruction/selection tools of composite : TopEventSelectionToolsTopEventSelectionTools

see JR & Dustin

I will focus on this one

Page 7: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

7Tutorial TopReco 26-FEB-2010

Selection algorithms

Event Selection Event Selection a) Event selection is done with TopInputsAlgsTopInputsAlgs

Input : TopInputs containerTopInputs container (centrally produced)

Output : TopOutput container AND BookKeepingTopOutput container AND BookKeeping

b) Event selection applies an overlap removal scheme

Overlap Flagging is defined on TopInputs objectsTopInputs objects

Overlap Removal is actually applied by the Event selector

e-jets overlap removal, -jet overlap removal (on request)

re-computation of global variables, mET (..)

c) Event selection can be organized in orthogonal selections

Lepton streams : electron vs muon selections, di-electron vs di- vs e-

Jet streams : 2-3 jets events vs ≥4 jets events etc…

d) Selection available for following final states TopEventSelectionToolsTopEventSelectionTools

Type #1 : TopPairSemiLeptonicSelector TopPairSemiLeptonicSelector

Type #2 : TopPairDiLeptonicSelectorTopPairDiLeptonicSelector

Type #3 : TopPairLeptonTrackSelectorTopPairLeptonTrackSelector

Type #4 : SingleTopLeptonicSelectorSingleTopLeptonicSelector

Page 8: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

8Tutorial TopReco 26-FEB-2010

Selection algorithms : SingleTopLeptonic

SingleTopLeptonicSelection.TopInputsName = "TopInputs"SingleTopLeptonicSelection.ElectronJetsContainerName = "SgTopElectronJetsCandidates"SingleTopLeptonicSelection.MuonJetsContainerName = "SgTopMuonJetsCandidates" SingleTopLeptonicSelection.ElectronTaggedJetsContainerName = "SgTopElectronBJetsCandidates"SingleTopLeptonicSelection.MuonTaggedJetsContainerName = "SgTopMuonBJetsCandidates"

SingleTopLeptonicSelection.ApplyLeptonVeto = FalseSingleTopLeptonicSelection.ApplyTaggedJetVeto = FalseSingleTopLeptonicSelection.RemoveMuonJetOverlaps = True

SingleTopLeptonicSelection.SingleTopLeptonicSelectionTool.MissingEtMin = 20.0*GeVSingleTopLeptonicSelection.SingleTopLeptonicSelectionTool.MissingEtMax = 1000000.0*GeVSingleTopLeptonicSelection.SingleTopLeptonicSelectionTool.JetNumberMin = 2SingleTopLeptonicSelection.SingleTopLeptonicSelectionTool.JetNumberMax = 4SingleTopLeptonicSelection.SingleTopLeptonicSelectionTool.TaggedJetNumberMin = 0 SingleTopLeptonicSelection.SingleTopLeptonicSelectionTool.TaggedJetNumberMax = 1000SingleTopLeptonicSelection.SingleTopLeptonicSelectionTool.ApplyTriggerDecision = TrueSingleTopLeptonicSelection.SingleTopLeptonicSelectionTool.ElectronChainName = "EF_e15_medium"SingleTopLeptonicSelection.SingleTopLeptonicSelectionTool.MuonChainName = "EF_mu15"

Type #4 : SingleTopLeptonicSelectorSingleTopLeptonicSelector / topology selection

select input object Container

define output containers

apply 2nd lepton veto

Apply -jet overlap

Apply event selection

…including trigger Selection chains

apply jet -veto

Page 9: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

9Tutorial TopReco 26-FEB-2010

Selection algorithms : SingleTopLeptonic

# Electron selection and vetoSingleTopLeptonicSelection.TopElectronSelectionTool.ApplyPtCut = TrueSingleTopLeptonicSelection.TopElectronSelectionTool.PtMin = 20.0*GeV SingleTopLeptonicSelection.TopElectronSelectionTool.EmMask = "Tight“

SingleTopLeptonicSelection.TopVetoElectronSelectionTool.ApplyPtCut = TrueSingleTopLeptonicSelection.TopVetoElectronSelectionTool.PtMin = 10.0*GeVSingleTopLeptonicSelection.TopVetoElectronSelectionTool.PtMax = 20.0*GeVSingleTopLeptonicSelection.TopVetoElectronSelectionTool.EmMask = "Medium"

# Muon selection and vetoSingleTopLeptonicSelection.TopMuonSelectionTool.ApplyPtCut = TrueSingleTopLeptonicSelection.TopMuonSelectionTool.PtMin = 20.0*GeV

SingleTopLeptonicSelection.TopVetoMuonSelectionTool.ApplyPtCut = TrueSingleTopLeptonicSelection.TopVetoMuonSelectionTool.PtMin = 10.0*GeVSingleTopLeptonicSelection.TopVetoMuonSelectionTool.PtMax = 20.0*GeV

Type #4 : SingleTopLeptonicSelectorSingleTopLeptonicSelector / Lepton selection

define electron selection

define electron-veto parameters

define muon-veto parameters

define muon selection

Page 10: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

10Tutorial TopReco 26-FEB-2010

Selection algorithms : SingleTopLeptonic

# jet selectionSingleTopLeptonicSelection.TopJetSelectionTool.ApplyPtCut = TrueSingleTopLeptonicSelection.TopJetSelectionTool.ApplyEtaCut = TrueSingleTopLeptonicSelection.TopJetSelectionTool.PtMin = 30.0*GeV SingleTopLeptonicSelection.TopJetSelectionTool.EtaMax = 5.0

# Tagged Jet selectionSingleTopLeptonicSelection.TopTaggedJetSelectionTool.ApplyPtCut = TrueSingleTopLeptonicSelection.TopTaggedJetSelectionTool.ApplyEtaCut = TrueSingleTopLeptonicSelection.TopTaggedJetSelectionTool.PtMin = 30.0*GeV SingleTopLeptonicSelection.TopTaggedJetSelectionTool.EtaMax = 2.5SingleTopLeptonicSelection.TopTaggedJetSelectionTool.TaggingAlgorithm = [“SV0"]SingleTopLeptonicSelection.TopTaggedJetSelectionTool.TaggingWeightCut = [5.68]

# Tagged jet vetoSingleTopLeptonicSelection.TopVetoTaggedJetSelectionTool.ApplyPtCut = TrueSingleTopLeptonicSelection.TopVetoTaggedJetSelectionTool.ApplyEtaCut = TrueSingleTopLeptonicSelection.TopVetoTaggedJetSelectionTool.PtMin = 30.0*GeV SingleTopLeptonicSelection.TopVetoTaggedJetSelectionTool.EtaMax = 2.5SingleTopLeptonicSelection.TopVetoTaggedJetSelectionTool.TaggingAlgorithm = [“SV0"]SingleTopLeptonicSelection.TopVetoTaggedJetSelectionTool.TaggingWeightCut = [4.20]

Type #4 : SingleTopLeptonicSelectorSingleTopLeptonicSelector / Jet selection

define (all) jet selection

define tagged-jet selection:- choice for tagger- setup b-tag weight cut

define tagged-jet veto - choice for tagger- setup specific weight cut (looser usually)

Page 11: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

11Tutorial TopReco 26-FEB-2010

Selection algorithms : TopPairDileptonic

TopPairDiLeptonicSelection.TopInputsName = "TopInputs"TopPairDiLeptonicSelection.DiElectronsJetsContainerName = "TTbarDiElectronsJetsCandidates"TopPairDiLeptonicSelection.DiMuonsJetsContainerName = "TTbarDiMuonsJetsCandidates" TopPairDiLeptonicSelection.ElectronMuonJetsContainerName = "TTbarElectronMuonJetsCandidates"

TopPairDiLeptonicSelection.ApplyLeptonVeto = FalseTopPairDiLeptonicSelection.RemoveMuonJetOverlaps = TrueTopPairDiLeptonicSelection.CheckTaggedJets = False

TopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.EEMuMuMissingEtMin = 35.0*GeVTopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.EMuMissingEtMin = 20.0*GeVTopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.JetNumberMin = 2 TopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.TaggedJetNumberMin = 0TopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.CheckNeutralCharge = TrueTopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.ApplyZMassVeto = FalseTopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.ApplyZMassCut = FalseTopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.ZMassMin = 86.0*GeVTopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.ZMassMax = 96.0*GeVTopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.ApplyTriggerDecision = TrueTopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.ElectronChainName = "EF_e15_medium"TopPairDiLeptonicSelection.TopPairDiLeptonicSelectionTool.MuonChainName = "EF_mu15"

Type #2 : TopPairDiLeptonicSelectorTopPairDiLeptonicSelector / Topology selection

select input Container

define output containers

no 2nd lepton veto

Apply -jet overlap

Apply event selection

…including trigger Selection chains

Page 12: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

12Tutorial TopReco 26-FEB-2010

Selection algorithms : TopPairDileptonic

TopPairDiLeptonicSelection.TopLeadingElectronSelectionTool.ApplyPtCut = True TopPairDiLeptonicSelection.TopLeadingElectronSelectionTool.PtMin = 20.0*GeV TopPairDiLeptonicSelection.TopLeadingElectronSelectionTool.EmMask = "Medium"

TopPairDiLeptonicSelection.TopSecondElectronSelectionTool.ApplyPtCut = True TopPairDiLeptonicSelection.TopSecondElectronSelectionTool.PtMin = 20.0*GeV TopPairDiLeptonicSelection.TopSecondElectronSelectionTool.EmMask = "Medium"

TopPairDiLeptonicSelection.TopLeadingMuonSelectionTool.ApplyPtCut = True TopPairDiLeptonicSelection.TopLeadingMuonSelectionTool.PtMin = 20.0*GeV

TopPairDiLeptonicSelection.TopSecondMuonSelectionTool.ApplyPtCut = True TopPairDiLeptonicSelection.TopSecondMuonSelectionTool.PtMin = 20.0*GeV

TopPairDiLeptonicSelection.TopVetoElectronSelectionTool.ApplyPtCut = True TopPairDiLeptonicSelection.TopVetoElectronSelectionTool.PtMin = 20.0*GeV TopPairDiLeptonicSelection.TopVetoElectronSelectionTool.EmMask = "Medium"

TopPairDiLeptonicSelection.TopVetoMuonSelectionTool.ApplyPtCut = True

TopPairDiLeptonicSelection.TopVetoMuonSelectionTool.PtMin = 20.0*GeV

Type #2 : TopPairDiLeptonicSelectorTopPairDiLeptonicSelector / Lepton selection

define leading electron selection

define 2nd electron selection

define 2nd muon selection

define leading muon selection

define electron-vetoparameter

define muon-vetoparameter

Page 13: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

13Tutorial TopReco 26-FEB-2010

Reconstruction of top, W, Z with TopInputAlgs…

Page 14: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

14Tutorial TopReco 26-FEB-2010

Reconstruction tools & Algorithms

Central tools to reconstruct composite particles in TopInputAlgsCentral tools to reconstruct composite particles in TopInputAlgs

Goal : provide the users in the top group with validated/benchmarked recon objects

Input : both TopInputsTopInputs and/or TopEvents containersTopEvents containers

Output : CompositeParticle container, UserData container, CompositeParticle container, UserData container, newnew TopEvent container TopEvent container

Reconstruction tools of composites and their selection are available in the following cases:

-- resonances from leptons (Zll, Wlv) or jets (Wjj)

-- top quarks decaying leptonically (tblv) or hadronically (tbjj),

…in different analysis contexts : l+jets, dilepton, top pair, single-top analyses..

Reconstruction is based upon the use of :

-- Tools to reconstruct objects

-- Selection algorithms that calls & combine the tools

Page 15: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

15Tutorial TopReco 26-FEB-2010

Reconstruction of W/Z, top : the tools

HadronicWSelectionToolHadronicWSelectionTool

return all jj combinations or one jj combination according to R, pT(jj)

LeptonicWSelectionTool LeptonicWSelectionTool

Use Mass constraint; return combination according to neutrino Min(Pz), Min()

Option if no solution is found:

-- “None” : no approximation made. Event is rejected

-- “NullDelta” : returns the neutrino by imposing a null discriminator

-- “ScalingMissingEt” : rescale mET until a solution is found

-- “SameEta” : returns the neutrino candidate with the same eta than lepton

-- “Colinear” : returns the neutrino with the same Pz than the lepton

HadronicTopSelectionToolHadronicTopSelectionTool

-- returns a jjj combination according to R(jjj), highest pT(jjj) or Mass(jjj)

HadronicWbSelectionToolHadronicWbSelectionTool

-- returns W(jj)j combination vs R(Wj), M(Wj), highest Pt(Wj)

LeptonicTopSelectionToolLeptonicTopSelectionTool

-- returns the best combination vs HighestPtJet, Highest pT(Wb), R(Wb), (Wb), M(Wb)

Page 16: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

16Tutorial TopReco 26-FEB-2010

Reconstruction of W/Z,top : the algorithms

Composite objects available in TopInputAlgsComposite objects available in TopInputAlgs

The algorithms already available in TopInputsAlgs are:

-- TopPairSemiLeptonicTopSelector-- TopPairSemiLeptonicTopSelector

reconstruct only the hadronic top in the “lepton + jets” channel

-- TopPairSemiLeptonicDiTopsSelector-- TopPairSemiLeptonicDiTopsSelector

reconstruct both the hadronic top quark and the leptonic top quark in the “lepton+jet”

-- SingleTopLeptonicCalculator-- SingleTopLeptonicCalculator

reconstruct both the leptonic top quark in the “l+jets” single-top (preselected) channel

-- PairCompositeSelector-- PairCompositeSelector

reconstruct Zll, Wjj, Zjj …

Page 17: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

17Tutorial TopReco 26-FEB-2010

Reconstruction of W/Z,top : examples

# instantiationSemiLeptonicTopSelection = TopPairSemiLeptonicTopSelector("SemiLeptonicTopSelection")SemiLeptonicTopSelection.OutputLevel = INFOSequence += SemiLeptonicTopSelection

# input/outputSemiLeptonicTopSelection.ElectronJetsContainerName = "TTbarElectronJetsCandidates"SemiLeptonicTopSelection.MuonJetsContainerName = "TTbarMuonJetsCandidates"SemiLeptonicTopSelection.ElectronJetsTopContainerName = "TTbarElectronJetsTopCandidates"SemiLeptonicTopSelection.MuonJetsTopContainerName = "TTbarMuonJetsTopCandidates"

# set option for hadronic top reconstructionSemiLeptonicTopSelection.ReconstructionOption = "TopFirst“ or “WFirst”

instantiate the tool andadd it to the sequence

define input/output containers

Options: - “TopFirst”:reco all 3j combinations - “Wfirst” reco Wjj first and then form t Wb

TopPairSemiLeptonicTopSelector : tt(bjj) lvb

Page 18: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

18Tutorial TopReco 26-FEB-2010

Reconstruction of W/Z,top : examples

# set option for hadronic top reconstructionSemiLeptonicTopSelection.ReconstructionOption = "TopFirst"

SemiLeptonicTopSelection.HadronicTopSelectionTool.Algorithm = "HighestPt"SemiLeptonicTopSelection.HadronicTopSelectionTool.TopMass = 175.0*GeVSemiLeptonicTopSelection.HadronicTopSelectionTool.ApplyWMassCut = FalseSemiLeptonicTopSelection.HadronicTopSelectionTool.WMassMin = 70.4*GeVSemiLeptonicTopSelection.HadronicTopSelectionTool.WMassMax = 90.4*GeVSemiLeptonicTopSelection.HadronicTopSelectionTool.ApplyTopMassCut = FalseSemiLeptonicTopSelection.HadronicTopSelectionTool.TopMassMin = 160.0*GeVSemiLeptonicTopSelection.HadronicTopSelectionTool.TopMassMax = 190.0*GeV

TopPairSemiLeptonicTopSelector : tt(bjj) lvb

Options: “TopFirst”

Choice for the tjjj selection :- “HighestPt” (comb w/ highest pt)- “ClosestMass” (mt)- “ClosestDeltaR”

Page 19: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

19Tutorial TopReco 26-FEB-2010

Reconstruction of W/Z,top : examples

# set option for hadronic top reconstructionSemiLeptonicTopSelection.ReconstructionOption = "WFirst"

SemiLeptonicTopSelection.HadronicWSelectionTool.Algorithm = "ClosestMass"SemiLeptonicTopSelection.HadronicWSelectionTool.Mass = 80.4*GeVSemiLeptonicTopSelection.HadronicWSelectionTool.ApplyMassCut = FalseSemiLeptonicTopSelection.HadronicWSelectionTool.MassMin = 70.4*GeVSemiLeptonicTopSelection.HadronicWSelectionTool.MassMax = 90.4*GeV SemiLeptonicTopSelection.HadronicWbSelectionTool.Algorithm = "HighestPtJet"SemiLeptonicTopSelection.HadronicWbSelectionTool.ApplyTopMassCut = FalseSemiLeptonicTopSelection.HadronicWbSelectionTool.TopMassMin = 149.0*GeVSemiLeptonicTopSelection.HadronicWbSelectionTool.TopMassMax = 189.0*GeV

TopPairSemiLeptonicTopSelector : tt(bjj) lvb

Options: “WFirst”

Choice for the Wjj selection:- “ClosestMass”- “ClosestDeltaR”

Page 20: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

20Tutorial TopReco 26-FEB-2010

Reconstruction of W/Z,top : examples

# set option for hadronic top reconstructionSemiLeptonicTopSelection.ReconstructionOption = "WFirst"

SemiLeptonicTopSelection.HadronicWSelectionTool.Algorithm = "ClosestMass"SemiLeptonicTopSelection.HadronicWSelectionTool.Mass = 80.4*GeVSemiLeptonicTopSelection.HadronicWSelectionTool.ApplyMassCut = FalseSemiLeptonicTopSelection.HadronicWSelectionTool.MassMin = 70.4*GeVSemiLeptonicTopSelection.HadronicWSelectionTool.MassMax = 90.4*GeV SemiLeptonicTopSelection.HadronicWbSelectionTool.Algorithm = "HighestPtJet"SemiLeptonicTopSelection.HadronicWbSelectionTool.ApplyTopMassCut = FalseSemiLeptonicTopSelection.HadronicWbSelectionTool.TopMassMin = 149.0*GeVSemiLeptonicTopSelection.HadronicWbSelectionTool.TopMassMax = 189.0*GeV

TopPairSemiLeptonicTopSelector : tt(bjj) lvb

Options: “TopFirst” or “Wfirst”

Choice for the Wb selection:- “ClosestMassWb”- “ClosestDeltaRWb”- “ClosestDeltaPhiWb”- “HighestPtJet”- “HighestPtWb”

Page 21: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

21Tutorial TopReco 26-FEB-2010

Event BookKeeping : how it works…

1) Generation of Bookkeeping information

Any event selection algorithm:

-- generates a decision flag (boolean)

associated to the Selection algorithm class (=FilterPassed parameter)

this flag is also recorded into a SkimDecision containerSkimDecision container

-- generates an event-mask reflecting the cut-flow selection

every individual cut is assigned to a bit of an unsigned int word

this word can be recorded in a dedicated UserData containerUserData container

2) Management of the recorded selection flags & event-masks

Makes use of 3 generic algorithms:

-- AlgorithmDecisionWriterAlgorithmDecisionWriter

record decision flag (FilterPassedFilterPassed) in the SkimDecision containerSkimDecision container

-- AlgorithmDecisionCombinedFilterAlgorithmDecisionCombinedFilter

can generate new decision flags from a combination of several flags

-- SkimDecisionCombinedFilterSkimDecisionCombinedFilter

can generate a new decision flag from the combination of several SkimDecision

flags, and can be added to the SkimDecision containerSkimDecision container

Page 22: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

22Tutorial TopReco 26-FEB-2010

Event BookKeeping : how it works…

3) Combination/Counting & dump of Bookkeeping information

Any event selection decision-flag and event-mask must be counted

and then stored in an EventBookkeeper container EventBookkeeper container (for dAOD dump)(for dAOD dump)

or in histograms or in histograms (for D3PD dump)(for D3PD dump)

Several algorithms are used for this:

-- AlgorithmBookKeepingWriter (-- AlgorithmBookKeepingWriter ( dAOD) dAOD)

uses the (FilterPassed) flag associated to the selection algoritm

-- SkimDecisionBookkeepingWriter (-- SkimDecisionBookkeepingWriter ( dAOD) dAOD)

uses the flags stored in the SkimDecision containerSkimDecision container

-- EventMaskBookkeepingWriter (-- EventMaskBookkeepingWriter ( dAOD) dAOD)

uses the event masks stored in a UserData containerUserData container

-- EventBookKeepingMaker (-- EventBookKeepingMaker ( Ntuple) Ntuple)

reads SkimDecsion and produces Histograms (1 per flag)

-- EventMaskBookKeepingMaker (-- EventMaskBookKeepingMaker ( Ntuple) Ntuple)

reads the event mask and produces Histograms (bins = selection criteria)

see example in

dAOD and Ntuple Dumping

Page 23: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

23Tutorial TopReco 26-FEB-2010

Event Dumping…

Page 24: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

24Tutorial TopReco 26-FEB-2010

Event Dumping into a POOL format (1)

from OutputStreamAthenaPool.MultipleStreamManager import MSMgr

TopOutputsStream = MSMgr.NewPoolStream("TopOutputsStream", "TopOutputs.pool.root") RecordedContainers = ["MissingET#MET_RefFinal", "ElectronContainer#ElectronAODCollection", "Analysis::MuonContainer#StacoMuonCollection", "JetCollection#Cone4H1TowerJets", "Rec::TrackParticleContainer#TrackParticleCandidate", "egDetailContainer#egDetailAOD", "TopRec::TTbarEJContainer#*“, "TopRec::TTbarMuJContainer#*", "TopRec::TTbarEJMetContainer#*“ , "TopRec::TTbarMuJMetContainer#*", "TopRec::TTbarEJTopContainer#*", "TopRec::TTbarMuJTopContainer#*", "TopRec::TTbarEJDiTopsContainer#*“, "TopRec::TTbarMuJDiTopsContainer#*", "TopRec::TTbarEEJetsContainer#*“ , "TopRec::TTbarMuMuJetsContainer#*", "TopRec::TTbarEMuJetsContainer#*", "CompositeParticleContainer#*", "SkimDecisionCollection#*"]

1) instantiate TopOutputStream

and set the name of pool file

2) define RecordedContainers=[]

enter the list of containers

(per event) to be recorded in

the D2PD for all selected events

(see next slide)

note) electron and muon

containers being orthogonal,

there will always be empty

containers !

Page 25: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

25Tutorial TopReco 26-FEB-2010

Event Dumping into a POOL format (2)

# Define the Accept for event selection AcceptedAlgorithms = ["TopPairSemiLeptonicSelection", "TopPairDiLeptonicSelection", "SingleTopLeptonicSelection"]

TopOutputsStream.AcceptAlgs(AcceptedAlgorithms)

TopOutputsStream.AddItem(RecordedContainers)

3) In order to define the filter we want to apply to

all events (for which we want to generate the list

of containers) we have to specify the list of algorithms

i.e. event selections in:

TopOutputsStream.AcceptAlgs(AcceptedAlgorithms)

3) a. First way:

enter the list of event

selection algorithms

4) define the Accept algorithms

via TopOutStream.AcceptAlgs

5) Add this selection to the

TopOutStream

Page 26: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

26Tutorial TopReco 26-FEB-2010

Event Dumping into a POOL format (3)

TopCombinedSelection = SkimDecisionCombinedFilter("TopCombinedSelection")TopCombinedSelection.OutputLevel = INFOSequence += TopCombinedSelection

TopCombinedSelection.SkimDecisionContainerName = "TopDecisions"TopCombinedSelection.OutputSkimDecisionLabel = "TopLeptonJets"

TopCombinedSelection.AcceptedSkimDecisionLabel = ["TTbarElectronJets","TTbarMuonJets",

"TTbarDiElectronsJets","TTbarDiMuonsJets", "TTbarElectronMuonJets", "SgTopElectronJets","SgTopMuonJets"]

AcceptedAlgorithms = ["TopCombinedSelection"]TopOutputsStream.AcceptAlgs(AcceptedAlgorithms)

TopOutputsStream.AddItem(RecordedContainers)

3) In order to define the filter we want to apply to

all events (for which we want to generate the list

of containers) we have to specify the list of algorithms

i.e. event selections in:

TopOutputsStream.AcceptAlgs(AcceptedAlgorithms)

3) b. Second way:

use the SkimDecision container

(which stores all selection flags)

& define the decision flags

associated to each selection

and include them in the list

4) define the Accept algorithms

via TopOutStream.AcceptAlgs

5) Add this selection to the

TopOutStreamused for the Ntuple

Filtering !!

Page 27: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

27Tutorial TopReco 26-FEB-2010

Event Dumping into Ntuples

This Event Dumping is provided by SingleTopDPDDumper SingleTopDPDDumper

(name is for historical reason -- tested first for single-top)

It requires:

1) Setup of Athena/Root THistSvc

2) Define the list of the TopEvents containers to be dumped into Tree

3) Filter and transfer of the book keeping information into the

Ntuples (efficiency calculation etc…)

Page 28: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

28Tutorial TopReco 26-FEB-2010

Event Dumping into Ntuples

from GaudiSvc.GaudiSvcConf import THistSvc

ServiceMgr += THistSvc()ServiceMgr.THistSvc.Output = ["TopOutputsStream DATAFILE='TopOutputs.root' OPT='recreate'"]ServiceMgr.THistSvc.OutputLevel = FATAL

ServiceMgr.THistSvc.Output += ["SingleTopOutputsStream DATAFILE='SingleTopOutputs.root' OPT='recreate'"]

1) Initialization & declaration of THistSvc

instantiate, provide names, save as many output file as you want :

- all Trees in one file

- some specific Trees in a separate files – QCD-enriched for e.g.

This latter option allows you to choose to run an analysis on

specific samples (background, signal enriched, control sample…)

1) Initialization

Page 29: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

29Tutorial TopReco 26-FEB-2010

Event Dumping into Ntuples

TopLeptonJetsTree = TopLeptonJetsDumper("TopLeptonJetsTree")TopLeptonJetsTree.OutputLevel = INFOSequence += TopLeptonJetsTree

TopLeptonJetsTree.RootName = "TopOutputsStream"TopLeptonJetsTree.TreeName = "TopLeptonJetsTree"

TopLeptonJetsTree.ElectronJetsContainerName = ["TTbarElectronJetsCandidates"]TopLeptonJetsTree.ElectronJetsContainerLabel = ["TTbarEJets"]

TopLeptonJetsTree.MuonJetsContainerName = ["TTbarMuonJetsCandidates"]TopLeptonJetsTree.MuonJetsContainerLabel = ["TTbarMuJets"]

TopLeptonJetsTree.MuonJetsMetContainerName = ["SgTopMuonJetsCandidates"]TopLeptonJetsTree.MuonJetsMetContainerLabel = ["SgTopMuJets"]

TopLeptonJetsTree.JetsContainerName = ["SgTopElectronBJetsCandidates","SgTopMuonBJetsCandidates"]TopLeptonJetsTree.JetsContainerLabel = ["SgTopEJets_BJets","SgTopMuJets_BJets"]

TopLeptonJetsTree.ElectronDumpTool.Options = ["FourMom","ChargeId","EtCone","Author","PIDCuts","PID"]TopLeptonJetsTree.MuonDumpTool.Options = ["FourMom","ChargeId","Author","Chi2", "EtCone","PtCone"]TopLeptonJetsTree.JetDumpTool.Options = ["FourMom","ChargeId","TagWeight","TruthInfo"]

2) define the list of containers to be dumped into the Ntuple

2) a. set the output

stream and Tree names

2) b. set the name of the

containers

2) c. set the name of

variable blocks to be

written

Page 30: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

30Tutorial TopReco 26-FEB-2010

Event Dumping into Ntuples

SkimDecisionTree = SkimDecisionDumper("SkimDecisionTree")SkimDecisionTree.OutputLevel = INFOSequence += SkimDecisionTree

SkimDecisionTree.RootName = "TopOutputsStream"SkimDecisionTree.TreeName = "DecisionTree"

SkimDecisionTree.SkimDecisionContainerName = ["TopDecisions"]

3) Filtering and bookkeeping information

3) a. create a Decision Tree which will

contains all decisions flags stored in

SkimDecision container

TreeFilling = TreeFiller("TreeFilling")

TreeFilling.OutputLevel = INFO

Sequence += TreeFilling

TreeFilling.SkimDecisionContainerName = ["TopDecisions"]

TreeFilling.SkimDecisionLabel = ["TopLeptonicEvent"]

TreeFilling.RootName = ["TopOutputsStream"]

3) b. set the name of the output stream

and root tree

3) c. The “magic command” to fill up

and filter the trees

Page 31: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

31Tutorial TopReco 26-FEB-2010

Event Dumping into Ntuples

SkimDecisionTree = SkimDecisionDumper("SkimDecisionTree")SkimDecisionTree.OutputLevel = INFOSequence += SkimDecisionTree

SkimDecisionTree.RootName = "TopOutputsStream"SkimDecisionTree.TreeName = "DecisionTree"

SkimDecisionTree.SkimDecisionContainerName = ["TopDecisions"]

3) Filtering and bookkeeping information

3) a. create a Decision Tree which will

contains all decisions flags stored in

SkimDecision container

TreeFilling = TreeFiller("TreeFilling")

TreeFilling.OutputLevel = INFO

Sequence += TreeFilling

TreeFilling.SkimDecisionContainerName = ["TopDecisions"]

TreeFilling.SkimDecisionLabel = ["TopLeptonicEvent"]

TreeFilling.RootName = ["TopOutputsStream"]

3) b. set the name of the output stream

and root tree

3) c. The “magic command” to fill up

and filter the trees

important note: only selected

events are stored in ntuple, i.e.

the ORing of all selections used

Page 32: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

32Tutorial TopReco 26-FEB-2010

Example: SingleTop Ntuple architecture

Electron Selection:Electron Selection:SgTopElectronJetsTagTree

SgTopElectronJetsPreTagTree

SgTopElectronJetsMedium

SgTopElectronJetsMediumFakeTree

SgTopElectronJetsTTbarBkgTree

ZDiElectronsTree

TTbarElectronJetsTree

TTbarDiElectronsJetsTree

Muon SelectionMuon Selection:

SgTopMuonJetsPreTagsTree

SgTopMuonJetsTagTree

SgTopMuonJetsMedium

SgTopMuonJetsMediumFakeTree

SgTopElectronJetsTTbarBkgTree

ZDiMuonsTree

TTbarMuonJetsTree

TTbarDiMuonsJetsTree

Single-Top “default” : from the selection…to the Tree

ElectronPreTag and MuonPreTag selections

(no btag preselected samples):

-- at least one tight lepton (e,muon) above 20 GeV

-- no other lepton above 20 GeV

-- at least 2 jets above 30 GeV with

-- at most 3 jets above 30 GeV with

-- transverse missing energy mET > 20 GeV

dielectron and dimuon selections (control samples):

-- at least one 'tight' lepton and one 'medium' lepton

of opposite signs above 20 GeV

-- no other lepton 'medium' above 20 GeV

-- Mass window cut or no

Page 33: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

33Tutorial TopReco 26-FEB-2010

SingleTop Ntuple Architecture

DecisionTree :

BookKeeping :

TopInputsTree

TriggerTree

TruthTree

TruthDecisionTree

TruthBookKeeping

Single-Top “default” trees for selected events

DecisionTree : tree for all events, contains a flag per

selection

BookKeeping : histograms displaying the number of

events selected for each selection

TopInput : needed at the begining / to be used for

optimization of the selection. Filtered by the OR of

all selections

Trigger Tree: contains all trigger flags

Page 34: Tutorial TopReco 26-FEB-2010 Event Selection… …and Event Dumping A. Lleres, A. Lucotte IN2P3-LPSC Grenoble A. Lucotte / LPSC, CNRS/IN2P3 I. Context II

34Tutorial TopReco 26-FEB-2010

Conclusion

Now to the practical part : see Annick and Dustin…