@@ -33,7 +33,6 @@ class TrackLTF : public TrackMFTExt
3333 TrackLTF () = default ;
3434 TrackLTF (const TrackLTF& t) = default ;
3535 ~TrackLTF () = default ;
36- const Int_t getNPoints () const { return mNPoints ; }
3736 const std::array<Float_t, constants::mft::LayersNumber>& getXCoordinates () const { return mX ; }
3837 const std::array<Float_t, constants::mft::LayersNumber>& getYCoordinates () const { return mY ; }
3938 const std::array<Float_t, constants::mft::LayersNumber>& getZCoordinates () const { return mZ ; }
@@ -42,13 +41,10 @@ class TrackLTF : public TrackMFTExt
4241 const std::array<Int_t, constants::mft::LayersNumber>& getLayers () const { return mLayer ; }
4342 const std::array<Int_t, constants::mft::LayersNumber>& getClustersId () const { return mClusterId ; }
4443 const std::array<MCCompLabel, constants::mft::LayersNumber>& getMCCompLabels () const { return mMCCompLabels ; }
45- void setPoint (const Cluster, const Int_t layer, const Int_t clusterId, const MCCompLabel label, Bool_t& newPoint);
44+ void setPoint (const Cluster, const Int_t layer, const Int_t clusterId, const MCCompLabel label, const Int_t extClsIndex, Bool_t& newPoint);
4645
4746 void sort ();
4847
49- protected:
50- Int_t mNPoints {0 };
51-
5248 private:
5349 std::array<Float_t, constants::mft::LayersNumber> mX = {-25 ., -25 ., -25 ., -25 ., -25 ., -25 ., -25 ., -25 ., -25 ., -25 .};
5450 std::array<Float_t, constants::mft::LayersNumber> mY = {-25 ., -25 ., -25 ., -25 ., -25 ., -25 ., -25 ., -25 ., -25 ., -25 .};
@@ -105,46 +101,48 @@ inline void TrackCA::removeLastCell(Int_t& layer, Int_t& cellId)
105101 layer = mCellLayer [mNCells - 1 ];
106102 cellId = mCellId [mNCells - 1 ];
107103
108- if (mNPoints == 2 ) { // we have only a single cell in the track
109- mNPoints --;
104+ auto nPoints = getNumberOfPoints ();
105+ if (nPoints == 2 ) { // we have only a single cell in the track
106+ setNumberOfPoints (--nPoints);
110107 }
111- mNPoints -- ;
108+ setNumberOfPoints (--nPoints) ;
112109 mNCells --;
113110}
114111
115112// _________________________________________________________________________________________________
116- inline void TrackLTF::setPoint (const Cluster cl, const Int_t layer, const Int_t clusterId, const MCCompLabel label, Bool_t& newPoint)
113+ inline void TrackLTF::setPoint (const Cluster cl, const Int_t layer, const Int_t clusterId, const MCCompLabel label, const Int_t extClsIndex, Bool_t& newPoint)
117114{
115+ auto nPoints = getNumberOfPoints ();
118116 if (newPoint) {
119- if (mNPoints > 0 )
120- if (mZ [mNPoints - 1 ] == cl.getZ ()) {
117+ if (nPoints > 0 )
118+ if (mZ [nPoints - 1 ] == cl.getZ ()) {
121119 LOG (WARN ) << " MFT TrackLTF: skipping setPoint (1 cluster per layer!)" ;
122120 return ;
123121 }
124- if (mNPoints >= constants::mft::LayersNumber - 1 ) {
122+ if (nPoints > constants::mft::LayersNumber) {
125123 LOG (WARN ) << " MFT TrackLTF Overflow" ;
126124 return ;
127125 }
128- mX [mNPoints ] = cl.getX ();
129- mY [mNPoints ] = cl.getY ();
130- mZ [mNPoints ] = cl.getZ ();
131- mSigmaX2 [mNPoints ] = cl.sigmaX2 ;
132- mSigmaY2 [mNPoints ] = cl.sigmaY2 ;
133- mLayer [mNPoints ] = layer;
134- mClusterId [mNPoints ] = clusterId;
135- mMCCompLabels [mNPoints ] = label;
136- mNPoints ++ ;
137- setClusterIndex (layer, clusterId, mNPoints );
126+ mX [nPoints ] = cl.getX ();
127+ mY [nPoints ] = cl.getY ();
128+ mZ [nPoints ] = cl.getZ ();
129+ mSigmaX2 [nPoints ] = cl.sigmaX2 ;
130+ mSigmaY2 [nPoints ] = cl.sigmaY2 ;
131+ mLayer [nPoints ] = layer;
132+ mClusterId [nPoints ] = clusterId;
133+ mMCCompLabels [nPoints ] = label;
134+ setExternalClusterIndex (nPoints, extClsIndex) ;
135+ setNumberOfPoints (nPoints + 1 );
138136 } else {
139- mX [mNPoints ] = cl.getX ();
140- mY [mNPoints ] = cl.getY ();
141- mZ [mNPoints ] = cl.getZ ();
142- mSigmaX2 [mNPoints ] = cl.sigmaX2 ;
143- mSigmaY2 [mNPoints ] = cl.sigmaY2 ;
144- mLayer [mNPoints ] = layer;
145- mClusterId [mNPoints ] = clusterId;
146- mMCCompLabels [mNPoints ] = label;
147- setClusterIndex (layer, clusterId, mNPoints );
137+ mX [nPoints ] = cl.getX ();
138+ mY [nPoints ] = cl.getY ();
139+ mZ [nPoints ] = cl.getZ ();
140+ mSigmaX2 [nPoints ] = cl.sigmaX2 ;
141+ mSigmaY2 [nPoints ] = cl.sigmaY2 ;
142+ mLayer [nPoints ] = layer;
143+ mClusterId [nPoints ] = clusterId;
144+ mMCCompLabels [nPoints ] = label;
145+ setExternalClusterIndex (nPoints, extClsIndex );
148146 }
149147}
150148
@@ -161,11 +159,12 @@ inline void TrackLTF::sort()
161159 Int_t layer;
162160 Int_t clusterId;
163161 MCCompLabel label;
162+ Int_t extClsIndex;
164163 };
165164 std::vector<ClusterData> points;
166165
167166 // Loading cluster data
168- for (Int_t point = 0 ; point < getNPoints (); ++point) {
167+ for (Int_t point = 0 ; point < getNumberOfPoints (); ++point) {
169168 auto & somepoint = points.emplace_back ();
170169 somepoint.x = mX [point];
171170 somepoint.y = mY [point];
@@ -175,13 +174,14 @@ inline void TrackLTF::sort()
175174 somepoint.layer = mLayer [point];
176175 somepoint.clusterId = mClusterId [point];
177176 somepoint.label = mMCCompLabels [point];
177+ somepoint.extClsIndex = mExtClsIndex [point];
178178 }
179179
180180 // Sorting cluster data
181181 std::sort (points.begin (), points.end (), [](ClusterData a, ClusterData b) { return a.z > b.z ; });
182182
183183 // Storing sorted cluster data
184- for (Int_t point = 0 ; point < getNPoints (); ++point) {
184+ for (Int_t point = 0 ; point < getNumberOfPoints (); ++point) {
185185 mX [point] = points[point].x ;
186186 mY [point] = points[point].y ;
187187 mZ [point] = points[point].z ;
@@ -190,6 +190,7 @@ inline void TrackLTF::sort()
190190 mLayer [point] = points[point].layer ;
191191 mClusterId [point] = points[point].clusterId ;
192192 mMCCompLabels [point] = points[point].label ;
193+ mExtClsIndex [point] = points[point].extClsIndex ;
193194 }
194195}
195196
0 commit comments