diff --git a/Reconstruction/Tracking/src/Clupatra/ClupatraAlg.cpp b/Reconstruction/Tracking/src/Clupatra/ClupatraAlg.cpp index 40a4f3960db9012d1461f7f01db87f867ef02b21..8889bc19e1cad7cd697c1a715bed77e6449707a3 100644 --- a/Reconstruction/Tracking/src/Clupatra/ClupatraAlg.cpp +++ b/Reconstruction/Tracking/src/Clupatra/ClupatraAlg.cpp @@ -545,7 +545,7 @@ StatusCode ClupatraAlg::execute() { MarlinTrk::IMarlinTrack* mTrk = fitter( *icv ) ; - debug() << "before add hits and filter" << endmsg; + debug() << "before add hits and filter, mTrk = " << mTrk << endmsg; // std::vector<std::pair<edm4hep::TrackerHit, double> > hitsInFit ; // mTrk->getHitsInFit( hitsInFit ) ; // for (auto hit : hitsInFit) std::cout << hit.first << std::endl; diff --git a/Reconstruction/Tracking/src/Clupatra/clupatra_new.cpp b/Reconstruction/Tracking/src/Clupatra/clupatra_new.cpp index ee11aba6d764feb53dc7114eb2ccd156e71d92a2..66282d7cceb0ac824ddfdbeb525d4cfde7f8fcfe 100644 --- a/Reconstruction/Tracking/src/Clupatra/clupatra_new.cpp +++ b/Reconstruction/Tracking/src/Clupatra/clupatra_new.cpp @@ -294,7 +294,7 @@ namespace clupatra_new{ encoder[UTIL::ILDCellID0::subdet] = UTIL::ILDDetID::TPC ; #if PODIO_BUILD_VERSION < PODIO_VERSION(0, 17, 4) - edm4hep::TrackerHit firstHit = 0; + edm4hep::TrackerHit firstHit(0); #else auto firstHit = edm4hep::TrackerHit::makeEmpty(); #endif @@ -353,7 +353,6 @@ namespace clupatra_new{ IMarlinTrack* theTrk = ( bwTrk ? bwTrk : trk ) ; - while( step < maxStep + 1 ) { layer += ( backward ? +1 : -1 ) ; @@ -379,27 +378,16 @@ namespace clupatra_new{ int intersects = -1 ; - if( firstHit.isAvailable() ) { // FIXME Mingrui:: Important!! need to check whether firstHit is OK or not. -// std::cout << "available" << std::endl; -// std::cout << layerID << std::endl; -// std::cout << firstHit << std::endl; -// std::cout << xv << std::endl; -// std::cout << elementID << std::endl; -// std::cout << mode << std::endl; - intersects = theTrk->intersectionWithLayer( layerID, firstHit, xv, elementID , mode ) ; - + if( firstHit.isAvailable() ) { + intersects = theTrk->intersectionWithLayer( layerID, firstHit, xv, elementID , mode ); } else { - - intersects = theTrk->intersectionWithLayer( layerID, xv, elementID , mode ) ; + intersects = theTrk->intersectionWithLayer( layerID, xv, elementID , mode ); } - - - - // std::cout << " -- addHitsAndFilter(): looked for intersection - " - // << " Step : " << step - // << " at layer: " << layer - // << " intersects: " << MarlinTrk::errorCode( intersects ) - // << " next xing point : " << xv ; + //std::cout << " -- addHitsAndFilter(): looked for intersection - " + // << " Step : " << step + // << " at layer: " << layer + // << " intersects: " << MarlinTrk::errorCode( intersects ) + // << " next xing point : " << xv ; if( intersects == IMarlinTrack::success ) { // found a crossing point @@ -465,7 +453,7 @@ namespace clupatra_new{ hLL.remove( bestHit ) ; clu->addElement( bestHit ) ; - // firstHit = 0 ; // after we added a hit, the next intersection search should use this last hit... + // after we added a hit, the next intersection search should use this last hit... firstHit.unlink(); ++nHitsAdded ; @@ -520,13 +508,11 @@ namespace clupatra_new{ // IMarlinTrack::modeBackward , IMarlinTrack::modeForward - /* - streamlog_out( DEBUG2 ) << " ============ addHitAndFilter(): looked for intersection - " - << " detector : " << detectorID - << " at layer: " << layer - << " intersects: " << MarlinTrk::errorCode( intersects ) - << " next xing point : " << xv ; - */ + //std::cout << " ============ addHitAndFilter(): looked for intersection - " + // << " detector : " << detectorID + // << " at layer: " << layer + // << " intersects: " << MarlinTrk::errorCode( intersects ) + // << " next xing point : " << xv ; bool hitAdded = false ; @@ -1283,12 +1269,15 @@ start: // for (auto hit : hitsInFit) std::cout << hit.first << std::endl; if( code != MarlinTrk::IMarlinTrack::success ){ - - std::cout << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> IMarlinTrkFitter : problem fitting track " - << " error code : " << MarlinTrk::errorCode( code ) - << std::endl ; - delete trk; - return 0; + if (!isFirstFit) { + // only report while repeat + std::cout << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> IMarlinTrkFitter : problem fitting track " + << " error code : " << MarlinTrk::errorCode( code ) + << std::endl ; + } + // don't return, will repeat for double _maxChi2Increment, if found still after repeat, TODO + //delete trk; + //return 0; } diff --git a/Service/TrackSystemSvc/src/MarlinKalTestTrack.cc b/Service/TrackSystemSvc/src/MarlinKalTestTrack.cc index 3ca601461c16443ca6352740f3358c3a4eb499cb..839da062c47ca5e1121efe82a5d07b5c50682ba9 100644 --- a/Service/TrackSystemSvc/src/MarlinKalTestTrack.cc +++ b/Service/TrackSystemSvc/src/MarlinKalTestTrack.cc @@ -1412,7 +1412,8 @@ namespace MarlinTrk { } int MarlinKalTestTrack::intersectionWithLayer( int layerID, edm4hep::Vector3d& point, int& detElementID, int mode ) { - + //std::cout << "debug: intersectionWithLayer" << std::endl; + //std::cout << "debug: layer=" << layerID << " pos=" << point.x << " " << point.y << " " << point.z << " det=" << detElementID << std::endl; const TKalTrackSite& site = *(dynamic_cast<const TKalTrackSite*>(_kaltrack->Last())) ; const ILDVMeasLayer* ml = 0; return this->intersectionWithLayer( layerID, site, point, detElementID, ml, mode ) ; @@ -1421,7 +1422,9 @@ namespace MarlinTrk { int MarlinKalTestTrack::intersectionWithLayer( int layerID, edm4hep::TrackerHit& trkhit, edm4hep::Vector3d& point, int& detElementID, int mode ) { - + //std::cout << "debug: intersectionWithLayer" << std::endl; + //std::cout << "debug: layer=" << layerID << " pos=" << point.x << " " << point.y << " " << point.z << " det=" << detElementID + // << " from first hit " << trkhit.getPosition().x << " " << trkhit.getPosition().y << trkhit.getPosition().z << std::endl; TKalTrackSite* site = 0; int error_code = getSiteFromLCIOHit(trkhit, site);