parameter | type | req. | description |
---|---|---|---|
tagProbePairs |
InputTag |
yes | input collection of (tag+probe pairs) |
arbitration |
string |
yes | how to handle tags with more than one probe supported values are None , OneProbe , BestMass , Random2 , OnePair , NonDuplicate |
massForArbitration |
double |
- | used if arbitration is BestMass |
variables |
PSet |
yes | variables of the probe to be included in the dataset |
flags |
PSet |
yes | criterias that define passing probes |
<xyz>Variables <xyz>Flags |
PSet |
no | Same as variables and flags , but with information on the tag (<xyz> = tag ), mc object matched to the probe (mc ), or tag & probe pair (pair ). The branche names will be prefixed by <xyz>_ .The parameters are optional, but must always come in pairs: e.g. if you set the tagVariables you must also set the tagFlags (even to an empty PSet ). |
isMC |
bool |
yes | true on mc, false on data |
tagMatches probeMatches |
InputTag |
if isMC |
associations from tags and probes to mc truth needed if isMC is true |
motherPdgId |
int32 or vint32 |
if isMC |
list of PDG Ids![]() |
makeMCUnbiasTree |
bool |
if isMC |
produce also a TTree with one entry per true probe, without looking if the tag is reconstructed and selected |
checkMotherInUnbiasEff |
bool |
if makeMCUnbiasTree |
If set, a "true probe" for the above tree must be matched to a particle coming from one of the resonances specified through the parameter moderPdgId . if not set, any truth-matched probe is used in the tree. |
allProbes |
InputTag |
if makeMCUnbiasTree |
the collection of all the probes, to make the unbiased efficiency |
fillTagTree |
bool |
no | default is false; if present and set to true, the module will fill a separate tree tag_tree with the same variables of the probes, but applied to tags. |
ignoreExceptions |
bool |
no | default is false; if present and set to true, exceptions thrown when evaluating the tree variables are silently ignored. |
addRunLumiInfo |
bool |
no | default is false; if present and set to true, two branches run and lumi will be added to the tree, containing the run and lumisection number. |
addEventVariablesInfo |
bool |
no | if set to true, some per-event variables will be added to the tree (see below for description) |
eventWeight |
double or InputTag |
no | Save a weight variable in the tree, either a constant in cfg (if the parameter is a cms.double ) or a double stored the edm::Event (if the parameter is a cms.InputTag ) |
tagProbePairs
reco::ShallowCloneCompositeCandidates
that have as daughters the tag and the probe (in this order).
This is specified through the parameter tagProbePairs
of type cms.InputTag
This is usually accomplished with this a standard CMSSW module, CandViewShallowCloneCombiner, as in this example
process.tagProbes = cms.EDProducer("CandViewShallowCloneCombiner", decay = cms.string("tagMuons@+ trkProbes@-"), # charge coniugate states are implied; 'tagMuons' and 'trkProbes' should be collections of Candidates cut = cms.string("2.5 < mass < 3.8"), )Parameters
arbitration
, massForArbitration
arbitration
parameter are: "None"
: don't perform any arbitration, use all (tag+probe) pairs.
"OneProbe"
: keep only tags that are matched to a single probe.
"BestMass"
: use the (tag+probe) pair that has the invariant mass nearest to the value of the massForArbitration
parameter.
"Random2"
"NonDuplicate"
"OnePair"
: disallow the same (tag+probe) pair to enter the dataset twice with the two roles exchanged. You can use this if you're looking not at properties of the individual muon but rather at properties of the pair (e.g. Δz between the two muons) or properties of the event (e.g. number of vertices, number of jets). reco::CompositeCandidate
objects before it's passed as input to the TagProbeFitTreeProducer. You can check if two reco::ShallowCloneCompositeCandidates
c1
, c2
share the tag by checking if (c1.daughter(0)->masterClone() == c2.daughter(0)->masterClone()).
eta()
, pt()
, track().numberOfValidHits()
, ...) cms.InputTag
to an edm::ValueMap<float>
that contains the values for each probe. variables = cms.PSet( # simple variables pt = cms.string("pt()"), # define the variable "pt" to be computed calling "object.pt()" phi = cms.string("phi"), # you can even omit the () if the method has no arguments abseta = cms.string("abs(eta)"), # and you can also use some mathematical functions scEta = cms.string("superCluster.eta"), # or use nested objects # external variables drjet = cms.InputTag("electronJetDR"), # external variable, from a ValueMap. )
V02-03-00
you can also include in the tree variables of the tag candidate, (tag+probe) pair or of the mc candidate matched to the probe. Such variables can be defined in the optional PSets
called tagVariables
, pairVariables
, mcVariables
. The associated branches will be prefixed with tag_
, pair_
and mc_
.
addRunLumiInfo
to true will cause the module to write in the tree also the run, lumisection and event number
addEventVariablesInfo
to true will cause the module to add in the tree the number of good primary vertices, the MET, SumET and MET significance for the three algorithms (calo, tc, pf), and the (x,y,z) position of the primary vertex and beamspot. This requires the following collections to be available in the event: offlineBeamSpot
, offlinePrimaryVertices
, met
, tcMet
, pfMet
(all input tags are hard coded, sorry).
InputTag
to a collection of passing probes. flags = cms.PSet( # some simple selections lastStationLoose = cms.string("muonID('TMLastStationLoose')"), # direct access to Muon ID as provided by PAT Muons hltMu3 = cms.string("!triggerObjectMatchesByPath('HLT_Mu3').empty()"), # if this is a PAT Muon with embedded trigger matches, you can check them relTkIso = cms.string("isolationR03().sumPt / pt() < 0.2"), # cut on the relative isolation, using the values stored in the reco::Muon object # external variables drjet = cms.InputTag("muonMatchedToPixelTrack"), # external, from a collection of references to passing probes. )
MuonAnalysis/Examples/plugins/MuonSelectorExample.cc
. That module just performs simple cuts on the objects, but you can perform a selection as complex as you want (e.g. try to match the probe to some other detector signal or physics object). edm::RefToBaseVector<reco::Candidate>
which you can fill from your edm::View<X>
by creating RefToBase=s as edm::RefToBase<reco::Candidate> ref = edm::RefToBase<reco::Candidate>(view->refAt(idx));. If you still get issues with dictionaries, try again but replacing =RefToBase
with Ptr
, RefToBaseVector
with PtrVector
, refAt(i)
with ptrAt(i)
.
CandViewCleaner
: selects candidates from the srcCands
collection that don't overlap with a candidates in any of the srcObjects
collections (VInputTag); the overlap is defined by ΔR, controlled by parameter deltaRMin
requireNoOverlaps
set to False), and then you can define the passing probes using string cuts (e.g. isAJet = cms.string("hasOverlaps('jets')")
)
V02-03-00
you can also include in the tree boolean flags associated to the tag candidate, (tag+probe) pair or of the mc candidate matched to the probe. Such variables can be defined in the optional PSets
called tagVariables
, pairVariables
, mcVariables
. The associated branches will be prefixed with tag_
, pair_
and mc_
.
isMC
is set to true
.
Parameters tagMatches
, probeMatches
InputTag
are used to define the association maps from the tags and probes to the simulation truth. Associations using simple matching by ΔR can be produced easily with the existing CMSSW module MCTruthDeltaRMatcherNew
.
For more complex matching, you can use any other matcher provided that the output is an edm::Association>reco::GenParticleCollection>
Example using MCTruthDeltaRMatcherNew:
process.muMcMatch = cms.EDFilter("MCTruthDeltaRMatcherNew", src = cms.InputTag("muons"), matched = cms.InputTag("genParticles"), pdgId = cms.vint32(13), distMin = cms.double(0.3), )Parameter
motherPdgId
motherPdgId
is set to a non-empty list of pdgId codes, the leptons will defined as "true" if they're matched to a true lepton that has one ancestor among those pdgId.
If the list is empty, any truth-matched lepton is used.
For convenience, a list of useful pdg ids for resonances is:
γ, Z | 22, 23 |
---|---|
J/Psi, Psi(2S) | 443, 100443 |
Y(1S), Y(2S), Y(3S) | 553, 100553, 200553 |
π0, η, φ | 111, 221, 333 |
makeMCUnbiasTree
, checkMotherInUnbiasEff
, allProbes
makeMCUnbiasTree
is set, the module will produce also another TTree that contains variables and flags for all true probes, irrespectively of the tag. This requires you to specify also the full collection of probes using the parameter allProbes
of type InputTag
.
If checkMotherInUnbiasEff
is set to true
, the "unbiased" MC efficiency is computed only using truth-matched leptons coming from the resonances selected by the parameter motherPdgId
. If it's set to false
, any truth-matched lepton is used in the efficiency.
TTree
fitter_tree
with one entry per (tag+probe) pair, and the following branches mass/F
: the mass of the T&P pair.
<variable>/F
: for each probe variable
<flag>/I
: for each passing probe flag, with values 1 for pass and 0 for fail (we didn't use x/B
columns because they don't always get imported well by RooFit)
mcTrue/I
: this flag is set to true if the (tag+probe) pair is matched to mc truth and is to be used in the mc efficiency. isMC
is set to true.
makeMCUnbiasTree
is activated, there is also another TTree
named mcUnbias_tree=m with one entry per truth-matched probe, and an identical layout except that it has no =mass
and mcTrue
branches.
fitter_tree
as a TObjString
.
You can dump that information from bare ROOT or FWLite using the macro PhysicsTools/TagAndProbe/test/psetDumpFromTTree.C
. If you have merged multiple files with hadd
, you might get the dump more than once.
CMS.PhysicsTools/CMS.TagAndProbe/test/
:
newstyleWrite.py
testTagProbeFitTreeProducer_ZMuMu.py
testTagProbeFitTreeProducer_JPsi.py
HLT_Mu3
trigger. It works with PAT objects, and requires some muon-specific packages to define the passing probes performing matching between standalone muon and tracker tracks.
%RESPONSIBLE% GiovanniPetrucciani