@@ -587,6 +587,19 @@ struct OnTheFlyTracker {
587587 insertHist (histPath + " h2dBRPtResAbs" , " h2dPtResAbs;Gen p_{T};#Delta p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
588588 }
589589
590+ if (doprocessDecayer) {
591+ insertHist (histPath + " h2dPrimaryPtRes" , " h2dPrimaryPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
592+ insertHist (histPath + " h2dSecondaryPtRes" , " h2dSecondaryPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
593+ insertHist (histPath + " h2dPrimaryElPtRes" , " h2dPrimaryElPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
594+ insertHist (histPath + " h2dSecondaryElPtRes" , " h2dSecondaryElPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
595+ insertHist (histPath + " h2dPrimaryPiPtRes" , " h2dPrimaryPiPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
596+ insertHist (histPath + " h2dSecondaryPiPtRes" , " h2dSecondaryPiPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
597+ insertHist (histPath + " h2dPrimaryKaPtRes" , " h2dPrimaryKaPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
598+ insertHist (histPath + " h2dSecondaryKaPtRes" , " h2dSecondaryKaPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
599+ insertHist (histPath + " h2dPrimaryPrPtRes" , " h2dPrimaryPrPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
600+ insertHist (histPath + " h2dSecondaryPrPtRes" , " h2dSecondaryPrPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
601+ }
602+
590603 } // end config loop
591604
592605 // Basic QA
@@ -2043,6 +2056,7 @@ struct OnTheFlyTracker {
20432056 const bool pdgsToBeHandled = longLivedToBeHandled || (enableNucleiSmearing && nucleiToBeHandled);
20442057
20452058 o2::upgrade::OTFParticle otfParticle (mcParticle);
2059+ otfParticle.setBits (mcParticle.decayerBits_raw ());
20462060 if (otfParticle.hasNaN ()) {
20472061 continue ;
20482062 }
@@ -2080,17 +2094,16 @@ struct OnTheFlyTracker {
20802094
20812095 multiplicityCounter++;
20822096 o2::track::TrackParCov trackParCov;
2083- const bool isDecayDaughter = (mcParticle.getProcess () == TMCProcess::kPDecay );
20842097 const float time = (eventCollisionTimeNS + gRandom ->Gaus (0 ., timeResolutionNs)) * nsToMus;
20852098
20862099 bool reconstructed = false ;
20872100 int nTrkHits = 0 ;
2088- if (enablePrimarySmearing && otfParticle.checkBit (o2::upgrade::DecayerBits::IsPrimary)) {
2101+ const bool isSecondary = !otfParticle.isPrimary () && otfParticle.checkBit (o2::upgrade::DecayerBits::ProducedByDecayer) && otfParticle.isAlive ();
2102+ if (enablePrimarySmearing && otfParticle.isPrimary ()) {
20892103 o2::upgrade::convertMCParticleToO2Track (mcParticle, trackParCov, pdgDB);
20902104 computeBremsstrahlungLoss (icfg, mcParticle, trackParCov);
20912105 reconstructed = mSmearer [icfg]->smearTrack (trackParCov, mcParticle.pdgCode (), dNdEta);
2092- nTrkHits = fastTrackerSettings.minSiliconHits ;
2093- } else if (enableSecondarySmearing && !otfParticle.checkBit (o2::upgrade::DecayerBits::IsPrimary) && otfParticle.checkBit (o2::upgrade::DecayerBits::ProducedByDecayer) && otfParticle.checkBit (o2::upgrade::DecayerBits::IsAlive)) {
2106+ } else if (enableSecondarySmearing && isSecondary) {
20942107 o2::track::TrackParCov perfectTrackParCov;
20952108 o2::upgrade::convertMCParticleToO2Track (mcParticle, perfectTrackParCov, pdgDB);
20962109 computeBremsstrahlungLoss (icfg, mcParticle, perfectTrackParCov);
@@ -2114,21 +2127,52 @@ struct OnTheFlyTracker {
21142127
21152128 histos.fill (HIST (" hNaNBookkeeping" ), 0 .0f , 1 .0f );
21162129 if (enablePrimarySmearing) {
2130+ const float ptResolution = (trackParCov.getPt () - mcParticle.pt ()) / trackParCov.getPt ();
21172131 getHist (TH1 , histPath + " hPtReconstructed" )->Fill (trackParCov.getPt ());
2118- if (std::abs (mcParticle.pdgCode ()) == kElectron )
2132+ if (otfParticle.isPrimary ()) {
2133+ getHist (TH2 , histPath + " h2dPrimaryPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2134+ } else {
2135+ getHist (TH2 , histPath + " h2dSecondaryPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2136+ }
2137+ if (std::abs (mcParticle.pdgCode ()) == kElectron ) {
21192138 getHist (TH1 , histPath + " hPtReconstructedEl" )->Fill (trackParCov.getPt ());
2120- if (std::abs (mcParticle.pdgCode ()) == kPiPlus )
2139+ if (otfParticle.isPrimary ()) {
2140+ getHist (TH2 , histPath + " h2dPrimaryElPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2141+ } else {
2142+ getHist (TH2 , histPath + " h2dSecondaryElPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2143+ }
2144+ }
2145+ if (std::abs (mcParticle.pdgCode ()) == kPiPlus ) {
21212146 getHist (TH1 , histPath + " hPtReconstructedPi" )->Fill (trackParCov.getPt ());
2122- if (std::abs (mcParticle.pdgCode ()) == kKPlus )
2147+ if (otfParticle.isPrimary ()) {
2148+ getHist (TH2 , histPath + " h2dPrimaryPiPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2149+ } else {
2150+ getHist (TH2 , histPath + " h2dSecondaryPiPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2151+ }
2152+ }
2153+ if (std::abs (mcParticle.pdgCode ()) == kKPlus ) {
21232154 getHist (TH1 , histPath + " hPtReconstructedKa" )->Fill (trackParCov.getPt ());
2124- if (std::abs (mcParticle.pdgCode ()) == kProton )
2155+ if (otfParticle.isPrimary ()) {
2156+ getHist (TH2 , histPath + " h2dPrimaryKaPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2157+ } else {
2158+ getHist (TH2 , histPath + " h2dSecondaryKaPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2159+ }
2160+ }
2161+ if (std::abs (mcParticle.pdgCode ()) == kProton ) {
21252162 getHist (TH1 , histPath + " hPtReconstructedPr" )->Fill (trackParCov.getPt ());
2163+ if (otfParticle.isPrimary ()) {
2164+ getHist (TH2 , histPath + " h2dPrimaryPrPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2165+ } else {
2166+ getHist (TH2 , histPath + " h2dSecondaryPrPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2167+ }
2168+ }
21262169 }
21272170
21282171 if (reconstructed) {
2129- tracksAlice3.push_back (TrackAlice3{trackParCov, mcParticle.globalIndex (), time, timeResolutionUs, isDecayDaughter, false , 0 , nTrkHits, kRecoPrimary });
2172+ tracksAlice3.push_back (TrackAlice3{trackParCov, mcParticle.globalIndex (), time, timeResolutionUs, isSecondary, false , 0 , nTrkHits, kRecoPrimary });
2173+ getHist (TH1 , histPath + " hPtReconstructedPr" )->Fill (trackParCov.getPt ());
21302174 } else {
2131- ghostTracksAlice3.push_back (TrackAlice3{trackParCov, mcParticle.globalIndex (), time, timeResolutionUs, isDecayDaughter , false , 0 , nTrkHits, kGhostPrimary });
2175+ ghostTracksAlice3.push_back (TrackAlice3{trackParCov, mcParticle.globalIndex (), time, timeResolutionUs, isSecondary , false , 0 , nTrkHits, kGhostPrimary });
21322176 }
21332177 }
21342178
0 commit comments