@@ -167,6 +167,27 @@ public void propagation(ArrayList<Track> tracks, DataEvent event, final double m
167167 hit .setResidual (PostFitPropagator .residual (hit ));
168168 }
169169 }
170+
171+ // Fill track and hit bank
172+ // TO DO : s and p_drift have to be checked to be sure they represent what we want
173+ double s = PostFitPropagator .stepper .sTot ;
174+ double p_drift = PostFitPropagator .stepper .p ();
175+ int sum_adc = 0 ;
176+ double sum_residuals = 0 ;
177+ double chi2 = 0 ;
178+ for (Hit hit : AHDC_hits ) {
179+ sum_adc += hit .getADC ();
180+ sum_residuals += hit .getResidual ();
181+ chi2 += Math .pow (hit .getResidual (),2 )/hit .MeasurementNoiseMatrix ().getEntry (0 ,0 );
182+ }
183+ track .set_sum_adc (sum_adc );
184+ track .set_sum_residuals (sum_residuals );
185+ track .set_chi2 (chi2 /(AHDC_hits .size ()-3 ));
186+ track .set_p_drift (p_drift );
187+ track .set_dEdx (sum_adc /s );
188+ track .set_path (s );
189+ track .set_n_hits (AHDC_hits .size ());
190+
170191 // Projection towards the ATOF surfaces
171192 // R1 : lower surface of an ATOF bar
172193 // R2 : upper surface of an ATOF bar = lower surface of an ATOF wedge
@@ -177,9 +198,6 @@ public void propagation(ArrayList<Track> tracks, DataEvent event, final double m
177198 double R1 = Math .hypot (pR1 .x (), pR1 .y ());
178199 double R2 = Math .hypot (pR2 .x (), pR2 .y ());
179200 double R3 = Math .hypot (pR3 .x (), pR3 .y ());
180-
181- System .out .println ("ATOF surface R2 : " + R2 );
182- System .out .println ("ATOF surface R3 : " + R3 );
183201 {
184202 // From last AHDC hit to surface R1
185203 RadialSurfaceKFHit hitR1 = new RadialSurfaceKFHit (R1 );
@@ -189,8 +207,8 @@ public void propagation(ArrayList<Track> tracks, DataEvent event, final double m
189207 posR1 .translateXYZ (0 , 0 , atof_alignement );
190208 int [] idR1 = predict_bar (ATOFdet , posR1 );
191209 System .out .println ("ATOF surface R1 : " + R1 );
192- System .out .printf (" final position : x (.2f) y (.2f) z (.2f)\n " , posR1 .x (), posR1 .y (), posR1 .z ());
193- System .out .printf (" ---> sector (2d) layer (2d) component (2d)\n " , idR1 [0 ], idR1 [1 ], idR1 [2 ]);
210+ System .out .printf (" final position : x (% .2f) y (% .2f) z (% .2f) --> R (%.2f) \n " , posR1 .x (), posR1 .y (), posR1 .z (), Math . hypot ( posR1 . x (), posR1 . y () ));
211+ System .out .printf (" ---> sector (% 2d) layer (% 2d) component (% 2d)\n " , idR1 [0 ], idR1 [1 ], idR1 [2 ]);
194212 // From surface R1 to surface R2
195213 RadialSurfaceKFHit hitR2 = new RadialSurfaceKFHit (R2 );
196214 PostFitPropagator .predict (hitR2 , true );
@@ -199,8 +217,8 @@ public void propagation(ArrayList<Track> tracks, DataEvent event, final double m
199217 posR2 .translateXYZ (0 , 0 , atof_alignement );
200218 int [] idR2 = predict_wedge (ATOFdet , posR2 );
201219 System .out .println ("ATOF surface R2 : " + R2 );
202- System .out .printf (" final position : x (.2f) y (.2f) z (.2f)\n " , posR2 .x (), posR2 .y (), posR2 .z ());
203- System .out .printf (" ---> sector (2d) layer (2d) component (2d)\n " , idR2 [0 ], idR2 [1 ], idR2 [2 ]);
220+ System .out .printf (" final position : x (% .2f) y (% .2f) z (% .2f)\n " , posR2 .x (), posR2 .y (), posR2 .z ());
221+ System .out .printf (" ---> sector (% 2d) layer (% 2d) component (% 2d)\n " , idR2 [0 ], idR2 [1 ], idR2 [2 ]);
204222 // From surface R2 to surface R3
205223 RadialSurfaceKFHit hitR3 = new RadialSurfaceKFHit (R3 );
206224 PostFitPropagator .predict (hitR3 , true );
@@ -209,29 +227,11 @@ public void propagation(ArrayList<Track> tracks, DataEvent event, final double m
209227 posR3 .translateXYZ (0 , 0 , atof_alignement );
210228 int [] idR3 = predict_wedge (ATOFdet , posR3 );
211229 System .out .println ("ATOF surface R3 : " + R3 );
212- System .out .printf (" final position : x (.2f) y (.2f) z (.2f)\n " , posR3 .x (), posR3 .y (), posR3 .z ());
213- System .out .printf (" ---> sector (2d) layer (2d) component (2d)\n " , idR3 [0 ], idR3 [1 ], idR3 [2 ]);
230+ System .out .printf (" final position : x (% .2f) y (% .2f) z (% .2f)\n " , posR3 .x (), posR3 .y (), posR3 .z ());
231+ System .out .printf (" ---> sector (% 2d) layer (% 2d) component (% 2d)\n " , idR3 [0 ], idR3 [1 ], idR3 [2 ]);
214232 }
215233
216- // Fill track and hit bank
217- // TO DO : s and p_drift have to be checked to be sure they represent what we want
218- double s = PostFitPropagator .stepper .sTot ;
219- double p_drift = PostFitPropagator .stepper .p ();
220- int sum_adc = 0 ;
221- double sum_residuals = 0 ;
222- double chi2 = 0 ;
223- for (Hit hit : AHDC_hits ) {
224- sum_adc += hit .getADC ();
225- sum_residuals += hit .getResidual ();
226- chi2 += Math .pow (hit .getResidual (),2 )/hit .MeasurementNoiseMatrix ().getEntry (0 ,0 );
227- }
228- track .set_sum_adc (sum_adc );
229- track .set_sum_residuals (sum_residuals );
230- track .set_chi2 (chi2 /(AHDC_hits .size ()-3 ));
231- track .set_p_drift (p_drift );
232- track .set_dEdx (sum_adc /s );
233- track .set_path (s );
234- track .set_n_hits (AHDC_hits .size ());
234+
235235
236236
237237
0 commit comments