Skip to content

Commit

Permalink
Make sure to propagate type information into the relation
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Feb 16, 2024
1 parent e67a85b commit 3fc54a2
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions source/Refitting/src/RefitProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,11 @@ void RefitProcessor::processEvent( LCEvent * evt ) {
LCFlagImpl trkFlag(0) ;
trkFlag.setBit( LCIO::TRBIT_HITS ) ;
trackVec->setFlag( trkFlag.getFlag() ) ;
// establish the track relations collection that will be created
LCCollectionVec* trackRelVec = new LCCollectionVec( LCIO::LCRELATION ) ;

// establish the track relations collection that will be created
auto trackRelNav = UTIL::LCRelationNavigator(LCIO::TRACK, LCIO::MCPARTICLE);

int nTracks = input_track_col->getNumberOfElements() ;

streamlog_out(DEBUG4) << "Processing input collection " << _input_track_col_name << " with " << nTracks << " tracks\n";

// loop over the input tacks and refit using KalTest
Expand Down Expand Up @@ -394,25 +393,17 @@ void RefitProcessor::processEvent( LCEvent * evt ) {

// assign the relations previously assigned to the input tracks
if(input_track_rels){
LCObjectVec objVec = input_track_rels->getRelatedToObjects( track_to_refit );
FloatVec weights = input_track_rels->getRelatedToWeights( track_to_refit );
const auto& objVec = input_track_rels->getRelatedToObjects( track_to_refit );
const auto& weights = input_track_rels->getRelatedToWeights( track_to_refit );

for( unsigned int irel=0 ; irel < objVec.size() ; ++irel ){

LCRelationImpl* rel = new LCRelationImpl ;
rel->setFrom (refittedTrack) ;
rel->setTo ( objVec[irel] ) ;
rel->setWeight(weights[irel]) ;
trackRelVec->addElement( rel );

trackRelNav.addRelation(refittedTrack, objVec[irel], weights[irel]);
}
}



}
}

evt->addCollection( trackVec , _output_track_col_name) ;
auto trackRelVec = trackRelNav.createLCCollection();
evt->addCollection( trackRelVec , _output_track_rel_name) ;
}
++_n_evt ;
Expand Down

0 comments on commit 3fc54a2

Please sign in to comment.