cms-sw/cmssw — pull request #1462 by lveldere (2013-11-14 09:42:22+00:00)
Title: removal of statics from FastSimulation/Event/interface/FBaseSimEvent.icc

this pull request replaces https://github.com/cms-sw/cmssw/pull/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