@@ -48,14 +48,14 @@ using namespace o2::framework::expressions;
4848using namespace o2 ::aod::track;
4949using namespace o2 ::aod::evsel;
5050
51- using CollisionDataTable = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs, aod::CentFV0As, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentNGlobals, aod::CentMFTs>;
52- using ColDataTablepp = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Ms>;
51+ using CollisionDataTable = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::PVMults, aod:: CentFT0Cs, aod::CentFV0As, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentNGlobals, aod::CentMFTs>;
52+ using ColDataTablepp = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::PVMults, aod:: CentFT0Ms>;
5353using TrackDataTable = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection>;
5454using FilTrackDataTable = soa::Filtered<TrackDataTable>;
5555using CollisionMCTrueTable = aod::McCollisions;
5656using TrackMCTrueTable = aod::McParticles;
57- using CollisionMCRecTable = soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs, aod::CentFV0As, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentNGlobals, aod::CentMFTs>>;
58- using ColMCRecTablepp = soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Ms>>;
57+ using CollisionMCRecTable = soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions, aod::EvSels, aod::Mults, aod::PVMults, aod:: CentFT0Cs, aod::CentFV0As, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentNGlobals, aod::CentMFTs>>;
58+ using ColMCRecTablepp = soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions, aod::EvSels, aod::Mults, aod::PVMults, aod:: CentFT0Ms>>;
5959using TrackMCRecTable = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::McTrackLabels, aod::TrackSelection>;
6060using FilTrackMCRecTable = soa::Filtered<TrackMCRecTable>;
6161using V0TrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTPCFullPr>;
@@ -115,7 +115,6 @@ AxisSpec axisMassLambda = {200, 1.07, 1.17, "Lambda/AntiLamda Mass", "Lambda/Ant
115115AxisSpec axisTracks{9 , 0.5 , 9.5 , " #tracks" , " TrackAxis" };
116116auto static constexpr kMinCharge = 3 .f;
117117auto static constexpr kMinpTcut = 0 .1f ;
118- auto static constexpr kEtaInelgt0 = 1 .0f ;
119118auto static constexpr kNItslayers = 7 ;
120119
121120struct HeavyionMultiplicity {
@@ -166,6 +165,7 @@ struct HeavyionMultiplicity {
166165 Configurable<bool > isApplyCentNGlobal{" isApplyCentNGlobal" , false , " Centrality based on global tracks" };
167166 Configurable<bool > isApplyCentMFT{" isApplyCentMFT" , false , " Centrality based on MFT tracks" };
168167 Configurable<bool > isApplySplitRecCol{" isApplySplitRecCol" , false , " Split MC reco collisions" };
168+ Configurable<bool > isApplyInelgt0{" isApplyInelgt0" , false , " Enable INEL > 0 condition" };
169169
170170 void init (InitContext const &)
171171 {
@@ -192,6 +192,7 @@ struct HeavyionMultiplicity {
192192 x->SetBinLabel (6 , " ApplyNoCollInTimeRangeStandard" );
193193 x->SetBinLabel (7 , " ApplyNoCollInRofStandard" );
194194 x->SetBinLabel (8 , " ApplyNoHighMultCollInPrevRof" );
195+ x->SetBinLabel (9 , " INEL > 0" );
195196
196197 if (doprocessData) {
197198 histos.add (" CentPercentileHist" , " CentPercentileHist" , kTH1D , {axisCent}, false );
@@ -309,6 +310,11 @@ struct HeavyionMultiplicity {
309310 return false ;
310311 }
311312 histos.fill (HIST (" EventHist" ), 8 );
313+
314+ if (isApplyInelgt0 && !col.isInelGt0 ()) {
315+ return false ;
316+ }
317+ histos.fill (HIST (" EventHist" ), 9 );
312318 return true ;
313319 }
314320
@@ -673,145 +679,121 @@ struct HeavyionMultiplicity {
673679 return ;
674680 }
675681
676- // INEL>0 sample
677- auto nTrks = 0 ;
682+ histos.fill (HIST (" VtxZHist" ), cols.posZ ());
683+ histos.fill (HIST (" MultPercentileHist" ), cols.centFT0M ());
684+ histos.fill (HIST (" hdatazvtxmultpp" ), cols.posZ (), cols.centFT0M ());
685+
678686 for (const auto & track : tracks) {
679687 if (!isTrackSelected (track)) {
680688 continue ;
681689 }
682- if (track.eta () < kEtaInelgt0 ) {
683- nTrks++;
690+ histos.fill (HIST (" PhiVsEtaHistpp" ), track.phi (), track.eta ());
691+ histos.fill (HIST (" hdatadndetapp" ), cols.posZ (), cols.centFT0M (), track.eta (), track.phi (), kGlobalplusITS );
692+ if (track.hasTPC ()) {
693+ histos.fill (HIST (" hdatadndetapp" ), cols.posZ (), cols.centFT0M (), track.eta (), track.phi (), kGlobalonly );
694+ } else {
695+ histos.fill (HIST (" hdatadndetapp" ), cols.posZ (), cols.centFT0M (), track.eta (), track.phi (), kITSonly );
684696 }
685697 } // track loop
686-
687- if (nTrks > 0 ) {
688- histos.fill (HIST (" EventHist" ), 9 );
689- histos.fill (HIST (" VtxZHist" ), cols.posZ ());
690- histos.fill (HIST (" MultPercentileHist" ), cols.centFT0M ());
691- histos.fill (HIST (" hdatazvtxmultpp" ), cols.posZ (), cols.centFT0M ());
692-
693- for (const auto & track : tracks) {
694- if (!isTrackSelected (track)) {
695- continue ;
696- }
697- histos.fill (HIST (" PhiVsEtaHistpp" ), track.phi (), track.eta ());
698- histos.fill (HIST (" hdatadndetapp" ), cols.posZ (), cols.centFT0M (), track.eta (), track.phi (), kGlobalplusITS );
699- if (track.hasTPC ()) {
700- histos.fill (HIST (" hdatadndetapp" ), cols.posZ (), cols.centFT0M (), track.eta (), track.phi (), kGlobalonly );
701- } else {
702- histos.fill (HIST (" hdatadndetapp" ), cols.posZ (), cols.centFT0M (), track.eta (), track.phi (), kITSonly );
703- }
704- } // track loop
705- } // nTrks>0
706698 }
707699 PROCESS_SWITCH (HeavyionMultiplicity, processppData, " process pp data" , false );
708700
709701 void processppMonteCarlo (CollisionMCTrueTable::iterator const &, ColMCRecTablepp const & RecCols, TrackMCTrueTable const & GenParticles, FilTrackMCRecTable const & RecTracks)
710702 {
703+ if (isApplySplitRecCol && (RecCols.size () == 0 || RecCols.size () > 1 )) {
704+ return ;
705+ }
706+
711707 for (const auto & RecCol : RecCols) {
712708 if (!isEventSelected (RecCol)) {
713709 continue ;
714710 }
715711 auto recTracksPart = RecTracks.sliceBy (perCollision, RecCol.globalIndex ());
716712 std::vector<int > mclabels;
717713
718- // INEL>0 sample
719- auto nTrks = 0 ;
714+ histos.fill (HIST (" VtxZHist" ), RecCol.posZ ());
715+ histos.fill (HIST (" MultPercentileMCRecHist" ), RecCol.centFT0M ());
716+ histos.fill (HIST (" hmczvtxmultpp" ), RecCol.posZ (), RecCol.centFT0M ());
717+
720718 for (const auto & Rectrack : recTracksPart) {
721719 if (!isTrackSelected (Rectrack)) {
722720 continue ;
723721 }
724- if (Rectrack.eta () < kEtaInelgt0 ) {
725- nTrks++;
722+ histos.fill (HIST (" MCrecPhiVsEtaHistpp" ), Rectrack.phi (), Rectrack.eta ());
723+ histos.fill (HIST (" hmcrecdndetapp" ), RecCol.posZ (), RecCol.centFT0M (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kGlobalplusITS );
724+ if (Rectrack.hasTPC ()) {
725+ histos.fill (HIST (" hmcrecdndetapp" ), RecCol.posZ (), RecCol.centFT0M (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kGlobalonly );
726+ } else {
727+ histos.fill (HIST (" hmcrecdndetapp" ), RecCol.posZ (), RecCol.centFT0M (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kITSonly );
726728 }
727- }
728729
729- if (nTrks > 0 ) {
730- histos.fill (HIST (" EventHist" ), 9 );
731- histos.fill (HIST (" VtxZHist" ), RecCol.posZ ());
732- histos.fill (HIST (" MultPercentileMCRecHist" ), RecCol.centFT0M ());
733- histos.fill (HIST (" hmczvtxmultpp" ), RecCol.posZ (), RecCol.centFT0M ());
734-
735- for (const auto & Rectrack : recTracksPart) {
736- if (!isTrackSelected (Rectrack)) {
737- continue ;
738- }
739- histos.fill (HIST (" MCrecPhiVsEtaHistpp" ), Rectrack.phi (), Rectrack.eta ());
740- histos.fill (HIST (" hmcrecdndetapp" ), RecCol.posZ (), RecCol.centFT0M (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kGlobalplusITS );
741- if (Rectrack.hasTPC ()) {
742- histos.fill (HIST (" hmcrecdndetapp" ), RecCol.posZ (), RecCol.centFT0M (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kGlobalonly );
743- } else {
744- histos.fill (HIST (" hmcrecdndetapp" ), RecCol.posZ (), RecCol.centFT0M (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kITSonly );
745- }
746-
747- if (Rectrack.has_mcParticle ()) {
748- int pid = kBkg ;
749- auto mcpart = Rectrack.template mcParticle_as <aod::McParticles>();
750- if (mcpart.isPhysicalPrimary ()) {
751- switch (std::abs (mcpart.pdgCode ())) {
752- case PDG_t::kPiPlus :
753- pid = kSpPion ;
754- break ;
755- case PDG_t::kKPlus :
756- pid = kSpKaon ;
757- break ;
758- case PDG_t::kProton :
759- pid = kSpProton ;
760- break ;
761- default :
762- pid = kSpOther ;
763- break ;
764- }
765- } else {
766- pid = kSpNotPrimary ;
767- }
768- if (mcpart.has_mothers ()) {
769- auto mcpartMother = mcpart.template mothers_as <aod::McParticles>().front ();
770- if (mcpartMother.pdgCode () == PDG_t::kK0Short || std::abs (mcpartMother.pdgCode ()) == PDG_t::kLambda0 ) {
771- pid = kSpStrangeDecay ;
772- }
773- }
774- if (find (mclabels.begin (), mclabels.end (), Rectrack.mcParticleId ()) != mclabels.end ()) {
775- pid = kBkg ;
730+ if (Rectrack.has_mcParticle ()) {
731+ int pid = kBkg ;
732+ auto mcpart = Rectrack.template mcParticle_as <aod::McParticles>();
733+ if (mcpart.isPhysicalPrimary ()) {
734+ switch (std::abs (mcpart.pdgCode ())) {
735+ case PDG_t::kPiPlus :
736+ pid = kSpPion ;
737+ break ;
738+ case PDG_t::kKPlus :
739+ pid = kSpKaon ;
740+ break ;
741+ case PDG_t::kProton :
742+ pid = kSpProton ;
743+ break ;
744+ default :
745+ pid = kSpOther ;
746+ break ;
776747 }
777- mclabels.push_back (Rectrack.mcParticleId ());
778- histos.fill (HIST (" hmcrecdndetapp" ), RecCol.posZ (), RecCol.centFT0M (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(pid), kGlobalplusITS );
779748 } else {
780- histos. fill ( HIST ( " hmcrecdndetapp " ), RecCol. posZ (), RecCol. centFT0M (), Rectrack. eta (), Rectrack. phi (), static_cast < double >( kBkg ), kGlobalplusITS ) ;
749+ pid = kSpNotPrimary ;
781750 }
782- } // track (mcrec) loop
783-
784- for ( const auto & particle : GenParticles ) {
785- if (! isGenTrackSelected (particle)) {
786- continue ;
751+ if (mcpart. has_mothers ()) {
752+ auto mcpartMother = mcpart. template mothers_as <aod::McParticles>(). front ();
753+ if (mcpartMother. pdgCode () == PDG_t:: kK0Short || std::abs (mcpartMother. pdgCode ()) == PDG_t:: kLambda0 ) {
754+ pid = kSpStrangeDecay ;
755+ }
787756 }
788- histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kNoGenpTVar );
789- if (particle.pt () < kMinpTcut ) {
790- histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTup , -10.0 * particle.pt () + 2 );
791- histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTdown , 5.0 * particle.pt () + 0.5 );
792- } else {
793- histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTup );
794- histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTdown );
757+ if (find (mclabels.begin (), mclabels.end (), Rectrack.mcParticleId ()) != mclabels.end ()) {
758+ pid = kBkg ;
795759 }
760+ mclabels.push_back (Rectrack.mcParticleId ());
761+ histos.fill (HIST (" hmcrecdndetapp" ), RecCol.posZ (), RecCol.centFT0M (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(pid), kGlobalplusITS );
762+ } else {
763+ histos.fill (HIST (" hmcrecdndetapp" ), RecCol.posZ (), RecCol.centFT0M (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kBkg ), kGlobalplusITS );
764+ }
765+ } // track (mcrec) loop
796766
797- int pid = 0 ;
798- switch (std::abs (particle.pdgCode ())) {
799- case PDG_t::kPiPlus :
800- pid = kSpPion ;
801- break ;
802- case PDG_t::kKPlus :
803- pid = kSpKaon ;
804- break ;
805- case PDG_t::kProton :
806- pid = kSpProton ;
807- break ;
808- default :
809- pid = kSpOther ;
810- break ;
811- }
812- histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(pid), kNoGenpTVar );
813- } // track (mcgen) loop
814- } // nTrks>0
767+ for (const auto & particle : GenParticles) {
768+ if (!isGenTrackSelected (particle)) {
769+ continue ;
770+ }
771+ histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kNoGenpTVar );
772+ if (particle.pt () < kMinpTcut ) {
773+ histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTup , -10.0 * particle.pt () + 2 );
774+ histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTdown , 5.0 * particle.pt () + 0.5 );
775+ } else {
776+ histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTup );
777+ histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTdown );
778+ }
779+
780+ int pid = 0 ;
781+ switch (std::abs (particle.pdgCode ())) {
782+ case PDG_t::kPiPlus :
783+ pid = kSpPion ;
784+ break ;
785+ case PDG_t::kKPlus :
786+ pid = kSpKaon ;
787+ break ;
788+ case PDG_t::kProton :
789+ pid = kSpProton ;
790+ break ;
791+ default :
792+ pid = kSpOther ;
793+ break ;
794+ }
795+ histos.fill (HIST (" hmcgendndetapp" ), RecCol.posZ (), RecCol.centFT0M (), particle.eta (), particle.phi (), static_cast <double >(pid), kNoGenpTVar );
796+ } // track (mcgen) loop
815797 } // collision loop
816798 }
817799 PROCESS_SWITCH (HeavyionMultiplicity, processppMonteCarlo, " process pp MC" , false );
0 commit comments