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

fix DDTrackCreatorBase::GetTrackStatesAtCalo #16

Merged
merged 2 commits into from
Oct 18, 2017

Conversation

gaede
Copy link
Contributor

@gaede gaede commented Oct 18, 2017

BEGINRELEASENOTES

ENDRELEASENOTES

 - treat correctly composite spacepoints (from strip stereo layers)
 - protect against initialization error
 - fix logic for backward tracks hitting endcap
@gaede gaede requested a review from andresailer October 18, 2017 10:44
for (int iHit = 0; iHit < nHitsTrack; ++iHit) {
marlintrk->addHit(trkHits[iHit]);
EVENT::TrackerHit* trkHit = trkHits[iHit] ;
if( UTIL::BitSet32( trkHit->getType() )[ UTIL::ILDTrkHitTypeBit::COMPOSITE_SPACEPOINT ] ){ //it is a composite spacepoint
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this necessary, when we get all the hits from the original track? Weren't the hits of the track already added the same way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this is what you have to do to pass an lcio::TrackerHit that is a spacepoint made from two strip hits to MarlinTrk - see here:
https://github.com/iLCSoft/MarlinTrk/blob/master/src/MarlinTrkUtils.cc#L236-L260

Copy link
Contributor

Choose a reason for hiding this comment

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

Then it would be better to change this in the addHit function itself. Avoiding all this code duplication

//Split it up and add both hits to the MarlinTrk
const EVENT::LCObjectVec rawObjects = trkHit->getRawHits();
for( unsigned k=0; k< rawObjects.size(); k++ ){
EVENT::TrackerHit* rawHit = dynamic_cast< EVENT::TrackerHit* >( rawObjects[k] );
Copy link
Contributor

Choose a reason for hiding this comment

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

static_cast or check rawHit for nullptr, or coverity will complain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

EVENT::TrackerHit* trkHit = trkHits[iHit] ;
if( UTIL::BitSet32( trkHit->getType() )[ UTIL::ILDTrkHitTypeBit::COMPOSITE_SPACEPOINT ] ){ //it is a composite spacepoint
//Split it up and add both hits to the MarlinTrk
const EVENT::LCObjectVec rawObjects = trkHit->getRawHits();
Copy link
Contributor

Choose a reason for hiding this comment

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

const&

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@gaede gaede merged commit 6b4f674 into iLCSoft:master Oct 18, 2017
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.

Seg fault caused by invalid track state at calo access
2 participants