-
Notifications
You must be signed in to change notification settings - Fork 19
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
Conversation
- treat correctly composite spacepoints (from strip stereo layers) - protect against initialization error - fix logic for backward tracks hitting endcap
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
src/DDTrackCreatorBase.cc
Outdated
//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] ); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
src/DDTrackCreatorBase.cc
Outdated
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
BEGINRELEASENOTES
ENDRELEASENOTES