1616#ifndef TRACKINGCA_INCLUDE_ROAD_H
1717#define TRACKINGCA_INCLUDE_ROAD_H
1818
19- #ifndef GPUCA_GPUCODE_DEVICE
20- #include < array>
21- #endif
22-
2319#include " ITStracking/Constants.h"
2420#include " GPUCommonDef.h"
2521
26- namespace o2
27- {
28- namespace its
22+ namespace o2 ::its
2923{
3024
3125template <unsigned char maxRoadSize = 5 >
3226class Road final
3327{
3428 public:
35- GPUhd () Road() : mCellIds {}, mRoadSize {}, mIsFakeRoad {} { resetRoad (); }
29+ GPUhd () Road() = default ;
3630 GPUhd () Road(int cellLayer, int cellId) : Road() { addCell (cellLayer, cellId); }
3731
38- GPUhd () int getRoadSize () const ;
39- int getLabel () const ;
40- void setLabel (const int );
41- GPUhd () bool isFakeRoad () const ;
42- void setFakeRoad (const bool );
43- GPUhd () int & operator [](const int &);
44- GPUhd () int operator [](const int &) const ;
32+ GPUhdi () int getRoadSize () const { return mRoadSize ; }
33+ GPUhdi () bool isFakeRoad () const { return mIsFakeRoad ; }
34+ GPUhdi () void setFakeRoad (const bool fake) { mIsFakeRoad = fake; }
35+ GPUhdi () int & operator [](const int & i) { return mCellIds [i]; }
36+ GPUhdi () int operator [](const int & i) const { return mCellIds [i]; }
4537
4638 GPUhd () void resetRoad ()
4739 {
@@ -61,42 +53,12 @@ class Road final
6153 }
6254
6355 private:
64- int mCellIds [maxRoadSize];
56+ int mCellIds [maxRoadSize]{constants::its::UnusedIndex} ;
6557 // int mLabel;
66- unsigned char mRoadSize ;
67- bool mIsFakeRoad ;
58+ unsigned char mRoadSize { 0 } ;
59+ bool mIsFakeRoad { false } ;
6860};
6961
70- template <unsigned char maxRoadSize>
71- GPUhdi () int Road<maxRoadSize>::getRoadSize() const
72- {
73- return mRoadSize ;
74- }
62+ } // namespace o2::its
7563
76- template <unsigned char maxRoadSize>
77- GPUhdi () int & Road<maxRoadSize>::operator [](const int & i)
78- {
79- return mCellIds [i];
80- }
81-
82- template <unsigned char maxRoadSize>
83- GPUhdi () int Road<maxRoadSize>::operator [](const int & i) const
84- {
85- return mCellIds [i];
86- }
87-
88- template <unsigned char maxRoadSize>
89- GPUhdi () bool Road<maxRoadSize>::isFakeRoad() const
90- {
91- return mIsFakeRoad ;
92- }
93-
94- template <unsigned char maxRoadSize>
95- inline void Road<maxRoadSize>::setFakeRoad(const bool isFakeRoad)
96- {
97- mIsFakeRoad = isFakeRoad;
98- }
99- } // namespace its
100- } // namespace o2
101-
102- #endif
64+ #endif
0 commit comments