Use of the AT Gene f h T G eric Matching in PAT M h P T Roger - - PowerPoint PPT Presentation

use of the at gene f h t g eric matching in pat m h p t
SMART_READER_LITE
LIVE PREVIEW

Use of the AT Gene f h T G eric Matching in PAT M h P T Roger - - PowerPoint PPT Presentation

Use of the AT Gene f h T G eric Matching in PAT M h P T Roger Wolf Jan V Roger Wolf, Jan V Ve erka Veverka PAT Tutorial Ju une 2010 Object Matching Object Matching What ever Analysis you do you will arrive e at some point where you


slide-1
SLIDE 1

f h T G Use of the AT Gene

Roger Wolf Jan V Roger Wolf, Jan V

PAT Tutorial Ju

M h P T eric Matching in PAT

Ve erka Veverka

une 2010

slide-2
SLIDE 2

Object Matching Object Matching

What ever Analysis you do you will arrive want to match one object to another obje

Matching for tag & probe methods (STA Muon to Glo Matching of calibration truth and calibration measure

Examples:

Matching of calibration truth and calibration measure Matching of trigger objects to reco objects Matching of MC truth vs reco object

e at some point where you ect

  • bal Muon)

ement (Photon to Jet) ement (Photon to Jet)

2 / 14

slide-3
SLIDE 3

Definition Definition

Matching means the association of o collections based on spacial or kinem (generator level – reco level or trigger le Goal is to find the same object in diffe (g gg Note that in the following we we are talk

  • r a one to many relation of the kind:
  • bjects from different

matic similarity. evel – reco level) erent representations ) ing about a one to one

...

(target collection reco::Jet)

...

(match collection gen::Jet)

3 / 14

slide-4
SLIDE 4

Implementations in

In Analysis Tools (AT) we have a very co

Implementations in

In Analysis Tools (AT) we have a very co matching (reco::PhysObjectMatcher)

Five-fold template, which can be expande

  • f matching, distance characterization and

Input Types Match Config.

n Analysis Tools

  • mmon framework for

n Analysis Tools

  • mmon framework for

ed using several methods/classes d object pre-selection.

4 / 14

slide-5
SLIDE 5

Match Configurati

S D and Q can be expanded by the foll

Match Configurati

S, D and Q can be expanded by the foll

  • n

lowing classes:

  • n

lowing classes:

5 / 14

slide-6
SLIDE 6

MCMatcher Config

MC matching in PAT exploits the reco::M

MCMatcher Config

MC matching in PAT exploits the reco::M

guration

MCMacher:

guration

MCMacher:

Special Selection criteria for MC particles for match collection Allow window in DR and Dpt for matching Match by distance in DR.(closest in DR)

6 / 14

slide-7
SLIDE 7

Resolve Ambiguitie Resolve Ambiguitie

The configuration in general consists of The configuration in general consists of

jetPartonMatch = cms.EDFilter("MCMatcher", # cut on src = cms.InputTag("ak5CaloJets"), # RECO o matched = cms.InputTag("genParticles"), # mc-tru mcPdgId = cms.vint32(1, 2, 3, 4, 5, 21), # one or i 32(3) # mcStatus = cms.vint32(3), # PYTHIA checkCharge = cms.bool(False), # False maxDeltaR = cms.double(0.4), # Minimu maxDPtRel = cms.double(3.0), # Minimu resolveAmbiguities = cms.bool(True), # Forbid resolveByMatchQuality = cms.bool(False), # False )

O j C Color Coding: PhysObjectMatcher MatchByDRDPt MCMat

1)to follow the expansion in detail have a look into the links

es? es?

f several parts1): f several parts :

n deltaR, deltaPt/Pt; pick best by deltaR

  • bjects to match

uth particle collection r more PDG ID (quarks except top; gluons) d (3 h d i ) A status code (3 = hard scattering) = any value of the charge of MC and RECO is ok um deltaR for the match um deltaPt/Pt for the match d two RECO objects to match to the same GEN object = just match input in order; True = pick lowest dR pair first

...

(target collection reco::Jet)

...

(target collection reco::Jet) (match collection gen::Jet)

S

...

(match collection gen::Jet)

tchSelector

  • n the indico page

7 / 14

slide-8
SLIDE 8

Configuration Princ Configuration Princ

The configuration in general consists of The configuration in general consists of

jetPartonMatch = cms.EDProducer("MCMatcher", # cut src = cms.InputTag("ak5CaloJets"), # RECO matched = cms.InputTag("genParticles"), # mc-t mcPdgId = cms.vint32(1, 2, 3, 4, 5, 21), # one o i 32(3) # mcStatus = cms.vint32(3), # PYTH checkCharge = cms.bool(False), # Fals maxDeltaR = cms.double(0.4), # Mini maxDPtRel = cms.double(3.0), # Mini resolveAmbiguities = cms.bool(True), # Forb resolveByMatchQuality = cms.bool(False), # Fals ) jetGenJetMatch = cms.EDProducer("GenJetMatcher", # cut src = cms.InputTag("ak5CaloJets"), # RECO matched = cms InputTag("ak5GenJets") # GEN matched = cms.InputTag("ak5GenJets"), # GEN mcPdgId = cms.vint32(), # n/a mcStatus = cms.vint32(), # n/a checkCharge = cms.bool(False), # n/a maxDeltaR = cms.double(0.4), # Mini maxDPtRel = cms.double(3.0), # Mini resolveAmbiguities = cms.bool(True), # Forb resolveByMatchQuality = cms.bool(False), # Fals )

O j C Color Coding: PhysObjectMatcher MatchByDRDPt MCMat

1)to follow the expansion in detail have a look into the links

ciples ciples

f several parts1): f several parts :

  • n deltaR, deltaPt/Pt; pick best by deltaR

O objects to match truth particle collection

  • r more PDG ID (quarks except top; gluons)

d (3 h d i ) HIA status code (3 = hard scattering) se = any value of the charge of MC and RECO is ok imum deltaR for the match imum deltaPt/Pt for the match bid two RECO objects to match to the same GEN object se = just match input in order; True = pick lowest dR pair first

  • n deltaR, deltaPt/Pt; pick best by deltaR

O jets (any View<Jet> is ok) jets (must be GenJetCollection) jets (must be GenJetCollection) imum deltaR for the match imum deltaPt/Pt for the match bid two RECO objects to match to the same GEN object se = just match input in order; True = pick lowest dR pair first

S tchSelector

  • n the indico page

8 / 14

slide-9
SLIDE 9

MC Matching in th MC Matching in th

Associations produced before hand:

Muon production workflow:

Find the muonMatch cfi.py in mcMatchingLayer0

Associations produced before hand:

_ py g y Find the muonProducer_cff.py in producersLayer1

Jet production workflow:

Find the jetMatch_cfi.py in mcMatchingLayer0 Find the jetProducer_cff.py in producersLayer1

he PAT Workflows he PAT Workflows

9 / 14

slide-10
SLIDE 10

Embedding the MC Embedding the MC

Example for Muons (python/producersLay Example for Muons (python/producersLay

patMuons = cms.EDProducer("PATMuonProducer", # input muonSource = cms.InputTag("muons"), # use particle flow instead of std reco useParticleFlow = cms.bool( False ), pfMuonSource = cms.InputTag("pfIsolatedMuons"), # add TeV refit tracks ... # add user data … # embedding objects ... # embed IsoDeposits isoDeposits = cms.PSet(), # user defined isolation variables the variables d # via pat::Muon::userIsolation(IsolationKeys key) # DataFormats/PatCandidates/interface/Isolation.h userIsolation = cms.PSet(), # mc matching addGenMatch = cms.bool(True), embedGenMatch = cms.bool(True), genParticleMatch = cms.InputTag("muonMatch"), ## p # efficiencies # efficiencies addEfficiencies = cms.bool(False), efficiencies = cms.PSet(), # resolution configurables addResolutions = cms.bool(False), resolutions = cms.PSet(), # high level selections b d i h l l i b l( ) embedHighLevelSelection = cms.bool(True), beamLineSrc = cms.InputTag("offlineBea )

C Match C Match

yer1/muonProducer cfi.py): yer1/muonProducer_cfi.py):

, defined here will be accessible with the key as defined in particles source to be used for the matching amSpot")

10 / 14

slide-11
SLIDE 11

Embedding the MC Embedding the MC

Example for Jets (python/producersLayer Example for Jets (python/producersLayer

patJets = cms.EDProducer("PATJetProducer", # input jetSource = cms.InputTag("ak5CaloJets"), # add user data ... # embedding of AOD items embedCaloTowers = cms.bool(False), ## ... # jet energy corrections addJetCorrFactors = cms.bool(True), jetCorrFactorsSource = cms.VInputTag(cms.InputTag( # btag information # btag information ... # clone tag infos ATTENTION: these take lots of sp # usually the discriminators from the default algo # are sufficient ... # mc matching addGenPartonMatch = cms.bool(True), embedGenPartonMatch = cms.bool(True), genPartonMatch = cms.InputTag("patJetPartonMa addGenJetMatch = cms.bool(True), embedGenJetMatch = cms.bool(True), genJetMatch = cms.InputTag("patJetGenJetMa ... ... )

Don't forget to keep the genParticle/genJet collec the match into the pat::Candidate (see Module 2 t Don t forget to keep the genParticle/genJet collec

C Match C Match

r1/jetProducer cfi.py): r1/jetProducer_cfi.py):

("jetCorrFactors") ), pace!

  • s

## ... ## ... atch"), ## ... ## ... ## ... atch"), ## ...

ction when not embedding to check how to do that) ction when not embedding

11 / 14

slide-12
SLIDE 12

How to access the How to access the

Common getter f nctions for all pat Candid Common getter functions for all pat::Candid More getter functions exist for the concrete Leptons, Photons, Jets Leptons, Photons, Jets

e GenMatch? e GenMatch?

dates (from PATObj t h) dates (from PATObject.h): e derived classes for

12 / 14

slide-13
SLIDE 13

Summary Summary

AT holds powerful tools to apply any kin think of PAT exploits an expanded template vers for MC matching For any more than trivial Matching you s PhysObjectMatcher, as it just relieves y

In what ever complexity you want to have it suc

You will find many parts of this also in le that discuss the matching between trigg nd of matching you could sion which is the MCMatcher should consider using the you from re-inventing

ch reduces to a 'one-liner'

ectures 4.1 and 4.2 ger and reco objects.

13 / 14

slide-14
SLIDE 14

Exercise 08 Exercise 08

You are now ready to do the [Exercise You are now ready to do the [Exercise https://twiki.cern.ch/twiki/bin/view/CM where you will: where you will:

  • Learn about the support of match
  • Learn how PAT supports these m

L h t fi M t C

  • Learn how to configure Monte Ca

access it. You will find some Questions and Exe Please go through all of them and fill t for this section.

  • t s sect o

En e 08] SWGuidePATMCMatchingExercise: e 08] SWGuidePATMCMatchingExercise: S/SWGuidePATMCMatchingExercise hing in the PhysicsTools. atching tools. l t th t hi i PAT d h t arlo truth matching in PAT and how to ercises to practice what you have learnt. the answers into the e-learning results njoy!

14 / 14