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

separate token for the view #5114

Conversation

slava77
Copy link
Contributor

@slava77 slava77 commented Aug 29, 2014

use a token with correct type for the fall-back case of using a candidate view as an input.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @slava77 (Slava Krutelyov) for CMSSW_7_2_X.

separate token for the view

It involves the following packages:

CommonTools/ParticleFlow

@nclopezo, @monttj, @cmsbuild, @StoyanStoynev, @slava77, @vadler can you please review it and eventually sign? Thanks.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.

@slava77
Copy link
Contributor Author

slava77 commented Aug 29, 2014

+1

for #5114 509a91a
tested in CMSSW_7_2_X_2014-08-28-1400 (test area sign418)
no diffs as expected; the error message in case of a missing input is now more sensible

@monttj
Copy link
Contributor

monttj commented Aug 29, 2014

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_2_X IBs unless changes or unless it breaks tests.

@@ -19,6 +19,8 @@ PFPileUp::PFPileUp(const edm::ParameterSet& iConfig) {

tokenPFCandidates_
= consumes<PFCollection>(iConfig.getParameter<InputTag>("PFCandidates"));
tokenPFCandidatesView_
= mayConsume<PFView>(iConfig.getParameter<InputTag>("PFCandidates"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slava77 - seems that the proper change here is

if (enable_)
tokenPFCandidates_ = consumes….
else
tokenPFCandidatesView_ = consumes …..

[as it is, the first consumes statement is not always right unless I've missed something]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the enable_?
If your point is to pick only one at the config step, that's not what the
code was designed to implement.
If thats an issue, current state of use cases is such that the second
branch using a view can be removed completely
On Aug 30, 2014 8:00 AM, "David Lange" notifications@github.com wrote:

In CommonTools/ParticleFlow/plugins/PFPileUp.cc:

@@ -19,6 +19,8 @@ PFPileUp::PFPileUp(const edm::ParameterSet& iConfig) {

tokenPFCandidates_
= consumes(iConfig.getParameter("PFCandidates"));

  • tokenPFCandidatesView_
  • = mayConsume(iConfig.getParameter("PFCandidates"));

@slava77 https://github.com/slava77 - seems that the proper change here
is

if (enable_)
tokenPFCandidates_ = consumes….
else
tokenPFCandidatesView_ = consumes …..

[as it is, the first consumes statement is not always right unless I've
missed something]


Reply to this email directly or view it on GitHub
https://github.com/cms-sw/cmssw/pull/5114/files#r16929566.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable_ is at line 28 (just below this change)

I thought I read
if enable_ use PFCandidates
if not enable_ use PFView

if I got that wrong, then i'm just creating noise.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks to me like both consumes are dependent upon enable_ being true. I think the confusion in the code is the long comment between the end of the if statement and the beginning if the else statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, the enable_ is about all of the consumes in this module .. if false, nothing is read and an empty product is inserted in the event.

The code is designed to solve the framework problem of not being able to deliver a view out of a collection of pointers. Since the output is a collection of pointers, the input can interchangeably be the parent object collection or a collection of pointers made out of them at a different place ( it could technically be even changing event by event, not that it is the use case now)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dr15Jones
Chris, if I say "consumes" or "mayConsume" for a product that doesn't exist (that's the case for my mayConsume here), what are the implications on the framework side?
In the current default 72X setup the code runs ok, or if there is a miss it fails on the event itself (not before event processing starts).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the product doesn't exist at all, you will fail when doing the get just like the case without the consumes.

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 1, 2014

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 1, 2014

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_2_X IBs unless changes (tests are also fine).

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 1, 2014

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 1, 2014

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_2_X IBs unless changes (tests are also fine).

ktf added a commit that referenced this pull request Sep 1, 2014
…n418/PFPileUp-fix

Separate token for the view
@ktf ktf merged commit 0c637ab into cms-sw:CMSSW_7_2_X Sep 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants