@@ -65,77 +65,77 @@ class TopologyDictionary
6565 [[nodiscard]] float getXCOG (int n, bool IB = true ) const
6666 {
6767 const auto & data = (IB) ? mDataIB : mDataOB ;
68- assert (n >= 0 || n < (int )data.mVectorOfIDs .size ());
68+ assert (n >= 0 && n < (int )data.mVectorOfIDs .size ());
6969 return data.mVectorOfIDs [n].mXCOG ;
7070 }
7171 // / Returns the error on the x position of the COG for the n_th element
7272 [[nodiscard]] float getErrX (int n, bool IB = true ) const
7373 {
7474 const auto & data = (IB) ? mDataIB : mDataOB ;
75- assert (n >= 0 || n < (int )data.mVectorOfIDs .size ());
75+ assert (n >= 0 && n < (int )data.mVectorOfIDs .size ());
7676 return data.mVectorOfIDs [n].mErrX ;
7777 }
7878 // / Returns the z position of the COG for the n_th element
7979 [[nodiscard]] float getZCOG (int n, bool IB = true ) const
8080 {
8181 const auto & data = (IB) ? mDataIB : mDataOB ;
82- assert (n >= 0 || n < (int )data.mVectorOfIDs .size ());
82+ assert (n >= 0 && n < (int )data.mVectorOfIDs .size ());
8383 return data.mVectorOfIDs [n].mZCOG ;
8484 }
8585 // / Returns the error on the z position of the COG for the n_th element
8686 [[nodiscard]] float getErrZ (int n, bool IB = true ) const
8787 {
8888 const auto & data = (IB) ? mDataIB : mDataOB ;
89- assert (n >= 0 || n < (int )data.mVectorOfIDs .size ());
89+ assert (n >= 0 && n < (int )data.mVectorOfIDs .size ());
9090 return data.mVectorOfIDs [n].mErrZ ;
9191 }
9292 // / Returns the error^2 on the x position of the COG for the n_th element
9393 [[nodiscard]] float getErr2X (int n, bool IB = true ) const
9494 {
9595 const auto & data = (IB) ? mDataIB : mDataOB ;
96- assert (n >= 0 || n < (int )data.mVectorOfIDs .size ());
96+ assert (n >= 0 && n < (int )data.mVectorOfIDs .size ());
9797 return data.mVectorOfIDs [n].mErr2X ;
9898 }
9999 // / Returns the error^2 on the z position of the COG for the n_th element
100100 [[nodiscard]] float getErr2Z (int n, bool IB = true ) const
101101 {
102102 const auto & data = (IB) ? mDataIB : mDataOB ;
103- assert (n >= 0 || n < (int )data.mVectorOfIDs .size ());
103+ assert (n >= 0 && n < (int )data.mVectorOfIDs .size ());
104104 return data.mVectorOfIDs [n].mErr2Z ;
105105 }
106106 // / Returns the hash of the n_th element
107107 [[nodiscard]] unsigned long getHash (int n, bool IB = true ) const
108108 {
109109 const auto & data = (IB) ? mDataIB : mDataOB ;
110- assert (n >= 0 || n < (int )data.mVectorOfIDs .size ());
110+ assert (n >= 0 && n < (int )data.mVectorOfIDs .size ());
111111 return data.mVectorOfIDs [n].mHash ;
112112 }
113113 // / Returns the number of fired pixels of the n_th element
114114 [[nodiscard]] int getNpixels (int n, bool IB = true ) const
115115 {
116116 const auto & data = (IB) ? mDataIB : mDataOB ;
117- assert (n >= 0 || n < (int )data.mVectorOfIDs .size ());
117+ assert (n >= 0 && n < (int )data.mVectorOfIDs .size ());
118118 return data.mVectorOfIDs [n].mNpixels ;
119119 }
120120 // / Returns the frequency of the n_th element;
121121 [[nodiscard]] double getFrequency (int n, bool IB = true ) const
122122 {
123123 const auto & data = (IB) ? mDataIB : mDataOB ;
124- assert (n >= 0 || n < (int )data.mVectorOfIDs .size ());
124+ assert (n >= 0 && n < (int )data.mVectorOfIDs .size ());
125125 return data.mVectorOfIDs [n].mFrequency ;
126126 }
127127 // / Returns true if the element corresponds to a group of rare topologies
128128 [[nodiscard]] bool isGroup (int n, bool IB = true ) const
129129 {
130130 const auto & data = (IB) ? mDataIB : mDataOB ;
131- assert (n >= 0 || n < (int )data.mVectorOfIDs .size ());
131+ assert (n >= 0 && n < (int )data.mVectorOfIDs .size ());
132132 return data.mVectorOfIDs [n].mIsGroup ;
133133 }
134134 // / Returns the pattern of the topology
135135 [[nodiscard]] const itsmft::ClusterPattern& getPattern (int n, bool IB = true ) const
136136 {
137137 const auto & data = (IB) ? mDataIB : mDataOB ;
138- assert (n >= 0 || n < (int )data.mVectorOfIDs .size ());
138+ assert (n >= 0 && n < (int )data.mVectorOfIDs .size ());
139139 return data.mVectorOfIDs [n].mPattern ;
140140 }
141141
0 commit comments