@@ -115,6 +115,8 @@ struct nucleiInJets {
115115 Configurable<bool > isWithLeadingJet{" isWithLeadingJet" , true , " Events with leading jet" };
116116 Configurable<bool > useLfTpcPid{" useLfTpcPid" , true , " Events with custom TPC parameters" };
117117 Configurable<int > centralityType{" centralityType" , 0 , " 0: FT0M, 1: FT0C, 2: FV0A" };
118+ Configurable<std::vector<int >> cfgOccupancyRange{" cfgOccupancyRange" , {0 , 1000 }, " Occupancy selection" };
119+ Configurable<bool > useOccupancy{" useOccupancy" , true , " Events with custom occupancy selection" };
118120
119121 Configurable<double > cfgtrkMinPt{" cfgtrkMinPt" , 0.15 , " set track min pT" };
120122 Configurable<double > cfgtrkMaxEta{" cfgtrkMaxEta" , 0.8 , " set track max Eta" };
@@ -171,6 +173,9 @@ struct nucleiInJets {
171173
172174 Configurable<bool > applySkim{" applySkim" , false , " Apply skimming" };
173175 Configurable<std::string> cfgSkim{" cfgSkim" , " fHighFt0Mult" , " Configurable for skimming" };
176+ Configurable<bool > sel8Coll{" sel8Coll" , true , " sel8Coll for collisions" };
177+ Configurable<bool > selNoSameBunchPileup{" selNoSameBunchPileup" , false , " selNoSameBunchPileup for collisions" };
178+ Configurable<bool > selIsGoodZvtxFT0vsPV{" selIsGoodZvtxFT0vsPV" , false , " selIsGoodZvtxFT0vsPV for collisions" };
174179
175180 // using EventTable = soa::Join<aod::JetCollisions, aod::EvSels, aod::CentFT0Ms, aod::CentFV0As, aod::CentFT0Cs>;
176181 using EventTable = aod::JetCollisions;
@@ -235,10 +240,13 @@ struct nucleiInJets {
235240 jetHist.get <TH1>(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (4 , " Sel8+|Vz|<10" );
236241 jetHist.get <TH1>(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (5 , " nJets>0" );
237242
238- jetHist.add (" hNEventsInc" , " hNEventsInc" , {HistType::kTH1D , {{4 , 0 .f , 4 .f }}});
243+ jetHist.add (" hNEventsInc" , " hNEventsInc" , {HistType::kTH1D , {{6 , 0 .f , 6 .f }}});
239244 jetHist.get <TH1>(HIST (" hNEventsInc" ))->GetXaxis ()->SetBinLabel (1 , " All" );
240245 jetHist.get <TH1>(HIST (" hNEventsInc" ))->GetXaxis ()->SetBinLabel (2 , " Sel8" );
241246 jetHist.get <TH1>(HIST (" hNEventsInc" ))->GetXaxis ()->SetBinLabel (3 , " |Vz|<10" );
247+ jetHist.get <TH1>(HIST (" hNEventsInc" ))->GetXaxis ()->SetBinLabel (4 , " noSameBunchPileup" );
248+ jetHist.get <TH1>(HIST (" hNEventsInc" ))->GetXaxis ()->SetBinLabel (5 , " isGoodZvtxFT0vsPV" );
249+ jetHist.get <TH1>(HIST (" hNEventsInc" ))->GetXaxis ()->SetBinLabel (6 , " OccupancySel" );
242250
243251 jetHist.add (" hNEventsIncVsCent" , " hNEventsIncVsCent" , {HistType::kTH2D , {{vzAxis}, {CentAxis}}});
244252
@@ -490,6 +498,9 @@ struct nucleiInJets {
490498 jetHist.get <TH1>(HIST (" recInc/eventStat" ))->GetXaxis ()->SetBinLabel (1 , " All" );
491499 jetHist.get <TH1>(HIST (" recInc/eventStat" ))->GetXaxis ()->SetBinLabel (2 , " Sel8" );
492500 jetHist.get <TH1>(HIST (" recInc/eventStat" ))->GetXaxis ()->SetBinLabel (3 , " |Vz|<10" );
501+ jetHist.get <TH1>(HIST (" recInc/eventStat" ))->GetXaxis ()->SetBinLabel (4 , " noSameBunchPileup" );
502+ jetHist.get <TH1>(HIST (" recInc/eventStat" ))->GetXaxis ()->SetBinLabel (5 , " isGoodZvtxFT0vsPV" );
503+ jetHist.get <TH1>(HIST (" recInc/eventStat" ))->GetXaxis ()->SetBinLabel (6 , " OccupancySel" );
493504
494505 jetHist.add <TH2>(" recInc/vertexZ" , " vertexZ (inclusive)" , HistType::kTH2F , {{vzAxis}, {CentAxis}});
495506 jetHist.add <TH3>(" recInc/pt/PtParticleTypeTPC" , " Pt vs ParticleType vs Centrality (TPC)" , HistType::kTH3F , {{100 , 0 .f , 10 .f }, {14 , -7 , 7 }, {100 , 0 , 100 }});
@@ -499,6 +510,10 @@ struct nucleiInJets {
499510
500511 jetHist.add <TH3>(" recInc/eff/tpcTrack3D" , " Pt vs ParticleType vs Centrality (tpc)" , HistType::kTH3F , {{100 , 0 .f , 10 .f }, {14 , -7 , 7 }, {100 , 0 , 100 }});
501512 jetHist.add <TH3>(" recInc/eff/tpcTofTrack3D" , " Pt vs ParticleType vs Centrality (tpc-tof)" , HistType::kTH3F , {{100 , 0 .f , 10 .f }, {14 , -7 , 7 }, {100 , 0 , 100 }});
513+
514+ jetHist.add <THnSparse>(" recInc/dcaxy/rec/tpcPtVsDcaxy3D" , " pT(p) vs ParticleType (p) vs Dcaxy" , HistType::kTHnSparseF , {{100 , 0 .f , 10 .f }, {14 , -7 , 7 }, {100 , 0 , 100 }, dcaxyAxis, {4 , 0 , 4 }}); // pt, parttype, cent, dcaxy, partOrigin
515+ jetHist.add <THnSparse>(" recInc/dcaxy/rec/tpcPtVsDcaxy3DPIDselected" , " pT(p) vs ParticleType (p) vs Dcaxy" , HistType::kTHnSparseF , {{100 , 0 .f , 10 .f }, {14 , -7 , 7 }, {100 , 0 , 100 }, dcaxyAxis, {4 , 0 , 4 }}); // pt, parttype, cent, dcaxy, partOrigin
516+
502517 // inside jet
503518 jetHist.add <TH3>(" tracks/mc/proton/h3PtVsProtonNSigmaTPCVsPtJet_jet" , " pT(p) vs NSigmaTPC (p) vs jet pT; #it{p}_{T} (GeV/#it{c}; NSigmaTPC; p^{jet}_{T}" , HistType::kTH3F , {{PtAxis}, {200 , -10 , 10 }, {PtJetAxis}});
504519 jetHist.add <TH3>(" tracks/mc/antiProton/h3PtVsantiProtonNSigmaTPCVsPtJet_jet" , " pT(#bar{p}) vs NSigmaTPC (#bar{p}) vs jet pT; #it{p}_{T} (GeV/#it{c}; NSigmaTPC; p^{jet}_{T}" , HistType::kTH3F , {{PtAxis}, {200 , -10 , 10 }, {PtJetAxis}});
@@ -660,7 +675,7 @@ struct nucleiInJets {
660675 }
661676
662677 template <typename TrackType>
663- bool isTrackSelected (const TrackType track)
678+ bool isTrackSelectedWithoutDcaxy (const TrackType track)
664679 {
665680 // standard track selection
666681 if (track.pt () < cfgtrkMinPt)
@@ -675,10 +690,6 @@ struct nucleiInJets {
675690 }
676691 if (std::fabs (track.eta ()) > cfgtrkMaxEta)
677692 return false ;
678- if (std::fabs (track.dcaXY ()) > cfgMaxDCArToPVcut && !useDcaxyPtDepCut)
679- return false ;
680- if (std::fabs (track.dcaXY ()) > dcaXYPtDepCut (track.pt ()) && useDcaxyPtDepCut)
681- return false ;
682693 if (std::fabs (track.dcaZ ()) > cfgMaxDCAzToPVcut)
683694 return false ;
684695 if (track.tpcNClsFindable () < cfgnFindableTPCClusters)
@@ -694,6 +705,29 @@ struct nucleiInJets {
694705 return true ;
695706 }
696707
708+ template <typename TrackType>
709+ bool isTrackSelected (const TrackType track)
710+ {
711+ if (!isTrackSelectedWithoutDcaxy (track))
712+ return false ;
713+ if (std::fabs (track.dcaXY ()) > cfgMaxDCArToPVcut && !useDcaxyPtDepCut)
714+ return false ;
715+ if (std::fabs (track.dcaXY ()) > dcaXYPtDepCut (track.pt ()) && useDcaxyPtDepCut)
716+ return false ;
717+
718+ return true ;
719+ }
720+
721+ template <typename coll>
722+ bool isOccupancyAccepted (const coll& collision)
723+ {
724+ auto occupancy{collision.trackOccupancyInTimeRange ()};
725+ if (occupancy < cfgOccupancyRange->at (0 ) || occupancy > cfgOccupancyRange->at (1 ))
726+ return false ;
727+ else
728+ return true ;
729+ }
730+
697731 int nEvents = 0 ;
698732 template <bool IsMC, typename TracksType, typename JetType>
699733 void fillTrackInfo (const TracksType& trk, const JetType& jets, std::vector<float >& leadingJetPtEtaPhi)
@@ -1345,13 +1379,28 @@ struct nucleiInJets {
13451379 {
13461380 jetHist.fill (HIST (" hNEventsInc" ), 0.5 );
13471381
1348- if (!jetderiveddatautilities::selectCollision (coll, jetderiveddatautilities::initialiseEventSelectionBits (" sel8" )))
1349- return ;
1382+ bool isSel8 = jetderiveddatautilities::selectCollision (coll, jetderiveddatautilities::initialiseEventSelectionBits (" sel8" ));
1383+ bool isSelNoSameBunchPileup = jetderiveddatautilities::selectCollision (coll, jetderiveddatautilities::initialiseEventSelectionBits (" selNoSameBunchPileup" ));
1384+ bool isSelIsGoodZvtxFT0vsPV = jetderiveddatautilities::selectCollision (coll, jetderiveddatautilities::initialiseEventSelectionBits (" selIsGoodZvtxFT0vsPV" ));
13501385
1386+ if (sel8Coll && !isSel8)
1387+ return ;
13511388 jetHist.fill (HIST (" hNEventsInc" ), 1.5 );
1389+
13521390 if (std::abs (coll.posZ ()) > 10 ) // bad vertex
13531391 return ;
13541392 jetHist.fill (HIST (" hNEventsInc" ), 2.5 );
1393+ if (selNoSameBunchPileup && !isSelNoSameBunchPileup)
1394+ return ;
1395+ jetHist.fill (HIST (" hNEventsInc" ), 3.5 );
1396+ if (selIsGoodZvtxFT0vsPV && !isSelIsGoodZvtxFT0vsPV)
1397+ return ;
1398+ jetHist.fill (HIST (" hNEventsInc" ), 4.5 );
1399+
1400+ if (useOccupancy && !isOccupancyAccepted (coll))
1401+ return ;
1402+ jetHist.fill (HIST (" hNEventsInc" ), 5.5 );
1403+
13551404 float centrality = -999 ;
13561405 switch (centralityType) {
13571406 case 0 : // FT0M
@@ -1963,12 +2012,31 @@ struct nucleiInJets {
19632012 void processRecInc (EventTableMC::iterator const & coll, TrackCandidatesIncMC const & tracks, aod::JetParticles const & particleTracks, aod::JMcCollisions const &)
19642013 {
19652014 jetHist.fill (HIST (" recInc/eventStat" ), 0.5 );
1966- if (!jetderiveddatautilities::selectCollision (coll, jetderiveddatautilities::initialiseEventSelectionBits (" sel8" )))
2015+
2016+ bool isSel8 = jetderiveddatautilities::selectCollision (coll, jetderiveddatautilities::initialiseEventSelectionBits (" sel8" ));
2017+ bool isSelNoSameBunchPileup = jetderiveddatautilities::selectCollision (coll, jetderiveddatautilities::initialiseEventSelectionBits (" selNoSameBunchPileup" ));
2018+ bool isSelIsGoodZvtxFT0vsPV = jetderiveddatautilities::selectCollision (coll, jetderiveddatautilities::initialiseEventSelectionBits (" selIsGoodZvtxFT0vsPV" ));
2019+
2020+ if (sel8Coll && !isSel8)
19672021 return ;
19682022 jetHist.fill (HIST (" recInc/eventStat" ), 1.5 );
2023+
19692024 if (std::abs (coll.posZ ()) > 10 ) // bad vertex
19702025 return ;
19712026 jetHist.fill (HIST (" recInc/eventStat" ), 2.5 );
2027+ if (selNoSameBunchPileup && !isSelNoSameBunchPileup)
2028+ return ;
2029+ jetHist.fill (HIST (" recInc/eventStat" ), 3.5 );
2030+ if (selIsGoodZvtxFT0vsPV && !isSelIsGoodZvtxFT0vsPV)
2031+ return ;
2032+ jetHist.fill (HIST (" recInc/eventStat" ), 4.5 );
2033+
2034+ if (useOccupancy && !isOccupancyAccepted (coll))
2035+ return ;
2036+ jetHist.fill (HIST (" recInc/eventStat" ), 5.5 );
2037+
2038+ // if (!jetderiveddatautilities::selectCollision(coll, jetderiveddatautilities::initialiseEventSelectionBits("sel8")))
2039+ // return;
19722040
19732041 float centrality = -999 ;
19742042 switch (centralityType) {
@@ -1987,7 +2055,7 @@ struct nucleiInJets {
19872055 jetHist.fill (HIST (" recInc/vertexZ" ), coll.posZ (), centrality);
19882056
19892057 for (const auto & track : tracks) {
1990- if (!isTrackSelected (track)) {
2058+ if (!isTrackSelectedWithoutDcaxy (track)) {
19912059 continue ;
19922060 }
19932061 if (!track.has_mcParticle ())
@@ -1996,13 +2064,37 @@ struct nucleiInJets {
19962064 continue ;
19972065
19982066 auto mcTrack = track.mcParticle_as <o2::aod::JMcParticles>();
1999- if (!mcTrack.isPhysicalPrimary ())
2067+
2068+ // require mc getProcess to get Decay and Material secondaries
2069+ int particleOriginType = 0 ;
2070+ auto isMcPrimary = false ;
2071+ // auto isMcTransport = false; // auto isMcSecondaryFromMaterial = false; auto isMcSecondaryFromWeakDecay = false;
2072+ if (mcTrack.isPhysicalPrimary ()) {
2073+ isMcPrimary = true ;
2074+ particleOriginType = 1 ;
2075+ } else if (mcTrack.getGenStatusCode () == -1 ) {
2076+ // isMcTransport = true;
2077+ particleOriginType = 2 ;
2078+ }
2079+
2080+ // Fill DCAxy histograms
2081+ jetHist.fill (HIST (" recInc/dcaxy/rec/tpcPtVsDcaxy3D" ), mcTrack.pt (), mapPDGToValue (mcTrack.pdgCode ()), centrality, track.dcaXY (), particleOriginType);
2082+ if (std::abs (track.tpcNSigmaPr ()) < cfgnTPCPIDPr)
2083+ jetHist.fill (HIST (" recInc/dcaxy/rec/tpcPtVsDcaxy3DPIDselected" ), mcTrack.pt (), mapPDGToValue (mcTrack.pdgCode ()), centrality, track.dcaXY (), particleOriginType);
2084+
2085+ if (!isMcPrimary)
2086+ continue ;
2087+
2088+ // DCAxy selection for rest of the analysis
2089+ if (std::fabs (track.dcaXY ()) > cfgMaxDCArToPVcut && !useDcaxyPtDepCut)
2090+ continue ;
2091+ if (std::fabs (track.dcaXY ()) > dcaXYPtDepCut (track.pt ()) && useDcaxyPtDepCut)
20002092 continue ;
20012093
20022094 auto mass = TDatabasePDG::Instance ()->GetParticle (abs (mcTrack.pdgCode ()))->Mass ();
20032095 auto rapidity = RecoDecay::y (std::array{track.px (), track.py (), track.pz ()}, mass);
20042096
2005- if (rapidity > cfgtrkMaxRap)
2097+ if (std::abs ( rapidity) > cfgtrkMaxRap)
20062098 continue ;
20072099 // Proton
20082100 if (std::abs (mcTrack.pdgCode ()) == 2212 ) { // Proton
0 commit comments