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

removal of statics from FastSimulation/Event/interface/FBaseSimEvent.icc #1462

Merged
merged 1 commit into from Nov 14, 2013
Merged

removal of statics from FastSimulation/Event/interface/FBaseSimEvent.icc #1462

merged 1 commit into from Nov 14, 2013

Conversation

lveldere
Copy link
Contributor

this pull request replaces #1368

I removed the definition of static FSimTrack, FSimVertex and FSimVertexType.
These statics used to be returned by functions track(int i), vertex(int i), vertexType(int i) in case the index i was out of range.
Now instead an error is thrown.
To avoid indices out of range, a number of changes were made

  • interface/FSimTrack.icc

The function FSimTrack::noEndVertex() now first of all checks if FSimTrack has an end vertex
(index of end vertex >= 0)
associated and returns false if this is not the case.

FSimtrack::nDaughters() returns 0 if the thrack has no daughter

To ease future debugging, errors are thrown when

  • FSimTrack::mother() is called for tracks w/o mother
  • FSimTrack::endVertex() is called for tracks w/o mother
  • FSimTrack::daugther(int i) is called with i out of range
  • FSimTrack::daughters() is called for track w/o end vertex
  • src/FSimEvent.cc

The function FSimEvent::load(edm::SimTrackContainer & c, edm::SimTrackContainer & m)
now verifies wether a track has a mother (index mother >= 0)
before evaluating the properties of the mother.

  • FastSimulation/TrajectoryManager/src/TrajectoryManager.cc

avoided the call of FSimTrack::mother() for tracks w/o mother

** Tests:
runTheMatrix.py -l 5.1,401.0

I removed the definition of static FSimTrack, FSimVertex and FSimVertexType.
These statics used to be returned by functions track(int i), vertex(int i), vertexType(int i) in case the index i was out of range.
Now instead an error is thrown.
To avoid indices out of range, a number of changes were made

* interface/FSimTrack.icc

The function FSimTrack::noEndVertex() now first of all checks if FSimTrack has an end vertex
(index of end vertex >= 0)
associated and returns false if this is not the case.

FSimtrack::nDaughters() returns 0 if the thrack has no daughter

To ease future debugging, errors are thrown when
- FSimTrack::mother() is called for tracks w/o mother
- FSimTrack::endVertex() is called for tracks w/o mother
- FSimTrack::daugther(int i) is called with i out of range
- FSimTrack::daughters() is called for track w/o end vertex

* src/FSimEvent.cc

The function FSimEvent::load(edm::SimTrackContainer & c, edm::SimTrackContainer & m)
now verifies wether a track has a mother (index mother >= 0)
before evaluating the properties of the mother.

* FastSimulation/TrajectoryManager/src/TrajectoryManager.cc

avoided the call of FSimTrack::mother() for tracks w/o mother

** Tests:
runTheMatrix.py -l 5.1,401.0
@cmsbuild
Copy link
Contributor

A new Pull Request was created by @lveldere for CMSSW_7_0_X.

removal of statics from FastSimulation/Event/interface/FBaseSimEvent.icc

It involves the following packages:

FastSimulation/TrajectoryManager
FastSimulation/Event

@cmsbuild, @nclopezo, @giamman, @lveldere 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.
@ktf you are the release manager for this.

@giamman
Copy link
Contributor

giamman commented Nov 14, 2013

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next IBs unless changes or unless it breaks tests. @ktf can you please take care of it?

}

inline const std::vector<int>& FSimTrack::daughters() const {
return abs(type()) != 11 ? endVertex().daughters() : daugh_;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Andrea,
would there be a particular reason why the special treatment is only for electrons and not for muons?
at all other places in this file, muons and electrons are treated equal

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next IBs unless changes or unless it breaks tests. @ktf can you please take care of it?

@giamman
Copy link
Contributor

giamman commented Nov 14, 2013

@lveldere Unfortunately I don't know (*) ... That class is very old, it must have been written by Patrick Janot himself. Why not asking him?

(*) my guess is that it may have to do with bremsstrahlung.

ktf added a commit that referenced this pull request Nov 14, 2013
Multithreading fixes -- Removal of statics from FastSimulation/Event/interface/FBaseSimEvent.icc
@ktf ktf merged commit 62ee651 into cms-sw:CMSSW_7_0_X Nov 14, 2013
@lveldere lveldere deleted the remove-statics-FSevent-take2 branch March 19, 2014 16:04
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