1313// / \brief
1414// /
1515
16+ #include < numeric>
17+ #include < sstream>
18+
19+ #include " Framework/Logger.h"
1620#include " ITStracking/TimeFrame.h"
1721#include " ITStracking/MathUtils.h"
1822#include " DataFormatsITSMFT/Cluster.h"
2428#include " ITStracking/BoundedAllocator.h"
2529#include " ITStracking/TrackingConfigParam.h"
2630
27- #include < iostream>
28- #include < numeric>
29-
3031namespace
3132{
3233struct ClusterHelper {
@@ -437,14 +438,14 @@ void TimeFrame<nLayers>::checkTrackletLUTs()
437438 auto & trk = getTracklets ()[iLayer][iTracklet];
438439 int currentId{trk.firstClusterIndex };
439440 if (currentId < prev) {
440- std::cout << " First Cluster Index not increasing monotonically on L:T:ID:Prev " << iLayer << " \t " << iTracklet << " \t " << currentId << " \t " << prev << std::endl ;
441+ LOG (info) << " First Cluster Index not increasing monotonically on L:T:ID:Prev " << iLayer << " \t " << iTracklet << " \t " << currentId << " \t " << prev;
441442 } else if (currentId == prev) {
442443 count++;
443444 } else {
444445 if (iLayer > 0 ) {
445446 auto & lut{getTrackletsLookupTable ()[iLayer - 1 ]};
446447 if (count != lut[prev + 1 ] - lut[prev]) {
447- std::cout << " LUT count broken " << iLayer - 1 << " \t " << prev << " \t " << count << " \t " << lut[prev + 1 ] << " \t " << lut[prev] << std::endl ;
448+ LOG (info) << " LUT count broken " << iLayer - 1 << " \t " << prev << " \t " << count << " \t " << lut[prev + 1 ] << " \t " << lut[prev];
448449 }
449450 }
450451 count = 1 ;
@@ -453,7 +454,7 @@ void TimeFrame<nLayers>::checkTrackletLUTs()
453454 if (iLayer > 0 ) {
454455 auto & lut{getTrackletsLookupTable ()[iLayer - 1 ]};
455456 if (iTracklet >= (uint32_t )(lut[currentId + 1 ]) || iTracklet < (uint32_t )(lut[currentId])) {
456- std::cout << " LUT broken: " << iLayer - 1 << " \t " << currentId << " \t " << iTracklet << std::endl ;
457+ LOG (info) << " LUT broken: " << iLayer - 1 << " \t " << currentId << " \t " << iTracklet;
457458 }
458459 }
459460 }
@@ -491,25 +492,25 @@ void TimeFrame<nLayers>::resetTracklets()
491492template <int nLayers>
492493void TimeFrame<nLayers>::printTrackletLUTonLayer(int i)
493494{
494- std::cout << " --------" << std::endl
495- << " Tracklet LUT " << i << std::endl ;
495+ LOG (info) << " -------- Tracklet LUT " << i;
496+ std::stringstream s ;
496497 for (int j : mTrackletsLookupTable [i]) {
497- std::cout << j << " \t " ;
498+ s << j << " \t " ;
498499 }
499- std::cout << " \n -------- " << std::endl
500- << std::endl ;
500+ LOG (info) << s. str ();
501+ LOG (info) << " -------- " ;
501502}
502503
503504template <int nLayers>
504505void TimeFrame<nLayers>::printCellLUTonLayer(int i)
505506{
506- std::cout << " --------" << std::endl
507- << " Cell LUT " << i << std::endl ;
507+ LOG (info) << " -------- Cell LUT " << i;
508+ std::stringstream s ;
508509 for (int j : mCellsLookupTable [i]) {
509- std::cout << j << " \t " ;
510+ s << j << " \t " ;
510511 }
511- std::cout << " \n -------- " << std::endl
512- << std::endl ;
512+ LOG (info) << s. str ();
513+ LOG (info) << " -------- " ;
513514}
514515
515516template <int nLayers>
@@ -531,56 +532,58 @@ void TimeFrame<nLayers>::printCellLUTs()
531532template <int nLayers>
532533void TimeFrame<nLayers>::printVertices()
533534{
534- std::cout << " Vertices in ROF (nROF = " << mNrof << " , lut size = " << mROFramesPV .size () << " )" << std::endl ;
535+ LOG (info) << " Vertices in ROF (nROF = " << mNrof << " , lut size = " << mROFramesPV .size () << " )" ;
535536 for (unsigned int iR{0 }; iR < mROFramesPV .size (); ++iR) {
536- std::cout << mROFramesPV [iR] << " \t " ;
537+ LOG (info) << mROFramesPV [iR] << " \t " ;
537538 }
538- std::cout << " \n\n Vertices:" << std::endl ;
539+ LOG (info) << " \n\n Vertices:" ;
539540 for (unsigned int iV{0 }; iV < mPrimaryVertices .size (); ++iV) {
540- std::cout << mPrimaryVertices [iV].getX () << " \t " << mPrimaryVertices [iV].getY () << " \t " << mPrimaryVertices [iV].getZ () << std::endl ;
541+ LOG (info) << mPrimaryVertices [iV].getX () << " \t " << mPrimaryVertices [iV].getY () << " \t " << mPrimaryVertices [iV].getZ ();
541542 }
542- std::cout << " --------" << std::endl ;
543+ LOG (info) << " --------" ;
543544}
544545
545546template <int nLayers>
546547void TimeFrame<nLayers>::printROFoffsets()
547548{
548- std::cout << " --------" << std::endl ;
549+ LOG (info) << " --------" ;
549550 for (unsigned int iLayer{0 }; iLayer < mROFramesClusters .size (); ++iLayer) {
550- std::cout << " Layer " << iLayer << std::endl;
551+ LOG (info) << " Layer " << iLayer;
552+ std::stringstream s;
551553 for (auto value : mROFramesClusters [iLayer]) {
552- std::cout << value << " \t " ;
554+ s << value << " \t " ;
553555 }
554- std::cout << std::endl ;
556+ LOG (info) << s. str () ;
555557 }
556558}
557559
558560template <int nLayers>
559561void TimeFrame<nLayers>::printNClsPerROF()
560562{
561- std::cout << " --------" << std::endl ;
563+ LOG (info) << " --------" ;
562564 for (unsigned int iLayer{0 }; iLayer < mNClustersPerROF .size (); ++iLayer) {
563- std::cout << " Layer " << iLayer << std::endl;
565+ LOG (info) << " Layer " << iLayer;
566+ std::stringstream s;
564567 for (auto & value : mNClustersPerROF [iLayer]) {
565- std::cout << value << " \t " ;
568+ s << value << " \t " ;
566569 }
567- std::cout << std::endl ;
570+ LOG (info) << s. str () ;
568571 }
569572}
570573
571574template <int nLayers>
572575void TimeFrame<nLayers>::printSliceInfo(const int startROF, const int sliceSize)
573576{
574- std::cout << " Dumping slice of " << sliceSize << " rofs:" << std::endl ;
577+ LOG (info) << " Dumping slice of " << sliceSize << " rofs:" ;
575578 for (int iROF{startROF}; iROF < startROF + sliceSize; ++iROF) {
576- std::cout << " ROF " << iROF << " dump:" << std::endl ;
579+ LOG (info) << " ROF " << iROF << " dump:" ;
577580 for (unsigned int iLayer{0 }; iLayer < mClusters .size (); ++iLayer) {
578- std::cout << " Layer " << iLayer << " has: " << getClustersOnLayer (iROF, iLayer).size () << " clusters." << std::endl ;
581+ LOG (info) << " Layer " << iLayer << " has: " << getClustersOnLayer (iROF, iLayer).size () << " clusters." ;
579582 }
580- std::cout << " Number of seeding vertices: " << getPrimaryVertices (iROF).size () << std::endl ;
583+ LOG (info) << " Number of seeding vertices: " << getPrimaryVertices (iROF).size ();
581584 int iVertex{0 };
582585 for (auto & v : getPrimaryVertices (iROF)) {
583- std::cout << " \t vertex " << iVertex++ << " : x=" << v.getX () << " " << " y=" << v.getY () << " z=" << v.getZ () << " has " << v.getNContributors () << " contributors." << std::endl ;
586+ LOG (info) << " \t vertex " << iVertex++ << " : x=" << v.getX () << " " << " y=" << v.getY () << " z=" << v.getZ () << " has " << v.getNContributors () << " contributors." ;
584587 }
585588 }
586589}
0 commit comments