diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index 0a3e99db80c..ebbe476af2a 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -54,8 +54,6 @@ #include #include -#include - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -88,9 +86,9 @@ struct kstarInOO { Configurable cfgTrackGlobalWoDCATrack{"cfgTrackGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) // TPC - Configurable cfgTrackFindableTPCClusters{"cfgTrackFindableTPCClusters", 50, "nFindable TPC Clusters"}; + Configurable cfgTrackFindableTPCClusters{"cfgTrackFindableTPCClusters", 0, "nFindable TPC Clusters"}; // origin = 50 Configurable cfgTrackTPCCrossedRows{"cfgTrackTPCCrossedRows", 70, "nCrossed TPC Rows"}; - Configurable cfgTrackRowsOverFindable{"cfgTrackRowsOverFindable", 1.2, "nRowsOverFindable TPC CLusters"}; + Configurable cfgTrackRowsOverFindable{"cfgTrackRowsOverFindable", 0, "nRowsOverFindable TPC CLusters"}; // origin = 1.2 Configurable cfgTrackTPCChi2{"cfgTrackTPCChi2", 4.0, "nTPC Chi2 per Cluster"}; // ITS @@ -120,7 +118,6 @@ struct kstarInOO { // MCGen Configurable cfgForceGenReco{"cfgForceGenReco", false, "Only consider events which are reconstructed (neglect event-loss)"}; Configurable cfgReqMcEffPID{"cfgReqMcEffPID", false, "Request McEfficiency PID"}; - Configurable cfgReqMcEffTrackQA{"cfgRecMcEffTrackQA", false, "Enable Jet Cut on Trig"}; // Pair Configurable cfgMinvNBins{"cfgMinvNBins", 300, "Number of bins for Minv axis"}; @@ -258,8 +255,6 @@ struct kstarInOO { histos.add("mcpjet_eta", "MC particle-level Jet Eta", kTH1F, {{100, -1.0, 1.0}}); histos.add("mcpjet_phi", "MC particle-level Jet Phi", kTH1F, {{80, -1.0, 7.0}}); - histos.add("nJet_6_8", "MC particle-level nJet pT 6 < jet pT < 8 (GeV/c)", kTH1F, {{2000, 0., 100.}}); - histos.add("Gen_KstarPt_All_BR", "Generated K*0 All pT (GeV/c)", kTH1F, {{2000, 0., 100.}}); histos.add("Gen_Kstar_BR", "Generated K*0 BR", kTH1F, {minvAxis}); histos.add("Gen_KstarPt_BR", "Generated K*0 pT (GeV/c)", kTH1F, {{2000, 0., 100.}}); @@ -268,6 +263,7 @@ struct kstarInOO { histos.add("dR_taggedjet_pion", "dR between tagged jet and pion wo pT cut", {HistType::kTH2F, {{100, 0., 3.0}, {150, 0., 30.}}}); histos.add("dR_taggedjet_all", "dR between tagged jet and kpi", {HistType::kTH2F, {{100, 0., 3.0}, {150, 0., 30.}}}); histos.add("dR_taggedjet_all_6_8", "dR between tagged jet and kpi 6 < jet pT < 8", {HistType::kTH2F, {{100, 0., 3.0}, {150, 0., 30.}}}); + histos.add("dR_taggedjet_all_8_12", "dR between tagged jet and kpi 8 < jet pT < 12", {HistType::kTH2F, {{100, 0., 3.0}, {150, 0., 30.}}}); histos.add("dR_kstar_pion", "dR between kstar and pion", {HistType::kTH2F, {{100, 0., 3.0}, {150, 0., 30.}}}); histos.add("dR_kstar_kaon", "dR between kstar and kaon", {HistType::kTH2F, {{100, 0., 3.0}, {150, 0., 30.}}}); @@ -275,6 +271,7 @@ struct kstarInOO { histos.add("Kstar_pT_INJet_6_8", "K*0 pT Inside 6-8 Jet", kTH1F, {{1000, 0., 50.}}); histos.add("Kstar_pT_INJet_8_10", "K*0 pT Inside 8-10 Jet", kTH1F, {{1000, 0., 50.}}); histos.add("Kstar_pT_INJet_10_12", "K*0 pT Inside 10-12 Jet", kTH1F, {{1000, 0., 50.}}); + histos.add("Kstar_pT_INJet_8_12", "K*0 pT Inside 8-12 Jet", kTH1F, {{1000, 0., 50.}}); histos.add("JetpT_8to", "Jet pT 8 to", kTH1F, {{2000, 0., 100.}}); histos.add("recoveredJetpT_6_8to8", "Recovered Jet pT 6-8 --> 8", kTH1F, {{2000, 0., 100.}}); @@ -336,7 +333,6 @@ struct kstarInOO { histos.add("hEffRecLowPtKstarDaughter", "EffRecLow Kstar daughter_pT (GeV/c)", kTH1F, {{800, 0., 40.}}); - histos.add("hEffGen_pT", "EffGen_pT (GeV/c)", kTH1F, {{800, 0., 40.}}); histos.add("hMotherPdg1", "hMotherPdg1", kTH1F, {{5000, 0., 5000.}}); histos.add("hMotherPdg2", "hMotherPdg2", kTH1F, {{5000, 0., 5000.}}); } @@ -806,10 +802,10 @@ struct kstarInOO { return {}; } - if (isMIDCut && isMIDPion(trk1, QA)) { + if (isMIDCut && isMIDPion(trk1, true)) { return {}; } - if (isMIDCut && isMIDKaon(trk2, QA)) { + if (isMIDCut && isMIDKaon(trk2, true)) { return {}; } @@ -883,7 +879,8 @@ struct kstarInOO { return {}; } - double track1_mass, track2_mass; + double track1_mass = 0; + double track2_mass = 0; if (std::abs(particle1.pdgCode()) == PionPDG) { track1_mass = massPi; } else { @@ -975,10 +972,7 @@ struct kstarInOO { double phidiff = TVector2::Phi_mpi_pi(jet.phi() - lResonance.Phi()); double etadiff = jet.eta() - lResonance.Eta(); double R = TMath::Sqrt((phidiff * phidiff) + (etadiff * etadiff)); - if (R < cfgJetR && bestR == 0) { - bestR = R; - bestJetpT = jet.pt(); - } else if (R < bestR) { + if (R < cfgJetR && (bestR == 0 || R < bestR)) { bestR = R; bestJetpT = jet.pt(); } @@ -1102,9 +1096,9 @@ struct kstarInOO { using JetTrackCandidates = soa::Join; using JetFilteredJets = soa::Filtered>; - int nJetEvents = 0; void processDataJets(o2::aod::JetCollision const& collision, JetFilteredJets const& chargedjets, JetTrackCandidates const& jetTracks, TrackCandidates const&) { + static int nJetEvents = 0; if (cDebugLevel > 0) { nJetEvents++; if ((nJetEvents + 1) % 10000 == 0) { @@ -1176,7 +1170,7 @@ struct kstarInOO { bool HasJets = false; int nJets = 0; - for (auto chargedjet : chargedjets) { + for (auto& chargedjet : chargedjets) { if (std::abs(chargedjet.eta()) > (cfgJetMaxEta - cfgJetdR)) { continue; } @@ -1227,9 +1221,9 @@ struct kstarInOO { //| JET MC STUFF //| //======================================================= - int nJetMCEvents = 0; void processMCJets(o2::aod::JetCollision const& collision, JetTrackCandidatesMC const& jetTracks, soa::Filtered const& mcdjets, TrackCandidatesMC const&, aod::McParticles const&, aod::JetParticles const&) { + static int nJetMCEvents = 0; if (cDebugLevel > 0) { nJetMCEvents++; if ((nJetMCEvents + 1) % 10000 == 0) { @@ -1263,7 +1257,7 @@ struct kstarInOO { bool HasJets = false; int nJets = 0; - for (auto mcdjet : mcdjets) { + for (auto& mcdjet : mcdjets) { if (std::abs(mcdjet.eta()) > cfgJetMaxEta - cfgJetdR) { continue; } @@ -1316,11 +1310,11 @@ struct kstarInOO { } ////////////////////////////// ////////////////////////////// - if (cfgReqMcEffTrackQA) { // false, true - if (!trackSelection(trk1, true) || !trackSelection(trk2, false)) { - continue; - } + + if (!trackSelection(trk1, true) || !trackSelection(trk2, false)) { + continue; } + ////////////////////////////// ////////////////////////////// @@ -1335,6 +1329,14 @@ struct kstarInOO { if (cfgJetMCHistos) { histos.fill(HIST("hEffRecTest3_pT"), lResonanceTest1.Pt()); } + + if (isMIDCut && isMIDPion(trk1, true)) { + continue; + } + if (isMIDCut && isMIDKaon(trk2, true)) { + continue; + } + auto particle1 = trk1.mcParticle(); auto particle2 = trk2.mcParticle(); //////////////////////////////////////////////////////////////////////// @@ -1415,9 +1417,9 @@ struct kstarInOO { //| DATA STUFF (SE) //| //======================================================= - int nEvents = 0; void processDataSameEvent(EventCandidates::iterator const& collision, TrackCandidates const& tracks) { + static int nEvents = 0; if (cDebugLevel > 0) { nEvents++; if ((nEvents + 1) % 10000 == 0) { @@ -1460,9 +1462,10 @@ struct kstarInOO { //| DATA STUFF (ME) //| //======================================================= - int nEventsMix = 0; + void processDataMixedEvent(EventCandidates const& collisions, TrackCandidates const& tracks) { + static int nEventsMix = 0; auto tracksTuple = std::make_tuple(tracks); BinningType colBinning{{cfgBinsMixVtx, cfgBinsMixMult}, true}; // true is for 'ignore overflows' (true by default) SameKindPair pairs{colBinning, cfgMixNMixedEvents, -1, collisions, tracksTuple, &cache}; @@ -1505,9 +1508,9 @@ struct kstarInOO { //| MC STUFF (SE) //| //========================================================= - int nEventsMC = 0; void processSameEventMC(EventCandidates::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&) { + static int nEventsMC = 0; if (cDebugLevel > 0) { nEventsMC++; if ((nEventsMC + 1) % 10000 == 0) { @@ -1552,9 +1555,9 @@ struct kstarInOO { //| MC STUFF (ME) //| //======================================================= - int nEventsMCMix = 0; void processMixedEventMC(EventCandidates const& collisions, TrackCandidatesMC const& tracks, aod::McParticles const&) { + static int nEventsMCMix = 0; auto tracksTuple = std::make_tuple(tracks); BinningType colBinning{{cfgBinsMixVtx, cfgBinsMixMult}, true}; // true is for 'ignore overflows' (true by default) SameKindPair pairs{colBinning, cfgMixNMixedEvents, -1, collisions, tracksTuple, &cache}; @@ -1581,9 +1584,9 @@ struct kstarInOO { //| GENERATED STUFF //| //====================================== - int nEventsGen = 0; void processGen(EventCandidatesTrue::iterator const& collision, soa::SmallGroups> const& recocolls, aod::McParticles const& mcParticles) { + static int nEventsGen = 0; if (cDebugLevel > 0) { ++nEventsGen; if (nEventsGen % 10000 == 0) { @@ -1685,9 +1688,9 @@ struct kstarInOO { //| GENERATED STUFF (INCLUSIVE & JETS) //| //============================================== - int nprocessGenEvents = 0; void processGenJets(o2::aod::JetMcCollision const& collision, soa::SmallGroups> const& recocolls, aod::JetParticles const& mcParticles) { + static int nprocessGenEvents = 0; if (cDebugLevel > 0) { ++nprocessGenEvents; if (nprocessGenEvents % 10000 == 0) { @@ -1798,9 +1801,9 @@ struct kstarInOO { } // end of process PROCESS_SWITCH(kstarInOO, processGenJets, "Process Generated Particles Inclusive&Jets", false); - int ndRtest = 0; void processJetQA(o2::aod::JetMcCollision const& collision, soa::Filtered const& mcpjets, aod::JetParticles const& mcParticles, aod::McParticles const&) { + static int ndRtest = 0; if (cDebugLevel > 0) { ++ndRtest; if (ndRtest % 10000 == 0) { @@ -1894,12 +1897,6 @@ struct kstarInOO { continue; } - if (bestJet.Pt() > 6.0 && bestJet.Pt() < 8.0) { - if (cfgJetdRHistos) { - histos.fill(HIST("nJet_6_8"), bestJet.Pt()); - } - } - //================== // daughters double dR_kaon = 0; @@ -1974,6 +1971,11 @@ struct kstarInOO { if (bestJet.Pt() > 10.0 && bestJet.Pt() < 12.0) { histos.fill(HIST("Kstar_pT_INJet_10_12"), lResonance.Pt()); } + if (bestJet.Pt() > 8.0 && bestJet.Pt() < 12.0) { + histos.fill(HIST("dR_taggedjet_all_8_12"), dR_kaon, lResonance.Pt()); + histos.fill(HIST("dR_taggedjet_all_8_12"), dR_pion, lResonance.Pt()); + histos.fill(HIST("Kstar_pT_INJet_8_12"), lResonance.Pt()); + } // Daughters out of jets if (!isKaonInJet || !isPionInJet) {