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

RefToBase to Ptr conversion for pat::TriggerObjectStandAlone #5

Merged
merged 7 commits into from
Nov 28, 2023

Conversation

nsmith-
Copy link
Collaborator

@nsmith- nsmith- commented Nov 17, 2023

Description:
Implemented two templated methods: refToBaseToPtr for use in class constructors, etc., where the desire is to keep the RefToBase API available, and then refToBaseToPtr_ioread to be used exclusively in ioread rules to do schema migration of data written with the old type.

Validation:
Managed to forward-copy the data products:

$ edmCopyPickMerge inputFiles=file:../../data/ul17ttsemi_miniaod.root outputFile=../../data/ul17ttsemi_miniaod_copy.root
20-Nov-2023 17:05:19 CST  Initiating request to open file file:../../data/ul17ttsemi_miniaod.root
20-Nov-2023 17:05:24 CST  Successfully opened file file:../../data/ul17ttsemi_miniaod.root
%MSG-w FastCloningDisabled:  AfterModBeginStream 20-Nov-2023 17:05:25 CST  BeforeEvents
Fast copying of file file:../../data/ul17ttsemi_miniaod.root to file ../../data/ul17ttsemi_miniaod_copy.root is disabled because:
The format of a data product has changed.

%MSG
Begin processing the 1st record. Run 1, Event 66298012, LumiSection 66299 on stream 0 at 20-Nov-2023 17:05:25.366 CST
Begin processing the 2nd record. Run 1, Event 66298002, LumiSection 66299 on stream 0 at 20-Nov-2023 17:05:25.805 CST
...

but I cannot verify if non-null origObjCand() is working, since it appears the PATTriggerProducer default value for saveL1Refs is false, and this is not overridden in MiniAOD production (despite l1extra being in MiniAOD)

@nsmith- nsmith- changed the title General RefToBase to Ptr conversion RefToBase to Ptr conversion for pat::TriggerObjectStandAlone Nov 20, 2023
Deprecate any API methods that return RefToBase
@nsmith- nsmith- marked this pull request as ready for review November 21, 2023 03:52
@Dr15Jones Dr15Jones self-assigned this Nov 21, 2023
@nsmith- nsmith- changed the base branch from master to CMSSW_14_0_0_pre0_modified November 21, 2023 19:25
@Dr15Jones Dr15Jones self-requested a review November 21, 2023 20:30
DataFormats/Common/interface/RefToBaseToPtr.h Outdated Show resolved Hide resolved
DataFormats/Common/interface/RefToBaseToPtr.h Outdated Show resolved Hide resolved
DataFormats/PatCandidates/src/classes_def_trigger.xml Outdated Show resolved Hide resolved
DataFormats/Common/interface/RefToBaseToPtr.h Outdated Show resolved Hide resolved
DataFormats/Common/interface/RefToBaseToPtr.h Outdated Show resolved Hide resolved
@Dr15Jones
Copy link

@nsmith- were you able to test that the IO rule worked?

@nsmith-
Copy link
Collaborator Author

nsmith- commented Nov 21, 2023

It worked but only because every RefToBase is null. Indeed the misspelled (non-ioread) function would have caused an error if the member was filled. (that's how I ran into it for reco::GsfElectron conversionRejection_, which I guess would have been a better canary)

@nsmith- nsmith- requested a review from Dr15Jones November 28, 2023 14:17
@Dr15Jones
Copy link

@nsmith- as long as you confirm this compiled, I'm fine with merging.

@nsmith-
Copy link
Collaborator Author

nsmith- commented Nov 28, 2023

It compiles, yes

@nsmith- nsmith- merged commit 8d25b97 into cms-rntuple-work:CMSSW_14_0_0_pre0_modified Nov 28, 2023
@nsmith- nsmith- deleted the ref2ptr branch November 28, 2023 15:38
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.

3 participants