@@ -101,10 +101,6 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
101101 auto* gman = o2 ::iotof ::GeometryTGeo ::Instance ();
102102 gman -> fillMatrixCache (o2 ::math_utils ::bit2Mask (o2 ::math_utils ::TransformType ::L2G ));
103103
104- // IOTOF response plane y = half sensor thickness
105- float depthMax = iotofPars .sensorThickness ; // fallback (no CCDB)
106- const float yPlaneIOTOF = depthMax / 2. ;
107-
108104 // Hits
109105 TFile * hitFile = TFile ::Open (hitfile .data ());
110106 TTree * hitTree = (TTree * )hitFile -> Get ("o2sim" );
@@ -162,7 +158,6 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
162158 Int_t subDetID = gman -> getIOTOFLayer (iDetID );
163159
164160 Float_t x = 0.f , y = 0.f , z = 0.f ;
165- Float_t x_flat = 0.f , z_flat = 0.f ;
166161
167162 // Float_t t = (*digArr)[iDigit].getTime();
168163
@@ -207,13 +202,9 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
207202 locHS .SetCoordinates (xyzLocS .X (), xyzLocS .Y (), xyzLocS .Z ());
208203 o2 ::math_utils ::Vector3D < float > locHE ; /// Hit, end pos
209204 locHE .SetCoordinates (xyzLocE .X (), xyzLocE .Y (), xyzLocE .Z ());
210- o2 ::math_utils ::Vector3D < float > locHF ;
211205
212- // IOTOF: Interpolate to response plane
213- float x0 = locHS .X (), y0 = locHS .Y (), z0 = locHS .Z ();
214- float dltx = locHE .X () - x0 , dlty = locHE .Y () - y0 , dltz = locHE .Z () - z0 ;
215- float r = (std ::abs (dlty ) > 1e-9f ) ? (yPlaneIOTOF - y0 ) / dlty : 0.5f ;
216- locH .SetCoordinates (x0 + r * dltx , yPlaneIOTOF , z0 + r * dltz );
206+ // IOTOF: Interpolate to mid point
207+ locH .SetCoordinates (0.5 * (locHS .X () + locHE .X ()), 0.5 * (locHS .Y () + locHE .Y ()), 0.5 * (locHS .Z () + locHE .Z ()));
217208
218209 int row = 0 , col = 0 ;
219210 float xlc = 0. , zlc = 0. ;
@@ -226,7 +217,7 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
226217 row , col , /// row and col retrieved from the hit: hit global position -> hit local position -> detector position (row, col)
227218 locH .X (), locH .Z (), /// x and z of the hit in the local reference frame: hit global position -> hit local position
228219 xlc , zlc , /// x and z of the hit in the local frame: hit global position -> hit local position -> detector position (row, col) -> local position
229- locHS .X () - locD .X (), locHS .Z () - locD .Z ()); /// difference in x and z between the hit and the digit in the local frame
220+ locH .X () - locD .X (), locH .Z () - locD .Z ()); /// difference in x and z between the hit and the digit in the local frame
230221 nt2 -> Fill (chipID , gloD .Z (), locHS .X () - locHE .X (), locHS .Z () - locHE .Z ()); /// differences between local hit start and hit end positions
231222
232223 } // end loop on digits array
@@ -237,35 +228,35 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
237228 auto canvXY = new TCanvas ("canvXY" , "" , 1600 , 800 );
238229 canvXY -> Divide (2 , 1 );
239230 canvXY -> cd (1 );
240- nt -> Draw ("y:x>>h_y_vs_x_IOTOF(1000, -100, 100, 1000, -100, 100)" , "id >= 0 && id < 14352 " , "colz" );
231+ nt -> Draw ("y:x>>h_y_vs_x_IOTOF(1000, -100, 100, 1000, -100, 100)" , "id >= 0 && id < 53568 " , "colz" );
241232 canvXY -> cd (2 );
242- nt -> Draw ("y:z>>h_y_vs_z_IOTOF(1000, -400, 400, 1000, -100, 100)" , "id >= 0 && id < 14352 " , "colz" );
233+ nt -> Draw ("y:z>>h_y_vs_z_IOTOF(1000, -400, 400, 1000, -100, 100)" , "id >= 0 && id < 53568 " , "colz" );
243234 canvXY -> SaveAs ("tf3digits_y_vs_x_vs_z.pdf" );
244235
245236 // z distributions
246237 auto canvZ = new TCanvas ("canvZ" , "" , 800 , 800 );
247238 canvZ -> cd ();
248- nt -> Draw ("z>>h_z_IOTOF(500, -70, 70)" , "id >= 0 && id < 14352 " );
239+ nt -> Draw ("z>>h_z_IOTOF(500, -70, 70)" , "id >= 0 && id < 53568 " );
249240 canvZ -> SaveAs ("tf3digits_z.pdf" );
250241
251242 // dz distributions (difference between local position of digits and hits in x and z)
252243 auto canvdZ = new TCanvas ("canvdZ" , "" , 800 , 800 );
253244 canvdZ -> cd ();
254- nt -> Draw ("dz>>h_dz_ML(500, -0.05, 0.05)" , "id >= 0 && id < 14352 " );
245+ nt -> Draw ("dz>>h_dz_ML(500, -0.05, 0.05)" , "id >= 0 && id < 53568 " );
255246 canvdZ -> SaveAs ("tf3digits_dz.pdf" );
256247 canvdZ -> SaveAs ("tf3digits_dz.root" );
257248
258249 // distributions of differences between local positions of digits and hits in x and z
259250 auto canvdXdZ = new TCanvas ("canvdXdZ" , "" , 1600 , 800 );
260251 canvdXdZ -> Divide (2 , 1 );
261252 canvdXdZ -> cd (1 );
262- nt -> Draw ("dx:dz>>h_dx_vs_dz_ITOF(600, -0.03, 0.03, 600, -0.03, 0.03)" , "id >= 0 && id < 960 " , "colz" );
253+ nt -> Draw ("dx:dz>>h_dx_vs_dz_ITOF(600, -0.03, 0.03, 600, -0.03, 0.03)" , "id >= 0 && id < 1920 " , "colz" );
263254 addTLines (0.01 );
264255 auto h = (TH2F * )gPad -> GetPrimitive ("h_dx_vs_dz_ITOF" );
265256 Info ("ITOF" , "RMS(dx)=%.1f mu" , h -> GetRMS (2 ) * 1e4 );
266257 Info ("ITOF" , "RMS(dz)=%.1f mu" , h -> GetRMS (1 ) * 1e4 );
267258 canvdXdZ -> cd (2 );
268- nt -> Draw ("dx:dz>>h_dx_vs_dz_OTOF(600, -0.03, 0.03, 600, -0.03, 0.03)" , "id >= 960 && id < 14352 " , "colz" );
259+ nt -> Draw ("dx:dz>>h_dx_vs_dz_OTOF(600, -0.03, 0.03, 600, -0.03, 0.03)" , "id >= 1920 && id < 53568 " , "colz" );
269260 addTLines (0.01 );
270261 h = (TH2F * )gPad -> GetPrimitive ("h_dx_vs_dz_OTOF" );
271262 Info ("OTOF" , "RMS(dx)=%.1f mu" , h -> GetRMS (2 ) * 1e4 );
@@ -278,13 +269,13 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
278269 canvdXdZHit -> Divide (2 , 1 );
279270 canvdXdZHit -> cd (1 );
280271 LOG (info ) << "dxH, dzH" ;
281- nt2 -> Draw ("dxH:dzH>>h_dxH_vs_dzH_ITOF(300, -0.03, 0.03, 300, -0.03, 0.03)" , "id >= 0 && id < 960 " , "colz" );
272+ nt2 -> Draw ("dxH:dzH>>h_dxH_vs_dzH_ITOF(300, -0.03, 0.03, 300, -0.03, 0.03)" , "id >= 0 && id < 1920 " , "colz" );
282273 addTLines (0.01 );
283274 h = (TH2F * )gPad -> GetPrimitive ("h_dxH_vs_dzH_ITOF" );
284275 Info ("ITOF" , "RMS(dxH)=%.1f mu" , h -> GetRMS (2 ) * 1e4 );
285276 Info ("ITOF" , "RMS(dzH)=%.1f mu" , h -> GetRMS (1 ) * 1e4 );
286277 canvdXdZHit -> cd (2 );
287- nt2 -> Draw ("dxH:dzH>>h_dxH_vs_dzH_OTOF(300, -0.03, 0.03, 300, -0.03, 0.03)" , "id >= 960 && id < 14352 " , "colz" );
278+ nt2 -> Draw ("dxH:dzH>>h_dxH_vs_dzH_OTOF(300, -0.03, 0.03, 300, -0.03, 0.03)" , "id >= 1920 && id < 53568 " , "colz" );
288279 addTLines (0.01 );
289280 h = (TH2F * )gPad -> GetPrimitive ("h_dxH_vs_dzH_OTOF" );
290281 Info ("OTOF" , "RMS(dxH)=%.1f mu" , h -> GetRMS (2 ) * 1e4 );
0 commit comments