Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PFCandidate no longer inherits from CompositeCandidate #8

Open
wants to merge 1 commit into
base: CMSSW_14_0_0_pre0_modified
Choose a base branch
from

Conversation

Dr15Jones
Copy link

PR description:

Nothing in CMSSW cared about that inheritance. Migration to ROOT RNTuple requires us to move away from CompositeCandidate.

PR validation:

Code compiles.

Nothing in CMSSW cared about that inheritance. Migration to
ROOT RNTuple requires us to move away from CompositeCandidate.
@nsmith- nsmith- self-requested a review November 21, 2023 19:58
@nsmith-
Copy link
Collaborator

nsmith- commented Nov 22, 2023

The issue from cms-sw#38999 is still present in this version of ROOT.
To add, in one AOD file, I have in an unmodified CMSSW:

>>> pf = handles.recoPFCandidates_particleFlow__RECO[0]
>>> pf.polarP4().pt(), pf.polarP4().eta(), pf.polarP4().phi(), pf.polarP4().mass()
(0.3606000542640686, 1.4348090887069702, 0.19513311982154846, 0.13956999778747559)
>>> pf.p4().px(), pf.p4().py(), pf.p4().pz(), pf.p4().energy()
(0.3537565383628609, 0.06991931564864541, 0.7141111619211516, 0.8120756953622134)

and with this PR,

>>> pf = handles.recoPFCandidates_particleFlow__RECO[0]
>>> pf.polarP4().pt(), pf.polarP4().eta(), pf.polarP4().phi(), pf.polarP4().mass()
(0.3606000542640686, 1.4348090887069702, 0.19513311982154846, -1.2804143870372504e+105)
>>> pf.p4().px(), pf.p4().py(), pf.p4().pz(), pf.p4().energy()
(3.8223162920824824e+182, 0.36037160125010853, 5.2306840702655195e-304, 2.8425318542429498e-306)

I added a rule, and confirmed these do run,

diff --git a/DataFormats/ParticleFlowCandidate/src/classes_def.xml b/DataFormats/ParticleFlowCandidate/src/classes_def.xml
index a1a5ce6754b..bb5648fa870 100644
--- a/DataFormats/ParticleFlowCandidate/src/classes_def.xml
+++ b/DataFormats/ParticleFlowCandidate/src/classes_def.xml
@@ -17,6 +17,9 @@
      <field name="getter_" transient="true"/>
      <field name="refsCollectionCache_" transient="true"/>
    </class>
+  <ioread sourceClass="reco::PFCandidate" version="[-20]" targetClass="reco::PFCandidate" source="" target="">
+    <![CDATA[ newObj->setP4(newObj->polarP4());]]>
+  </ioread>
   <ioread sourceClass = "reco::PFCandidate" version="[1-]" targetClass="reco::PFCandidate" source="" target="getter_">
     <![CDATA[edm::EDProductGetter::assignEDProductGetter(getter_); ]]>
   </ioread>

but it would not fix the issue since one member of polarP4 is already corrupted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants