diff --git a/Detectors/ITSMFT/ITS/macros/test/CheckTracks.C b/Detectors/ITSMFT/ITS/macros/test/CheckTracks.C index 15e6a4836d9b4..7fd46d167675a 100644 --- a/Detectors/ITSMFT/ITS/macros/test/CheckTracks.C +++ b/Detectors/ITSMFT/ITS/macros/test/CheckTracks.C @@ -153,7 +153,7 @@ void CheckTracks(std::string tracfile = "o2trac_its.root", std::string clusfile if (!recTree->GetEvent(frame)) continue; int loadedEventTracks = frame; - cout << "Number of tracks in frame " << frame << ": " << recArr->size() << std::endl; + cout << "Number of tracks in frame " << frame << ": " << recArr->size() << std::endl; for (unsigned int i = 0; i < recArr->size(); i++) { // Find the last MC event within this reconstructed entry auto lab = (*trkLabArr)[i]; if (!lab.isValid()) { diff --git a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/Cluster.h b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/Cluster.h index 9da2bba1409c6..2a2e643649417 100644 --- a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/Cluster.h +++ b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/Cluster.h @@ -40,8 +40,8 @@ struct Cluster final { float xCoordinate; // = -999.f; float yCoordinate; // = -999.f; float zCoordinate; // = -999.f; - float phi; // = -999.f; - float radius; // = -999.f; + float phi; // = -999.f; + float radius; // = -999.f; int clusterId; // = -1; int indexTableBinIndex; // = -1; diff --git a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/MathUtils.h b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/MathUtils.h index b508c1baf9e9a..bddca746bad90 100644 --- a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/MathUtils.h +++ b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/MathUtils.h @@ -57,8 +57,7 @@ GPUhdi() float math_utils::hypot(const float x, const float y) GPUhdi() constexpr float math_utils::getNormalizedPhi(const float phi) { - return (phi < 0) ? phi + constants::math::TwoPi : - (phi > constants::math::TwoPi) ? phi - constants::math::TwoPi : phi; + return (phi < 0) ? phi + constants::math::TwoPi : (phi > constants::math::TwoPi) ? phi - constants::math::TwoPi : phi; } GPUhdi() constexpr float3 math_utils::crossProduct(const float3& firstVector, const float3& secondVector) diff --git a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TimeFrame.h b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TimeFrame.h index 2b45d5d2ab1ee..40e8f8787ac96 100644 --- a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TimeFrame.h +++ b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TimeFrame.h @@ -42,7 +42,7 @@ class Cluster; class CompClusterExt; class TopologyDictionary; class ROFRecord; -} +} // namespace itsmft namespace its { @@ -63,14 +63,14 @@ class TimeFrame final int getTotalClusters() const; bool empty() const; - int getSortedIndex(int rof, int layer, int i) const; - int getNrof() const; + int getSortedIndex(int rof, int layer, int i) const; + int getNrof() const; float getBeamX() const; float getBeamY() const; float getMinR(int layer) const { return mMinR[layer]; } float getMaxR(int layer) const { return mMaxR[layer]; } - + gsl::span getClustersOnLayer(int rofId, int layerId); gsl::span getClustersOnLayer(int rofId, int layerId) const; gsl::span getUnsortedClustersOnLayer(int rofId, int layerId) const; @@ -121,43 +121,42 @@ class TimeFrame final void addClusterLabelToLayer(int layer, const MCCompLabel label); void addClusterExternalIndexToLayer(int layer, const int idx); - int mNrof = 0; - int mBeamPosWeight = 0; - float mBeamPos[2] = {0.f,0.f}; - std::vector mMinR; - std::vector mMaxR; - std::vector mROframesPV = {0}; - std::vector> mROframesClusters; - std::vector mPrimaryVertices; - std::vector> mClusters; - std::vector> mUnsortedClusters; - std::vector> mUsedClusters; + int mNrof = 0; + int mBeamPosWeight = 0; + float mBeamPos[2] = {0.f, 0.f}; + std::vector mMinR; + std::vector mMaxR; + std::vector mROframesPV = {0}; + std::vector> mROframesClusters; + std::vector mPrimaryVertices; + std::vector> mClusters; + std::vector> mUnsortedClusters; + std::vector> mUsedClusters; std::vector> mTrackingFrameInfo; - std::vector> mClusterLabels; - std::vector> mClusterExternalIndices; - std::vector> mCells; - std::vector> mCellsLookupTable; - std::vector>> mCellsNeighbours; - std::vector mRoads; + std::vector> mClusterLabels; + std::vector> mClusterExternalIndices; + std::vector> mCells; + std::vector> mCellsLookupTable; + std::vector>> mCellsNeighbours; + std::vector mRoads; - std::vector mIndexTables; - std::vector> mTracklets; - std::vector> mTrackletsLookupTable; + std::vector mIndexTables; + std::vector> mTracklets; + std::vector> mTrackletsLookupTable; std::vector> mRoadLabels; }; - inline const float3& TimeFrame::getPrimaryVertex(const int vertexIndex) const { return mPrimaryVertices[vertexIndex]; } inline gsl::span TimeFrame::getPrimaryVertices(int tf) const -{ +{ const int start = tf > 0 ? tf - 1 : 0; const int stop = tf >= mNrof - 1 ? mNrof : tf + 2; return {&mPrimaryVertices[start], static_cast::size_type>(mROframesPV[stop] - mROframesPV[start])}; } -inline gsl::span TimeFrame::getPrimaryVertices(int romin, int romax) const +inline gsl::span TimeFrame::getPrimaryVertices(int romin, int romax) const { return {&mPrimaryVertices[romin], static_cast::size_type>(mROframesPV[romax + 1] - mROframesPV[romin])}; } @@ -323,7 +322,6 @@ inline std::vector>& TimeFrame::getUnsortedClusters() return mUnsortedClusters; } - inline std::vector>& TimeFrame::getCells() { return mCells; } inline std::vector>& TimeFrame::getCellsLookupTable() diff --git a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/Tracker.h b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/Tracker.h index 3b373286c2f11..8529008631082 100644 --- a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/Tracker.h +++ b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/Tracker.h @@ -101,7 +101,7 @@ class Tracker float evaluateTask(void (Tracker::*)(T...), const char*, std::ostream& ostream, T&&... args); TrackerTraits* mTraits = nullptr; /// Observer pointer, not owned by this class - TimeFrame* mTimeFrame = nullptr; /// Observer pointer, not owned by this class + TimeFrame* mTimeFrame = nullptr; /// Observer pointer, not owned by this class std::vector mMemParams; std::vector mTrkParams; diff --git a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackerTraitsCPU.h b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackerTraitsCPU.h index f5c7f6eae5b76..1325b3d623cfd 100644 --- a/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackerTraitsCPU.h +++ b/Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackerTraitsCPU.h @@ -39,7 +39,7 @@ namespace its class TrackerTraitsCPU : public TrackerTraits { public: - TrackerTraitsCPU(TimeFrame *tf = nullptr) { mTimeFrame = tf; } //TODO: the TimeFrame pointer should be given by the tracker that is the external interface + TrackerTraitsCPU(TimeFrame* tf = nullptr) { mTimeFrame = tf; } //TODO: the TimeFrame pointer should be given by the tracker that is the external interface ~TrackerTraitsCPU() override { delete mTimeFrame; } void computeLayerCells() final; diff --git a/Detectors/ITSMFT/ITS/tracking/src/Cluster.cxx b/Detectors/ITSMFT/ITS/tracking/src/Cluster.cxx index f7d7a2476b95f..c14fbe7496936 100644 --- a/Detectors/ITSMFT/ITS/tracking/src/Cluster.cxx +++ b/Detectors/ITSMFT/ITS/tracking/src/Cluster.cxx @@ -22,8 +22,8 @@ namespace its { using math_utils::computePhi; -using math_utils::hypot; using math_utils::getNormalizedPhi; +using math_utils::hypot; Cluster::Cluster(const float x, const float y, const float z, const int index) : xCoordinate{x}, diff --git a/Detectors/ITSMFT/ITS/tracking/src/TimeFrame.cxx b/Detectors/ITSMFT/ITS/tracking/src/TimeFrame.cxx index a889dcf40c707..027aae42172bf 100644 --- a/Detectors/ITSMFT/ITS/tracking/src/TimeFrame.cxx +++ b/Detectors/ITSMFT/ITS/tracking/src/TimeFrame.cxx @@ -286,29 +286,37 @@ void TimeFrame::initialise(const int iteration, const MemoryParameters& memParam } } -void TimeFrame::printTrackletLUTonLayer(int i) { - std::cout << "--------" << std::endl << "Tracklet LUT " << i << std::endl; +void TimeFrame::printTrackletLUTonLayer(int i) +{ + std::cout << "--------" << std::endl + << "Tracklet LUT " << i << std::endl; for (int j : mTrackletsLookupTable[i]) { std::cout << j << "\t"; } - std::cout << "\n--------" << std::endl << std::endl; + std::cout << "\n--------" << std::endl + << std::endl; } -void TimeFrame::printCellLUTonLayer(int i) { - std::cout << "--------" << std::endl << "Cell LUT " << i << std::endl; +void TimeFrame::printCellLUTonLayer(int i) +{ + std::cout << "--------" << std::endl + << "Cell LUT " << i << std::endl; for (int j : mCellsLookupTable[i]) { std::cout << j << "\t"; } - std::cout << "\n--------" << std::endl << std::endl; + std::cout << "\n--------" << std::endl + << std::endl; } -void TimeFrame::printTrackletLUTs() { +void TimeFrame::printTrackletLUTs() +{ for (unsigned int i{0}; i < mTrackletsLookupTable.size(); ++i) { printTrackletLUTonLayer(i); } } -void TimeFrame::printCellLUTs() { +void TimeFrame::printCellLUTs() +{ for (unsigned int i{0}; i < mCellsLookupTable.size(); ++i) { printCellLUTonLayer(i); } diff --git a/Detectors/ITSMFT/ITS/tracking/src/TrackerTraitsCPU.cxx b/Detectors/ITSMFT/ITS/tracking/src/TrackerTraitsCPU.cxx index bb0b15f502d0c..4b426687b2f46 100644 --- a/Detectors/ITSMFT/ITS/tracking/src/TrackerTraitsCPU.cxx +++ b/Detectors/ITSMFT/ITS/tracking/src/TrackerTraitsCPU.cxx @@ -87,7 +87,7 @@ void TrackerTraitsCPU::computeLayerTracklets() maxBinIndex < 0 || maxBinIndex > tf->getIndexTables(rof1)[iLayer].size()) { std::cout << iLayer << "\t" << iCluster << "\t" << zAtRmin << "\t" << zAtRmax << "\t" << mTrkParams.TrackletMaxDeltaZ[iLayer] << "\t" << mTrkParams.TrackletMaxDeltaPhi << std::endl; std::cout << currentCluster.zCoordinate << "\t" << primaryVertex.z << "\t" << currentCluster.radius << std::endl; - std::cout << tf->getMinR(iLayer + 1) << "\t" << currentCluster.radius << "\t" << currentCluster.zCoordinate << std::endl; + std::cout << tf->getMinR(iLayer + 1) << "\t" << currentCluster.radius << "\t" << currentCluster.zCoordinate << std::endl; std::cout << "Illegal access to IndexTable " << firstBinIndex << "\t" << maxBinIndex << "\t" << selectedBinsRect.z << "\t" << selectedBinsRect.x << std::endl; exit(1); } @@ -172,7 +172,7 @@ void TrackerTraitsCPU::computeLayerCells() cellClus1R2 - cellClus0R2}; for (int iNextTracklet{nextLayerFirstTrackletIndex}; iNextTracklet < nextLayerLastTrackletIndex; ++iNextTracklet) { - + if (tf->getTracklets()[iLayer + 1][iNextTracklet].firstClusterIndex != nextLayerClusterIndex) { break; } @@ -201,7 +201,7 @@ void TrackerTraitsCPU::computeLayerCells() tf->getClusters()[iLayer + 2][nextTracklet.secondClusterIndex]}; const float thirdCellClusterR2{thirdCellCluster.radius * - thirdCellCluster.radius}; + thirdCellCluster.radius}; const float3 secondDeltaVector{thirdCellCluster.xCoordinate - cellClus0.xCoordinate, thirdCellCluster.yCoordinate - cellClus0.yCoordinate, diff --git a/macro/run_trac_ca_its.C b/macro/run_trac_ca_its.C index 971c96c22f0a2..fa81af4caf986 100644 --- a/macro/run_trac_ca_its.C +++ b/macro/run_trac_ca_its.C @@ -252,7 +252,7 @@ void run_trac_ca_its(bool cosmics = false, gsl::span patt(patterns->data(), patterns->size()); auto pattIt = patt.begin(); auto clSpan = gsl::span(cclusters->data(), cclusters->size()); - + o2::its::TimeFrame tf; tf.loadROFrameData(rofs, clSpan, pattIt, dict, labels); pattIt = patt.begin(); @@ -270,7 +270,7 @@ void run_trac_ca_its(bool cosmics = false, std::vector vertITS = vertexer.exportVertices(); std::vector> tfVert; for (const auto& vert : vertITS) { - tfVert.push_back(std::make_pair({vert.getX(), vert.getY(), vert.getZ()},vert.getNContributors())); + tfVert.push_back(std::make_pair({vert.getX(), vert.getY(), vert.getZ()}, vert.getNContributors())); } tf.addPrimaryVertices(tfVert); auto& vtxROF = vertROFvec.emplace_back(rof); // register entry and number of vertices in the