@@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE(FastTransform_test1)
5353
5454 BOOST_CHECK_EQUAL (geo.test (), 0 );
5555
56- BOOST_CHECK_EQUAL (geo.getNumberOfRocs (), Sector::MAXSECTOR);
56+ BOOST_CHECK_EQUAL (geo.getNumberOfSectors (), Sector::MAXSECTOR);
5757 BOOST_CHECK_EQUAL (geo.getNumberOfRows (), mapper.getNumberOfRows ());
5858
5959 double maxDx = 0 , maxDy = 0 ;
@@ -71,15 +71,16 @@ BOOST_AUTO_TEST_CASE(FastTransform_test1)
7171 for (int pad = 0 ; pad < nPads; pad++) {
7272 const GlobalPadNumber p = mapper.globalPadNumber (PadPos (row, pad));
7373 const PadCentre& c = mapper.padCentre (p);
74- float u = 0 , v = 0 ;
75- fastTransform.convPadTimeToUV (row, pad, 0 , u, v, 0 .);
76-
74+ float y = 0 , z = 0 ;
75+ int sector = 0 ;
76+ float time = 0 .;
77+ fastTransform.convPadTimeToLocal (sector, row, pad, time, y, z, 0 .);
7778 double dx = x - c.X ();
78- double dy = u - (-c.Y ()); // diferent sign convention for Y coordinate in the map
79+ double dy = y - (-c.Y ()); // diferent sign convention for Y coordinate in the map
7980 BOOST_CHECK (fabs (dx) < 1 .e -6 );
8081 BOOST_CHECK (fabs (dy) < 1 .e -5 );
8182 if (fabs (dy) >= 1 .e -5 ) {
82- std::cout << " row " << row << " pad " << pad << " y calc " << u << " y in map " << -c.Y () << " dy " << dy << std::endl;
83+ std::cout << " row " << row << " pad " << pad << " y calc " << y << " y in map " << -c.Y () << " dy " << dy << std::endl;
8384 }
8485 if (fabs (maxDx) < fabs (dx)) {
8586 maxDx = dx;
@@ -104,46 +105,46 @@ BOOST_AUTO_TEST_CASE(FastTransform_test_setSpaceChargeCorrection)
104105 std::unique_ptr<TPCFastTransform> fastTransform0 (TPCFastTransformHelperO2::instance ()->create (0 ));
105106 const TPCFastTransformGeo& geo = fastTransform0->getGeometry ();
106107
107- auto correctionUV = [&](int roc , int /* row*/ , const double u, const double v, double & dX, double & dU, double & dV) {
108+ auto correctionUV = [&](int sector , int /* row*/ , const double u, const double v, double & dX, double & dU, double & dV) {
108109 // float lx = geo.getRowInfo(row).x;
109110 dX = 1 . + 1 * u + 0.1 * u * u;
110111 dU = 2 . + 0.2 * u + 0.002 * u * u; // + 0.001 * u * u * u;
111112 dV = 3 . + 0.1 * v + 0.01 * v * v; // + 0.0001 * v * v * v;
112113 };
113114
114- auto correctionLocal = [&](int roc , int row, double ly, double lz,
115+ auto correctionLocal = [&](int sector , int row, double ly, double lz,
115116 double & dx, double & dly, double & dlz) {
116117 float u, v;
117- geo.convLocalToUV (roc , ly, lz, u, v);
118+ geo.convLocalToUV (sector , ly, lz, u, v);
118119 double du, dv;
119- correctionUV (roc , row, u, v, dx, du, dv);
120+ correctionUV (sector , row, u, v, dx, du, dv);
120121 float ly1, lz1;
121- geo.convUVtoLocal (roc , u + du, v + dv, ly1, lz1);
122+ geo.convUVtoLocal (sector , u + du, v + dv, ly1, lz1);
122123 dly = ly1 - ly;
123124 dlz = lz1 - lz;
124125 };
125126
126- int nRocs = geo.getNumberOfRocs ();
127+ int nSectors = geo.getNumberOfSectors ();
127128 int nRows = geo.getNumberOfRows ();
128129 TPCFastSpaceChargeCorrectionMap& scData = TPCFastTransformHelperO2::instance ()->getCorrectionMap ();
129- scData.init (nRocs , nRows);
130+ scData.init (nSectors , nRows);
130131
131- for (int iRoc = 0 ; iRoc < nRocs; iRoc ++) {
132+ for (int iSector = 0 ; iSector < nSectors; iSector ++) {
132133 for (int iRow = 0 ; iRow < nRows; iRow++) {
133134 double dsu = 1 . / (3 * 8 - 3 );
134135 double dsv = 1 . / (3 * 20 - 3 );
135136 for (double su = 0 .f ; su < 1 .f + .5 * dsu; su += dsv) {
136137 for (double sv = 0 .f ; sv < 1 .f + .5 * dsv; sv += dsv) {
137138 float ly = 0 .f , lz = 0 .f ;
138- geo.convScaledUVtoLocal (iRoc , iRow, su, sv, ly, lz);
139+ geo.convScaledUVtoLocal (iSector , iRow, su, sv, ly, lz);
139140 double dx, dy, dz;
140- correctionLocal (iRoc , iRow, ly, lz, dx, dy, dz);
141- scData.addCorrectionPoint (iRoc , iRow,
141+ correctionLocal (iSector , iRow, ly, lz, dx, dy, dz);
142+ scData.addCorrectionPoint (iSector , iRow,
142143 ly, lz, dx, dy, dz);
143144 }
144145 }
145146 } // row
146- } // roc
147+ } // sector
147148
148149 std::unique_ptr<TPCFastTransform> fastTransform (TPCFastTransformHelperO2::instance ()->create (0 ));
149150
@@ -158,12 +159,12 @@ BOOST_AUTO_TEST_CASE(FastTransform_test_setSpaceChargeCorrection)
158159 double statDiff = 0 ., statN = 0 .;
159160 double statDiffFile = 0 ., statNFile = 0 .;
160161
161- for (int roc = 0 ; roc < geo.getNumberOfRocs (); roc += 1 ) {
162- // std::cout << "roc " << roc << " ... " << std::endl;
162+ for (int sector = 0 ; sector < geo.getNumberOfSectors (); sector += 1 ) {
163+ // std::cout << "sector " << sector << " ... " << std::endl;
163164
164- const TPCFastTransformGeo::RocInfo& rocInfo = geo.getRocInfo (roc );
165+ const TPCFastTransformGeo::SectorInfo& sectorInfo = geo.getSectorInfo (sector );
165166
166- float lastTimeBin = fastTransform->getMaxDriftTime (roc , 0 .f );
167+ float lastTimeBin = fastTransform->getMaxDriftTime (sector , 0 .f );
167168
168169 for (int row = 0 ; row < geo.getNumberOfRows (); row++) {
169170
@@ -172,31 +173,31 @@ BOOST_AUTO_TEST_CASE(FastTransform_test_setSpaceChargeCorrection)
172173 for (int pad = 0 ; pad < nPads; pad += 10 ) {
173174
174175 for (float time = 0 ; time < lastTimeBin; time += 30 ) {
175- // std::cout<<"roc "<<roc <<" row "<<row<<" pad "<<pad<<" time "<<time<<std::endl;
176+ // std::cout<<"sector "<<sector <<" row "<<row<<" pad "<<pad<<" time "<<time<<std::endl;
176177
177178 fastTransform->setApplyCorrectionOff ();
178179 float x0, y0, z0;
179- fastTransform->Transform (roc , row, pad, time, x0, y0, z0);
180+ fastTransform->Transform (sector , row, pad, time, x0, y0, z0);
180181
181- BOOST_CHECK_EQUAL (geo.test (roc , row, y0, z0), 0 );
182+ BOOST_CHECK_EQUAL (geo.test (sector , row, y0, z0), 0 );
182183
183184 fastTransform->setApplyCorrectionOn ();
184185 float x1, y1, z1;
185- fastTransform->Transform (roc , row, pad, time, x1, y1, z1);
186+ fastTransform->Transform (sector , row, pad, time, x1, y1, z1);
186187
187188 // local to UV
188189 float u0, v0, u1, v1;
189- geo.convLocalToUV (roc , y0, z0, u0, v0);
190- geo.convLocalToUV (roc , y1, z1, u1, v1);
190+ geo.convLocalToUV (sector , y0, z0, u0, v0);
191+ geo.convLocalToUV (sector , y1, z1, u1, v1);
191192 double dx, du, dv;
192- correctionUV (roc , row, u0, v0, dx, du, dv);
193+ correctionUV (sector , row, u0, v0, dx, du, dv);
193194 statDiff += fabs ((x1 - x0) - dx) + fabs ((u1 - u0) - du) + fabs ((v1 - v0) - dv);
194195 statN += 3 ;
195196 // std::cout << (x1 - x0) - dx << " " << (u1 - u0) - du << " " << (v1 - v0) - dv << std::endl; //": v0 " << v0 <<" z0 "<<z0<<" v1 "<< v1<<" z1 "<<z1 << std::endl;
196197 // BOOST_CHECK_MESSAGE(0, "SG");
197198
198199 float x1f, y1f, z1f;
199- fromFile->Transform (roc , row, pad, time, x1f, y1f, z1f);
200+ fromFile->Transform (sector , row, pad, time, x1f, y1f, z1f);
200201 statDiffFile += fabs (x1f - x1) + fabs (y1f - y1) + fabs (z1f - z1);
201202 statNFile += 3 ;
202203 }
0 commit comments