Skip to content

Commit 6e1039c

Browse files
bovulpesshahor02
authored andcommitted
MFT: introduce configuration of the tracker
1 parent a42d101 commit 6e1039c

File tree

16 files changed

+373
-200
lines changed

16 files changed

+373
-200
lines changed

Detectors/ITSMFT/MFT/tracking/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ o2_add_library(MFTTracking
1414
src/ROframe.cxx
1515
src/Cluster.cxx
1616
src/IOUtils.cxx
17-
src/TrackFitter.cxx
18-
src/MFTTrackingParam.cxx
17+
src/TrackFitter.cxx
18+
src/MFTTrackingParam.cxx
19+
src/TrackerConfig.cxx
1920
PUBLIC_LINK_LIBRARIES O2::CommonConstants
2021
O2::DataFormatsITSMFT
2122
O2::SimulationDataFormat
@@ -27,4 +28,5 @@ o2_target_root_dictionary(MFTTracking
2728
HEADERS include/MFTTracking/TrackCA.h
2829
HEADERS include/MFTTracking/TrackFitter.h
2930
HEADERS include/MFTTracking/MFTTrackingParam.h
31+
HEADERS include/MFTTracking/TrackerConfig.h
3032
LINKDEF src/MFTTrackingLinkDef.h)

Detectors/ITSMFT/MFT/tracking/include/MFTTracking/Cell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Cell final
3030
{
3131
public:
3232
Cell();
33-
/// layer1, layer2, clsLayer1, clsLayer2, cellId; set level = 1
33+
/// layer1, layer2, clsInLayer1, clsInLayer2, cellId; set level = 1
3434
Cell(const Int_t, const Int_t, const Int_t, const Int_t, const Int_t);
3535

3636
const Int_t getFirstLayerId() const;

Detectors/ITSMFT/MFT/tracking/include/MFTTracking/Cluster.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include <array>
1919
#include "ReconstructionDataFormats/BaseCluster.h"
20-
#include "MFTTracking/IndexTableUtils.h"
2120
#include "GPUCommonDef.h"
2221

2322
namespace o2
@@ -37,7 +36,6 @@ struct Cluster : public o2::BaseCluster<float> {
3736
sigmaY2{sigY2},
3837
isUsed{false} {};
3938
Cluster(const Float_t x, const Float_t y, const Float_t z, const Int_t index);
40-
Cluster(const Int_t layerIndex, const Cluster& other);
4139

4240
void setUsed(Bool_t bval) { isUsed = bval; }
4341
const Bool_t getUsed() { return isUsed; }

Detectors/ITSMFT/MFT/tracking/include/MFTTracking/Constants.h

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include <climits>
1919
#include <vector>
20+
#include <array>
2021

2122
#include <Rtypes.h>
2223

@@ -47,13 +48,6 @@ constexpr std::array<Float_t, LayersNumber> InverseLayerZCoordinate()
4748
{
4849
return std::array<Float_t, LayersNumber>{-1. / 45.3, -1. / 46.7, -1. / 48.6, -1. / 50.0, -1. / 52.4, -1. / 53.8, -1. / 67.7, -1. / 69.1, -1. / 76.1, -1. / 77.5};
4950
}
50-
constexpr Int_t MinTrackPointsLTF{5};
51-
constexpr Int_t MinTrackPointsCA{4};
52-
constexpr Int_t MinTrackStationsLTF{4};
53-
constexpr Int_t MinTrackStationsCA{4};
54-
constexpr Int_t MaxTrackPoints{20};
55-
constexpr Float_t LTFclsRCut{0.0100};
56-
constexpr Float_t ROADclsRCut{0.0400};
5751
constexpr Int_t MaxCellNeighbours{10};
5852
} // namespace mft
5953

@@ -65,38 +59,7 @@ constexpr Float_t RMax{16.0};
6559
constexpr Float_t PhiMin{0.};
6660
constexpr Float_t PhiMax{o2::constants::math::TwoPI}; // [rad]
6761

68-
constexpr Int_t RBins{50};
69-
constexpr Int_t PhiBins{50};
70-
71-
constexpr Int_t RPhiBins{RBins * PhiBins};
72-
73-
constexpr Float_t PhiBinSize{(PhiMax - PhiMin) / PhiBins};
74-
constexpr Float_t RBinSize{(RMax - RMin) / RBins};
75-
76-
constexpr Float_t InversePhiBinSize{PhiBins / (PhiMax - PhiMin)};
77-
constexpr Float_t InverseRBinSize{RBins / (RMax - RMin)};
78-
79-
constexpr UChar_t LTFseed2BinWin{3};
80-
constexpr UChar_t LTFinterBinWin{3};
81-
82-
constexpr Int_t getRBinIndex(const Float_t r)
83-
{
84-
return (Int_t)((r - RMin) * InverseRBinSize);
85-
}
86-
87-
constexpr Int_t getPhiBinIndex(const Float_t phi)
88-
{
89-
return (Int_t)((phi - PhiMin) * InversePhiBinSize);
90-
}
91-
92-
constexpr Int_t getBinIndex(const Int_t rIndex, const Int_t phiIndex)
93-
{
94-
if (0 <= rIndex && rIndex < RBins &&
95-
0 <= phiIndex && phiIndex < PhiBins) {
96-
return (phiIndex * RBins + rIndex);
97-
}
98-
return -1;
99-
}
62+
constexpr Int_t MaxRPhiBins{100 * 100};
10063
} // namespace index_table
10164

10265
} // namespace constants

Detectors/ITSMFT/MFT/tracking/include/MFTTracking/IOUtils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <vector>
2222
#include <gsl/gsl>
2323

24+
#include "MFTTracking/TrackerConfig.h"
2425
#include "MFTTracking/ROframe.h"
2526
#include "ITSMFTBase/SegmentationAlpide.h"
2627
#include "DataFormatsITSMFT/ROFRecord.h"
@@ -56,7 +57,7 @@ constexpr float DefClusError2Col = DefClusErrorCol * DefClusErrorCol;
5657

5758
int loadROFrameData(const o2::itsmft::ROFRecord& rof, ROframe& events, gsl::span<const itsmft::CompClusterExt> clusters,
5859
gsl::span<const unsigned char>::iterator& pattIt, const itsmft::TopologyDictionary& dict,
59-
const dataformats::MCTruthContainer<MCCompLabel>* mClsLabels = nullptr);
60+
const dataformats::MCTruthContainer<MCCompLabel>* mClsLabels = nullptr, const o2::mft::TrackerConfig* trkParam = nullptr);
6061

6162
} // namespace ioutils
6263
} // namespace mft

Detectors/ITSMFT/MFT/tracking/include/MFTTracking/IndexTableUtils.h

Lines changed: 0 additions & 53 deletions
This file was deleted.

Detectors/ITSMFT/MFT/tracking/include/MFTTracking/MFTTrackingParam.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ struct MFTTrackingParam : public o2::conf::ConfigurableParamHelper<MFTTrackingPa
3535
double MFTRadLength = 1.0; // MFT average material budget within acceptance. Should be 0.041
3636
bool verbose = false;
3737

38+
/// tracking algorithm (LTF and CA) parameters
39+
/// minimum number of points for a LTF track
40+
Int_t MinTrackPointsLTF = 5;
41+
/// minimum number of points for a CA track
42+
Int_t MinTrackPointsCA = 4;
43+
/// minimum number of detector stations for a LTF track
44+
Int_t MinTrackStationsLTF = 4;
45+
/// minimum number of detector stations for a CA track
46+
Int_t MinTrackStationsCA = 4;
47+
/// maximum distance for a cluster to be attached to a seed line (LTF)
48+
Float_t LTFclsRCut = 0.0100;
49+
/// maximum distance for a cluster to be attached to a seed line (CA road)
50+
Float_t ROADclsRCut = 0.0400;
51+
/// number of bins in r-direction
52+
Int_t RBins = 50;
53+
/// number of bins in phi-direction
54+
Int_t PhiBins = 50;
55+
/// RPhi search window bin width for the second point of a seed (LTF and CA)
56+
Int_t LTFseed2BinWin = 3;
57+
/// RPhi search window bin width for the intermediate points
58+
Int_t LTFinterBinWin = 3;
59+
3860
O2ParamDef(MFTTrackingParam, "MFTTracking");
3961
};
4062

Detectors/ITSMFT/MFT/tracking/include/MFTTracking/ROframe.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ROframe final
5252

5353
const MCCompLabel& getClusterLabels(Int_t layerId, const Int_t clusterId) const { return mClusterLabels[layerId][clusterId]; }
5454

55-
const std::array<std::pair<Int_t, Int_t>, constants::index_table::RPhiBins>& getClusterBinIndexRange(Int_t layerId) const { return mClusterBinIndexRange[layerId]; }
55+
const std::array<std::pair<Int_t, Int_t>, constants::index_table::MaxRPhiBins>& getClusterBinIndexRange(Int_t layerId) const { return mClusterBinIndexRange[layerId]; }
5656

5757
const Int_t getClusterExternalIndex(Int_t layerId, const Int_t clusterId) const { return mClusterExternalIndices[layerId][clusterId]; }
5858

@@ -89,7 +89,7 @@ class ROframe final
8989
std::array<std::vector<Cluster>, constants::mft::LayersNumber> mClusters;
9090
std::array<std::vector<MCCompLabel>, constants::mft::LayersNumber> mClusterLabels;
9191
std::array<std::vector<Int_t>, constants::mft::LayersNumber> mClusterExternalIndices;
92-
std::array<std::array<std::pair<Int_t, Int_t>, constants::index_table::RPhiBins>, constants::mft::LayersNumber> mClusterBinIndexRange;
92+
std::array<std::array<std::pair<Int_t, Int_t>, constants::index_table::MaxRPhiBins>, constants::mft::LayersNumber> mClusterBinIndexRange;
9393
std::vector<TrackLTF> mTracksLTF;
9494
std::vector<TrackCA> mTracksCA;
9595
std::vector<Road> mRoads;
@@ -149,7 +149,7 @@ inline void ROframe::clear()
149149
mClusters[iLayer].clear();
150150
mClusterLabels[iLayer].clear();
151151
mClusterExternalIndices[iLayer].clear();
152-
for (Int_t iBin = 0; iBin < constants::index_table::RPhiBins; ++iBin) {
152+
for (Int_t iBin = 0; iBin < constants::index_table::MaxRPhiBins; ++iBin) {
153153
mClusterBinIndexRange[iLayer][iBin] = std::pair<Int_t, Int_t>(0, -1);
154154
}
155155
}

Detectors/ITSMFT/MFT/tracking/include/MFTTracking/Tracker.h

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "MFTTracking/ROframe.h"
1919
#include "MFTTracking/TrackFitter.h"
2020
#include "MFTTracking/Cluster.h"
21+
#include "MFTTracking/TrackerConfig.h"
2122

2223
#include "MathUtils/Utils.h"
2324
#include "MathUtils/Cartesian.h"
@@ -26,9 +27,6 @@
2627
#include "SimulationDataFormat/MCTruthContainer.h"
2728
#include "DataFormatsParameters/GRPObject.h"
2829

29-
// BV
30-
#include "TStopwatch.h"
31-
3230
namespace o2
3331
{
3432
namespace mft
@@ -61,8 +59,12 @@ class Tracker
6159
void setROFrame(std::uint32_t f) { mROFrame = f; }
6260
std::uint32_t getROFrame() const { return mROFrame; }
6361

64-
// BV
6562
void initialize();
63+
const o2::mft::TrackerConfig* getConfig() { return mTrackerConfig.get(); }
64+
void setConfig(const TrackerConfig& conf)
65+
{
66+
mTrackerConfig = std::make_unique<o2::mft::TrackerConfig>(conf);
67+
}
6668

6769
private:
6870
void findTracks(ROframe&);
@@ -95,13 +97,24 @@ class Tracker
9597

9698
bool mUseMC = false;
9799

98-
std::array<std::array<std::array<std::vector<Int_t>, constants::index_table::RPhiBins>, (constants::mft::LayersNumber - 1)>, (constants::mft::LayersNumber - 1)> mBinsS;
99-
std::array<std::array<std::array<std::vector<Int_t>, constants::index_table::RPhiBins>, (constants::mft::LayersNumber - 1)>, (constants::mft::LayersNumber - 1)> mBins;
100+
std::array<std::array<std::array<std::vector<Int_t>, constants::index_table::MaxRPhiBins>, (constants::mft::LayersNumber - 1)>, (constants::mft::LayersNumber - 1)> mBinsS;
101+
std::array<std::array<std::array<std::vector<Int_t>, constants::index_table::MaxRPhiBins>, (constants::mft::LayersNumber - 1)>, (constants::mft::LayersNumber - 1)> mBins;
100102

101103
struct TrackElement {
104+
TrackElement() = default;
105+
TrackElement(Int_t la, Int_t id)
106+
{
107+
layer = la;
108+
idInLayer = id;
109+
};
102110
Int_t layer;
103111
Int_t idInLayer;
104112
};
113+
114+
std::vector<TrackElement> roadPoints;
115+
116+
/// tracking configuration parameters
117+
std::unique_ptr<o2::mft::TrackerConfig> mTrackerConfig = nullptr;
105118
};
106119

107120
//_________________________________________________________________________________________________
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
/// \file GeometryTGeo.h
12+
/// \brief Definition of the GeometryTGeo class
13+
/// \author bogdan.vulpescu@clermont.in2p3.fr - adapted from ITS, 21.09.2017
14+
15+
#ifndef ALICEO2_MFT_TRACKERCONFIG_H_
16+
#define ALICEO2_MFT_TRACKERCONFIG_H_
17+
18+
#include "MFTTracking/Constants.h"
19+
#include "MFTTracking/MFTTrackingParam.h"
20+
21+
namespace o2
22+
{
23+
namespace mft
24+
{
25+
class TrackerConfig
26+
{
27+
public:
28+
TrackerConfig();
29+
TrackerConfig(const TrackerConfig& conf);
30+
TrackerConfig& operator=(const TrackerConfig& conf);
31+
32+
void initialize(const MFTTrackingParam& trkParam);
33+
34+
const Int_t getRBinIndex(const Float_t r) const;
35+
const Int_t getPhiBinIndex(const Float_t phi) const;
36+
const Int_t getBinIndex(const Int_t rIndex, const Int_t phiIndex) const;
37+
38+
// tracking configuration parameters
39+
Int_t mMinTrackPointsLTF = 5;
40+
Int_t mMinTrackPointsCA = 4;
41+
Int_t mMinTrackStationsLTF = 4;
42+
Int_t mMinTrackStationsCA = 4;
43+
Float_t mLTFclsRCut = 0.0100;
44+
Float_t mROADclsRCut = 0.0400;
45+
Int_t mLTFseed2BinWin = 3;
46+
Int_t mLTFinterBinWin = 3;
47+
Int_t mRBins = 50;
48+
Int_t mPhiBins = 50;
49+
Int_t mRPhiBins = 50 * 50;
50+
Float_t mRBinSize = (constants::index_table::RMax - constants::index_table::RMin) / 50.;
51+
Float_t mPhiBinSize = constants::index_table::PhiMax / 50.;
52+
Float_t mInverseRBinSize = 50. / (constants::index_table::RMax - constants::index_table::RMin);
53+
Float_t mInversePhiBinSize = 50. / constants::index_table::PhiMax;
54+
55+
private:
56+
57+
ClassDefNV(TrackerConfig, 1);
58+
};
59+
60+
inline const Int_t TrackerConfig::getRBinIndex(const Float_t r) const
61+
{
62+
return (Int_t)((r - constants::index_table::RMin) * mInverseRBinSize);
63+
}
64+
65+
inline const Int_t TrackerConfig::getPhiBinIndex(const Float_t phi) const
66+
{
67+
return (Int_t)((phi - constants::index_table::PhiMin) * mInversePhiBinSize);
68+
}
69+
70+
inline const Int_t TrackerConfig::getBinIndex(const Int_t rIndex, const Int_t phiIndex) const
71+
{
72+
if (0 <= rIndex && rIndex < mRBins &&
73+
0 <= phiIndex && phiIndex < mPhiBins) {
74+
return (phiIndex * mRBins + rIndex);
75+
}
76+
return (mRBins * mPhiBins);
77+
}
78+
79+
} // namespace mft
80+
} // namespace o2
81+
82+
#endif

0 commit comments

Comments
 (0)