@@ -30,17 +30,18 @@ struct PointInfos{
3030 // ---------------- plot TRACCE (reco/smooth/filt/meas) ------------------------
3131static void makeTrackGraph (TTree* steps, TDirectory* outDir) {
3232
33- Int_t track_id=0 ;
34- step_idx=0 /* orientation=0*/ ;
33+ Int_t run=0 , event=0 , track_id=0 , step_idx=0 ;
34+ steps->SetBranchAddress (" run" ,&run);
35+ steps->SetBranchAddress (" event" ,&event);
36+ steps->SetBranchAddress (" track_id" ,&track_id);
37+ steps->SetBranchAddress (" step_idx" ,&step_idx);
38+
3539 Double_t z=0 ;
3640 Double_t x_meas=0 , y_meas=0 ;
3741 Double_t x_pred=0 , y_pred=0 ;
3842 Double_t x_filt=0 , y_filt=0 ;
3943 Double_t x_smooth=0 , y_smooth=0 ;
4044
41- steps->SetBranchAddress (" track_id" , &track_id);
42- steps->SetBranchAddress (" step_idx" , &step_idx);
43- // steps->SetBranchAddress("orientation", &orientation);
4445 steps->SetBranchAddress (" z" , &z);
4546
4647 steps->SetBranchAddress (" x_meas" , &x_meas);
@@ -175,148 +176,275 @@ int makePlot(const std::string& input_root,
175176 TTree* tracks = (TTree*)fin.Get (" tracks" );
176177 if (!steps || !tracks) { std::cerr<<" Missing 'steps' or 'tracks' trees\n " ; return 2 ; }
177178
178- Double_t x_true=0 , y_true=0 ;
179- Double_t x_meas=0 , y_meas=0 ;
180- Double_t x_smooth=0 , y_smooth=0 ;
181- Double_t p_true=0 , p_smooth=0 ;
182- Double_t var_x=NAN , var_y=NAN ;
183- Double_t innov_pos=0 , innov_ang=0 , chi2=0 ;
184-
185- steps->SetBranchAddress (" x_true" , &x_true);
186- steps->SetBranchAddress (" y_true" , &y_true);
187- steps->SetBranchAddress (" x_meas" , &x_meas);
188- steps->SetBranchAddress (" y_meas" , &y_meas);
189- steps->SetBranchAddress (" x_smooth" , &x_smooth);
190- steps->SetBranchAddress (" y_smooth" , &y_smooth);
191- steps->SetBranchAddress (" p_true" , &p_true);
192- steps->SetBranchAddress (" p_smooth" ,&p_smooth);
193- if (steps->GetBranch (" var_x" )) steps->SetBranchAddress (" var_x" ,&var_x);
194- if (steps->GetBranch (" var_y" )) steps->SetBranchAddress (" var_y" ,&var_y);
195- if (steps->GetBranch (" innov_pos" )) steps->SetBranchAddress (" innov_pos" ,&innov_pos);
196- if (steps->GetBranch (" innov_ang" )) steps->SetBranchAddress (" innov_ang" ,&innov_ang);
197- if (steps->GetBranch (" chi2" )) steps->SetBranchAddress (" chi2" ,&chi2);
198-
199- TH1D meas_x_res (" (x_meas - x_true)" ," (x_{meas}-x_{true}) [mm];mm;Entries" ,200 ,-2 ,2 );
200- TH1D meas_y_res (" (y_meas - y_true)" ," (y_{meas}-y_{true}) [mm];mm;Entries" ,200 ,-2 ,2 );
179+ Int_t run=0 , event=0 , track_id=0 , step_idx=0 ;
180+ Double_t z=0.0 ;
181+ steps->SetBranchAddress (" run" ,&run);
182+ steps->SetBranchAddress (" event" ,&event);
183+ steps->SetBranchAddress (" track_id" ,&track_id);
184+ steps->SetBranchAddress (" step_idx" ,&step_idx);
185+ steps->SetBranchAddress (" z" , &z);
186+
187+ // ---true---
188+ Double_t x_true=0.0 ;
189+ Double_t y_true=0.0 ;
190+ Double_t invR_true=0.0 ;
191+ Double_t tanL_true=0.0 ;
192+ Double_t phi_true=0.0 ;
193+ steps->SetBranchAddress (" x_true" , &x_true);
194+ steps->SetBranchAddress (" y_true" , &y_true);
195+ steps->SetBranchAddress (" invR_true" , &invR_true);
196+ steps->SetBranchAddress (" tanL_true" , &tanL_true);
197+ steps->SetBranchAddress (" phi_true" , &phi_true);
198+
199+ // ---smooth---
200+ Double_t x_smooth=0.0 ;
201+ Double_t y_smooth=0.0 ;
202+ Double_t invR_smooth=0.0 ;
203+ Double_t tanL_smooth=0.0 ;
204+ Double_t phi_smooth=0.0 ;
205+ steps->SetBranchAddress (" x_smooth" , &x_smooth);
206+ steps->SetBranchAddress (" y_smooth" , &y_smooth);
207+ steps->SetBranchAddress (" invR_smooth" , &invR_smooth);
208+ steps->SetBranchAddress (" tanL_smooth" , &tanL_smooth);
209+ steps->SetBranchAddress (" phi_smooth" , &phi_smooth);
210+
211+ // sigma smoothed
212+ Double_t sigma_x_smooth=0.0 ;
213+ Double_t sigma_y_smooth=0.0 ;
214+ Double_t sigma_invR_smooth=0.0 ;
215+ Double_t sigma_tanL_smooth=0.0 ;
216+ Double_t sigma_phi_smooth=0.0 ;
217+ if (steps->GetBranch (" sigma_x_smooth" )) steps->SetBranchAddress (" sigma_x_smooth" ,&sigma_x_smooth);
218+ if (steps->GetBranch (" sigma_y_smooth" )) steps->SetBranchAddress (" sigma_y_smooth" ,&sigma_y_smooth);
219+ if (steps->GetBranch (" sigma_invR_smooth" )) steps->SetBranchAddress (" sigma_invR_smooth" ,&sigma_invR_smooth);
220+ if (steps->GetBranch (" sigma_tanL_smooth" )) steps->SetBranchAddress (" sigma_tanL_smooth" ,&sigma_tanL_smooth);
221+ if (steps->GetBranch (" sigma_phi_smooth" )) steps->SetBranchAddress (" sigma_phi_smooth" ,&sigma_phi_smooth);
222+
223+ Double_t x_meas=0.0 , y_meas=0.0 ;
224+ Double_t x_pred=0.0 , y_pred=0.0 ;
225+ Double_t x_filt=0.0 , y_filt=0.0 ;
226+ steps->SetBranchAddress (" x_meas" , &x_meas);
227+ steps->SetBranchAddress (" y_meas" , &y_meas);
228+ steps->SetBranchAddress (" x_pred" , &x_pred);
229+ steps->SetBranchAddress (" y_pred" , &y_pred);
230+ steps->SetBranchAddress (" x_filt" , &x_filt);
231+ steps->SetBranchAddress (" y_filt" , &y_filt);
232+
233+ Double_t p_true=0.0 ; // MeV
234+ Double_t p_smooth=0.0 ; // MeV
235+ Double_t innov_pos=0.0 , innov_ang=0.0 , chi2=0.0 ;
236+ steps->SetBranchAddress (" p_true" , &p_true);
237+ steps->SetBranchAddress (" p_smooth" , &p_smooth);
238+ if (steps->GetBranch (" innov_pos" )) steps->SetBranchAddress (" innov_pos" ,&innov_pos);
239+ if (steps->GetBranch (" innov_ang" )) steps->SetBranchAddress (" innov_ang" ,&innov_ang);
240+ if (steps->GetBranch (" chi2" )) steps->SetBranchAddress (" chi2" ,&chi2);
241+
242+ // ---smoooth - true ---
243+ TH1D x_res_step (" (x_smooth - x_true)" ," (x_{smooth}-x_{true}) [mm];mm;Entries" ,200 ,-2 ,2 );
244+ TH1D y_res_step (" (y_smooth - y_true)" ," (y_{smooth}-y_{true}) [mm];mm;Entries" ,200 ,-2 ,2 );
245+ TH1D invR_res_step (" (invR_smooth - invR_true)" ," invR_{smooth}-invR_{true};;Entries" ,200 ,-1e-2 ,1e-2 );
246+ TH1D tanL_res_step (" (tanL_smooth - tanL_true)" ," tan#lambda_{smooth}-tan#lambda_{true};;Entries" ,200 ,-0.1 ,0.1 );
247+ TH1D phi_res_step (" (phi_smooth - phi_true)" ," #phi_{smooth}-#phi_{true} [rad];rad;Entries" ,200 ,-0.1 ,0.1 );
201248 TH1D smooth_x_res (" (x_smooth - x_true)" ," (x_{smooth}-x_{true}) [mm];mm;Entries" ,200 ,-2 ,2 );
202249 TH1D smooth_y_res (" (y_smooth - y_true)" ," (y_{smooth}-y_{true}) [mm];mm;Entries" ,200 ,-2 ,2 );
203250
251+ TH1D x_pull_step (" x_pull_step" ," (x_s-x_true)/#sigma_{x};;Entries" ,200 ,-5 ,5 );
252+ TH1D y_pull_step (" y_pull_step" ," (y_s-y_true)/#sigma_{y};;Entries" ,200 ,-5 ,5 );
253+ TH1D invR_pull_step (" invR_pull_step" ," (invR_s-invR_t)/#sigma_{invR};;Entries" ,200 ,-5 ,5 );
254+ TH1D tanL_pull_step (" tanL_pull_step" ," (tanL_s-tanL_t)/#sigma_{tanL};;Entries" ,200 ,-5 ,5 );
255+ TH1D phi_pull_step (" phi_pull_step" ," (phi_s-phi_t)/#sigma_{phi};;Entries" ,200 ,-5 ,5 );
256+
257+ // --- misura - true ---
258+ TH1D measx_res_step (" (x_meas - x_true)" ," (x_{meas}-x_{true}) [mm];mm;Entries" ,200 ,-2 ,2 );
259+ TH1D measy_res_step (" (y_meas - y_true)" ," (y_{meas}-y_{true}) [mm];mm;Entries" ,200 ,-2 ,2 );
260+
261+ // --- momentum---
204262 TH1D p_res_step (" p_res_step" ," p_{smooth} - p_{true} [MeV];MeV;Entries" ,200 ,-500 ,500 );
263+ TH1D p_rel_res_step (" (p_smooth - p_true)/p_true" ," (p_{s}-p_{t})/p_{t};;Entries" ,200 ,-1 ,1 );
264+
205265 TH2D p_true_vs_p_smooth_step (" p_true_vs_p_smooth_step" ," True p vs smoothed p; p_{true}[MeV]; p_{reco}[MeV]" ,200 ,0 ,5000 ,200 ,0 ,5000 );
266+ TH2D dp_vs_ptrue_step (" dp_vs_ptrue_step" ," #Delta p vs p_{true};p_{true} [MeV];#Delta p [MeV]" ,200 ,0 ,5000 ,200 ,-500 ,500 );
267+ TH2D dprel_vs_ptrue_step (" dprel_vs_ptrue_step" ," #Delta p/p vs p_{true};p_{true} [MeV];(p_{s}-p_{t})/p_{t}" ,200 ,0 ,5000 ,200 ,-1 ,1 );
268+
206269
207270 TH1D h_gpos (" innovation_pos" ," Innovation (pos);;Entries" ,100 ,-3 ,3 );
208271 TH1D h_gang (" innovation_ang" ," Innovation (ang);;Entries" ,100 ,-3 ,3 );
209- TH1D x_pull (" x_pull_smooth" ," (x_s-x_true)/#sigma_x;;Entries" ,200 ,-5 ,5 );
210- TH1D y_pull (" y_pull_smooth" ," (y_s-y_true)/#sigma_y;;Entries" ,200 ,-5 ,5 );
211272 TH1D chi2_h (" chi2" ," chi2;;Entries" ,1000 ,0 ,1e5 );
212- TH1D h_pull_x_first (" x_pull_first" , " (x_s - x_true)/#sigma_{x} at first step; pull_{x}; entries" , 100 , -5 , 5 );
213- TH1D h_pull_y_first (" y_pull_first" , " (y_s - y_true)/#sigma_{y} at first step; pull_{y}; entries" , 100 , -5 , 5 );
214-
215- // --------PULL SEED------------
216- std::unordered_map<int , Long64_t> firstEntry;
217- std::unordered_map<int , int > firstStep;
218-
219- const Long64_t nSteps = steps->GetEntries ();
220- for (Long64_t ie = 0 ; ie < nSteps; ++ie) {
221- steps->GetEntry (ie);
222- auto it = firstStep.find (trk);
223- if (it == firstStep.end () || step < it->second ) {
224- firstStep[trk] = step;
225- firstEntry[trk] = ie;
226- }
227- }
228-
229- for (const auto & kv : firstEntry) {
230- steps->GetEntry (kv.second );
231-
232- const double sigma_pos = 200E-6 ;
233273
234- if (std::isfinite (sigma_pos) && sigma_pos > 0 ) {
235- const double pull_x = (x_smoothed - x_true) / sigma_pos;
236- if (std::isfinite (pull_x)) h_pull_x_first.Fill (pull_x);
237- }
238- if (std::isfinite (sigma_pos) && sigma_pos > 0 ) {
239- const double pull_y = (y_smoothed - y_true) / sigma_pos;
240- if (std::isfinite (pull_y)) h_pull_y_first.Fill (pull_y);
241- }
242- }
243-
244- h_pull_x_first.Write ();
245- h_pull_y_first.Write ();
246-
247-
248274
249275 // ---------------- plot per STEP ------------------------
250276 const Long64_t ns = steps->GetEntries (); // numero step
251277 for (Long64_t i=0 ;i<ns;++i){
252278 steps->GetEntry (i);
253279
280+ // smoothed vs. true
281+ x_res_step.Fill (x_smooth - x_true);
282+ y_res_step.Fill (y_smooth - y_true);
283+ invR_res_step.Fill (invR_smooth - invR_true);
284+ tanL_res_step.Fill (tanL_smooth - tanL_true);
285+ phi_res_step.Fill (phi_smooth - phi_true);
286+
287+ if (std::isfinite (sigma_x_smooth) && sigma_x_smooth>0 ) x_pull_step.Fill ((x_smooth - x_true)/sigma_x_smooth);
288+ if (std::isfinite (sigma_y_smooth) && sigma_y_smooth>0 ) y_pull_step.Fill ((y_smooth - y_true)/sigma_y_smooth);
289+ if (std::isfinite (sigma_invR_smooth) && sigma_invR_smooth>0 ) invR_pull_step.Fill ((invR_smooth - invR_true)/sigma_invR_smooth);
290+ if (std::isfinite (sigma_tanL_smooth) && sigma_tanL_smooth>0 ) tanL_pull_step.Fill ((tanL_smooth - tanL_true)/sigma_tanL_smooth);
291+ if (std::isfinite (sigma_phi_smooth) && sigma_phi_smooth>0 ) phi_pull_step.Fill ((phi_smooth - phi_true)/sigma_phi_smooth);
292+
254293 // measured vs. truth (per ora solo smearing di differenza)
255- meas_x_res .Fill (x_meas - x_true);
256- meas_y_res .Fill (y_meas - y_true);
294+ measx_res_step .Fill (x_meas - x_true);
295+ measy_res_step .Fill (y_meas - y_true);
257296
258- // smoothed vs. true
259- smooth_x_res.Fill (x_smooth - x_true);
260- smooth_y_res.Fill (y_smooth - y_true);
261297
262298 // momentum per step
263299 if (std::isfinite (p_true) && std::isfinite (p_smooth)) {
264300 p_res_step.Fill (p_smooth - p_true);
265301 p_true_vs_p_smooth_step.Fill (p_true, p_smooth);
266302 }
303+
304+ if (std::isfinite (p_true) && p_true>0 && std::isfinite (p_smooth)) {
305+ const double dp = p_smooth - p_true;
306+ p_rel_res_step.Fill (dp / p_true);
307+ dp_vs_ptrue_step.Fill (p_true, dp);
308+ dprel_vs_ptrue_step.Fill (p_true, dp / p_true);
309+ }
267310
268311 // innovation e chi2
269312 if (std::isfinite (innov_pos)) h_gpos.Fill (innov_pos);
270313 if (std::isfinite (innov_ang)) h_gang.Fill (innov_ang);
271314 chi2_h.Fill (chi2);
272315
273- // pulls: var_x/var_y in m^2, pos in mm → dividere per 1e3??
274- if (std::isfinite (var_x) && var_x>0 ) x_pull.Fill ((x_smooth - x_true)/(std::sqrt (var_x)*1e3 ));
275- if (std::isfinite (var_y) && var_y>0 ) y_pull.Fill ((y_smooth - y_true)/(std::sqrt (var_y)*1e3 ));
276316 }
277317
278318
319+ // ------ SEED CHECKS------
320+
321+ std::map<std::tuple<int ,int ,int >, std::pair<int , Long64_t>> lastEntry;
322+ for (Long64_t ie=0 ; ie<ns; ++ie) {
323+ steps->GetEntry (ie);
324+ auto key = std::make_tuple (run, event, track_id);
325+ auto it = lastEntry.find (key);
326+ if (it==lastEntry.end () || step_idx > it->second .first ) {
327+ lastEntry[key] = { step_idx, ie };
328+ }
329+ }
330+
331+ TH1D seed_dx (" seed_dx" ," Seed: x_{s}-x_{t} [mm];mm;Entries" ,200 ,-2 ,2 );
332+ TH1D seed_dy (" seed_dy" ," Seed: y_{s}-y_{t} [mm];mm;Entries" ,200 ,-2 ,2 );
333+ TH1D seed_dinvR (" seed_dinvR" ," Seed: invR_{s}-invR_{t};;Entries" ,200 ,-1e-2 ,1e-2 );
334+ TH1D seed_dtanL (" seed_dtanL" ," Seed: tan#lambda_{s}-tan#lambda_{t};;Entries" ,200 ,-0.1 ,0.1 );
335+ TH1D seed_dphi (" seed_dphi" ," Seed: #phi_{s}-#phi_{t} [rad];rad;Entries" ,200 ,-0.1 ,0.1 );
336+
337+ TH1D seed_pullx (" seed_pullx" ," Seed: (x_{s}-x_{t})/#sigma_{x};pull_{x};Entries" ,100 ,-5 ,5 );
338+ TH1D seed_pully (" seed_pully" ," Seed: (y_{s}-y_{t})/#sigma_{y};pull_{y};Entries" ,100 ,-5 ,5 );
339+ TH1D seed_invR_pull (" seed_invR_pull" ," Seed: (invR_{s}-invR_{t})/#sigma_{invR};;Entries" ,100 ,-5 ,5 );
340+ TH1D seed_tanL_pull (" seed_tanL_pull" ," Seed: (tan#lambda_{s}-tan#lambda_{t})/#sigma_{tanL};;Entries" ,100 ,-5 ,5 );
341+ TH1D seed_phi_pull (" seed_phi_pull" ," Seed: (#phi_{s}-#phi_{t})/#sigma_{phi};;Entries" ,100 ,-5 ,5 );
342+
343+ TH1D seed_dp (" seed_dp" ," p_{s}^{last} - p_{t}^{first} [MeV];MeV;Entries" ,200 ,-1000 ,1000 );
344+ TH1D seed_dprel (" seed_dprel" ," (p_{s}^{last}-p_{t}^{first})/p_{t}^{first};;Entries" ,200 ,-1 ,1 );
345+ TH1D seed_ratio_ps_over_pfirst (" seed_ratio_ps_over_pfirst" ," p_{s}^{last}/p_{t}^{first};;Entries" ,200 ,0 ,2 );
346+
347+ Int_t tr_run=0 , tr_event=0 , tr_tid=0 , n_steps=0 ;
348+ Double_t p_true_first=0 , p_true_last=0 , p_smooth_last=0 ;
349+ tracks->SetBranchAddress (" run" ,&tr_run);
350+ tracks->SetBranchAddress (" event" ,&tr_event);
351+ tracks->SetBranchAddress (" track_id" ,&tr_tid);
352+ tracks->SetBranchAddress (" n_steps" ,&n_steps);
353+ tracks->SetBranchAddress (" p_true_first" ,&p_true_first);
354+
355+ tracks->SetBranchAddress (" p_true_last" ,&p_true_last);
356+ tracks->SetBranchAddress (" p_smooth_last" ,&p_smooth_last);
357+
358+
359+ std::map<std::tuple<int ,int ,int >, double > pfirst_by_key;
360+ const Long64_t nt = tracks->GetEntries ();
361+ for (Long64_t it=0 ; it<nt; ++it) {
362+ tracks->GetEntry (it);
363+ pfirst_by_key[ std::make_tuple (tr_run,tr_event,tr_tid) ] = p_true_first;
364+ }
365+
366+ for (const auto & kv : lastEntry) {
367+ const auto key = kv.first ;
368+ const Long64_t ie = kv.second .second ;
369+ steps->GetEntry (ie);
370+
371+ const double dx = x_smooth - x_true;
372+ const double dy = y_smooth - y_true;
373+ seed_dx.Fill (dx);
374+ seed_dy.Fill (dy);
375+ seed_dinvR.Fill (invR_smooth - invR_true);
376+ seed_dtanL.Fill (tanL_smooth - tanL_true);
377+ seed_dphi.Fill (phi_smooth - phi_true);
378+
379+ if (std::isfinite (sigma_x_smooth) && sigma_x_smooth>0 ) seed_pullx.Fill (dx / sigma_x_smooth);
380+ if (std::isfinite (sigma_y_smooth) && sigma_y_smooth>0 ) seed_pully.Fill (dy / sigma_y_smooth);
381+ if (std::isfinite (sigma_invR_smooth) && sigma_invR_smooth>0 ) seed_invR_pull.Fill ((invR_smooth - invR_true)/sigma_invR_smooth);
382+ if (std::isfinite (sigma_tanL_smooth) && sigma_tanL_smooth>0 ) seed_tanL_pull.Fill ((tanL_smooth - tanL_true)/sigma_tanL_smooth);
383+ if (std::isfinite (sigma_phi_smooth) && sigma_phi_smooth>0 ) seed_phi_pull.Fill ((phi_smooth - phi_true)/sigma_phi_smooth);
384+
385+
386+ const auto itp = pfirst_by_key.find (key);
387+ if (itp != pfirst_by_key.end () && std::isfinite (itp->second ) && itp->second >0 && std::isfinite (p_smooth)) {
388+ const double p_first = itp->second ;
389+ const double dp_first = p_smooth - p_first;
390+ seed_dp.Fill (dp_first);
391+ seed_dprel.Fill (dp_first / p_first);
392+ seed_ratio_ps_over_pfirst.Fill (p_smooth / p_first);
393+ }
394+ }
395+
396+
397+
279398 TFile fout (output_root.c_str ()," RECREATE" );
280399 if (fout.IsZombie ()) { std::cerr<<" Cannot create " <<output_root<<" \n " ; return 3 ; }
281400
282- meas_x_res.Write ();
283- meas_y_res.Write ();
284- smooth_x_res.Write ();
285- smooth_y_res.Write ();
286- p_res_step.Write ();
401+ x_res_step.Write ();
402+ y_res_step.Write ();
403+ invR_res_step.Write ();
404+ tanL_res_step.Write ();
405+ phi_res_step.Write ();
406+
407+ measx_res_step.Write ();
408+ measy_res_step.Write ();
409+
410+ p_res_step.Write ();
287411 p_true_vs_p_smooth_step.Write ();
288- h_gpos.Write ();
412+
413+ p_rel_res_step.Write ();
414+ dp_vs_ptrue_step.Write ();
415+ dprel_vs_ptrue_step.Write ();
416+
417+ h_gpos.Write ();
289418 h_gang.Write ();
290- x_pull.Write ();
291- y_pull.Write ();
292419 chi2_h.Write ();
293420
421+ seed_dx.Write ();
422+ seed_dy.Write ();
423+ seed_dinvR.Write ();
424+ seed_dtanL.Write ();
425+ seed_dphi.Write ();
426+ seed_pullx.Write ();
427+ seed_pully.Write ();
428+ seed_invR_pull.Write ();
429+ seed_tanL_pull.Write ();
430+ seed_phi_pull.Write ();
431+
432+ seed_dp.Write ();
433+ seed_dprel.Write ();
434+ seed_ratio_ps_over_pfirst.Write ();
435+
294436 TDirectory* dGraphs = fout.mkdir (" graphs" );
295437 makeTrackGraph (steps, dGraphs);
296438
297439 // ---- Istogrammi per track ----
298- Int_t tr_track_id=0 , tr_run=0 , tr_event=0 , n_steps=0 ;
299- Double_t p_init_true=0 ;
300- Double_t p_true_last=0 ;
301- Double_t p_smooth_last=0 ;
302-
303- tracks->SetBranchAddress (" track_id" ,&tr_track_id);
304- tracks->SetBranchAddress (" run" ,&tr_run);
305- tracks->SetBranchAddress (" event" ,&tr_event);
306- tracks->SetBranchAddress (" n_steps" ,&n_steps);
307- tracks->SetBranchAddress (" p_init_true" ,&p_init_true);
308- tracks->SetBranchAddress (" p_true_last" ,&p_true_last);
309- tracks->SetBranchAddress (" p_smooth_last" ,&p_smooth_last);
310-
311440 TH2D p_init_vs_reco_smooth (" p_init_vs_reco_smooth" ," Initial true p vs last smoothed reco p; p_{true}^{init} [MeV]; p_{reco}^{smooth,last} [MeV]" ,200 ,0 ,5000 ,200 ,0 ,5000 );// ???
312441 TH2D p_true_vs_reco_smooth (" p_true_vs_reco_smooth" ," True p at last step vs last smoothed reco p; p_{true}^{last} [MeV]; p_{reco}^{smooth,last} [MeV]" ,200 ,0 ,5000 ,200 ,0 ,5000 );
313442 TH2D p_diff_vs_points (" p_diff_vs_points" ," DeltaP vs nPoints; nPoints; (p_{reco}^{last} - p_{true}^{last}) [MeV]" ,200 ,0 ,200 ,200 ,-500 ,500 );
314443
315- const Long64_t nt = tracks->GetEntries ();
316444 for (Long64_t i=0 ;i<nt;++i){
317445 tracks->GetEntry (i);
318- if (std::isfinite (p_init_true ) && std::isfinite (p_smooth_last))
319- p_init_vs_reco_smooth.Fill (p_init_true , p_smooth_last);
446+ if (std::isfinite (p_true_first ) && std::isfinite (p_smooth_last))
447+ p_init_vs_reco_smooth.Fill (p_true_first , p_smooth_last);
320448
321449 if (std::isfinite (p_true_last) && std::isfinite (p_smooth_last)) {
322450 // p_first_vs_reco_smooth.Fill(p_true_last, p_smooth_last);
0 commit comments