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

solve a long standing performance issue with Vertex::TrackWeight #2894

Merged
merged 2 commits into from Mar 23, 2014

Conversation

VinInn
Copy link
Contributor

@VinInn VinInn commented Mar 17, 2014

may be used elsewhere

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @VinInn (Vincenzo Innocente) for CMSSW_7_1_X.

solve a long standing performance issue with Vertex::TrackWeight

It involves the following packages:

DataFormats/VertexReco

@nclopezo, @cmsbuild, @anton-a, @thspeer, @slava77, @Degano 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.
@nclopezo, @ktf you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@cmsbuild
Copy link
Contributor

///returns the weight with which a Track has contributed to the vertex-fit.
float trackWeight ( const TrackBaseRef & r ) const;
///returns the weight with which a Track has contributed to the vertex-fit.
float trackWeight ( const TrackRef & r ) const;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we not need a definition of trackWeight when we do not have C++11?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point,
@vadler @Dr15Jones @alja
maybe Volker or Chris or Alja could comment if it's actively used in FWLite-based code.
(I never trust using Refs in FWLite, but that's mostly based on TChain experience reading from multiple files).

Other than "auto", this is a regular C++, so this code can be changed for compliance

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I though about it (after had deleted the old code)
is trivial
#else
old interface
#endif
I did in other places...

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to me that we either need no ifdef or an else

On Mar 19, 2014, at 12:16 PM, "Vincenzo Innocente" <notifications@github.commailto:notifications@github.com> wrote:

In DataFormats/VertexReco/interface/Vertex.h:

 ///returns the weight with which a Track has contributed to the vertex-fit.
  • float trackWeight ( const TrackBaseRef & r ) const;
  • ///returns the weight with which a Track has contributed to the vertex-fit.
  • float trackWeight ( const TrackRef & r ) const;

I though about it (after had deleted the old code)
is trivial
#else
old interface
#endif
I did in other places...


Reply to this email directly or view it on GitHubhttps://github.com//pull/2894/files#r10744729.

Copy link
Contributor

Choose a reason for hiding this comment

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

On 3/19/14, 6:15 AM, Vincenzo Innocente wrote:

In DataFormats/VertexReco/interface/Vertex.h:

 ///returns the weight with which a Track has contributed to the vertex-fit.
  • float trackWeight ( const TrackBaseRef & r ) const;
  • ///returns the weight with which a Track has contributed to the vertex-fit.
  • float trackWeight ( const TrackRef & r ) const;

I though about it (after had deleted the old code)
is trivial
#else
old interface
#endif
I did in other places...

Still confused. Isn't the only c++11 thing here the
"for (auto t: tracks_)" ?
If so, there's no cost to write the same with vector::const_iterator

Did I miss something?

    --slava


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


Vyacheslav (Slava) Krutelyov
TAMU: Physics Dept Texas A&M MS4242, College Station, TX 77843-4242
CERN: 42-R-027
AIM/Skype: siava16 googleTalk: slava77@gmail.com
(630) 291-5128 Cell (US) +41 76 275 7116 Cell (CERN)


Copy link
Contributor Author

Choose a reason for hiding this comment

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

On 19 Mar, 2014, at 1:10 PM, slava77 notifications@github.com wrote:

Still confused. Isn't the only c++11 thing here the "for (auto t: tracks_)" ? If so, there's no cost to write the same with vector::const_iterator Did I miss something?
I think that tempplates are a bit useless in FWLite or similar.
They need generated function or template instantiation…
v.

@VinInn
Copy link
Contributor Author

VinInn commented Mar 20, 2014

test again?

@cmsbuild
Copy link
Contributor

Pull request #2894 was updated. @nclopezo, @cmsbuild, @anton-a, @thspeer, @slava77, @Degano can you please check and sign again.

@cmsbuild
Copy link
Contributor

@slava77
Copy link
Contributor

slava77 commented Mar 23, 2014

+1

for #2894 47b67c6
tested in CMSSW_7_1_X_2014-03-18-0200 (sign322)

no regressions

the calls to trackWeight apparently went down in cpu cost by about x2. It's hard to tell precisely because some are fully inlined some still show up as a separate call.

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_1_X IBs unless changes (tests are also fine). @nclopezo, @ktf can you please take care of it?

davidlange6 added a commit that referenced this pull request Mar 23, 2014
solve a long standing performance issue with Vertex::TrackWeight
@davidlange6 davidlange6 merged commit 3bfcc67 into cms-sw:CMSSW_7_1_X Mar 23, 2014
@VinInn VinInn deleted the VertexWeight branch April 21, 2017 11:48
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

4 participants