Skip to content

Commit

Permalink
Merge pull request cms-sw#11 from emanueledimarco/heppy_80X
Browse files Browse the repository at this point in the history
missing part to allow float16 GenPart branches
  • Loading branch information
emanueledimarco authored Jul 19, 2018
2 parents 8e0e5ce + 0876ced commit b254f2f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion PhysicsTools/Heppy/python/analyzers/objects/autophobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
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())),
# ^^^^------- Note: p4 normally is not saved unless 'saveTLorentzVectors' is enabled in the tree producer
])
lightFourVectorType = NTupleObjectType("lightFourVector", variables = [
NTupleVariable("pt", lambda x : x.pt(), storageType="H"),
NTupleVariable("eta", lambda x : x.eta(), storageType="H"),
NTupleVariable("phi", lambda x : x.phi(), storageType="H"),
NTupleVariable("mass", lambda x : x.mass(), storageType="H"),
])
tlorentzFourVectorType = NTupleObjectType("tlorentzFourVectorType", variables = [
NTupleVariable("pt", lambda x : x.Pt()),
NTupleVariable("eta", lambda x : x.Eta()),
Expand Down Expand Up @@ -239,7 +245,8 @@
## GENPARTICLE
##------------------------------------------

genParticleType = NTupleObjectType("genParticle", baseObjectTypes = [ particleType ], mcOnly=True, variables = [
genParticleType = NTupleObjectType("genParticle", baseObjectTypes = [ lightFourVectorType ], mcOnly=True, variables = [
NTupleVariable("pdgId", lambda x : x.pdgId(), int),
NTupleVariable("charge", lambda x : x.threeCharge()/3.0, float),
NTupleVariable("status", lambda x : x.status(),int),
NTupleVariable("isPromptHard", lambda x : getattr(x,"promptHardFlag",0), int)
Expand Down

0 comments on commit b254f2f

Please sign in to comment.