8 twoVectorType = NTupleObjectType(
"twoVector", variables = [
9 NTupleVariable(
"pt",
lambda x : x.pt()),
10 NTupleVariable(
"phi",
lambda x : x.phi()),
13 fourVectorType = NTupleObjectType(
"fourVector", variables = [
14 NTupleVariable(
"pt",
lambda x : x.pt()),
15 NTupleVariable(
"eta",
lambda x : x.eta()),
16 NTupleVariable(
"phi",
lambda x : x.phi()),
17 NTupleVariable(
"mass",
lambda x : x.mass()),
18 NTupleVariable(
"p4",
lambda x : x,
"TLorentzVector", default=ROOT.reco.Particle.LorentzVector(0.,0.,0.,0.), filler =
lambda vector, obj: vector.SetPtEtaPhiM(obj.pt(), obj.eta(), obj.phi(), obj.mass())),
21 particleType = NTupleObjectType(
"particle", baseObjectTypes = [ fourVectorType ], variables = [
22 NTupleVariable(
"pdgId",
lambda x : x.pdgId(), int),
29 leptonType = NTupleObjectType(
"lepton", baseObjectTypes = [ particleType ], variables = [
30 NTupleVariable(
"charge",
lambda x : x.charge(), int),
31 NTupleVariable(
"dxy",
lambda x : x.dxy(), help=
"d_{xy} with respect to PV, in cm (with sign)"),
32 NTupleVariable(
"dz",
lambda x : x.dz() , help=
"d_{z} with respect to PV, in cm (with sign)"),
33 NTupleVariable(
"edxy",
lambda x : x.edB(), help=
"#sigma(d_{xy}) with respect to PV, in cm"),
34 NTupleVariable(
"edz",
lambda x : x.gsfTrack().dzError()
if abs(x.pdgId())==11
else x.innerTrack().dzError() , help=
"#sigma(d_{z}) with respect to PV, in cm"),
36 NTupleVariable(
"sip3d",
lambda x : x.sip3D(), help=
"S_{ip3d} with respect to PV (absolute value)"),
37 NTupleVariable(
"tightId",
lambda x : x.tightId(), int, help=
"POG Tight ID (based on triggering MVA value for electrons, boolean for muons)"),
38 NTupleVariable(
"convVeto",
lambda x : x.passConversionVeto()
if abs(x.pdgId())==11
else 1, int, help=
"Conversion veto (always true for muons)"),
39 NTupleVariable(
"lostHits",
lambda x : x.lostInner() , int, help=
"Number of lost hits on inner track")
41 leptonTypeTTH = NTupleObjectType(
"leptonTTH", baseObjectTypes = [ leptonType ], variables = [
42 NTupleVariable(
"tightCharge",
lambda lepton : ( lepton.isGsfCtfScPixChargeConsistent() + lepton.isGsfScPixChargeConsistent() )
if abs(lepton.pdgId()) == 11
else 2*(lepton.innerTrack().ptError()/lepton.innerTrack().
pt() < 0.2), int, help=
"Tight charge criteria"),
43 NTupleVariable(
"relIso",
lambda x : x.relIso(dBetaFactor=0.5), help=
"PF Iso, R=0.4, with deltaBeta correction"),
44 NTupleVariable(
"chargedRelIso",
lambda x : x.chargedHadronIso()/x.pt(), help=
"PF Iso from charged hadrons only, R=0.4"),
45 NTupleVariable(
"mvaId",
lambda lepton : lepton.mvaNonTrigV0()
if abs(lepton.pdgId()) == 11
else 1, help=
"EGamma POG MVA ID for non-triggering electrons (as HZZ); 1 for muons"),
46 NTupleVariable(
"mvaIdTrig",
lambda lepton : lepton.mvaTrigV0()
if abs(lepton.pdgId()) == 11
else 1, help=
"EGamma POG MVA ID for triggering electrons; 1 for muons"),
47 NTupleVariable(
"mva",
lambda lepton : lepton.mvaValue, help=
"Lepton MVA (ttH version)"),
48 NTupleVariable(
"jetPtRatio",
lambda lepton : lepton.pt()/lepton.jet.pt()),
49 NTupleVariable(
"jetBTagCSV",
lambda lepton : lepton.jet.btag(
'combinedSecondaryVertexBJetTags')
if hasattr(lepton.jet,
'btag')
else -99),
50 NTupleVariable(
"jetDR",
lambda lepton :
deltaR(lepton.eta(),lepton.phi(),lepton.jet.eta(),lepton.jet.phi())),
51 NTupleVariable(
"mcMatchId",
lambda x : x.mcMatchId, int, mcOnly=
True, help=
"Match to source from hard scatter (25 for H, 6 for t, 23/24 for W/Z)"),
52 NTupleVariable(
"mcMatchAny",
lambda x : x.mcMatchAny, int, mcOnly=
True, help=
"Match to any final state leptons: -mcMatchId if prompt, 0 if unmatched, 1 if light flavour, 2 if heavy flavour (b)"),
53 NTupleVariable(
"mcMatchTau",
lambda x : x.mcMatchTau, int, mcOnly=
True, help=
"True if the leptons comes from a tau"),
54 NTupleVariable(
"convVetoFull",
lambda x : (x.passConversionVeto()
and x.gsfTrack().trackerExpectedHitsInner().numberOfLostHits() == 0)
if abs(x.pdgId())==11
else 1, int, help=
"Conv veto + no missing hits for electrons, always true for muons."),
56 leptonTypeSusy = NTupleObjectType(
"leptonSusy", baseObjectTypes = [ leptonType ], variables = [
58 NTupleVariable(
"looseIdSusy",
lambda x : x.looseIdSusy
if hasattr(x,
'looseIdSusy')
else -1, int, help=
"Loose ID for Susy ntuples (always true on selected leptons)"),
60 NTupleVariable(
"relIso03",
lambda x : x.relIso03, help=
"PF Rel Iso, R=0.3, with deltaBeta correction for muons and rho corrections for electrons"),
61 NTupleVariable(
"relIso04",
lambda x : x.relIso04, help=
"PF Rel Iso, R=0.4, with deltaBeta correction for muons and rho corrections for electrons"),
62 NTupleVariable(
"chargedHadRelIso03",
lambda x : x.chargedHadronIso(0.3)/x.pt(), help=
"PF Rel Iso, R=0.3, charged hadrons only"),
63 NTupleVariable(
"chargedHadRelIso04",
lambda x : x.chargedHadronIso(0.4)/x.pt(), help=
"PF Rel Iso, R=0.4, charged hadrons only"),
65 NTupleVariable(
"convVetoFull",
lambda x : (x.passConversionVeto()
and x.gsfTrack().trackerExpectedHitsInner().numberOfLostHits() == 0)
if abs(x.pdgId())==11
else 1, int, help=
"Conv veto + no missing hits for electrons, always true for muons."),
68 NTupleVariable(
"eleCutIdCSA14_25ns_v1",
lambda x : (1*x.electronID(
"POG_Cuts_ID_CSA14_25ns_v1_Veto") + 1*x.electronID(
"POG_Cuts_ID_CSA14_25ns_v1_Loose") + 1*x.electronID(
"POG_Cuts_ID_CSA14_25ns_v1_Medium") + 1*x.electronID(
"POG_Cuts_ID_CSA14_25ns_v1_Tight"))
if abs(x.pdgId()) == 11
else -1, int, help=
"Electron cut-based id (POG CSA14_25ns_v1): 0=none, 1=veto, 2=loose, 3=medium, 4=tight"),
69 NTupleVariable(
"eleCutIdCSA14_50ns_v1",
lambda x : (1*x.electronID(
"POG_Cuts_ID_CSA14_50ns_v1_Veto") + 1*x.electronID(
"POG_Cuts_ID_CSA14_50ns_v1_Loose") + 1*x.electronID(
"POG_Cuts_ID_CSA14_50ns_v1_Medium") + 1*x.electronID(
"POG_Cuts_ID_CSA14_50ns_v1_Tight"))
if abs(x.pdgId()) == 11
else -1, int, help=
"Electron cut-based id (POG CSA14_50ns_v1): 0=none, 1=veto, 2=loose, 3=medium, 4=tight"),
71 NTupleVariable(
"eleMVAId",
lambda x : (x.electronID(
"POG_MVA_ID_NonTrig_full5x5") + 2*x.electronID(
"POG_MVA_ID_Trig_full5x5"))
if abs(x.pdgId()) == 11
else -1, int, help=
"Electron mva id working point (2012, full5x5 shapes): 0=none, 1=non-trig, 2=trig, 3=both"),
72 NTupleVariable(
"tightCharge",
lambda lepton : ( lepton.isGsfCtfScPixChargeConsistent() + lepton.isGsfScPixChargeConsistent() )
if abs(lepton.pdgId()) == 11
else 2*(lepton.innerTrack().ptError()/lepton.innerTrack().
pt() < 0.2), int, help=
"Tight charge criteria"),
74 NTupleVariable(
"mvaId",
lambda lepton : lepton.mvaNonTrigV0(full5x5=
True)
if abs(lepton.pdgId()) == 11
else 1, help=
"EGamma POG MVA ID for non-triggering electrons (as HZZ); 1 for muons"),
75 NTupleVariable(
"mvaIdTrig",
lambda lepton : lepton.mvaTrigV0(full5x5=
True)
if abs(lepton.pdgId()) == 11
else 1, help=
"EGamma POG MVA ID for triggering electrons; 1 for muons"),
77 NTupleVariable(
"nStations",
lambda lepton : lepton.numberOfMatchedStations()
if abs(lepton.pdgId()) == 13
else 4, help=
"Number of matched muons stations (4 for electrons)"),
78 NTupleVariable(
"trkKink",
lambda lepton : lepton.combinedQuality().trkKink
if abs(lepton.pdgId()) == 13
else 0, help=
"Tracker kink-finder"),
79 NTupleVariable(
"caloCompatibility",
lambda lepton : lepton.caloCompatibility()
if abs(lepton.pdgId()) == 13
else 0, help=
"Calorimetric compatibility"),
80 NTupleVariable(
"globalTrackChi2",
lambda lepton : lepton.globalTrack().normalizedChi2()
if abs(lepton.pdgId()) == 13
and lepton.globalTrack().isNonnull()
else 0, help=
"Global track normalized chi2"),
82 NTupleVariable(
"trackerLayers",
lambda x : (x.track()
if abs(x.pdgId())==13
else x.gsfTrack()).hitPattern().trackerLayersWithMeasurement(), int, help=
"Tracker Layers"),
83 NTupleVariable(
"pixelLayers",
lambda x : (x.track()
if abs(x.pdgId())==13
else x.gsfTrack()).hitPattern().pixelLayersWithMeasurement(), int, help=
"Pixel Layers"),
85 NTupleVariable(
"mvaTTH",
lambda lepton : lepton.mvaValue
if hasattr(lepton,
'mvaValue')
else -1, help=
"Lepton MVA (ttH version)"),
86 NTupleVariable(
"jetPtRatio",
lambda lepton : lepton.pt()/lepton.jet.pt()
if hasattr(lepton,
'jet')
else -1, help=
"pt(lepton)/pt(nearest jet)"),
87 NTupleVariable(
"jetBTagCSV",
lambda lepton : lepton.jet.btag(
'combinedSecondaryVertexBJetTags')
if hasattr(lepton,
'jet')
and hasattr(lepton.jet,
'btag')
else -99, help=
"btag of nearest jet"),
88 NTupleVariable(
"jetDR",
lambda lepton :
deltaR(lepton.eta(),lepton.phi(),lepton.jet.eta(),lepton.jet.phi())
if hasattr(lepton,
'jet')
else -1, help=
"deltaR(lepton, nearest jet)"),
90 NTupleVariable(
"mcMatchId",
lambda x : x.mcMatchId, int, mcOnly=
True, help=
"Match to source from hard scatter (25 for H, 6 for t, 23/24 for W/Z)"),
91 NTupleVariable(
"mcMatchAny",
lambda x : x.mcMatchAny, int, mcOnly=
True, help=
"Match to any final state leptons: -mcMatchId if prompt, 0 if unmatched, 1 if light flavour, 2 if heavy flavour (b)"),
92 NTupleVariable(
"mcMatchTau",
lambda x : x.mcMatchTau, int, mcOnly=
True, help=
"True if the leptons comes from a tau"),
95 leptonTypeSusyExtra = NTupleObjectType(
"leptonSusyExtra", baseObjectTypes = [ leptonTypeSusy ], variables = [
97 NTupleVariable(
"hasSV",
lambda x : (2
if getattr(x,
'ivfAssoc',
'') ==
"byref" else (0
if getattr(x,
'ivf',
None) ==
None else 1)), int, help=
"2 if lepton track is from a SV, 1 if loosely matched, 0 if no SV found."),
98 NTupleVariable(
"svRedPt",
lambda x : getattr(x,
'ivfRedPt', 0), help=
"pT of associated SV, removing the lepton track"),
99 NTupleVariable(
"svRedM",
lambda x : getattr(x,
'ivfRedM', 0), help=
"mass of associated SV, removing the lepton track"),
100 NTupleVariable(
"svLepSip3d",
lambda x : getattr(x,
'ivfSip3d', 0), help=
"sip3d of lepton wrt SV"),
101 NTupleVariable(
"svSip3d",
lambda x : x.ivf.d3d.significance()
if getattr(x,
'ivf',
None) !=
None else -99, help=
"S_{ip3d} of associated SV"),
102 NTupleVariable(
"svNTracks",
lambda x : x.ivf.numberOfDaughters()
if getattr(x,
'ivf',
None) !=
None else -99, help=
"Number of tracks of associated SV"),
103 NTupleVariable(
"svChi2n",
lambda x : x.vertexChi2()/x.ivf.vertexNdof()
if getattr(x,
'ivf',
None) !=
None else -99, help=
"Normalized chi2 of associated SV"),
104 NTupleVariable(
"svDxy",
lambda x : x.ivf.dxy.value()
if getattr(x,
'ivf',
None) !=
None else -99, help=
"dxy of associated SV"),
105 NTupleVariable(
"svM",
lambda x : x.ivf.mass()
if getattr(x,
'ivf',
None) !=
None else -99, help=
"mass of associated SV"),
106 NTupleVariable(
"svPt",
lambda x : x.ivf.pt()
if getattr(x,
'ivf',
None) !=
None else -99, help=
"pt of associated SV"),
107 NTupleVariable(
"svMCMatchFraction",
lambda x : x.ivf.mcMatchFraction
if getattr(x,
'ivf',
None) !=
None else -99, mcOnly=
True, help=
"Fraction of mc-matched tracks from b/c matched to a single hadron (if >= 2 tracks found), for associated SV"),
109 NTupleVariable(
"segmentCompatibility",
lambda lepton : lepton.segmentCompatibility()
if abs(lepton.pdgId()) == 13
else 0, help=
"Segment-based compatibility"),
110 NTupleVariable(
"innerTrackValidHitFraction",
lambda lepton : lepton.innerTrack().validFraction()
if abs(lepton.pdgId()) == 13
else 0, help=
"Calorimetric compatibility"),
111 NTupleVariable(
"chi2LocalPosition",
lambda lepton : lepton.combinedQuality().chi2LocalPosition
if abs(lepton.pdgId()) == 13
else 0, help=
"Calorimetric compatibility"),
112 NTupleVariable(
"chi2LocalMomentum",
lambda lepton : lepton.combinedQuality().chi2LocalMomentum
if abs(lepton.pdgId()) == 13
else 0, help=
"Calorimetric compatibility"),
113 NTupleVariable(
"glbTrackProbability",
lambda lepton : lepton.combinedQuality().glbTrackProbability
if abs(lepton.pdgId()) == 13
else 0, help=
"Calorimetric compatibility"),
114 NTupleVariable(
"trackerHits",
lambda x : (x.track()
if abs(x.pdgId())==13
else x.gsfTrack()).hitPattern().numberOfValidTrackerHits(), int, help=
"Tracker hits"),
115 NTupleVariable(
"lostOuterHits",
lambda x : x.gsfTrack().trackerExpectedHitsOuter().numberOfLostHits()
if abs(x.pdgId())==11
else x.innerTrack().trackerExpectedHitsOuter().numberOfLostHits(), int, help=
"Number of lost hits on inner track"),
117 NTupleVariable(
"caloEMEnergy",
lambda lepton : lepton.calEnergy().em
if abs(lepton.pdgId()) == 13
else 0, help=
"Calorimetric compatibility"),
118 NTupleVariable(
"caloHadEnergy",
lambda lepton : lepton.calEnergy().had
if abs(lepton.pdgId()) == 13
else 0, help=
"Calorimetric compatibility"),
119 NTupleVariable(
"innerTrackChi2",
lambda lepton : lepton.innerTrack().normalizedChi2()
if abs(lepton.pdgId()) == 13
and lepton.innerTrack().isNonnull()
else 0, help=
"Inner track normalized chi2"),
120 NTupleVariable(
"stationsWithAnyHits",
lambda lepton : lepton.outerTrack().hitPattern().muonStationsWithAnyHits()
if abs(lepton.pdgId()) == 13
and lepton.outerTrack().isNonnull()
else 0, help=
"Outer track stations with any hits"),
121 NTupleVariable(
"stationsWithValidHits",
lambda lepton : lepton.outerTrack().hitPattern().muonStationsWithValidHits()
if abs(lepton.pdgId()) == 13
and lepton.outerTrack().isNonnull()
else 0, help=
"Outer track stations with valid hits"),
122 NTupleVariable(
"stationsWithValidHitsGlbTrack",
lambda lepton : lepton.globalTrack().hitPattern().muonStationsWithValidHits()
if abs(lepton.pdgId()) == 13
and lepton.globalTrack().isNonnull()
else 0, help=
"Global track stations with valid hits"),
125 leptonTypeSusyFR = NTupleObjectType(
"leptonSusyFR", baseObjectTypes = [ leptonTypeTTH ], variables = [
126 NTupleVariable(
"relIso03",
lambda x : x.relIso03, help=
"PF Rel Iso, R, with deltaBeta correction"),
127 NTupleVariable(
"looseFakeId",
lambda x : x.looseFakeId, int, help=
"Loose ID for Susy Fake Rate exercise"),
128 NTupleVariable(
"tightFakeId",
lambda x : x.tightFakeId, int, help=
"Tight ID for Susy Fake Rate exercise"),
135 leptonTypeFull = NTupleObjectType(
"leptonFull", baseObjectTypes = [ leptonTypeSusy ], variables = [
136 NTupleVariable(
"pfMuonId",
lambda x : x.muonID(
"POG_ID_Loose")
if abs(x.pdgId())==13
else 1, int, help=
"Muon POG Loose id"),
137 NTupleVariable(
"softMuonId",
lambda x : x.muonID(
"POG_ID_Soft")
if abs(x.pdgId())==13
else 1, int, help=
"Muon POG Soft id"),
145 tauType = NTupleObjectType(
"tau", baseObjectTypes = [ particleType ], variables = [
146 NTupleVariable(
"charge",
lambda x : x.charge(), int),
147 NTupleVariable(
"dxy",
lambda x : x.dxy(), help=
"d_{xy} of lead track with respect to PV, in cm (with sign)"),
148 NTupleVariable(
"dz",
lambda x : x.dz() , help=
"d_{z} of lead track with respect to PV, in cm (with sign)"),
150 NTupleVariable(
"idCI3hit",
lambda x : x.idCI3hit, int, help=
"1,2,3 if the tau passes the loose, medium, tight WP of the By<X>CombinedIsolationDBSumPtCorr3Hits discriminator"),
151 NTupleVariable(
"isoCI3hit",
lambda x : x.tauID(
"byCombinedIsolationDeltaBetaCorrRaw3Hits"), help=
"byCombinedIsolationDeltaBetaCorrRaw3Hits raw output discriminator"),
154 tauTypeTTH = NTupleObjectType(
"tauTTH", baseObjectTypes = [ tauType ], variables = [
155 NTupleVariable(
"mcMatchId",
lambda x : x.mcMatchId, int, mcOnly=
True, help=
"Match to source from hard scatter (25 for H, 6 for t, 23/24 for W/Z)"),
157 tauTypeSusy = NTupleObjectType(
"tauSusy", baseObjectTypes = [ tauType ], variables = [
158 NTupleVariable(
"mcMatchId",
lambda x : x.mcMatchId, int, mcOnly=
True, help=
"Match to source from hard scatter (25 for H, 6 for t, 23/24 for W/Z)"),
165 isoTrackType = NTupleObjectType(
"isoTrack", baseObjectTypes = [ particleType ], variables = [
166 NTupleVariable(
"charge",
lambda x : x.charge(), int),
167 NTupleVariable(
"dz",
lambda x : x.dz() , help=
"d_{z} of lead track with respect to PV, in cm (with sign)"),
168 NTupleVariable(
"absIso",
lambda x : x.absIso, float, mcOnly=
False, help=
"abs charged iso with condition for isolation such that Min(0.2*pt, 8 GeV)"),
169 NTupleVariable(
"mcMatchId",
lambda x : x.mcMatchId, int, mcOnly=
True, help=
"Match to source from hard scatter (25 for H, 6 for t, 23/24 for W/Z)"),
177 photonTypeSusy = NTupleObjectType(
"gamma", baseObjectTypes = [ particleType ], variables = [
178 NTupleVariable(
"idCutBased",
lambda x : x.idCutBased, int, help=
"1,2,3 if the gamma passes the loose, medium, tight WP of PhotonCutBasedID"),
179 NTupleVariable(
"hOverE",
lambda x : x.hOVERe(), float, help=
"hoverE for photons"),
180 NTupleVariable(
"r9",
lambda x : x.r9(), float, help=
"r9 for photons"),
181 NTupleVariable(
"sigmaIetaIeta",
lambda x : x.sigmaIetaIeta(), float, help=
"sigmaIetaIeta for photons"),
182 NTupleVariable(
"chHadIso",
lambda x : x.chargedHadronIso(), float, help=
"chargedHadronIsolation for photons"),
183 NTupleVariable(
"neuHadIso",
lambda x : x.neutralHadronIso(), float, help=
"neutralHadronIsolation for photons"),
184 NTupleVariable(
"phIso",
lambda x : x.photonIso(), float, help=
"gammaIsolation for photons"),
185 NTupleVariable(
"mcMatchId",
lambda x : x.mcMatchId, int, mcOnly=
True, help=
"Match to source from hard scatter (25 for H, 6 for t, 23/24 for W/Z)"),
192 jetType = NTupleObjectType(
"jet", baseObjectTypes = [ fourVectorType ], variables = [
193 NTupleVariable(
"btagCSV",
lambda x : x.btag(
'combinedSecondaryVertexBJetTags'), help=
"CSV discriminator"),
194 NTupleVariable(
"rawPt",
lambda x : x.pt() * x.rawFactor(), help=
"p_{T} before JEC"),
195 NTupleVariable(
"mcPt",
lambda x : x.mcJet.pt()
if x.mcJet
else 0., mcOnly=
True, help=
"p_{T} of associated gen jet"),
196 NTupleVariable(
"mcFlavour",
lambda x : x.partonFlavour(), int, mcOnly=
True, help=
"parton flavour (physics definition, i.e. including b's from shower)"),
199 jetTypeTTH = NTupleObjectType(
"jetTTH", baseObjectTypes = [ jetType ], variables = [
200 NTupleVariable(
"mcMatchId",
lambda x : x.mcMatchId, int, mcOnly=
True, help=
"Match to source from hard scatter (25 for H, 6 for t, 23/24 for W/Z)"),
201 NTupleVariable(
"mcMatchFlav",
lambda x : x.mcMatchFlav, int, mcOnly=
True, help=
"Flavour of associated parton from hard scatter (if any)"),
203 jetTypeSusy = NTupleObjectType(
"jetSusy", baseObjectTypes = [ jetType ], variables = [
204 NTupleVariable(
"mcMatchId",
lambda x : x.mcMatchId, int, mcOnly=
True, help=
"Match to source from hard scatter (25 for H, 6 for t, 23/24 for W/Z)"),
205 NTupleVariable(
"mcMatchFlav",
lambda x : x.mcMatchFlav, int, mcOnly=
True, help=
"Flavour of associated parton from hard scatter (if any)"),
206 NTupleVariable(
"area",
lambda x : x.jetArea(), help=
"Catchment area of jet"),
207 NTupleVariable(
"puId",
lambda x : x.puJetIdPassed, int, mcOnly=
False, help=
"puId (full MVA, loose WP, 5.3.X training on AK5PFchs: the only thing that is available now)"),
211 NTupleVariable(
"id",
lambda x : x.jetID(
"POG_PFID") , int, mcOnly=
False,help=
"POG Loose jet ID"),
219 metType = NTupleObjectType(
"met", baseObjectTypes = [ fourVectorType ], variables = [
220 NTupleVariable(
"sumEt",
lambda x : x.sumEt() ),
221 NTupleVariable(
"genPt",
lambda x : x.genMET().
pt() , mcOnly=
True ),
222 NTupleVariable(
"genPhi",
lambda x : x.genMET().
phi(), mcOnly=
True ),
223 NTupleVariable(
"genEta",
lambda x : x.genMET().
eta(), mcOnly=
True ),
230 genParticleType = NTupleObjectType(
"genParticle", baseObjectTypes = [ particleType ], mcOnly=
True, variables = [
231 NTupleVariable(
"charge",
lambda x : x.threeCharge()/3.0, float),
232 NTupleVariable(
"status",
lambda x : x.status(),int),
235 genParticleWithSourceType = NTupleObjectType(
"genParticleWithSource", baseObjectTypes = [ genParticleType ], mcOnly=
True, variables = [
236 NTupleVariable(
"sourceId",
lambda x : x.sourceId, int, help=
"origin of the particle: 6=t, 25=h, 23/24=W/Z")
238 genParticleWithMotherId = NTupleObjectType(
"genParticleWithMotherId", baseObjectTypes = [ genParticleType ], mcOnly=
True, variables = [
240 NTupleVariable(
"motherId",
lambda x : x.mother(0).
pdgId()
if x.mother(0)
else 0, int, help=
"pdgId of the mother of the particle"),
241 NTupleVariable(
"grandmaId",
lambda x : x.mother(0).mother(0).
pdgId()
if x.mother(0)
and x.mother(0).mother(0)
else 0, int, help=
"pdgId of the grandmother of the particle")
248 svType = NTupleObjectType(
"sv", baseObjectTypes = [ fourVectorType ], variables = [
249 NTupleVariable(
"charge",
lambda x : x.charge(), int),
250 NTupleVariable(
"ntracks",
lambda x : x.numberOfDaughters(), int, help=
"Number of tracks (with weight > 0.5)"),
251 NTupleVariable(
"chi2",
lambda x : x.vertexChi2(), help=
"Chi2 of the vertex fit"),
252 NTupleVariable(
"ndof",
lambda x : x.vertexNdof(), help=
"Degrees of freedom of the fit, ndof = (2*ntracks - 3)" ),
253 NTupleVariable(
"dxy",
lambda x : x.dxy.value(), help=
"Transverse distance from the PV [cm]"),
254 NTupleVariable(
"edxy",
lambda x : x.dxy.error(), help=
"Uncertainty on the transverse distance from the PV [cm]"),
255 NTupleVariable(
"ip3d",
lambda x : x.d3d.value(), help=
"3D distance from the PV [cm]"),
256 NTupleVariable(
"eip3d",
lambda x : x.d3d.error(), help=
"Uncertainty on the 3D distance from the PV [cm]"),
257 NTupleVariable(
"sip3d",
lambda x : x.d3d.significance(), help=
"S_{ip3d} with respect to PV (absolute value)"),
258 NTupleVariable(
"cosTheta",
lambda x : x.cosTheta, help=
"Cosine of the angle between the 3D displacement and the momentum"),
259 NTupleVariable(
"jetPt",
lambda x : x.jet.pt()
if x.jet !=
None else 0, help=
"pT of associated jet"),
260 NTupleVariable(
"jetBTag",
lambda x : x.jet.btag(
'combinedSecondaryVertexBJetTags')
if x.jet !=
None else -99, help=
"CSV b-tag of associated jet"),
261 NTupleVariable(
"mcMatchNTracks",
lambda x : x.mcMatchNTracks, int, mcOnly=
True, help=
"Number of mc-matched tracks in SV"),
262 NTupleVariable(
"mcMatchNTracksHF",
lambda x : x.mcMatchNTracksHF, int, mcOnly=
True, help=
"Number of mc-matched tracks from b/c in SV"),
263 NTupleVariable(
"mcMatchFraction",
lambda x : x.mcMatchFraction, mcOnly=
True, help=
"Fraction of mc-matched tracks from b/c matched to a single hadron (or -1 if mcMatchNTracksHF < 2)"),
264 NTupleVariable(
"mcFlavFirst",
lambda x : x.mcFlavFirst, int, mcOnly=
True, help=
"Flavour of last ancestor with maximum number of matched daughters"),
265 NTupleVariable(
"mcFlavHeaviest",
lambda x : x.mcFlavHeaviest, int, mcOnly=
True, help=
"Flavour of heaviest hadron with maximum number of matched daughters"),
268 heavyFlavourHadronType = NTupleObjectType(
"heavyFlavourHadron", baseObjectTypes = [ genParticleType ], variables = [
269 NTupleVariable(
"flav",
lambda x : x.flav, int, mcOnly=
True, help=
"Flavour"),
270 NTupleVariable(
"sourceId",
lambda x : x.sourceId, int, mcOnly=
True, help=
"pdgId of heaviest mother particle (stopping at the first one heaviest than 175 GeV)"),
271 NTupleVariable(
"svMass",
lambda x : x.sv.mass()
if x.sv
else 0, help=
"SV: mass"),
272 NTupleVariable(
"svPt",
lambda x : x.sv.pt()
if x.sv
else 0, help=
"SV: pt"),
273 NTupleVariable(
"svCharge",
lambda x : x.sv.charge()
if x.sv
else -99., int, help=
"SV: charge"),
274 NTupleVariable(
"svNtracks",
lambda x : x.sv.numberOfDaughters()
if x.sv
else 0, int, help=
"SV: Number of tracks (with weight > 0.5)"),
275 NTupleVariable(
"svChi2",
lambda x : x.sv.vertexChi2()
if x.sv
else -99., help=
"SV: Chi2 of the vertex fit"),
276 NTupleVariable(
"svNdof",
lambda x : x.sv.vertexNdof()
if x.sv
else -99., help=
"SV: Degrees of freedom of the fit, ndof = (2*ntracks - 3)" ),
277 NTupleVariable(
"svDxy",
lambda x : x.sv.dxy.value()
if x.sv
else -99., help=
"SV: Transverse distance from the PV [cm]"),
278 NTupleVariable(
"svEdxy",
lambda x : x.sv.dxy.error()
if x.sv
else -99., help=
"SV: Uncertainty on the transverse distance from the PV [cm]"),
279 NTupleVariable(
"svIp3d",
lambda x : x.sv.d3d.value()
if x.sv
else -99., help=
"SV: 3D distance from the PV [cm]"),
280 NTupleVariable(
"svEip3d",
lambda x : x.sv.d3d.error()
if x.sv
else -99., help=
"SV: Uncertainty on the 3D distance from the PV [cm]"),
281 NTupleVariable(
"svSip3d",
lambda x : x.sv.d3d.significance()
if x.sv
else -99., help=
"SV: S_{ip3d} with respect to PV (absolute value)"),
282 NTupleVariable(
"svCosTheta",
lambda x : x.sv.cosTheta
if x.sv
else -99., help=
"SV: Cosine of the angle between the 3D displacement and the momentum"),
283 NTupleVariable(
"jetPt",
lambda x : x.jet.pt()
if x.jet !=
None else 0, help=
"Jet: pT"),
284 NTupleVariable(
"jetBTag",
lambda x : x.jet.btag(
'combinedSecondaryVertexBJetTags')
if x.jet !=
None else -99, help=
"CSV b-tag of associated jet"),
Abs< T >::type abs(const T &t)
double deltaR(double eta1, double eta2, double phi1, double phi2)