@@ -125,6 +125,8 @@ enum TrackType {
125125 kGenCasc ,
126126 kRecoCascDaug ,
127127 kGenCascDaug ,
128+ kRecoSecondary ,
129+ kGhostSecondary ,
128130 kNTrackTypes ,
129131};
130132
@@ -587,6 +589,19 @@ struct OnTheFlyTracker {
587589 insertHist (histPath + " h2dBRPtResAbs" , " h2dPtResAbs;Gen p_{T};#Delta p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
588590 }
589591
592+ if (doprocessDecayer) {
593+ insertHist (histPath + " h2dPrimaryPtRes" , " h2dPrimaryPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
594+ insertHist (histPath + " h2dSecondaryPtRes" , " h2dSecondaryPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
595+ insertHist (histPath + " h2dPrimaryElPtRes" , " h2dPrimaryElPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
596+ insertHist (histPath + " h2dSecondaryElPtRes" , " h2dSecondaryElPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
597+ insertHist (histPath + " h2dPrimaryPiPtRes" , " h2dPrimaryPiPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
598+ insertHist (histPath + " h2dSecondaryPiPtRes" , " h2dSecondaryPiPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
599+ insertHist (histPath + " h2dPrimaryKaPtRes" , " h2dPrimaryKaPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
600+ insertHist (histPath + " h2dSecondaryKaPtRes" , " h2dSecondaryKaPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
601+ insertHist (histPath + " h2dPrimaryPrPtRes" , " h2dPrimaryPrPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
602+ insertHist (histPath + " h2dSecondaryPrPtRes" , " h2dSecondaryPrPtRes;Gen p_{T};#Delta p_{T} / Reco p_{T}" , {kTH2D , {{axes.axisMomentum , axes.axisPtRes }}});
603+ }
604+
590605 } // end config loop
591606
592607 // Basic QA
@@ -2043,6 +2058,7 @@ struct OnTheFlyTracker {
20432058 const bool pdgsToBeHandled = longLivedToBeHandled || (enableNucleiSmearing && nucleiToBeHandled);
20442059
20452060 o2::upgrade::OTFParticle otfParticle (mcParticle);
2061+ otfParticle.setBits (mcParticle.decayerBits_raw ());
20462062 if (otfParticle.hasNaN ()) {
20472063 continue ;
20482064 }
@@ -2080,17 +2096,16 @@ struct OnTheFlyTracker {
20802096
20812097 multiplicityCounter++;
20822098 o2::track::TrackParCov trackParCov;
2083- const bool isDecayDaughter = (mcParticle.getProcess () == TMCProcess::kPDecay );
20842099 const float time = (eventCollisionTimeNS + gRandom ->Gaus (0 ., timeResolutionNs)) * nsToMus;
20852100
20862101 bool reconstructed = false ;
20872102 int nTrkHits = 0 ;
2088- if (enablePrimarySmearing && otfParticle.checkBit (o2::upgrade::DecayerBits::IsPrimary)) {
2103+ const bool isSecondary = !otfParticle.isPrimary () && otfParticle.checkBit (o2::upgrade::DecayerBits::ProducedByDecayer) && otfParticle.isAlive ();
2104+ if (enablePrimarySmearing && otfParticle.isPrimary ()) {
20892105 o2::upgrade::convertMCParticleToO2Track (mcParticle, trackParCov, pdgDB);
20902106 computeBremsstrahlungLoss (icfg, mcParticle, trackParCov);
20912107 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)) {
2108+ } else if (enableSecondarySmearing && isSecondary) {
20942109 o2::track::TrackParCov perfectTrackParCov;
20952110 o2::upgrade::convertMCParticleToO2Track (mcParticle, perfectTrackParCov, pdgDB);
20962111 computeBremsstrahlungLoss (icfg, mcParticle, perfectTrackParCov);
@@ -2114,21 +2129,52 @@ struct OnTheFlyTracker {
21142129
21152130 histos.fill (HIST (" hNaNBookkeeping" ), 0 .0f , 1 .0f );
21162131 if (enablePrimarySmearing) {
2132+ const float ptResolution = (trackParCov.getPt () - mcParticle.pt ()) / trackParCov.getPt ();
21172133 getHist (TH1 , histPath + " hPtReconstructed" )->Fill (trackParCov.getPt ());
2118- if (std::abs (mcParticle.pdgCode ()) == kElectron )
2134+ if (otfParticle.isPrimary ()) {
2135+ getHist (TH2 , histPath + " h2dPrimaryPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2136+ } else {
2137+ getHist (TH2 , histPath + " h2dSecondaryPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2138+ }
2139+ if (std::abs (mcParticle.pdgCode ()) == kElectron ) {
21192140 getHist (TH1 , histPath + " hPtReconstructedEl" )->Fill (trackParCov.getPt ());
2120- if (std::abs (mcParticle.pdgCode ()) == kPiPlus )
2141+ if (otfParticle.isPrimary ()) {
2142+ getHist (TH2 , histPath + " h2dPrimaryElPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2143+ } else {
2144+ getHist (TH2 , histPath + " h2dSecondaryElPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2145+ }
2146+ }
2147+ if (std::abs (mcParticle.pdgCode ()) == kPiPlus ) {
21212148 getHist (TH1 , histPath + " hPtReconstructedPi" )->Fill (trackParCov.getPt ());
2122- if (std::abs (mcParticle.pdgCode ()) == kKPlus )
2149+ if (otfParticle.isPrimary ()) {
2150+ getHist (TH2 , histPath + " h2dPrimaryPiPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2151+ } else {
2152+ getHist (TH2 , histPath + " h2dSecondaryPiPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2153+ }
2154+ }
2155+ if (std::abs (mcParticle.pdgCode ()) == kKPlus ) {
21232156 getHist (TH1 , histPath + " hPtReconstructedKa" )->Fill (trackParCov.getPt ());
2124- if (std::abs (mcParticle.pdgCode ()) == kProton )
2157+ if (otfParticle.isPrimary ()) {
2158+ getHist (TH2 , histPath + " h2dPrimaryKaPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2159+ } else {
2160+ getHist (TH2 , histPath + " h2dSecondaryKaPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2161+ }
2162+ }
2163+ if (std::abs (mcParticle.pdgCode ()) == kProton ) {
21252164 getHist (TH1 , histPath + " hPtReconstructedPr" )->Fill (trackParCov.getPt ());
2165+ if (otfParticle.isPrimary ()) {
2166+ getHist (TH2 , histPath + " h2dPrimaryPrPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2167+ } else {
2168+ getHist (TH2 , histPath + " h2dSecondaryPrPtRes" )->Fill (trackParCov.getPt (), ptResolution);
2169+ }
2170+ }
21262171 }
21272172
21282173 if (reconstructed) {
2129- tracksAlice3.push_back (TrackAlice3{trackParCov, mcParticle.globalIndex (), time, timeResolutionUs, isDecayDaughter, false , 0 , nTrkHits, kRecoPrimary });
2174+ tracksAlice3.push_back (TrackAlice3{trackParCov, mcParticle.globalIndex (), time, timeResolutionUs, isSecondary, false , 0 , nTrkHits, kRecoPrimary });
2175+ getHist (TH1 , histPath + " hPtReconstructedPr" )->Fill (trackParCov.getPt ());
21302176 } else {
2131- ghostTracksAlice3.push_back (TrackAlice3{trackParCov, mcParticle.globalIndex (), time, timeResolutionUs, isDecayDaughter , false , 0 , nTrkHits, kGhostPrimary });
2177+ ghostTracksAlice3.push_back (TrackAlice3{trackParCov, mcParticle.globalIndex (), time, timeResolutionUs, isSecondary , false , 0 , nTrkHits, kGhostPrimary });
21322178 }
21332179 }
21342180
0 commit comments