@@ -93,11 +93,11 @@ struct FullJetSpectra {
9393 Configurable<float > jetPhiMax{" jetPhiMax" , 2.86 , " maximum emcal Fid phi" };
9494 Configurable<float > jetAreaFractionMin{" jetAreaFractionMin" , -99.0 , " used to make a cut on the jet areas" };
9595
96- // Leading track and cluster pT configurables
97- Configurable<float > minTrackPt{" minTrackPt" , - 99.0 , " minimum pT selection on jet tracks" };
98- Configurable<float > maxTrackPt{" maxTrackPt" , 999 .0 , " maximum pT selection on jet tracks" };
99- Configurable<float > minClusterPt{" minClusterPt" , - 99.0 , " minimum pT selection on jet clusters" };
100- Configurable<float > maxClusterPt{" maxClusterPt" , 999 .0 , " maximum pT selection on jet clusters" };
96+ // Maximum track and cluster pT configurables
97+ Configurable<float > minTrackPt{" minTrackPt" , 0.15 , " minimum pT selection on jet tracks" };
98+ Configurable<float > maxTrackPt{" maxTrackPt" , 150 .0 , " maximum pT selection on jet tracks" };
99+ Configurable<float > minClusterPt{" minClusterPt" , 0.3 , " minimum pT selection on jet clusters" };
100+ Configurable<float > maxClusterPt{" maxClusterPt" , 250 .0 , " maximum pT selection on jet clusters" };
101101
102102 // Track configurables
103103 Configurable<float > trackpTMin{" trackpTMin" , 0.15 , " minimum track pT" };
@@ -279,6 +279,19 @@ struct FullJetSpectra {
279279 hMatchedNoFidcollisionCounter->GetXaxis ()->SetBinLabel (9 , " EMCAcceptedDetColl" );
280280 }
281281
282+ if (doprocessJetsNewNoFidMCPMCDMatchedWeighted) {
283+ auto hMatchedNewNoFidcollisionCounter = registry.get <TH1>(HIST (" hMatchedNewNoFidcollisionCounter" ));
284+ hMatchedNewNoFidcollisionCounter->GetXaxis ()->SetBinLabel (1 , " allDetColl" );
285+ hMatchedNewNoFidcollisionCounter->GetXaxis ()->SetBinLabel (2 , " DetCollWithVertexZ" );
286+ hMatchedNewNoFidcollisionCounter->GetXaxis ()->SetBinLabel (3 , " RejectedDetCollWithOutliers" );
287+ hMatchedNewNoFidcollisionCounter->GetXaxis ()->SetBinLabel (4 , " RejectedPartCollWithOutliers" );
288+ hMatchedNewNoFidcollisionCounter->GetXaxis ()->SetBinLabel (5 , " EMCMBRejectedDetColl" );
289+ hMatchedNewNoFidcollisionCounter->GetXaxis ()->SetBinLabel (6 , " EventsNotSatisfyingEventSelection" );
290+ hMatchedNewNoFidcollisionCounter->GetXaxis ()->SetBinLabel (7 , " EMCreadoutDetJJEventsWithkTVXinEMC" );
291+ hMatchedNewNoFidcollisionCounter->GetXaxis ()->SetBinLabel (8 , " AllRejectedDetEventsAfterEMCEventSelection" );
292+ hMatchedNewNoFidcollisionCounter->GetXaxis ()->SetBinLabel (9 , " EMCAcceptedDetColl" );
293+ }
294+
282295 if (doprocessMBCollisionsDATAWithMultiplicity || doprocessMBMCDCollisionsWithMultiplicity) {
283296 auto hEventmultiplicityCounter = registry.get <TH1>(HIST (" hEventmultiplicityCounter" ));
284297 hEventmultiplicityCounter->GetXaxis ()->SetBinLabel (1 , " allDetColl" );
@@ -748,7 +761,7 @@ struct FullJetSpectra {
748761 filteredTrackPt = 0.0 ;
749762 filteredClusterPt = 0.0 ;
750763
751- // --- Track cuts: ALL tracks must satisfy 0.15 <= pT <= 200 or 150 GeV/c---
764+ // --- Track cuts: ALL tracks must satisfy 0.15 <= pT <= 140 GeV/c---
752765 // if (leadingTrackPtMin > kLeadingTrackPtMinThreshold || leadingTrackPtMax < kLeadingTrackPtMaxThreshold) {
753766 bool hasValidTrack = false ;
754767 for (const auto & constituent : jet.template tracks_as <T>()) {
@@ -1220,13 +1233,18 @@ struct FullJetSpectra {
12201233 }
12211234 registry.fill (HIST (" hDetcollisionCounter" ), 7.5 ); // EMCAcceptedDetColl
12221235
1236+ double filteredTrackPt = 0.0 ;
1237+ double filteredClusterPt = 0.0 ;
12231238 for (auto const & jet : jets) {
12241239 if (!jetfindingutilities::isInEtaAcceptance (jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) {
12251240 continue ;
12261241 }
12271242 // if (jet.phi() < jetPhiMin || jet.phi() > jetPhiMax) {
12281243 // continue;
12291244 // }
1245+ if (!isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(jet, filteredTrackPt, filteredClusterPt)) {
1246+ continue ; // maximum cuts on tracks and clusters due to poor detector reso; discard jets
1247+ }
12301248 if (!isInPhiAcceptance (jet)) { // Using the new phi acceptance function
12311249 continue ;
12321250 }
@@ -1350,10 +1368,16 @@ struct FullJetSpectra {
13501368 registry.fill (HIST (" hDetTrigcollisionCounter" ), 15.5 ); // EMCAcceptedDetTrigCollWithLow+HighFullJetTriggers
13511369 eventAccepted = true ;
13521370 }
1371+
1372+ double filteredTrackPt = 0.0 ;
1373+ double filteredClusterPt = 0.0 ;
13531374 for (auto const & jet : jets) {
13541375 if (!jetfindingutilities::isInEtaAcceptance (jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) {
13551376 continue ;
13561377 }
1378+ if (!isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(jet, filteredTrackPt, filteredClusterPt)) {
1379+ continue ; // maximum cuts on tracks and clusters due to poor detector reso; discard jets
1380+ }
13571381 if (!isInPhiAcceptance (jet)) { // Using the new phi acceptance function
13581382 continue ;
13591383 }
@@ -1444,10 +1468,15 @@ struct FullJetSpectra {
14441468 }
14451469 registry.fill (HIST (" hDetcollisionCounter" ), 7.5 ); // EMCAcceptedDetColl
14461470
1471+ double filteredTrackPt = 0.0 ;
1472+ double filteredClusterPt = 0.0 ;
14471473 for (auto const & jet : jets) {
14481474 if (!jetfindingutilities::isInEtaAcceptance (jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) {
14491475 continue ;
14501476 }
1477+ if (!isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(jet, filteredTrackPt, filteredClusterPt)) {
1478+ continue ; // maximum cuts on tracks and clusters due to poor detector reso; discard jets
1479+ }
14511480 if (!isInPhiAcceptance (jet)) { // Using the new phi acceptance function
14521481 continue ;
14531482 }
@@ -1536,11 +1565,15 @@ struct FullJetSpectra {
15361565 }
15371566 registry.fill (HIST (" hDetcollisionCounter" ), 7.5 , collision.mcCollision ().weight ()); // EMCAcceptedDetColl
15381567
1568+ double filteredTrackPt = 0.0 ;
1569+ double filteredClusterPt = 0.0 ;
15391570 for (auto const & jet : jets) {
1540-
15411571 if (!jetfindingutilities::isInEtaAcceptance (jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) {
15421572 continue ;
15431573 }
1574+ if (!isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(jet, filteredTrackPt, filteredClusterPt)) {
1575+ continue ; // maximum cuts on tracks and clusters due to poor detector reso; discard jets
1576+ }
15441577 if (!isInPhiAcceptance (jet)) { // Using the new phi acceptance function
15451578 continue ;
15461579 }
@@ -1827,14 +1860,18 @@ struct FullJetSpectra {
18271860 }
18281861 registry.fill (HIST (" hMatchedcollisionCounter" ), 8.5 ); // EMCAcceptedDetColl
18291862
1863+ double filteredTrackPt = 0.0 ;
1864+ double filteredClusterPt = 0.0 ;
18301865 for (const auto & mcdjet : mcdjets) {
1831-
18321866 if (!jetfindingutilities::isInEtaAcceptance (mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) ||
18331867 !isInPhiAcceptance (mcdjet)) {
18341868 fakeMcdJet++;
18351869 registry.fill (HIST (" h2_full_fakemcdjets" ), mcdjet.pt (), fakeMcdJet, 1.0 );
18361870 continue ;
18371871 }
1872+ if (!isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(mcdjet, filteredTrackPt, filteredClusterPt)) {
1873+ continue ; // maximum cuts on tracks and clusters due to poor detector reso; discard jets
1874+ }
18381875 // Check if MCD jet is within the EMCAL fiducial region; if not then flag it as a fake jet
18391876 // if (mcdjet.phi() < jetPhiMin || mcdjet.phi() > jetPhiMax || mcdjet.eta() < jetEtaMin || mcdjet.eta() > jetEtaMax) {
18401877 // fakeMcdJet++;
@@ -1916,14 +1953,18 @@ struct FullJetSpectra {
19161953 }
19171954 registry.fill (HIST (" hMatchedNoFidcollisionCounter" ), 8.5 , eventWeight); // EMCAcceptedDetColl
19181955
1956+ double filteredTrackPt = 0.0 ;
1957+ double filteredClusterPt = 0.0 ;
19191958 for (const auto & mcdjet : mcdjets) {
1920-
19211959 if (!jetfindingutilities::isInEtaAcceptance (mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) ||
19221960 !isInPhiAcceptance (mcdjet)) {
19231961 fakeMcdJet++;
19241962 registry.fill (HIST (" h2_full_NoFidfakemcdjets" ), mcdjet.pt (), fakeMcdJet, eventWeight);
19251963 continue ;
19261964 }
1965+ if (!isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(mcdjet, filteredTrackPt, filteredClusterPt)) {
1966+ continue ; // maximum cuts on tracks and clusters due to poor detector reso; discard jets
1967+ }
19271968
19281969 for (const auto & mcpjet : mcdjet.template matchedJetGeo_as <JetTableMCPMatchedJoined>()) {
19291970 allMatchedPartJets++;
@@ -1950,6 +1991,114 @@ struct FullJetSpectra {
19501991 }
19511992 PROCESS_SWITCH (FullJetSpectra, processJetsNoFidMCPMCDMatchedWeighted, " Full Jet finder No Fid MCP matched to MCD on weighted events" , false );
19521993
1994+ // Matching with Fiducial cuts at MCD only.
1995+ // New: First matching is done and then all the cuts are applied - if the matched jet pair pass the cuts then Accept the pair otherwise reject the jet pair.
1996+ void processJetsNewNoFidMCPMCDMatchedWeighted (soa::Filtered<EMCCollisionsMCD>::iterator const & collision, JetTableMCDMatchedJoined const & mcdjets, JetTableMCPMatchedJoined const & mcpjets, aod::JMcCollisions const &,
1997+ aod::JetTracks const &, ClusterWithCorrections const &, aod::JetParticles const &)
1998+ {
1999+ bool eventAccepted = false ;
2000+ int fakeMcdJet = 0 ;
2001+ int fakeMcpJet = 0 ;
2002+ int NPartJetFid = 0 ; // counter for the matched and accepted particle-level jets at the event level.
2003+ // int allMatchedPartJets = 0;
2004+ float eventWeight = collision.mcCollision ().weight ();
2005+ float pTHat = 10 .f / (std::pow (eventWeight, 1 .0f / pTHatExponent));
2006+ const auto mcpJetsPerMcCollision = mcpjets.sliceBy (JetMCPPerMcCollision, collision.mcCollisionId ());
2007+
2008+ registry.fill (HIST (" hMatchedNewNoFidcollisionCounter" ), 0.5 , eventWeight); // allDetColl
2009+ if (std::fabs (collision.posZ ()) > vertexZCut) { // making double sure this condition is satisfied
2010+ return ;
2011+ }
2012+ registry.fill (HIST (" hMatchedNewNoFidcollisionCounter" ), 1.5 , eventWeight); // DetCollWithVertexZ
2013+
2014+ // outlier check: for every outlier jet, reject the whole event
2015+ for (auto const & mcdjet : mcdjets) {
2016+ if (mcdjet.pt () > pTHatMaxMCD * pTHat || pTHat < pTHatAbsoluteMin) {
2017+ registry.fill (HIST (" hMatchedNewNoFidcollisionCounter" ), 2.5 , eventWeight); // RejectedDetCollWithOutliers
2018+ return ;
2019+ }
2020+ }
2021+
2022+ if (doMBGapTrigger && collision.getSubGeneratorId () == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
2023+ registry.fill (HIST (" hMatchedNewNoFidcollisionCounter" ), 4.5 , eventWeight); // EMCMBRejectedDetColl
2024+ return ;
2025+ }
2026+
2027+ if (!jetderiveddatautilities::selectCollision (collision, eventSelectionBits, doMBGapTrigger)) {
2028+ registry.fill (HIST (" hMatchedNewNoFidcollisionCounter" ), 5.5 , eventWeight); // EventsNotSatisfyingEventSelection
2029+ return ;
2030+ }
2031+
2032+ for (auto const & mcpjet : mcpJetsPerMcCollision) {
2033+ if (mcpjet.pt () > pTHatMaxMCP * pTHat) { // outlier rejection for MCP: Should I remove this cut as I'm already doing MC outlier rejection @L1071?
2034+ return ;
2035+ }
2036+ }
2037+ if (doEMCALEventWorkaround) {
2038+ if (collision.isEmcalReadout () && !collision.isAmbiguous ()) { // i.e. EMCAL has a cell content
2039+ if (collision.alias_bit (kTVXinEMC )) {
2040+ eventAccepted = true ;
2041+ registry.fill (HIST (" hMatchedNewNoFidcollisionCounter" ), 6.5 , eventWeight); // EMCreadoutDetJJEventsWithkTVXinEMC
2042+ }
2043+ }
2044+ } else {
2045+ if (!collision.isAmbiguous () && jetderiveddatautilities::eventEMCAL (collision) && collision.alias_bit (kTVXinEMC )) {
2046+ eventAccepted = true ;
2047+ registry.fill (HIST (" hMatchedNewNoFidcollisionCounter" ), 6.5 , eventWeight); // EMCreadoutDetJJEventsWithkTVXinEMC
2048+ }
2049+ }
2050+ if (!eventAccepted) {
2051+ registry.fill (HIST (" hMatchedNewNoFidcollisionCounter" ), 7.5 , eventWeight); // AllRejectedDetEventsAfterEMCEventSelection
2052+ return ;
2053+ }
2054+ registry.fill (HIST (" hMatchedNewNoFidcollisionCounter" ), 8.5 , eventWeight); // EMCAcceptedDetColl
2055+
2056+ double filteredTrackPt = 0.0 ;
2057+ double filteredClusterPt = 0.0 ;
2058+
2059+ // NEW: event-level counter of all MCP–MCD matches (pair count)
2060+ int allMatchedPartJetsEvent = 0 ;
2061+
2062+ for (const auto & mcdjet : mcdjets) {
2063+
2064+ for (const auto & mcpjet : mcdjet.template matchedJetGeo_as <JetTableMCPMatchedJoined>()) {
2065+ // allMatchedPartJets++;
2066+ // count every matched pair (MCD ↔ MCP), regardless of later cuts
2067+ ++allMatchedPartJetsEvent;
2068+
2069+ registry.fill (HIST (" h_allMatchedNewNoFidPartJetsPt" ), mcpjet.pt (), eventWeight);
2070+
2071+ if (!jetfindingutilities::isInEtaAcceptance (mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) ||
2072+ !isInPhiAcceptance (mcdjet)) {
2073+ fakeMcdJet++;
2074+ registry.fill (HIST (" h2_full_NewNoFidfakemcdjets" ), mcdjet.pt (), fakeMcdJet, eventWeight);
2075+ continue ;
2076+ }
2077+ if (!isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(mcdjet, filteredTrackPt, filteredClusterPt)) {
2078+ continue ; // maximum cuts on tracks and clusters due to poor detector reso; discard jets
2079+ }
2080+
2081+ // Not applying any emcal fiducial cuts in eta and phi on MCP jets when matching.
2082+ // Keeping jet eta here open = |0.9| and no cut in phi at all.
2083+ if (!jetfindingutilities::isInEtaAcceptance (mcpjet, jetNoFidPartEtaMin, jetNoFidPartEtaMax, trackEtaMin, trackEtaMax)) {
2084+ fakeMcpJet++;
2085+ registry.fill (HIST (" h2_full_NewNoFidfakemcpjets" ), mcpjet.pt (), fakeMcpJet, eventWeight);
2086+ continue ;
2087+ }
2088+ ++NPartJetFid;
2089+ // Fill matched histograms (including Response Matrix) for valid MCD-MCP pairs
2090+ fillMatchedNoFidHistograms<JetTableMCDMatchedJoined::iterator, JetTableMCPMatchedJoined>(mcdjet, eventWeight);
2091+ registry.fill (HIST (" h2_full_NewNoFidmatchedmcpjet_pt" ), mcpjet.pt (), NPartJetFid, eventWeight);
2092+ registry.fill (HIST (" h_full_NewNoFidmatchedmcpjet_eta" ), mcpjet.eta (), eventWeight);
2093+ registry.fill (HIST (" h_full_NewNoFidmatchedmcpjet_phi" ), mcpjet.phi (), eventWeight);
2094+ } // mcpjet
2095+ } // mcdjet
2096+ // Fill the total matched particle jets histogram after processing all MCP jets for the MCD jet in a given accepted event
2097+ registry.fill (HIST (" h_allMatchedNewNoFidPartJetsCounter" ), allMatchedPartJetsEvent, eventWeight);
2098+ }
2099+ PROCESS_SWITCH (FullJetSpectra, processJetsNewNoFidMCPMCDMatchedWeighted, " Full Jet finder No Fid MCP matched to MCD on weighted events with new algorithm of rejecting jet pair" , false );
2100+
2101+
19532102 void processJetsMCPMCDMatchedWeighted (soa::Filtered<EMCCollisionsMCD>::iterator const & collision, JetTableMCDMatchedJoined const & mcdjets, JetTableMCPMatchedJoined const & mcpjets, aod::JMcCollisions const &,
19542103 aod::JetTracks const &, ClusterWithCorrections const &, aod::JetParticles const &)
19552104 {
@@ -2042,14 +2191,18 @@ struct FullJetSpectra {
20422191 }
20432192 registry.fill (HIST (" hMatchedcollisionCounter" ), 8.5 , eventWeight); // EMCAcceptedDetColl
20442193
2194+ double filteredTrackPt = 0.0 ;
2195+ double filteredClusterPt = 0.0 ;
20452196 for (const auto & mcdjet : mcdjets) {
2046-
20472197 if (!jetfindingutilities::isInEtaAcceptance (mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) ||
20482198 !isInPhiAcceptance (mcdjet)) {
20492199 fakeMcdJet++;
20502200 registry.fill (HIST (" h2_full_fakemcdjets" ), mcdjet.pt (), fakeMcdJet, eventWeight);
20512201 continue ;
20522202 }
2203+ if (!isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(mcdjet, filteredTrackPt, filteredClusterPt)) {
2204+ continue ; // maximum cuts on tracks and clusters due to poor detector reso; discard jets
2205+ }
20532206
20542207 for (const auto & mcpjet : mcdjet.template matchedJetGeo_as <JetTableMCPMatchedJoined>()) {
20552208 allMatchedPartJets++;
0 commit comments