@@ -111,6 +111,9 @@ struct NucleitpcPbPb {
111111 Configurable<bool > cfgRigidityCorrection{" cfgRigidityCorrection" , false , " apply rigidity correction" };
112112 // Track Selection Cuts
113113 Configurable<float > cfgCutEta{" cfgCutEta" , 0 .9f , " Eta range for tracks" };
114+ Configurable<bool > cfgetaRequire{" cfgetaRequire" , true , " eta cut require" };
115+ Configurable<bool > cfgetaRequireMC{" cfgetaRequireMC" , true , " eta cut require for generated particles" };
116+ Configurable<bool > cfgrapidityRequireMC{" cfgrapidityRequireMC" , true , " rapidity cut require for generated particles" };
114117 Configurable<bool > cfgUsePVcontributors{" cfgUsePVcontributors" , true , " use tracks that are PV contibutors" };
115118 Configurable<bool > cfgITSrequire{" cfgITSrequire" , true , " Additional cut on ITS require" };
116119 Configurable<bool > cfgTPCrequire{" cfgTPCrequire" , true , " Additional cut on TPC require" };
@@ -146,6 +149,9 @@ struct NucleitpcPbPb {
146149 Configurable<float > centcut{" centcut" , 80 .0f , " centrality cut" };
147150 Configurable<float > cfgCutRapidity{" cfgCutRapidity" , 0 .5f , " Rapidity range" };
148151 Configurable<float > cfgZvertex{" cfgZvertex" , 10 , " Min Z Vertex" };
152+ Configurable<bool > cfgZvertexRequire{" cfgZvertexRequire" , true , " Pos Z cut require" };
153+ Configurable<bool > cfgZvertexRequireMC{" cfgZvertexRequireMC" , true , " Pos Z cut require for generated particles" };
154+ Configurable<bool > cfgsel8Require{" cfgsel8Require" , true , " sel8 cut require" };
149155 Configurable<float > cfgITSnsigma{" cfgITSnsigma" , 5 , " Max ITS nsigma value" };
150156 Configurable<float > cfgtpcNClsFound{" cfgtpcNClsFound" , 100 .0f , " min. no. of tpcNClsFound" };
151157 Configurable<float > cfgitsNCls{" cfgitsNCls" , 2 .0f , " min. no. of itsNCls" };
@@ -232,6 +238,7 @@ struct NucleitpcPbPb {
232238
233239 if (doprocessMC) {
234240 histomc.add (" histVtxZgen" , " histVtxZgen" , kTH1F , {axisVtxZ});
241+ histomc.add (" ImptParameter" , " ImptParameter" , kTH1F , {axisImpt});
235242 histomc.add (" histEtagen" , " histEtagen" , kTH1F , {axiseta});
236243 histomc.add (" histPtgenHe3" , " histPtgenHe3" , kTH1F , {ptAxis});
237244 histomc.add (" histPtgenAntiHe3" , " histPtgenAntiHe3" , kTH1F , {ptAxis});
@@ -266,7 +273,7 @@ struct NucleitpcPbPb {
266273 continue ;
267274 if (!track.passedTPCRefit () && cfgPassedTPCRefit)
268275 continue ;
269- if (std::abs (track.eta ()) > cfgCutEta)
276+ if (std::abs (track.eta ()) > cfgCutEta && cfgetaRequire )
270277 continue ;
271278 for (size_t i = 0 ; i < primaryParticles.size (); i++) {
272279 if (std::abs (getRapidity (track, i)) > cfgCutRapidity && cfgRapidityRequire)
@@ -326,12 +333,12 @@ struct NucleitpcPbPb {
326333 if ((getRigidity (track) > cfgTrackPIDsettings->get (i, " TOFrequiredabove" ) && (tofMasses < cfgTrackPIDsettings->get (i, " minTOFmass" ) || tofMasses > cfgTrackPIDsettings->get (i, " maxTOFmass" ))) && cfgmassRequire)
327334 continue ;
328335 fillhmass (track, i);
336+ if (cfgRequirebetaplot) {
337+ histos.fill (HIST (" Tofsignal" ), getRigidity (track) * track.sign (), o2::pid::tof::Beta::GetBeta (track));
338+ }
339+ filldedx (track, nParticles);
329340 }
330341 histos.fill (HIST (" histeta" ), track.eta ());
331- if (cfgRequirebetaplot) {
332- histos.fill (HIST (" Tofsignal" ), getRigidity (track), o2::pid::tof::Beta::GetBeta (track));
333- }
334- filldedx (track, nParticles);
335342 } // track loop
336343 }
337344 // ----------------------------------------------------------------------------------------------------------------
@@ -380,18 +387,19 @@ struct NucleitpcPbPb {
380387 mcCollInfos.resize (mcCollisions.size ());
381388 // ----------------------------- Generated particles loop -----------------------------
382389 for (auto const & mcColl : mcCollisions) {
383- if (std::abs (mcColl.posZ ()) > cfgZvertex)
390+ if (std::abs (mcColl.posZ ()) > cfgZvertex && cfgZvertexRequireMC )
384391 continue ;
385392 histomc.fill (HIST (" histVtxZgen" ), mcColl.posZ ());
393+ histomc.fill (HIST (" ImptParameter" ), mcColl.impactParameter ());
386394 for (auto const & mcParticle : particlesMC) {
387395 if (mcParticle.mcCollisionId () != mcColl.globalIndex ())
388396 continue ;
389397 if (!mcParticle.isPhysicalPrimary ())
390398 continue ;
391399 int pdgCode = mcParticle.pdgCode ();
392- if (std::abs (mcParticle.y ()) > cfgCutRapidity)
400+ if (std::abs (mcParticle.y ()) > cfgCutRapidity && cfgrapidityRequireMC )
393401 continue ;
394- if (std::abs (mcParticle.eta ()) > cfgCutEta)
402+ if (std::abs (mcParticle.eta ()) > cfgCutEta && cfgetaRequireMC )
395403 continue ;
396404 histomc.fill (HIST (" histEtagen" ), mcParticle.eta ());
397405 float ptScaled = mcParticle.pt ();
@@ -415,9 +423,11 @@ struct NucleitpcPbPb {
415423 initCCDB (bc);
416424 collHasCandidate = false ;
417425 histomc.fill (HIST (" histNevReco" ), 0.5 );
418- collPassedEvSel = collision.sel8 () && std::abs (collision.posZ ()) < cfgZvertex;
426+ if (std::abs (collision.posZ ()) > cfgZvertex && cfgZvertexRequire)
427+ continue ;
428+ collPassedEvSel = collision.sel8 ();
419429 occupancy = collision.trackOccupancyInTimeRange ();
420- if (!collPassedEvSel)
430+ if (!collPassedEvSel && cfgsel8Require )
421431 continue ;
422432 histomc.fill (HIST (" histNevReco" ), 1.5 );
423433 histomc.fill (HIST (" histVtxZReco" ), collision.posZ ());
@@ -456,7 +466,7 @@ struct NucleitpcPbPb {
456466 continue ;
457467 if (!track.passedTPCRefit () && cfgPassedTPCRefit)
458468 continue ;
459- if (std::abs (track.eta ()) > cfgCutEta)
469+ if (std::abs (track.eta ()) > cfgCutEta && cfgetaRequire )
460470 continue ;
461471 if (!matchedMCParticle.isPhysicalPrimary ())
462472 continue ;
@@ -519,52 +529,52 @@ struct NucleitpcPbPb {
519529 if ((getRigidity (track) > cfgTrackPIDsettings->get (i, " TOFrequiredabove" ) && (tofMasses < cfgTrackPIDsettings->get (i, " minTOFmass" ) || tofMasses > cfgTrackPIDsettings->get (i, " maxTOFmass" ))) && cfgmassRequire)
520530 continue ;
521531 fillhmass (track, i);
522- }
523- histos.fill (HIST (" histeta" ), track.eta ());
524- if (cfgRequirebetaplot) {
525- histos.fill (HIST (" Tofsignal" ), getRigidity (track), o2::pid::tof::Beta::GetBeta (track));
526- }
527- filldedx (track, nParticles);
528- /* ----------------------------------------------------------------------------------------------------------------*/
529- float ptReco;
530- setTrackParCov (track, mTrackParCov );
531- mTrackParCov .setPID (track.pidForTracking ());
532- ptReco = (std::abs (pdg) == particlePdgCodes.at (4 ) || std::abs (pdg) == particlePdgCodes.at (5 )) ? 2 * mTrackParCov .getPt () : mTrackParCov .getPt ();
533- if (pdg == -particlePdgCodes.at (5 ) && cfgmccorrectionhe4Require) {
534- ptReco = ptReco + 0.00765 + 0.503791 * std::exp (-1.10517 * ptReco);
535- }
532+ if (cfgRequirebetaplot) {
533+ histos.fill (HIST (" Tofsignal" ), getRigidity (track) * track.sign (), o2::pid::tof::Beta::GetBeta (track));
534+ }
535+ filldedx (track, nParticles);
536+ /* ----------------------------------------------------------------------------------------------------------------*/
537+ float ptReco;
538+ mTrackParCov .setPID (track.pidForTracking ());
539+ ptReco = (std::abs (pdg) == particlePdgCodes.at (4 ) || std::abs (pdg) == particlePdgCodes.at (5 )) ? 2 * mTrackParCov .getPt () : mTrackParCov .getPt ();
540+ if (pdg == -particlePdgCodes.at (5 ) && cfgmccorrectionhe4Require) {
541+ ptReco = ptReco + 0.00765 + 0.503791 * std::exp (-1.10517 * ptReco);
542+ }
536543
537- if (pdg == -particlePdgCodes.at (4 ) && cfgmccorrectionhe4Require) {
538- int pidGuess = track.pidForTracking ();
539- int antitriton = 6 ;
540- if (pidGuess == antitriton) {
541- ptReco = ptReco - 0.464215 + 0.195771 * ptReco - 0.0183111 * ptReco * ptReco;
542- // LOG(info) << "we have he3" << pidGuess;
544+ if (pdg == -particlePdgCodes.at (4 ) && cfgmccorrectionhe4Require) {
545+ int pidGuess = track.pidForTracking ();
546+ int antitriton = 6 ;
547+ if (pidGuess == antitriton) {
548+ ptReco = ptReco - 0.464215 + 0.195771 * ptReco - 0.0183111 * ptReco * ptReco;
549+ // LOG(info) << "we have he3" << pidGuess;
550+ }
543551 }
544- }
545- float ptGen = matchedMCParticle.pt ();
546- float deltaPt = ptReco - ptGen;
552+ float ptGen = matchedMCParticle.pt ();
553+ float deltaPt = ptReco - ptGen;
547554
548- if (pdg == -particlePdgCodes.at (4 )) {
549- histomc.fill (HIST (" histDeltaPtVsPtGen" ), ptReco, deltaPt);
550- histomc.fill (HIST (" histPIDtrack" ), ptReco, track.pidForTracking ());
551- }
552- if (pdg == -particlePdgCodes.at (5 )) {
553- histomc.fill (HIST (" histDeltaPtVsPtGenHe4" ), ptReco, deltaPt);
554- }
555- if (pdg == particlePdgCodes.at (4 )) {
556- histomc.fill (HIST (" histPtRecoHe3" ), ptReco);
557- } else if (pdg == -particlePdgCodes.at (4 )) {
558- histomc.fill (HIST (" histPtRecoAntiHe3" ), ptReco);
559- } else if (pdg == particlePdgCodes.at (5 )) {
560- histomc.fill (HIST (" histPtRecoHe4" ), ptReco);
561- } else if (pdg == -particlePdgCodes.at (5 )) {
562- histomc.fill (HIST (" histPtRecoAntiHe4" ), ptReco);
555+ if (pdg == -particlePdgCodes.at (4 )) {
556+ histomc.fill (HIST (" histDeltaPtVsPtGen" ), ptReco, deltaPt);
557+ histomc.fill (HIST (" histPIDtrack" ), ptReco, track.pidForTracking ());
558+ }
559+ if (pdg == -particlePdgCodes.at (5 )) {
560+ histomc.fill (HIST (" histDeltaPtVsPtGenHe4" ), ptReco, deltaPt);
561+ }
562+ if (pdg == particlePdgCodes.at (4 )) {
563+ histomc.fill (HIST (" histPtRecoHe3" ), ptReco);
564+ } else if (pdg == -particlePdgCodes.at (4 )) {
565+ histomc.fill (HIST (" histPtRecoAntiHe3" ), ptReco);
566+ } else if (pdg == particlePdgCodes.at (5 )) {
567+ histomc.fill (HIST (" histPtRecoHe4" ), ptReco);
568+ } else if (pdg == -particlePdgCodes.at (5 )) {
569+ histomc.fill (HIST (" histPtRecoAntiHe4" ), ptReco);
570+ }
563571 }
572+ histos.fill (HIST (" histeta" ), track.eta ());
573+ /* ----------------------------------------------------------------------------------------------------------------*/
564574 } // Track loop
565575 } // Collision loop
566576 }
567- PROCESS_SWITCH (NucleitpcPbPb, processMC, " MC reco+gen analysis" , true );
577+ PROCESS_SWITCH (NucleitpcPbPb, processMC, " MC reco+gen analysis" , false );
568578 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
569579 void initCCDB (aod::BCsWithTimestamps::iterator const & bc)
570580 {
@@ -673,9 +683,9 @@ struct NucleitpcPbPb {
673683 mTrackParCov .setPID (track.pidForTracking ());
674684 ptMomn = (species == he3 || species == he4) ? 2 * mTrackParCov .getPt () : mTrackParCov .getPt ();
675685 if (track.sign () > 0 ) {
676- hmass[2 * species]->Fill (ptMomn, massDiff * massDiff );
686+ hmass[2 * species]->Fill (ptMomn, massDiff);
677687 } else if (track.sign () < 0 ) {
678- hmass[2 * species + 1 ]->Fill (ptMomn, massDiff * massDiff );
688+ hmass[2 * species + 1 ]->Fill (ptMomn, massDiff);
679689 }
680690 }
681691 // ----------------------------------------------------------------------------------------------------------------
0 commit comments