@@ -49,6 +49,8 @@ struct JFlucEfficiencyTask {
4949 170.0 , 180.0 , 190.0 , 200.0 , 210.0 , 220.0 , 230.0 , 240.0 , 250.0 , 260.0 ,
5050 270.0 , 280.0 , 290.0 , 300.0 };
5151
52+ static constexpr double kChargeThreshold = 3.0 ; // PDG charge units: 3 = |e|
53+
5254 // Update the axisPt configuration with proper vector initialization
5355 ConfigurableAxis axisPt{" axisPt" , std::vector<double >(PttJacek.begin (), PttJacek.end ()), " pT axis" };
5456
@@ -105,6 +107,8 @@ struct JFlucEfficiencyTask {
105107 Configurable<float > cfgMaxbDCAzToPVcut{" cfgMaxbDCAzToPVcut" , 1.0 , " Track DCAz cut to PV Maximum" };
106108 } TrackCuts;
107109
110+ Configurable<bool > applyMCStudy{" applyMCStudy" , false , " Apply MC study" };
111+
108112 // Configurable for track selection
109113 Configurable<int > trackSelection{" trackSelection" , 0 , " Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks" };
110114
@@ -175,17 +179,50 @@ struct JFlucEfficiencyTask {
175179 o2::framework::HistType::kTH2F , {AxisSpec (100 , -1 , 1 ), AxisSpec (axisMultiplicity)});
176180 registry.add (" hPtGenPos" , " Generated p_{T} (positive);p_{T} (GeV/c);Centrality (%);Counts" ,
177181 o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
182+ registry.add (" hPtGenPos_Pos" , " Generated p_{T} (positive) in TPC positive side;p_{T} (GeV/c);Centrality (%);Counts" ,
183+ o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
184+ registry.add (" hPtGenPos_Neg" , " Generated p_{T} (positive) in TPC negative side;p_{T} (GeV/c);Centrality (%);Counts" ,
185+ o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
178186 registry.add (" hPtGenNeg" , " Generated p_{T} (negative);p_{T} (GeV/c);Centrality (%);Counts" ,
179187 o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
188+ registry.add (" hPtGenNeg_Pos" , " Generated p_{T} (negative) in TPC positive side;p_{T} (GeV/c);Centrality (%);Counts" ,
189+ o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
190+ registry.add (" hPtGenNeg_Neg" , " Generated p_{T} (negative) in TPC negative side;p_{T} (GeV/c);Centrality (%);Counts" ,
191+ o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
180192 }
181193 registry.add (" hPtRec" , " Reconstructed p_{T} (all);p_{T} (GeV/c);Centrality (%);Counts" ,
182194 o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
183195 registry.add (" hEtaRec" , " Reconstructed #eta (all);#eta;Centrality (%);Counts" ,
184196 o2::framework::HistType::kTH2F , {AxisSpec (100 , -1 , 1 ), AxisSpec (axisMultiplicity)});
185197 registry.add (" hPtRecPos" , " Reconstructed p_{T} (positive);p_{T} (GeV/c);Centrality (%);Counts" ,
186198 o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
199+ registry.add (" hPtRecPos_Pos" , " Reconstructed p_{T} (positive) in TPC positive side;p_{T} (GeV/c);Centrality (%);Counts" ,
200+ o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
201+ registry.add (" hPtRecPos_Neg" , " Reconstructed p_{T} (positive) in TPC negative side;p_{T} (GeV/c);Centrality (%);Counts" ,
202+ o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
187203 registry.add (" hPtRecNeg" , " Reconstructed p_{T} (negative);p_{T} (GeV/c);Centrality (%);Counts" ,
188204 o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
205+ registry.add (" hPtRecNeg_Pos" , " Reconstructed p_{T} (negative) in TPC positive side;p_{T} (GeV/c);Centrality (%);Counts" ,
206+ o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
207+ registry.add (" hPtRecNeg_Neg" , " Reconstructed p_{T} (negative) in TPC negative side;p_{T} (GeV/c);Centrality (%);Counts" ,
208+ o2::framework::HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)});
209+ if (applyMCStudy) {
210+ registry.add (" hChargeSignMismatch" , " Charge-Sign mismatch cases" , {HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)}});
211+ registry.add (" hChargeSignMismatchPos" , " MC charge + but track sign -" , {HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)}});
212+ registry.add (" hChargeSignMismatchNeg" , " MC charge - but track sign +" , {HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)}});
213+ registry.add (" hChargeSignMatch" , " Charge-Sign match cases" , {HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)}});
214+ registry.add (" hChargeSignMatchPos" , " MC charge + and track sign +" , {HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)}});
215+ registry.add (" hChargeSignMatchNeg" , " MC charge - and track sign -" , {HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)}});
216+ registry.add (" hChargeSignRatio" , " Ratio of mismatch to total" , {HistType::kTH2F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity)}});
217+
218+ // pT resolution
219+ registry.add (" hPtResolution" , " p_{T} resolution;p_{T} (GeV/c);Centrality (%);Counts" ,
220+ o2::framework::HistType::kTH3F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity), AxisSpec (60 , -3 , 3 )});
221+ registry.add (" hPtResolutionPos" , " p_{T} resolution (positive);p_{T} (GeV/c);Centrality (%);Counts" ,
222+ o2::framework::HistType::kTH3F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity), AxisSpec (60 , -3 , 3 )});
223+ registry.add (" hPtResolutionNeg" , " p_{T} resolution (negative);p_{T} (GeV/c);Centrality (%);Counts" ,
224+ o2::framework::HistType::kTH3F , {AxisSpec (axisPt), AxisSpec (axisMultiplicity), AxisSpec (60 , -3 , 3 )});
225+ }
189226
190227 if (doprocessEfficiency) {
191228 registry.add (" hPtGenData" , " Generated p_{T} from data events (all);p_{T} (GeV/c);Centrality (%);Counts" ,
@@ -239,7 +276,7 @@ struct JFlucEfficiencyTask {
239276 if (p != nullptr ) {
240277 charge = p->Charge ();
241278 }
242- return std::abs (charge) >= 3 . ;
279+ return std::abs (charge) >= kChargeThreshold ;
243280 }
244281 // Track selection
245282 template <typename TrackType>
@@ -380,10 +417,25 @@ struct JFlucEfficiencyTask {
380417 }
381418 registry.fill (HIST (" hPtGen" ), particle.pt (), centrality);
382419 registry.fill (HIST (" hEtaGen" ), particle.eta (), centrality);
420+ if (particle.eta () > 0 ) {
421+ registry.fill (HIST (" hPtGenPos_Pos" ), particle.pt (), centrality);
422+ } else if (particle.eta () < 0 ) {
423+ registry.fill (HIST (" hPtGenNeg_Neg" ), particle.pt (), centrality);
424+ }
383425 if (charge > 0 ) { // Positive particles
384426 registry.fill (HIST (" hPtGenPos" ), particle.pt (), centrality);
427+ if (particle.eta () > 0 ) {
428+ registry.fill (HIST (" hPtGenPos_Pos" ), particle.pt (), centrality);
429+ } else if (particle.eta () < 0 ) {
430+ registry.fill (HIST (" hPtGenPos_Neg" ), particle.pt (), centrality);
431+ }
385432 } else if (charge < 0 ) { // Negative particles
386433 registry.fill (HIST (" hPtGenNeg" ), particle.pt (), centrality);
434+ if (particle.eta () > 0 ) {
435+ registry.fill (HIST (" hPtGenNeg_Pos" ), particle.pt (), centrality);
436+ } else if (particle.eta () < 0 ) {
437+ registry.fill (HIST (" hPtGenNeg_Neg" ), particle.pt (), centrality);
438+ }
387439 }
388440 }
389441 // Reconstruct tracks from MC particles
@@ -402,12 +454,56 @@ struct JFlucEfficiencyTask {
402454 if (!mcPart.isPhysicalPrimary () || !isChargedParticle (mcPart.pdgCode ())) {
403455 continue ;
404456 }
457+ if (applyMCStudy) {
458+ // Check charge-sign consistency
459+ auto mcCharge = getCharge (mcPart);
460+ auto trackSign = track.sign ();
461+
462+ if (mcCharge > 0 && trackSign > 0 ) {
463+ // MC charge + and track sign +
464+ registry.fill (HIST (" hChargeSignMatchPos" ), track.pt (), centrality);
465+ registry.fill (HIST (" hChargeSignMatch" ), track.pt (), centrality);
466+ } else if (mcCharge < 0 && trackSign < 0 ) {
467+ // MC charge - and track sign -
468+ registry.fill (HIST (" hChargeSignMatchNeg" ), track.pt (), centrality);
469+ registry.fill (HIST (" hChargeSignMatch" ), track.pt (), centrality);
470+ } else if (mcCharge > 0 && trackSign < 0 ) {
471+ // MC charge + but track sign -
472+ registry.fill (HIST (" hChargeSignMismatchPos" ), track.pt (), centrality);
473+ registry.fill (HIST (" hChargeSignMismatch" ), track.pt (), centrality);
474+ } else if (mcCharge < 0 && trackSign > 0 ) {
475+ // MC charge - but track sign +
476+ registry.fill (HIST (" hChargeSignMismatchNeg" ), track.pt (), centrality);
477+ registry.fill (HIST (" hChargeSignMismatch" ), track.pt (), centrality);
478+ }
479+
480+ // pT resolution
481+ auto ptRec = track.pt ();
482+ auto ptGen = mcPart.pt ();
483+ auto ptResolution = (ptRec - ptGen);
484+ registry.fill (HIST (" hPtResolution" ), ptRec, centrality, ptResolution);
485+ if (track.sign () > 0 ) {
486+ registry.fill (HIST (" hPtResolutionPos" ), ptRec, centrality, ptResolution);
487+ } else if (track.sign () < 0 ) {
488+ registry.fill (HIST (" hPtResolutionNeg" ), ptRec, centrality, ptResolution);
489+ }
490+ }
405491 registry.fill (HIST (" hPtRec" ), track.pt (), centrality);
406492 registry.fill (HIST (" hEtaRec" ), track.eta (), centrality);
407493 if (track.sign () > 0 ) { // Positive tracks
408494 registry.fill (HIST (" hPtRecPos" ), track.pt (), centrality);
495+ if (track.eta () > 0 ) {
496+ registry.fill (HIST (" hPtRecPos_Pos" ), track.pt (), centrality);
497+ } else if (track.eta () < 0 ) {
498+ registry.fill (HIST (" hPtRecPos_Neg" ), track.pt (), centrality);
499+ }
409500 } else if (track.sign () < 0 ) { // Negative tracks
410501 registry.fill (HIST (" hPtRecNeg" ), track.pt (), centrality);
502+ if (track.eta () > 0 ) {
503+ registry.fill (HIST (" hPtRecNeg_Pos" ), track.pt (), centrality);
504+ } else if (track.eta () < 0 ) {
505+ registry.fill (HIST (" hPtRecNeg_Neg" ), track.pt (), centrality);
506+ }
411507 }
412508 }
413509 }
@@ -481,6 +577,11 @@ struct JFlucEfficiencyTask {
481577 registry.fill (HIST (" hPtRecPos" ), track.pt (), centrality);
482578 } else if (track.sign () < 0 ) { // Negative tracks
483579 registry.fill (HIST (" hPtRecNeg" ), track.pt (), centrality);
580+ if (track.eta () > 0 ) {
581+ registry.fill (HIST (" hPtRecNeg_Pos" ), track.pt (), centrality);
582+ } else if (track.eta () < 0 ) {
583+ registry.fill (HIST (" hPtRecNeg_Neg" ), track.pt (), centrality);
584+ }
484585 }
485586 }
486587 }
@@ -508,8 +609,18 @@ struct JFlucEfficiencyTask {
508609 registry.fill (HIST (" hEtaRec" ), track.eta (), centrality);
509610 if (track.sign () > 0 ) { // Positive tracks
510611 registry.fill (HIST (" hPtRecPos" ), track.pt (), centrality);
612+ if (track.eta () > 0 ) {
613+ registry.fill (HIST (" hPtRecPos_Pos" ), track.pt (), centrality);
614+ } else if (track.eta () < 0 ) {
615+ registry.fill (HIST (" hPtRecPos_Neg" ), track.pt (), centrality);
616+ }
511617 } else if (track.sign () < 0 ) { // Negative tracks
512618 registry.fill (HIST (" hPtRecNeg" ), track.pt (), centrality);
619+ if (track.eta () > 0 ) {
620+ registry.fill (HIST (" hPtRecPos_Pos" ), track.pt (), centrality);
621+ } else if (track.eta () < 0 ) {
622+ registry.fill (HIST (" hPtRecPos_Neg" ), track.pt (), centrality);
623+ }
513624 }
514625 }
515626 }
@@ -535,6 +646,11 @@ struct JFlucEfficiencyTask {
535646 registry.fill (HIST (" hPtRecPos" ), track.pt (), centrality);
536647 } else if (track.sign () < 0 ) { // Negative tracks
537648 registry.fill (HIST (" hPtRecNeg" ), track.pt (), centrality);
649+ if (track.eta () > 0 ) {
650+ registry.fill (HIST (" hPtRecNeg_Pos" ), track.pt (), centrality);
651+ } else if (track.eta () < 0 ) {
652+ registry.fill (HIST (" hPtRecNeg_Neg" ), track.pt (), centrality);
653+ }
538654 }
539655 }
540656 }
0 commit comments