diff --git a/PWGLF/Tasks/Resonances/CMakeLists.txt b/PWGLF/Tasks/Resonances/CMakeLists.txt index d49deced8f3..6988da46437 100644 --- a/PWGLF/Tasks/Resonances/CMakeLists.txt +++ b/PWGLF/Tasks/Resonances/CMakeLists.txt @@ -100,7 +100,7 @@ o2physics_add_dpl_workflow(lambda1520-pbpb COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(kshortkshort - SOURCES KshortKshort.cxx + SOURCES higherMassResonances.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Resonances/KshortKshort.cxx b/PWGLF/Tasks/Resonances/higherMassResonances.cxx similarity index 66% rename from PWGLF/Tasks/Resonances/KshortKshort.cxx rename to PWGLF/Tasks/Resonances/higherMassResonances.cxx index 69e967b2d94..68f0c4652a7 100644 --- a/PWGLF/Tasks/Resonances/KshortKshort.cxx +++ b/PWGLF/Tasks/Resonances/higherMassResonances.cxx @@ -8,10 +8,12 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// + +/// \file higherMassResonances.cxx /// \brief glueball resonance -/// \author Sawan (sawan.sawan@cern.ch) -#include +/// \author Sawan + +// #include #include #include #include @@ -25,6 +27,7 @@ #include #include #include +#include #include "TF1.h" #include "TRandom3.h" #include "Math/Vector3D.h" @@ -55,19 +58,21 @@ using namespace o2::soa; // using namespace o2::constants::physics; using std::array; -struct strangeness_tutorial { +struct HigherMassResonances { SliceCache cache; HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry rKzeroShort{"kzeroShort", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry hglue{"hglueball", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - - Configurable QAv0{"QAv0", false, "QAv0"}; - Configurable QAPID{"QAPID", true, "QAPID"}; - Configurable QAv0_daughters{"QAv0_daughters", false, "QA of v0 daughters"}; - Configurable QAevents{"QAevents", false, "QA of events"}; - Configurable inv_mass1D{"inv_mass1D", false, "1D invariant mass histograms"}; + HistogramRegistry hMChists{"hMChists", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + // PID and QA + Configurable qAv0{"qAv0", false, "qAv0"}; + Configurable qAPID{"qAPID", true, "qAPID"}; + Configurable qAv0Daughters{"qAv0Daughters", false, "QA of v0 daughters"}; + Configurable qAevents{"qAevents", false, "QA of events"}; + Configurable invMass1D{"invMass1D", false, "1D invariant mass histograms"}; Configurable correlation2Dhist{"correlation2Dhist", true, "Lamda K0 mass correlation"}; - Configurable DCAv0topv{"DCAv0topv", false, "DCA V0 to PV"}; + Configurable cDCAv0topv{"cDCAv0topv", false, "DCA V0 to PV"}; Configurable armcut{"armcut", true, "arm cut"}; Configurable globalTracks{"globalTracks", false, "Global tracks"}; Configurable hasTPC{"hasTPC", false, "TPC"}; @@ -81,29 +86,27 @@ struct strangeness_tutorial { Configurable itstpctracks{"itstpctracks", false, "selects collisions with at least one ITS-TPC track,"}; Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; Configurable applyOccupancyCut{"applyOccupancyCut", false, "Apply occupancy cut"}; - Configurable OccupancyCut{"OccupancyCut", 1000, "Mimimum Occupancy cut"}; + Configurable occupancyCut{"occupancyCut", 1000, "Mimimum Occupancy cut"}; // Configurable parameters for V0 selection - Configurable ConfV0DCADaughMax{"ConfV0DCADaughMax", 1.0f, "DCA b/w V0 daughters"}; - Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.06, "DCA Pos To PV"}; - Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.06, "DCA Neg To PV"}; + Configurable confV0DCADaughMax{"confV0DCADaughMax", 1.0f, "DCA b/w V0 daughters"}; + Configurable v0settingDcapostopv{"v0settingDcapostopv", 0.06, "DCA Pos To PV"}; + Configurable v0settingDcanegtopv{"v0settingDcanegtopv", 0.06, "DCA Neg To PV"}; Configurable cMaxV0DCA{"cMaxV0DCA", 1, "DCA V0 to PV"}; // Configurable isStandarv0{"isStandarv0", false, "Standard V0"}; // Configurable ConfDaughDCAMin{"ConfDaughDCAMin", 0.06f, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"}; // same as DCA pos to pv and neg to pv - - Configurable ConfV0PtMin{"ConfV0PtMin", 0.f, "Minimum transverse momentum of V0"}; - Configurable ConfV0CPAMin{"ConfV0CPAMin", 0.97f, "Minimum CPA of V0"}; - Configurable ConfV0TranRadV0Min{"ConfV0TranRadV0Min", 0.5f, "Minimum transverse radius"}; - Configurable ConfV0TranRadV0Max{"ConfV0TranRadV0Max", 200.f, "Maximum transverse radius"}; + Configurable confV0PtMin{"confV0PtMin", 0.f, "Minimum transverse momentum of V0"}; + Configurable confV0CPAMin{"confV0CPAMin", 0.97f, "Minimum CPA of V0"}; + Configurable confV0TranRadV0Min{"confV0TranRadV0Min", 0.5f, "Minimum transverse radius"}; + Configurable confV0TranRadV0Max{"confV0TranRadV0Max", 200.f, "Maximum transverse radius"}; Configurable cMaxV0LifeTime{"cMaxV0LifeTime", 15, "Maximum V0 life time"}; Configurable cSigmaMassKs0{"cSigmaMassKs0", 4, "n Sigma cut on Ks0 mass (Mass (Ks) - cSigmaMassKs0*cWidthKs0)"}; Configurable cWidthKs0{"cWidthKs0", 0.005, "Width of KS0"}; - Configurable ConfDaughEta{"ConfDaughEta", 0.8f, "V0 Daugh sel: max eta"}; - Configurable ConfDaughTPCnclsMin{"ConfDaughTPCnclsMin", 70.f, "V0 Daugh sel: Min. nCls TPC"}; - Configurable ConfDaughPIDCuts{"ConfDaughPIDCuts", 5, "PID selections for KS0 daughters"}; - Configurable Confarmcut{"Confarmcut", 0.2f, "Armenteros cut"}; - Configurable ConfKsrapidity{"ConfKsrapidity", 0.5f, "Rapidity cut on K0s"}; - + Configurable confDaughEta{"confDaughEta", 0.8f, "V0 Daugh sel: max eta"}; + Configurable confDaughTPCnclsMin{"confDaughTPCnclsMin", 70.f, "V0 Daugh sel: Min. nCls TPC"}; + Configurable confDaughPIDCuts{"confDaughPIDCuts", 5, "PID selections for KS0 daughters"}; + Configurable confarmcut{"confarmcut", 0.2f, "Armenteros cut"}; + Configurable confKsrapidity{"confKsrapidity", 0.5f, "Rapidity cut on K0s"}; // Configurable lowmasscutks0{"lowmasscutks0", 0.497 - 4 * 0.005, "Low mass cut on K0s"}; // Configurable highmasscutks0{"highmasscutks0", 0.497 + 4 * 0.005, "High mass cut on K0s"}; @@ -113,16 +116,20 @@ struct strangeness_tutorial { Configurable cfgMultFOTM{"cfgMultFOTM", true, "Use FOTM multiplicity if pp else use 0 here for PbPb (FT0C)"}; ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 5., 10., 30., 50., 70., 100., 110., 150.}, "Binning of the centrality axis"}; + // Configurable for MC + Configurable allGenCollisions{"allGenCollisions", true, "To fill all generated collisions for the signal loss calculations"}; + Configurable cTVXEvsel{"cTVXEvsel", true, "Triggger selection"}; + // output THnSparses Configurable activateTHnSparseCosThStarHelicity{"activateTHnSparseCosThStarHelicity", false, "Activate the THnSparse with cosThStar w.r.t. helicity axis"}; Configurable activateTHnSparseCosThStarProduction{"activateTHnSparseCosThStarProduction", false, "Activate the THnSparse with cosThStar w.r.t. production axis"}; Configurable activateTHnSparseCosThStarBeam{"activateTHnSparseCosThStarBeam", true, "Activate the THnSparse with cosThStar w.r.t. beam axis (Gottified jackson frame)"}; Configurable activateTHnSparseCosThStarRandom{"activateTHnSparseCosThStarRandom", false, "Activate the THnSparse with cosThStar w.r.t. random axis"}; - Configurable c_nof_rotations{"c_nof_rotations", 3, "Number of random rotations in the rotational background"}; + Configurable cRrotations{"cRrotations", 3, "Number of random rotations in the rotational background"}; // Other cuts on Ks and glueball Configurable rapidityks{"rapidityks", true, "rapidity cut on K0s"}; - Configurable apply_competingcut{"apply_competingcut", false, "Competing cascade rejection cut"}; + Configurable applyCompetingcut{"applyCompetingcut", false, "Competing cascade rejection cut"}; Configurable competingcascrejlambda{"competingcascrejlambda", 0.005, "rejecting competing cascade lambda"}; Configurable competingcascrejlambdaanti{"competingcascrejlambdaanti", 0.005, "rejecting competing cascade anti-lambda"}; // If one of the pions is misidentified as a proton, then instead of Ks we reconstruct lambda, therefore the competing cascade rejection cut is applied in which if the reconstrcted mass of a pion and proton (which we are assuming to be misidentified as proton) is close to lambda or anti-lambda, then the track is rejected. Configurable tpcCrossedrows{"tpcCrossedrows", 70, "TPC crossed rows"}; @@ -130,20 +137,20 @@ struct strangeness_tutorial { // Mass and pT axis as configurables Configurable cPtMin{"cPtMin", 0.0f, "Minimum pT"}; - Configurable cPtMax{"cPtMax", 50.0f, "Maximum pT"}; - Configurable cPtBins{"cPtBins", 500, "Number of pT bins"}; + Configurable cPtMax{"cPtMax", 30.0f, "Maximum pT"}; + Configurable cPtBins{"cPtBins", 300, "Number of pT bins"}; Configurable cMassMin{"cMassMin", 0.9f, "Minimum mass of glueball"}; Configurable cMassMax{"cMassMax", 3.0f, "Maximum mass of glueball"}; Configurable cMassBins{"cMassBins", 210, "Number of mass bins for glueball"}; Configurable ksMassMin{"ksMassMin", 0.45f, "Minimum mass of K0s"}; Configurable ksMassMax{"ksMassMax", 0.55f, "Maximum mass of K0s"}; Configurable ksMassBins{"ksMassBins", 200, "Number of mass bins for K0s"}; - Configurable rotational_cut{"rotational_cut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; + Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; ConfigurableAxis configThnAxisPOL{"configThnAxisPOL", {20, -1.0, 1.0}, "Costheta axis"}; ConfigurableAxis axisdEdx{"axisdEdx", {20000, 0.0f, 200.0f}, "dE/dx (a.u.)"}; ConfigurableAxis axisPtfordEbydx{"axisPtfordEbydx", {2000, 0, 20}, "pT (GeV/c)"}; ConfigurableAxis axisMultdist{"axisMultdist", {3500, 0, 70000}, "Multiplicity distribution"}; - ConfigurableAxis occupancy_bins{"occupancy_bins", {VARIABLE_WIDTH, 0.0, 100, 500, 600, 1000, 1100, 1500, 1600, 2000, 2100, 2500, 2600, 3000, 3100, 3500, 3600, 4000, 4100, 4500, 4600, 5000, 5100, 9999}, "Binning of the occupancy axis"}; + ConfigurableAxis occupancyBins{"occupancyBins", {VARIABLE_WIDTH, 0.0, 100, 500, 600, 1000, 1100, 1500, 1600, 2000, 2100, 2500, 2600, 3000, 3100, 3500, 3600, 4000, 4100, 4500, 4600, 5000, 5100, 9999}, "Binning: occupancy axis"}; // Event selection cuts - Alex (Temporary, need to fix!) TF1* fMultPVCutLow = nullptr; @@ -151,20 +158,20 @@ struct strangeness_tutorial { TF1* fMultCutLow = nullptr; TF1* fMultCutHigh = nullptr; TF1* fMultMultPVCut = nullptr; - Service PDGdatabase; + // Service PDGdatabase; TRandom* rn = new TRandom(); void init(InitContext const&) { // Axes - AxisSpec K0ShortMassAxis = {ksMassBins, ksMassMin, ksMassMax, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec k0ShortMassAxis = {ksMassBins, ksMassMin, ksMassMax, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; AxisSpec glueballMassAxis = {cMassBins, cMassMin, cMassMax, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; AxisSpec vertexZAxis = {60, -15.f, 15.f, "vrtx_{Z} [cm]"}; // for histogram AxisSpec ptAxis = {cPtBins, cPtMin, cPtMax, "#it{p}_{T} (GeV/#it{c})"}; // AxisSpec multiplicityAxis = {110, 0.0f, 150.0f, "Multiplicity Axis"}; AxisSpec multiplicityAxis = {binsCent, "Multiplicity Axis"}; AxisSpec thnAxisPOL{configThnAxisPOL, "Configurabel theta axis"}; - AxisSpec occupancy_axis = {occupancy_bins, "Occupancy [-40,100]"}; + AxisSpec occupancyAxis = {occupancyBins, "Occupancy [-40,100]"}; // THnSparses std::array sparses = {activateTHnSparseCosThStarHelicity, activateTHnSparseCosThStarProduction, activateTHnSparseCosThStarBeam, activateTHnSparseCosThStarRandom}; @@ -189,7 +196,7 @@ struct strangeness_tutorial { } // Event selection - if (QAevents) { + if (qAevents) { rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); rEventSelection.add("hmultiplicity", "multiplicity percentile distribution", {HistType::kTH1F, {{150, 0.0f, 150.0f}}}); rEventSelection.add("multdist_FT0M", "FT0M Multiplicity distribution", kTH1F, {axisMultdist}); @@ -198,15 +205,15 @@ struct strangeness_tutorial { rEventSelection.add("hNcontributor", "Number of primary vertex contributor", kTH1F, {{2000, 0.0f, 10000.0f}}); } - if (inv_mass1D) { + if (invMass1D) { hglue.add("h1glueInvMassDS", "h1glueInvMassDS", kTH1F, {glueballMassAxis}); hglue.add("h1glueInvMassME", "h1glueInvMassME", kTH1F, {glueballMassAxis}); hglue.add("h1glueInvMassRot", "h1glueInvMassRot", kTH1F, {glueballMassAxis}); } - hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancy_axis}, true); - hglue.add("h3glueInvMassME", "h3glueInvMassME", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancy_axis}, true); - hglue.add("h3glueInvMassRot", "h3glueInvMassRot", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancy_axis}, true); + hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancyAxis}, true); + hglue.add("h3glueInvMassME", "h3glueInvMassME", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancyAxis}, true); + hglue.add("h3glueInvMassRot", "h3glueInvMassRot", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancyAxis}, true); hglue.add("heventscheck", "heventscheck", kTH1I, {{10, 0, 10}}); hglue.add("htrackscheck_v0", "htrackscheck_v0", kTH1I, {{15, 0, 15}}); hglue.add("htrackscheck_v0_daughters", "htrackscheck_v0_daughters", kTH1I, {{15, 0, 15}}); @@ -225,11 +232,11 @@ struct strangeness_tutorial { rKzeroShort.add("mass_lambda_kshort_after9", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); rKzeroShort.add("mass_lambda_kshort_after10", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); } - if (QAv0) { + if (qAv0) { // Invariant Mass - rKzeroShort.add("hMassK0Shortbefore", "hMassK0Shortbefore", kTHnSparseF, {K0ShortMassAxis, ptAxis}); - rKzeroShort.add("hMasscorrelationbefore", "hMasscorrelationbefore", kTH2F, {K0ShortMassAxis, K0ShortMassAxis}); - rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", kTHnSparseF, {K0ShortMassAxis, ptAxis}); + rKzeroShort.add("hMassK0Shortbefore", "hMassK0Shortbefore", kTHnSparseF, {k0ShortMassAxis, ptAxis}); + rKzeroShort.add("hMasscorrelationbefore", "hMasscorrelationbefore", kTH2F, {k0ShortMassAxis, k0ShortMassAxis}); + rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", kTHnSparseF, {k0ShortMassAxis, ptAxis}); // Topological histograms (after the selection) rKzeroShort.add("hDCAV0Daughters", "DCA between v0 daughters", {HistType::kTH1F, {{60, -3.0f, 3.0f}}}); rKzeroShort.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.96f, 1.1f}}}); @@ -244,7 +251,7 @@ struct strangeness_tutorial { rKzeroShort.add("hv0radius", "hv0radius", kTH1F, {{100, 0.0f, 200.0f}}); rKzeroShort.add("hDCApostopv", "DCA positive daughter to PV", kTH1F, {{1000, -10.0f, 10.0f}}); rKzeroShort.add("hDCAnegtopv", "DCA negative daughter to PV", kTH1F, {{1000, -10.0f, 10.0f}}); - rKzeroShort.add("hDCAv0topv", "DCA V0 to PV", kTH1F, {{60, -3.0f, 3.0f}}); + rKzeroShort.add("hcDCAv0topv", "DCA V0 to PV", kTH1F, {{60, -3.0f, 3.0f}}); rKzeroShort.add("halpha", "Armenteros alpha", kTH1F, {{100, -5.0f, 5.0f}}); rKzeroShort.add("hqtarmbyalpha", "qtarm/alpha", kTH1F, {{100, 0.0f, 1.0f}}); rKzeroShort.add("hpsipair", "psi pair angle", kTH1F, {{100, -5.0f, 5.0f}}); @@ -255,14 +262,14 @@ struct strangeness_tutorial { // rKzeroShort.add("hV0CosPA_before", "hV0CosPA_before", {HistType::kTH1F, {{200, 0.91f, 1.1f}}}); // rKzeroShort.add("hLT_before", "hLT_before", {HistType::kTH1F, {{100, 0.0f, 50.0f}}}); } - if (QAPID) { + if (qAPID) { rKzeroShort.add("hNSigmaPosPionK0s_before", "hNSigmaPosPionK0s_before", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); // rKzeroShort.add("hNSigmaPosPionK0s_after", "hNSigmaPosPionK0s_after", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); rKzeroShort.add("hNSigmaNegPionK0s_before", "hNSigmaNegPionK0s_before", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); // rKzeroShort.add("hNSigmaNegPionK0s_after", "hNSigmaNegPionK0s_after", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); rKzeroShort.add("dE_by_dx_TPC", "dE/dx signal in the TPC as a function of pT", kTH2F, {axisPtfordEbydx, axisdEdx}); } - if (QAv0_daughters) { + if (qAv0Daughters) { rKzeroShort.add("negative_pt", "Negative daughter pT", kTH1F, {ptAxis}); rKzeroShort.add("positive_pt", "Positive daughter pT", kTH1F, {ptAxis}); rKzeroShort.add("negative_eta", "Negative daughter eta", kTH1F, {{100, -1.0f, 1.0f}}); @@ -270,6 +277,19 @@ struct strangeness_tutorial { rKzeroShort.add("negative_phi", "Negative daughter phi", kTH1F, {{70, 0.0f, 7.0f}}); rKzeroShort.add("positive_phi", "Positive daughter phi", kTH1F, {{70, 0.0f, 7.0f}}); } + + // For MC + hMChists.add("events_check", "No. of events in the generated MC", kTH1I, {{20, 0, 20}}); + hMChists.add("events_checkrec", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}}); + hMChists.add("Genf1710", "Gen f_{0}(1710)", kTH1F, {ptAxis}); + hMChists.add("Recf1710_pt1", "Rec f_{0}(1710) p_{T}", kTH1F, {ptAxis}); + hMChists.add("Recf1710_pt2", "Rec f_{0}(1710) p_{T}", kTH1F, {ptAxis}); + hMChists.add("Recf1710_p", "Rec f_{0}(1710) p", kTH1F, {ptAxis}); + hMChists.add("Recf1710_mass", "Rec f_{0}(1710) mass", kTH1F, {glueballMassAxis}); + hMChists.add("Genf1710_mass", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis}); + hMChists.add("MC_mult", "Multiplicity in MC", kTH1F, {multiplicityAxis}); + hMChists.add("MC_mult_after_event_sel", "Multiplicity in MC", kTH1F, {multiplicityAxis}); + if (additionalEvsel) { fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); fMultPVCutLow->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); @@ -328,8 +348,7 @@ struct strangeness_tutorial { } template - bool SelectionV0(Collision const& collision, V0 const& candidate, - float /*multiplicity*/) + bool selectionV0(Collision const& collision, V0 const& candidate, float /*multiplicity*/) { const float qtarm = candidate.qtarm(); const float alph = candidate.alpha(); @@ -339,15 +358,15 @@ struct strangeness_tutorial { const float dcaDaughv0 = candidate.dcaV0daughters(); const float cpav0 = candidate.v0cosPA(); - float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * PDGdatabase->Mass(310); + float ctauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; float lowmasscutks0 = 0.497 - cWidthKs0 * cSigmaMassKs0; float highmasscutks0 = 0.497 + cWidthKs0 * cSigmaMassKs0; // float decayLength = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * RecoDecay::sqrtSumOfSquares(candidate.px(), candidate.py(), candidate.pz()); - if (QAv0) { + if (qAv0) { rKzeroShort.fill(HIST("hMassK0Shortbefore"), candidate.mK0Short(), candidate.pt()); rKzeroShort.fill(HIST("hMasscorrelationbefore"), candidate.mK0Short(), candidate.mK0Short()); - rKzeroShort.fill(HIST("hLT"), CtauK0s); + rKzeroShort.fill(HIST("hLT"), ctauK0s); rKzeroShort.fill(HIST("hDCAV0Daughters"), candidate.dcaV0daughters()); rKzeroShort.fill(HIST("hV0CosPA"), candidate.v0cosPA()); rKzeroShort.fill(HIST("Mass_lambda"), candidate.mLambda()); @@ -359,7 +378,7 @@ struct strangeness_tutorial { rKzeroShort.fill(HIST("hv0radius"), candidate.v0radius()); rKzeroShort.fill(HIST("hDCApostopv"), candidate.dcapostopv()); rKzeroShort.fill(HIST("hDCAnegtopv"), candidate.dcanegtopv()); - rKzeroShort.fill(HIST("hDCAv0topv"), candidate.dcav0topv()); + rKzeroShort.fill(HIST("hcDCAv0topv"), candidate.dcav0topv()); rKzeroShort.fill(HIST("halpha"), candidate.alpha()); rKzeroShort.fill(HIST("hqtarmbyalpha"), arm); rKzeroShort.fill(HIST("hpsipair"), candidate.psipair()); @@ -369,77 +388,78 @@ struct strangeness_tutorial { hglue.fill(HIST("htrackscheck_v0"), 0.5); - if (DCAv0topv && fabs(candidate.dcav0topv()) > cMaxV0DCA) { + if (cDCAv0topv && std::fabs(candidate.dcav0topv()) > cMaxV0DCA) { return false; } hglue.fill(HIST("htrackscheck_v0"), 1.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after1"), candidate.mK0Short(), candidate.mLambda()); - if (rapidityks && TMath::Abs(candidate.yK0Short()) >= ConfKsrapidity) { + if (rapidityks && std::abs(candidate.yK0Short()) >= confKsrapidity) { return false; } hglue.fill(HIST("htrackscheck_v0"), 2.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after2"), candidate.mK0Short(), candidate.mLambda()); - if (pT < ConfV0PtMin) { + if (pT < confV0PtMin) { return false; } hglue.fill(HIST("htrackscheck_v0"), 3.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after3"), candidate.mK0Short(), candidate.mLambda()); - if (dcaDaughv0 > ConfV0DCADaughMax) { + if (dcaDaughv0 > confV0DCADaughMax) { return false; } hglue.fill(HIST("htrackscheck_v0"), 4.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after4"), candidate.mK0Short(), candidate.mLambda()); - if (cpav0 < ConfV0CPAMin) { + if (cpav0 < confV0CPAMin) { return false; } hglue.fill(HIST("htrackscheck_v0"), 5.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after5"), candidate.mK0Short(), candidate.mLambda()); - if (tranRad < ConfV0TranRadV0Min) { + if (tranRad < confV0TranRadV0Min) { return false; } hglue.fill(HIST("htrackscheck_v0"), 6.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after6"), candidate.mK0Short(), candidate.mLambda()); - if (tranRad > ConfV0TranRadV0Max) { + if (tranRad > confV0TranRadV0Max) { return false; } hglue.fill(HIST("htrackscheck_v0"), 7.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after7"), candidate.mK0Short(), candidate.mLambda()); - if (fabs(CtauK0s) > cMaxV0LifeTime) { + if (std::fabs(ctauK0s) > cMaxV0LifeTime) { return false; } hglue.fill(HIST("htrackscheck_v0"), 8.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after8"), candidate.mK0Short(), candidate.mLambda()); - if (armcut && arm < Confarmcut) { + if (armcut && arm < confarmcut) { return false; } hglue.fill(HIST("htrackscheck_v0"), 9.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after9"), candidate.mK0Short(), candidate.mLambda()); - if (apply_competingcut && (TMath::Abs(candidate.mLambda() - PDGdatabase->Mass(3122)) <= competingcascrejlambda || TMath::Abs(candidate.mAntiLambda() - PDGdatabase->Mass(-3122)) <= competingcascrejlambdaanti)) { + // if (applyCompetingcut && (std::abs(candidate.mLambda() - PDGdatabase->Mass(3122)) <= competingcascrejlambda || std::abs(candidate.mAntiLambda() - PDGdatabase->Mass(-3122)) <= competingcascrejlambdaanti)) + if (applyCompetingcut && (std::abs(candidate.mLambda() - o2::constants::physics::MassLambda0) <= competingcascrejlambda || std::abs(candidate.mAntiLambda() - o2::constants::physics::MassLambda0) <= competingcascrejlambdaanti)) { return false; } hglue.fill(HIST("htrackscheck_v0"), 10.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after10"), candidate.mK0Short(), candidate.mLambda()); - if (QAv0) { + if (qAv0) { rKzeroShort.fill(HIST("hMassK0ShortSelected"), candidate.mK0Short(), candidate.pt()); // rKzeroShort.fill(HIST("mass_lambda_kshort_after"), candidate.mK0Short(), candidate.mLambda()); } @@ -453,7 +473,7 @@ struct strangeness_tutorial { template bool isSelectedV0Daughter(T const& track, float charge, double nsigmaV0Daughter, V0s const& /*candidate*/) { - if (QAPID) { + if (qAPID) { // Filling the PID of the V0 daughters in the region of the K0 peak. (charge == 1) ? rKzeroShort.fill(HIST("hNSigmaPosPionK0s_before"), track.tpcInnerParam(), track.tpcNSigmaPi()) : rKzeroShort.fill(HIST("hNSigmaNegPionK0s_before"), track.tpcInnerParam(), track.tpcNSigmaPi()); rKzeroShort.fill(HIST("dE_by_dx_TPC"), track.p(), track.tpcSignal()); @@ -477,7 +497,7 @@ struct strangeness_tutorial { return false; hglue.fill(HIST("htrackscheck_v0_daughters"), 3.5); - if (tpcNClsF < ConfDaughTPCnclsMin) { + if (tpcNClsF < confDaughTPCnclsMin) { return false; } hglue.fill(HIST("htrackscheck_v0_daughters"), 4.5); @@ -497,12 +517,12 @@ struct strangeness_tutorial { } hglue.fill(HIST("htrackscheck_v0_daughters"), 6.5); - if (std::abs(eta) > ConfDaughEta) { + if (std::abs(eta) > confDaughEta) { return false; } hglue.fill(HIST("htrackscheck_v0_daughters"), 7.5); - if (std::abs(nsigmaV0Daughter) > ConfDaughPIDCuts) { + if (std::abs(nsigmaV0Daughter) > confDaughPIDCuts) { return false; } hglue.fill(HIST("htrackscheck_v0_daughters"), 8.5); @@ -513,17 +533,21 @@ struct strangeness_tutorial { // Defining filters for events (event selection) // Filter eventFilter = (o2::aod::evsel::sel8 == true); Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); - Filter AcceptenceFilter = (nabs(aod::track::eta) < cfgETAcut && nabs(aod::track::pt) > cfgPTcut); + Filter acceptenceFilter = (nabs(aod::track::eta) < cfgETAcut && nabs(aod::track::pt) > cfgPTcut); // Filters on V0s - Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && - nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv); + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0settingDcapostopv && + nabs(aod::v0data::dcanegtopv) > v0settingDcanegtopv); // Defining the type of the daughter tracks using DaughterTracks = soa::Join; using EventCandidates = soa::Filtered>; using TrackCandidates = soa::Filtered>; using V0TrackCandidate = aod::V0Datas; + // For Monte Carlo + using EventCandidatesMC = soa::Join; + using TrackCandidatesMC = soa::Filtered>; + using V0TrackCandidatesMC = soa::Join; // void processSE(soa::Filtered>::iterator const& collision, // soa::Filtered const& V0s, @@ -531,10 +555,12 @@ struct strangeness_tutorial { ROOT::Math::PxPyPzMVector daughter1, daughter2; ROOT::Math::PxPyPzMVector lv3; + // int counter3 = 0; void processSE(EventCandidates::iterator const& collision, TrackCandidates const& /*tracks*/, aod::V0Datas const& V0s) { hglue.fill(HIST("heventscheck"), 0.5); - const double massK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(); + // const double massK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(); + const double massK0s = o2::constants::physics::MassK0Short; float multiplicity = 0.0f; if (cfgMultFOTM) { multiplicity = collision.centFT0M(); @@ -545,12 +571,12 @@ struct strangeness_tutorial { return; } - auto occupancy_no = collision.trackOccupancyInTimeRange(); - if (applyOccupancyCut && occupancy_no < OccupancyCut) { + auto occupancyNumber = collision.trackOccupancyInTimeRange(); + if (applyOccupancyCut && occupancyNumber < occupancyCut) { return; } - if (QAevents) { + if (qAevents) { rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); rEventSelection.fill(HIST("hmultiplicity"), multiplicity); rEventSelection.fill(HIST("multdist_FT0M"), collision.multFT0M()); @@ -561,16 +587,16 @@ struct strangeness_tutorial { std::vector v0indexes; - for (auto& [v1, v2] : combinations(CombinationsUpperIndexPolicy(V0s, V0s))) { + for (const auto& [v1, v2] : combinations(CombinationsUpperIndexPolicy(V0s, V0s))) { if (v1.size() == 0 || v2.size() == 0) { continue; } - if (!SelectionV0(collision, v1, multiplicity)) { + if (!selectionV0(collision, v1, multiplicity)) { continue; } - if (!SelectionV0(collision, v2, multiplicity)) { + if (!selectionV0(collision, v2, multiplicity)) { continue; } @@ -591,7 +617,7 @@ struct strangeness_tutorial { continue; } - if (QAv0_daughters) { + if (qAv0Daughters) { rKzeroShort.fill(HIST("negative_pt"), negtrack1.pt()); rKzeroShort.fill(HIST("positive_pt"), postrack1.pt()); rKzeroShort.fill(HIST("negative_eta"), negtrack1.eta()); @@ -640,72 +666,78 @@ struct strangeness_tutorial { ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massK0s); // Kshort - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair + ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of HigherMassResonances pair ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - if (TMath::Abs(lv3.Rapidity() < 0.5)) { + // if (counter3 < 1e3) { + // std::cout << "rapidity is " << lv3.Rapidity() << std::endl; + // } + // counter3++; + + if (std::abs(lv3.Rapidity()) < 0.5) { - if (inv_mass1D) { + if (invMass1D) { hglue.fill(HIST("h1glueInvMassRot"), lv3.M()); } if (activateTHnSparseCosThStarHelicity) { ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); - hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancy_no); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(TMath::Pi() - TMath::Pi() / rotational_cut, TMath::Pi() + TMath::Pi() / rotational_cut); + hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancyNumber); + for (int i = 0; i < cRrotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); lv4.SetPtEtaPhiM(v1.pt(), v1.eta(), v1.phi() + theta2, massK0s); // for rotated background lv5 = lv2 + lv4; - hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarHelicity, occupancy_no); + hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarHelicity, occupancyNumber); } - } else if (activateTHnSparseCosThStarProduction) { ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); - hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancy_no); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(TMath::Pi() - TMath::Pi() / rotational_cut, TMath::Pi() + TMath::Pi() / rotational_cut); + hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancyNumber); + for (int i = 0; i < cRrotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); lv4.SetPtEtaPhiM(v1.pt(), v1.eta(), v1.phi() + theta2, massK0s); // for rotated background lv5 = lv2 + lv4; - hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarProduction, occupancy_no); + hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarProduction, occupancyNumber); } } else if (activateTHnSparseCosThStarBeam) { ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancy_no); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(TMath::Pi() - TMath::Pi() / rotational_cut, TMath::Pi() + TMath::Pi() / rotational_cut); + hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancyNumber); + for (int i = 0; i < cRrotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); lv4.SetPtEtaPhiM(v1.pt(), v1.eta(), v1.phi() + theta2, massK0s); // for rotated background lv5 = lv2 + lv4; - hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarBeam, occupancy_no); + hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarBeam, occupancyNumber); } } else if (activateTHnSparseCosThStarRandom) { auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancy_no); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(TMath::Pi() - TMath::Pi() / rotational_cut, TMath::Pi() + TMath::Pi() / rotational_cut); + hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancyNumber); + for (int i = 0; i < cRrotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); lv4.SetPtEtaPhiM(v1.pt(), v1.eta(), v1.phi() + theta2, massK0s); // for rotated background lv5 = lv2 + lv4; - hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarRandom, occupancy_no); + hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarRandom, occupancyNumber); } } } } - if (QAv0) { + if (qAv0) { int sizeofv0indexes = v0indexes.size(); rKzeroShort.fill(HIST("NksProduced"), sizeofv0indexes); // std::cout << "Size of v0indexes: " << sizeofv0indexes << std::endl; } } - PROCESS_SWITCH(strangeness_tutorial, processSE, "same event process", true); + PROCESS_SWITCH(HigherMassResonances, processSE, "same event process", true); + array pvec0; + array pvec1; // use any one of 3 alias depending on the dataset. If pp then FT0M and if pbpb then FTOC using BinningTypeTPCMultiplicity = ColumnBinningPolicy; using BinningTypeCentralityM = ColumnBinningPolicy; @@ -716,7 +748,8 @@ struct strangeness_tutorial { void processME(EventCandidates const& collisions, TrackCandidates const& /*tracks*/, V0TrackCandidate const& v0s) { - const double massK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(); + // const double massK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(); + const double massK0s = o2::constants::physics::MassK0Short; auto tracksTuple = std::make_tuple(v0s); BinningTypeVertexContributor binningOnPositions1{{mevz, memult}, true}; BinningTypeCentralityM binningOnPositions2{{mevz, memult}, true}; @@ -725,7 +758,7 @@ struct strangeness_tutorial { SameKindPair pair2{binningOnPositions2, cfgNmixedEvents, -1, collisions, tracksTuple, &cache}; // for pp if (cfgMultFOTM) { - for (auto& [c1, tracks1, c2, tracks2] : pair2) // two different centrality c1 and c2 and tracks corresponding to them + for (const auto& [c1, tracks1, c2, tracks2] : pair2) // two different centrality c1 and c2 and tracks corresponding to them { float multiplicity = 0.0f; @@ -735,21 +768,21 @@ struct strangeness_tutorial { if (!eventselection(c1, multiplicity) || !eventselection(c2, multiplicity)) { continue; } - auto occupancy_no = c1.trackOccupancyInTimeRange(); - auto occupancy_no2 = c2.trackOccupancyInTimeRange(); - if (applyOccupancyCut && (occupancy_no < OccupancyCut || occupancy_no2 < OccupancyCut)) { + auto occupancyNumber = c1.trackOccupancyInTimeRange(); + auto occupancyNumber2 = c2.trackOccupancyInTimeRange(); + if (applyOccupancyCut && (occupancyNumber < occupancyCut || occupancyNumber2 < occupancyCut)) { return; } - for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (t1.size() == 0 || t2.size() == 0) { continue; } - if (!SelectionV0(c1, t1, multiplicity)) + if (!selectionV0(c1, t1, multiplicity)) continue; - if (!SelectionV0(c2, t2, multiplicity)) + if (!selectionV0(c2, t2, multiplicity)) continue; auto postrack1 = t1.template posTrack_as(); @@ -787,36 +820,36 @@ struct strangeness_tutorial { ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massK0s); // Kshort - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair + ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of HigherMassResonances pair ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - if (TMath::Abs(lv3.Rapidity() < 0.5)) { + if (std::abs(lv3.Rapidity()) < 0.5) { if (activateTHnSparseCosThStarHelicity) { ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancyNumber); } else if (activateTHnSparseCosThStarProduction) { ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancyNumber); } else if (activateTHnSparseCosThStarBeam) { ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancyNumber); } else if (activateTHnSparseCosThStarRandom) { auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancyNumber); } } - // if (TMath::Abs(lv3.Rapidity() < 0.5)) { - // if (inv_mass1D) { + // if (std::abs(lv3.Rapidity()) < 0.5) { + // if (invMass1D) { // hglue.fill(HIST("h1glueInvMassME"), lv3.M()); // } // hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M()); @@ -824,7 +857,7 @@ struct strangeness_tutorial { } } } else { - for (auto& [c1, tracks1, c2, tracks2] : pair1) // two different centrality c1 and c2 and tracks corresponding to them + for (const auto& [c1, tracks1, c2, tracks2] : pair1) // two different centrality c1 and c2 and tracks corresponding to them { float multiplicity = 0.0f; multiplicity = c1.centFT0C(); @@ -832,20 +865,20 @@ struct strangeness_tutorial { if (!eventselection(c1, multiplicity) || !eventselection(c2, multiplicity)) { continue; } - auto occupancy_no = c1.trackOccupancyInTimeRange(); - auto occupancy_no2 = c2.trackOccupancyInTimeRange(); - if (applyOccupancyCut && (occupancy_no < OccupancyCut || occupancy_no2 < OccupancyCut)) { + auto occupancyNumber = c1.trackOccupancyInTimeRange(); + auto occupancyNumber2 = c2.trackOccupancyInTimeRange(); + if (applyOccupancyCut && (occupancyNumber < occupancyCut || occupancyNumber2 < occupancyCut)) { return; } - for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (t1.size() == 0 || t2.size() == 0) { continue; } - if (!SelectionV0(c1, t1, multiplicity)) + if (!selectionV0(c1, t1, multiplicity)) continue; - if (!SelectionV0(c2, t2, multiplicity)) + if (!selectionV0(c2, t2, multiplicity)) continue; auto postrack1 = t1.template posTrack_as(); @@ -883,31 +916,31 @@ struct strangeness_tutorial { ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massK0s); // Kshort - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair + ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of HigherMassResonances pair ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - if (TMath::Abs(lv3.Rapidity() < 0.5)) { + if (std::abs(lv3.Rapidity()) < 0.5) { if (activateTHnSparseCosThStarHelicity) { ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancyNumber); } else if (activateTHnSparseCosThStarProduction) { ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancyNumber); } else if (activateTHnSparseCosThStarBeam) { ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancyNumber); } else if (activateTHnSparseCosThStarRandom) { auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancyNumber); } } @@ -915,8 +948,8 @@ struct strangeness_tutorial { // lv1.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massK0s); // lv2.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massK0s); // lv3 = lv1 + lv2; - // if (TMath::Abs(lv3.Rapidity() < 0.5)) { - // if (inv_mass1D) { + // if (std::abs(lv3.Rapidity()) < 0.5) { + // if (invMass1D) { // hglue.fill(HIST("h1glueInvMassME"), lv3.M()); // } // hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M()); @@ -925,11 +958,285 @@ struct strangeness_tutorial { } } } - PROCESS_SWITCH(strangeness_tutorial, processME, "mixed event process", true); + PROCESS_SWITCH(HigherMassResonances, processME, "mixed event process", true); + + int counter = 0; + void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) + { + TLorentzVector genvec; + hMChists.fill(HIST("events_check"), 0.5); + if (std::abs(mcCollision.posZ()) < cutzvertex) { + hMChists.fill(HIST("events_check"), 1.5); + } + // int Nchinel = 0; + // for (const auto& mcParticle : mcParticles) { + // auto pdgcode = std::abs(mcParticle.pdgCode()); + // if (mcParticle.isPhysicalPrimary() && (pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == 11 || pdgcode == 13)) { + // if (std::abs(mcParticle.eta()) < 1.0) { + // Nchinel = Nchinel + 1; + // } + // } + // } + // if (Nchinel > 0 && std::abs(mcCollision.posZ()) < cutzvertex) + hMChists.fill(HIST("events_check"), 2.5); + + std::vector selectedEvents(collisions.size()); + int nevts = 0; + for (const auto& collision : collisions) { + if (std::abs(collision.mcCollision().posZ()) > cutzvertex) { + continue; + } + + if (timFrameEvsel && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + continue; + } + if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { + continue; + } + + selectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); + } + selectedEvents.resize(nevts); + hMChists.fill(HIST("events_check"), 3.5); + // const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end(); + + // if (!allGenCollisions && !evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection + // return; + // } + hMChists.fill(HIST("events_check"), 4.5); + for (const auto& mcParticle : mcParticles) { + if (std::abs(mcParticle.y()) >= 0.5) { + continue; + } + hMChists.fill(HIST("events_check"), 5.5); + + // if (counter < 1e4) { + // std::cout << "PDG code mother " << mcParticle.pdgCode() << std::endl; + // } + // counter++; + if (std::abs(mcParticle.pdgCode()) != 10331) // f2(1525), f0(1710) + { + continue; + } + hMChists.fill(HIST("events_check"), 6.5); + + auto kDaughters = mcParticle.daughters_as(); + if (kDaughters.size() != 2) { + continue; + } + hMChists.fill(HIST("events_check"), 7.5); + + auto passKs = false; + for (const auto& kCurrentDaughter : kDaughters) { + // int daupdg = std::abs(kCurrentDaughter.pdgCode()); + // if (counter < 1e4) + // std::cout << "Daughter pdg code: " << daupdg << std::endl; + // counter++; + + if (!kCurrentDaughter.isPhysicalPrimary()) { + continue; + } + hMChists.fill(HIST("events_check"), 8.5); + + if (std::abs(kCurrentDaughter.pdgCode()) == 310) { + passKs = true; + hMChists.fill(HIST("events_check"), 9.5); + } + } + if (passKs) { + genvec.SetPtEtaPhiE(mcParticle.pt(), mcParticle.eta(), mcParticle.phi(), mcParticle.e()); + hMChists.fill(HIST("Genf1710"), mcParticle.pt()); + hMChists.fill(HIST("Genf1710_mass"), genvec.M()); + } + } + } + PROCESS_SWITCH(HigherMassResonances, processGen, "Process Generated", false); + + int counter2 = 0; + int eventCounter = 0; + std::vector gindex1, gindex2; + void processRec(EventCandidatesMC::iterator const& collision, V0TrackCandidatesMC const& V0s, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/) + { + + TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; + + float multiplicity = 0.0f; + multiplicity = collision.centFT0C(); + hMChists.fill(HIST("MC_mult"), multiplicity); + + hMChists.fill(HIST("events_checkrec"), 0.5); + if (!collision.has_mcCollision()) { + return; + } + hMChists.fill(HIST("events_checkrec"), 1.5); + // if (std::abs(collision.mcCollision().posZ()) > cutzvertex || !collision.sel8()) { + if (std::abs(collision.mcCollision().posZ()) > cutzvertex) { + return; + } + hMChists.fill(HIST("events_checkrec"), 2.5); + + if (timFrameEvsel && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + return; + } + hMChists.fill(HIST("events_checkrec"), 3.5); + if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { + return; + } + hMChists.fill(HIST("events_checkrec"), 4.5); + hMChists.fill(HIST("MC_mult_after_event_sel"), multiplicity); + eventCounter++; + + for (const auto& v01 : V0s) { + + for (const auto& v02 : V0s) { + + hMChists.fill(HIST("events_checkrec"), 5.5); + + if (v02.index() <= v01.index()) { + continue; + } + + if (!v01.has_mcParticle() || !v02.has_mcParticle()) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 6.5); + + auto postrack1 = v01.template posTrack_as(); + auto negtrack1 = v01.template negTrack_as(); + + auto postrack2 = v02.template posTrack_as(); + auto negtrack2 = v02.template negTrack_as(); + + if (!postrack1.has_mcParticle() || !postrack2.has_mcParticle()) + continue; // Checking that the daughter tracks come from particles and are not fake + hMChists.fill(HIST("events_checkrec"), 7.5); + + if (!negtrack1.has_mcParticle() || !negtrack2.has_mcParticle()) + continue; + hMChists.fill(HIST("events_checkrec"), 8.5); + + double nTPCSigmaPos1[1]{postrack1.tpcNSigmaPi()}; + double nTPCSigmaNeg1[1]{negtrack1.tpcNSigmaPi()}; + + double nTPCSigmaPos2[1]{postrack2.tpcNSigmaPi()}; + double nTPCSigmaNeg2[1]{negtrack2.tpcNSigmaPi()}; + + if (!isSelectedV0Daughter(postrack1, 1, nTPCSigmaPos1[0], v01) || !isSelectedV0Daughter(postrack2, 1, nTPCSigmaPos2[0], v02)) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 9.5); + + if (!isSelectedV0Daughter(negtrack1, -1, nTPCSigmaNeg1[0], v01) || !isSelectedV0Daughter(negtrack2, -1, nTPCSigmaNeg2[0], v02)) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 10.5); + + if (!selectionV0(collision, v01, multiplicity) || !selectionV0(collision, v02, multiplicity)) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 11.5); + + auto mctrackv01 = v01.mcParticle(); + auto mctrackv02 = v02.mcParticle(); + + int trackv0PDG1 = std::abs(mctrackv01.pdgCode()); + int trackv0PDG2 = std::abs(mctrackv02.pdgCode()); + + if (std::abs(trackv0PDG1) != 310 || std::abs(trackv0PDG2) != 310) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 12.5); + + for (const auto& mothertrack1 : mctrackv01.mothers_as()) { + + // int motpdgs = std::abs(mothertrack1.pdgCode()); + gindex1.push_back(mothertrack1.globalIndex()); + if (gindex1.size() > 1) { + if (std::find(gindex1.begin(), gindex1.end(), mothertrack1.globalIndex()) != gindex1.end()) { + continue; + } + } + // if (counter2 < 1e4) + // std::cout << "Mother1 pdg code: " << motpdgs << " p_{T} " << mothertrack1.pt() << "Global index " << mothertrack1.globalIndex() << " event " << eventCounter << std::endl; + // counter2++; + + // int counter_check = 0; + + for (const auto& mothertrack2 : mctrackv02.mothers_as()) { + + hMChists.fill(HIST("events_checkrec"), 13.5); + + if (mothertrack1.pdgCode() != mothertrack2.pdgCode()) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 14.5); + + // int motpdgs2 = std::abs(mothertrack2.pdgCode()); + gindex2.push_back(mothertrack2.globalIndex()); + if (gindex2.size() > 1) { + if (std::find(gindex2.begin(), gindex2.end(), mothertrack2.globalIndex()) != gindex2.end()) { + continue; + } + } + // if (counter2 < 1e4) + // std::cout << "Mother2 pdg code: " << motpdgs2 << " p_{T} " << mothertrack2.pt() << "Global index " << mothertrack1.globalIndex() << " event " << eventCounter << std::endl; + + if (mothertrack1.pdgCode() != 10331) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 15.5); + + if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 16.5); + + if (!mothertrack1.producedByGenerator()) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 17.5); + + if (std::abs(mothertrack1.y()) >= 0.5) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 18.5); + + // counter_check++; + // if (counter_check > 1) { + // std::cout << "Total mothers is " << counter_check << std::endl; + // } + // std::cout << "After selection " << " p_{T} " << mothertrack2.pt() << " event " << eventCounter << std::endl; + + pvec0 = std::array{v01.px(), v01.py(), v01.pz()}; + pvec1 = std::array{v02.px(), v02.py(), v02.pz()}; + auto arrMomrec = std::array{pvec0, pvec1}; + auto motherP = mothertrack1.p(); + // auto motherE = mothertrack1.e(); + // auto genMass = std::sqrt(motherE * motherE - motherP * motherP); + auto recMass = RecoDecay::m(arrMomrec, std::array{o2::constants::physics::MassK0Short, o2::constants::physics::MassK0Short}); + // auto recpt = TMath::Sqrt((track1.px() + track2.px()) * (track1.px() + track2.px()) + (track1.py() + track2.py()) * (track1.py() + track2.py())); + //// Resonance reconstruction + lDecayDaughter1.SetXYZM(v01.px(), v01.py(), v01.pz(), o2::constants::physics::MassK0Short); + lDecayDaughter2.SetXYZM(v02.px(), v02.py(), v02.pz(), o2::constants::physics::MassK0Short); + lResonance = lDecayDaughter1 + lDecayDaughter2; + + hMChists.fill(HIST("Recf1710_p"), motherP); + hMChists.fill(HIST("Recf1710_mass"), recMass); + hMChists.fill(HIST("Recf1710_pt1"), mothertrack1.pt()); + // hMChists.fill(HIST("Genf1710_mass"), genMass); + hMChists.fill(HIST("Recf1710_pt2"), lResonance.Pt()); + } + gindex2.clear(); + } + gindex1.clear(); + } + } + } + PROCESS_SWITCH(HigherMassResonances, processRec, "Process Reconstructed", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index 5517a69818e..06fcb14511c 100644 --- a/PWGLF/Tasks/Resonances/kstarqa.cxx +++ b/PWGLF/Tasks/Resonances/kstarqa.cxx @@ -8,17 +8,19 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// -/// \brief this is a code for the kstarqa resonance + +/// \file Kstarqa.cxx +/// \brief this is a code for the Kstarqa resonance /// \author prottay das, sawan /// \since 13/03/2024 -#include +// #include #include #include #include #include #include +#include #include #include #include @@ -52,7 +54,7 @@ using namespace o2::framework::expressions; using namespace o2::soa; using std::array; -struct kstarqa { +struct Kstarqa { SliceCache cache; @@ -61,27 +63,27 @@ struct kstarqa { HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; // Confugrable for QA histograms - Configurable CalcLikeSign{"CalcLikeSign", true, "Calculate Like Sign"}; - Configurable CalcRotational{"CalcRotational", true, "Calculate Rotational"}; - Configurable QAbefore{"QAbefore", true, "QAbefore"}; - Configurable QAafter{"QAafter", true, "QAafter"}; - Configurable QAevents{"QAevents", true, "Multiplicity dist, DCAxy, DCAz"}; + Configurable calcLikeSign{"calcLikeSign", true, "Calculate Like Sign"}; + Configurable calcRotational{"calcRotational", true, "Calculate Rotational"}; + Configurable cQAbefore{"cQAbefore", true, "cQAbefore"}; + Configurable cQAafter{"cQAafter", true, "cQAafter"}; + Configurable cQAevents{"cQAevents", true, "Multiplicity dist, DCAxy, DCAz"}; Configurable onlyTOF{"onlyTOF", false, "only TOF tracks"}; Configurable onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"}; Configurable onlyTPC{"onlyTPC", true, "only TPC tracks"}; Configurable cfgFT0M{"cfgFT0M", true, "1: pp, 0: PbPb"}; // Configurables for track selections - Configurable rotational_cut{"rotational_cut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; + Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; Configurable cfgCutPT{"cfgCutPT", 0.2f, "PT cut on daughter track"}; Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta cut on daughter track"}; Configurable cfgCutDCAxy{"cfgCutDCAxy", 2.0f, "DCAxy range for tracks"}; Configurable cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"}; - Configurable nsigmaCutTPCPi{"nsigmacutTPCPi", 3.0, "Value of the TPC Nsigma cut for pions"}; - Configurable nsigmaCutTPCKa{"nsigmacutTPCKa", 3.0, "Value of the TPC Nsigma cut for kaons"}; - Configurable nsigmaCutTOFPi{"nsigmacutTOFPi", 3.0, "Value of the TOF Nsigma cut for pions"}; - Configurable nsigmaCutTOFKa{"nsigmacutTOFKa", 3.0, "Value of the TOF Nsigma cut for kaons"}; - Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Value of the Combined Nsigma cut"}; + Configurable nsigmaCutTPCPi{"nsigmaCutTPCPi", 3.0, "TPC Nsigma cut for pions"}; + Configurable nsigmaCutTPCKa{"nsigmaCutTPCKa", 3.0, "TPC Nsigma cut for kaons"}; + Configurable nsigmaCutTOFPi{"nsigmaCutTOFPi", 3.0, "TOF Nsigma cut for pions"}; + Configurable nsigmaCutTOFKa{"nsigmaCutTOFKa", 3.0, "TOF Nsigma cut for kaons"}; + Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Combined Nsigma cut"}; Configurable cfgNoMixedEvents{"cfgNoMixedEvents", 5, "Number of mixed events per event"}; Configurable ismanualDCAcut{"ismanualDCAcut", true, "ismanualDCAcut"}; Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; @@ -96,9 +98,9 @@ struct kstarqa { // Event selection configurables Configurable timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"}; - Configurable TVXEvsel{"TVXEvsel", false, "Triggger selection"}; + Configurable cTVXEvsel{"cTVXEvsel", false, "Triggger selection"}; Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; - Configurable MID{"MID", false, "Misidentification of tracks"}; + Configurable cMID{"cMID", false, "Misidentification of tracks"}; // Configurable for histograms Configurable nBins{"nBins", 100, "N bins in all histos"}; @@ -108,21 +110,21 @@ struct kstarqa { Configurable nBinspT{"nBinspT", 200, "N bins in pT histos"}; Configurable pTbinlow{"pTbinlow", 0.0, "pT bin low"}; Configurable pTbinhigh{"pTbinhigh", 20.0, "pT bin high"}; - ConfigurableAxis binsMultPlot{"binsCent", {201, -0.5f, 200.5f}, "Binning of the centrality axis for plots"}; Configurable avoidsplitrackMC{"avoidsplitrackMC", true, "avoid split track in MC"}; - Configurable AllGenCollisions{"AllGenCollisions", true, "To fill all generated collisions for the signal loss calculations"}; + Configurable cAllGenCollisions{"cAllGenCollisions", true, "To fill all generated collisions for the signal loss calculations"}; + ConfigurableAxis binsMultPlot{"binsMultPlot", {201, -0.5f, 200.5f}, "centrality axis bins"}; ConfigurableAxis axisdEdx{"axisdEdx", {20000, 0.0f, 200.0f}, "dE/dx (a.u.)"}; ConfigurableAxis axisPtfordEbydx{"axisPtfordEbydx", {2000, 0, 20}, "pT (GeV/c)"}; ConfigurableAxis axisMultdist{"axisMultdist", {3500, 0, 70000}, "Multiplicity distribution"}; // Event plane configurables - Configurable boost_daugter1{"boost_daugter1", false, "Boost daughter Kaon in the COM frame"}; - Configurable boost_daugter2{"boost_daugter2", true, "Boost daughter Pion in the COM frame"}; + Configurable boostDaugter1{"boostDaugter1", false, "Boost daughter Kaon in the COM frame"}; + Configurable boostDaugter2{"boostDaugter2", true, "Boost daughter Pion in the COM frame"}; Configurable activateTHnSparseCosThStarHelicity{"activateTHnSparseCosThStarHelicity", true, "Activate the THnSparse with cosThStar w.r.t. helicity axis"}; Configurable activateTHnSparseCosThStarProduction{"activateTHnSparseCosThStarProduction", false, "Activate the THnSparse with cosThStar w.r.t. production axis"}; Configurable activateTHnSparseCosThStarBeam{"activateTHnSparseCosThStarBeam", false, "Activate the THnSparse with cosThStar w.r.t. beam axis (Gottified jackson frame)"}; Configurable activateTHnSparseCosThStarRandom{"activateTHnSparseCosThStarRandom", false, "Activate the THnSparse with cosThStar w.r.t. random axis"}; - Configurable c_nof_rotations{"c_nof_rotations", 3, "Number of random rotations in the rotational background"}; + Configurable cRotations{"cRotations", 3, "Number of random rotations in the rotational background"}; ConfigurableAxis configThnAxisPOL{"configThnAxisPOL", {20, -1.0, 1.0}, "Costheta axis"}; TRandom* rn = new TRandom(); @@ -140,7 +142,7 @@ struct kstarqa { rEventSelection.add("hmult", "Multiplicity percentile", kTH1F, {{binsMultPlot}}); // for primary tracks - if (QAbefore && QAafter) { + if (cQAbefore && cQAafter) { histos.add("hNsigmaTPC_before", "NsigmaKaon TPC distribution before", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); histos.add("hNsigmaTOF_before", "NsigmaKaon TOF distribution before", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); histos.add("dE_by_dx_TPC", "dE/dx signal in the TPC as a function of pT", kTH2F, {axisPtfordEbydx, axisdEdx}); @@ -176,7 +178,7 @@ struct kstarqa { histos.add("h1KSRecsplit", "KS meson Rec split", kTH1F, {{100, 0.0f, 10.0f}}); // Multplicity distribution - if (QAevents) { + if (cQAevents) { histos.add("multdist_FT0M", "FT0M Multiplicity distribution", kTH1F, {axisMultdist}); histos.add("multdist_FT0A", "FT0A Multiplicity distribution", kTH1F, {axisMultdist}); histos.add("multdist_FT0C", "FT0C Multiplicity distribution", kTH1F, {axisMultdist}); @@ -186,11 +188,9 @@ struct kstarqa { } } - double massPi = TDatabasePDG::Instance()->GetParticle(kPiPlus)->Mass(); // FIXME: Get from the common header + // double massPi = TDatabasePDG::Instance()->GetParticle(kPiPlus)->Mass(); // FIXME: Get from the common header + double massPi = o2::constants::physics::MassPiPlus; double massKa = o2::constants::physics::MassKPlus; - ROOT::Math::PtEtaPhiMVector CKSVector; - ROOT::Math::PtEtaPhiMVector CKSVectorRot1; - ROOT::Math::PtEtaPhiMVector CKSVectorRot2; template bool selectionTrack(const T& candidate) @@ -284,7 +284,7 @@ struct kstarqa { } template - bool MIDselectionPID(const T& candidate, int PID) + bool cMIDselectionPID(const T& candidate, int PID) { if (PID == 0) { if (onlyTOF) { @@ -363,8 +363,8 @@ struct kstarqa { return false; } - array pvec0; - array pvec1; + std::array pvec0; + std::array pvec1; // Defining filters for events (event selection) // Processed events will be already fulfilling the event selection @@ -373,7 +373,7 @@ struct kstarqa { Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT); - Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); + Filter fDCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); using EventCandidates = soa::Filtered>; using TrackCandidates = soa::Filtered>; @@ -384,23 +384,23 @@ struct kstarqa { template void fillInvMass(const T1& track1, const T2& track2, const T3& lv2, const T4& lv3, float multiplicity, bool isMix) { - ROOT::Math::PxPyPzMVector daughter1, daughter2, daughter_selected; + ROOT::Math::PxPyPzMVector daughter1, daughter2, daughterSelected; daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); // Kaon daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); // Pion - daughter_selected = (boost_daugter1) ? daughter1 : daughter2; - auto selected_dau_mass = (boost_daugter1) ? massKa : massPi; + daughterSelected = (boostDaugter1) ? daughter1 : daughter2; + auto selectedDauMass = (boostDaugter1) ? massKa : massPi; TLorentzVector lv4, lv5; // polarization calculations - ROOT::Math::PxPyPzMVector fourVecDau1 = ROOT::Math::PxPyPzMVector(daughter_selected.Px(), daughter_selected.Py(), daughter_selected.Pz(), selected_dau_mass); // Kaon or Pion + ROOT::Math::PxPyPzMVector fourVecDau1 = ROOT::Math::PxPyPzMVector(daughterSelected.Px(), daughterSelected.Py(), daughterSelected.Pz(), selectedDauMass); // Kaon or Pion ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau1); // boost the frame of daughter same as mother ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - if (TMath::Abs(lv3.Rapidity() < 0.5)) { + if (std::abs(lv3.Rapidity()) < 0.5) { if (activateTHnSparseCosThStarHelicity) { ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); @@ -409,11 +409,11 @@ struct kstarqa { if (!isMix) { histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(TMath::Pi() - TMath::Pi() / rotational_cut, TMath::Pi() + TMath::Pi() / rotational_cut); + for (int i = 0; i < cRotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; - if (CalcRotational) + if (calcRotational) histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarHelicity); } } else { @@ -421,7 +421,7 @@ struct kstarqa { } } else { if (!isMix) { - if (CalcLikeSign) + if (calcLikeSign) histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity); } } @@ -433,11 +433,11 @@ struct kstarqa { if (track1.sign() * track2.sign() < 0) { if (!isMix) { histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(0, TMath::Pi()); + for (int i = 0; i < cRotations; i++) { + float theta2 = rn->Uniform(0, o2::constants::math::PI); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; - if (CalcRotational) + if (calcRotational) histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarProduction); } } else { @@ -445,7 +445,7 @@ struct kstarqa { } } else { if (!isMix) { - if (CalcLikeSign) + if (calcLikeSign) histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction); } } @@ -456,18 +456,18 @@ struct kstarqa { if (track1.sign() * track2.sign() < 0) { if (!isMix) { histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(0, TMath::Pi()); + for (int i = 0; i < cRotations; i++) { + float theta2 = rn->Uniform(0, o2::constants::math::PI); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; - if (CalcRotational) + if (calcRotational) histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarBeam); } } else { histos.fill(HIST("h3KstarInvMassMixed"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); } } else { - if (CalcLikeSign) + if (calcLikeSign) histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); } } else if (activateTHnSparseCosThStarRandom) { @@ -480,11 +480,11 @@ struct kstarqa { if (track1.sign() * track2.sign() < 0) { if (!isMix) { histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(0, TMath::Pi()); + for (int i = 0; i < cRotations; i++) { + float theta2 = rn->Uniform(0, o2::constants::math::PI); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; - if (CalcRotational) + if (calcRotational) histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarRandom); } } else { @@ -492,7 +492,7 @@ struct kstarqa { } } else { if (!isMix) { - if (CalcLikeSign) + if (calcLikeSign) histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom); } } @@ -505,7 +505,7 @@ struct kstarqa { { histos.fill(HIST("events_check_data"), 0.5); - if (TVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { + if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { return; } histos.fill(HIST("events_check_data"), 1.5); @@ -525,7 +525,7 @@ struct kstarqa { multiplicity = (cfgFT0M) ? collision.centFT0M() : collision.centFT0C(); // Fill the event counter - if (QAevents) { + if (cQAevents) { rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); rEventSelection.fill(HIST("hmult"), multiplicity); histos.fill(HIST("multdist_FT0M"), collision.multFT0M()); @@ -534,8 +534,8 @@ struct kstarqa { // histos.fill(HIST("hNcontributor"), collision.numContrib()); } - for (auto& [track1, track2] : combinations(CombinationsFullIndexPolicy(tracks, tracks))) { - if (QAbefore) { + for (const auto& [track1, track2] : combinations(CombinationsFullIndexPolicy(tracks, tracks))) { + if (cQAbefore) { histos.fill(HIST("hNsigmaTPC_before"), track1.pt(), track1.tpcNSigmaKa()); histos.fill(HIST("hNsigmaTOF_before"), track1.pt(), track1.tofNSigmaKa()); histos.fill(HIST("hCRFC_before"), track1.tpcCrossedRowsOverFindableCls()); @@ -551,7 +551,7 @@ struct kstarqa { continue; } histos.fill(HIST("events_check_data"), 5.5); - if (QAevents) { + if (cQAevents) { histos.fill(HIST("hDcaxy"), track1.dcaXY()); histos.fill(HIST("hDcaz"), track1.dcaZ()); } @@ -564,18 +564,18 @@ struct kstarqa { histos.fill(HIST("events_check_data"), 6.5); - if (MID) { - if (MIDselectionPID(track1, 0)) // Kaon misidentified as pion + if (cMID) { + if (cMIDselectionPID(track1, 0)) // Kaon misidentified as pion continue; - if (MIDselectionPID(track1, 2)) // Kaon misidentified as proton + if (cMIDselectionPID(track1, 2)) // Kaon misidentified as proton continue; - if (MIDselectionPID(track2, 1)) // Pion misidentified as kaon + if (cMIDselectionPID(track2, 1)) // Pion misidentified as kaon continue; } histos.fill(HIST("events_check_data"), 7.5); - if (QAafter) { + if (cQAafter) { histos.fill(HIST("hEta_after"), track1.eta()); histos.fill(HIST("hCRFC_after"), track1.tpcCrossedRowsOverFindableCls()); // histos.fill(HIST("hNsigmaKaonTPC_after"), track1.pt(), track1.tpcNSigmaKa()); @@ -598,7 +598,7 @@ struct kstarqa { } } - PROCESS_SWITCH(kstarqa, processSE, "Process Same event", true); + PROCESS_SWITCH(Kstarqa, processSE, "Process Same event", true); ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for ME mixing"}; ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {10, 0, 100}, "multiplicity percentile for ME mixing"}; @@ -617,7 +617,7 @@ struct kstarqa { void processME(EventCandidates const&, TrackCandidates const&) { if (cfgFT0M) { - for (auto& [c1, tracks1, c2, tracks2] : pair1) { + for (const auto& [c1, tracks1, c2, tracks2] : pair1) { if (!c1.sel8()) { continue; @@ -630,13 +630,13 @@ struct kstarqa { continue; } - if (TVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { + if (cTVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { return; } auto multiplicity = c1.centFT0M(); - for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (!selectionTrack(t1)) // Kaon continue; @@ -646,30 +646,30 @@ struct kstarqa { continue; if (!selectionPID(t2, 0)) // Pion continue; - if (MID) { - if (MIDselectionPID(t1, 0)) // misidentified as pion + if (cMID) { + if (cMIDselectionPID(t1, 0)) // misidentified as pion continue; - if (MIDselectionPID(t1, 2)) // misidentified as proton + if (cMIDselectionPID(t1, 2)) // misidentified as proton continue; - if (MIDselectionPID(t2, 1)) // misidentified as kaon + if (cMIDselectionPID(t2, 1)) // misidentified as kaon continue; } - TLorentzVector KAON; - KAON.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); - TLorentzVector PION; - PION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); + TLorentzVector vKAON; + vKAON.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); + TLorentzVector vPION; + vPION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); - TLorentzVector Kstar = KAON + PION; + TLorentzVector kstar = vKAON + vPION; bool isMix = true; - if (TMath::Abs(Kstar.Rapidity()) < 0.5) { - fillInvMass(t1, t2, PION, Kstar, multiplicity, isMix); + if (std::abs(kstar.Rapidity()) < 0.5) { + fillInvMass(t1, t2, vPION, kstar, multiplicity, isMix); } } } } else { - for (auto& [c1, tracks1, c2, tracks2] : pair2) { + for (const auto& [c1, tracks1, c2, tracks2] : pair2) { if (!c1.sel8()) { continue; @@ -682,13 +682,13 @@ struct kstarqa { continue; } - if (TVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { + if (cTVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { return; } auto multiplicity = c1.centFT0C(); - for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (!selectionTrack(t1)) // Kaon continue; @@ -698,51 +698,51 @@ struct kstarqa { continue; if (!selectionPID(t2, 0)) // Pion continue; - if (MID) { - if (MIDselectionPID(t1, 0)) // misidentified as pion + if (cMID) { + if (cMIDselectionPID(t1, 0)) // misidentified as pion continue; - if (MIDselectionPID(t1, 2)) // misidentified as proton + if (cMIDselectionPID(t1, 2)) // misidentified as proton continue; - if (MIDselectionPID(t2, 1)) // misidentified as kaon + if (cMIDselectionPID(t2, 1)) // misidentified as kaon continue; } - TLorentzVector KAON; - KAON.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); - TLorentzVector PION; - PION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); + TLorentzVector vKAON; + vKAON.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); + TLorentzVector vPION; + vPION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); - TLorentzVector Kstar = KAON + PION; + TLorentzVector kstar = vKAON + vPION; bool isMix = true; - if (TMath::Abs(Kstar.Rapidity()) < 0.5) { - fillInvMass(t1, t2, PION, Kstar, multiplicity, isMix); + if (std::abs(kstar.Rapidity()) < 0.5) { + fillInvMass(t1, t2, vPION, kstar, multiplicity, isMix); } } } } } - PROCESS_SWITCH(kstarqa, processME, "Process Mixed event", true); + PROCESS_SWITCH(Kstarqa, processME, "Process Mixed event", true); - void processGen(aod::McCollision const& mcCollision, aod::McParticles& mcParticles, const soa::SmallGroups& collisions) + void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) { histos.fill(HIST("events_check"), 0.5); if (std::abs(mcCollision.posZ()) < cutzvertex) { histos.fill(HIST("events_check"), 1.5); } - int Nchinel = 0; - for (auto& mcParticle : mcParticles) { + int nChInel = 0; + for (const auto& mcParticle : mcParticles) { auto pdgcode = std::abs(mcParticle.pdgCode()); if (mcParticle.isPhysicalPrimary() && (pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == 11 || pdgcode == 13)) { if (std::abs(mcParticle.eta()) < 1.0) { - Nchinel = Nchinel + 1; + nChInel = nChInel + 1; } } } - if (Nchinel > 0 && std::abs(mcCollision.posZ()) < cutzvertex) + if (nChInel > 0 && std::abs(mcCollision.posZ()) < cutzvertex) histos.fill(HIST("events_check"), 2.5); - std::vector SelectedEvents(collisions.size()); + std::vector selectedEvents(collisions.size()); int nevts = 0; for (const auto& collision : collisions) { // if (!collision.sel8() || std::abs(collision.mcCollision().posZ()) > cutzvertex) { @@ -753,26 +753,26 @@ struct kstarqa { if (timFrameEvsel && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { continue; } - if (TVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { + if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { continue; } - SelectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); + selectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); } - SelectedEvents.resize(nevts); + selectedEvents.resize(nevts); histos.fill(HIST("events_check"), 3.5); - const auto evtReconstructedAndSelected = std::find(SelectedEvents.begin(), SelectedEvents.end(), mcCollision.globalIndex()) != SelectedEvents.end(); + const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end(); - if (!AllGenCollisions && !evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection + if (!cAllGenCollisions && !evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection return; } histos.fill(HIST("events_check"), 4.5); - for (auto& mcParticle : mcParticles) { + for (const auto& mcParticle : mcParticles) { if (std::abs(mcParticle.y()) >= 0.5) { continue; } histos.fill(HIST("events_check"), 5.5); - if (abs(mcParticle.pdgCode()) != 313) { + if (std::abs(mcParticle.pdgCode()) != 313) { continue; } histos.fill(HIST("events_check"), 6.5); @@ -783,16 +783,16 @@ struct kstarqa { histos.fill(HIST("events_check"), 7.5); auto passkaon = false; auto passpion = false; - for (auto kCurrentDaughter : kDaughters) { + for (const auto& kCurrentDaughter : kDaughters) { if (!kCurrentDaughter.isPhysicalPrimary()) { continue; } histos.fill(HIST("events_check"), 8.5); - if (abs(kCurrentDaughter.pdgCode()) == 321) { + if (std::abs(kCurrentDaughter.pdgCode()) == 321) { // if (kCurrentDaughter.pdgCode() == +321) { passkaon = true; histos.fill(HIST("events_check"), 9.5); - } else if (abs(kCurrentDaughter.pdgCode()) == 211) { + } else if (std::abs(kCurrentDaughter.pdgCode()) == 211) { //} else if (kCurrentDaughter.pdgCode() == -321) { passpion = true; // histos.fill(HIST("events_check"), 10.5); @@ -806,7 +806,7 @@ struct kstarqa { } } } - PROCESS_SWITCH(kstarqa, processGen, "Process Generated", false); + PROCESS_SWITCH(Kstarqa, processGen, "Process Generated", false); void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/) { @@ -828,13 +828,13 @@ struct kstarqa { return; } histos.fill(HIST("events_checkrec"), 3.5); - if (TVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { + if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { return; } histos.fill(HIST("events_checkrec"), 4.5); auto oldindex = -999; - for (auto track1 : tracks) { + for (const auto& track1 : tracks) { if (!selectionTrack(track1)) { continue; } @@ -844,7 +844,7 @@ struct kstarqa { } histos.fill(HIST("events_checkrec"), 6.5); auto track1ID = track1.index(); - for (auto track2 : tracks) { + for (const auto& track2 : tracks) { if (!track2.has_mcParticle()) { continue; } @@ -886,8 +886,8 @@ struct kstarqa { } // LOG(info) << "trackpdgs are:"<()) { - for (auto& mothertrack2 : mctrack2.mothers_as()) { + for (const auto& mothertrack1 : mctrack1.mothers_as()) { + for (const auto& mothertrack2 : mctrack2.mothers_as()) { if (mothertrack1.pdgCode() != mothertrack2.pdgCode()) { continue; } @@ -913,13 +913,13 @@ struct kstarqa { continue; } oldindex = mothertrack1.globalIndex(); - pvec0 = array{track1.px(), track1.py(), track1.pz()}; - pvec1 = array{track2.px(), track2.py(), track2.pz()}; - auto arrMomrec = array{pvec0, pvec1}; + pvec0 = std::array{track1.px(), track1.py(), track1.pz()}; + pvec1 = std::array{track2.px(), track2.py(), track2.pz()}; + auto arrMomrec = std::array{pvec0, pvec1}; auto motherP = mothertrack1.p(); auto motherE = mothertrack1.e(); auto genMass = std::sqrt(motherE * motherE - motherP * motherP); - auto recMass = RecoDecay::m(arrMomrec, array{massKa, massPi}); + auto recMass = RecoDecay::m(arrMomrec, std::array{massKa, massPi}); // auto recpt = TMath::Sqrt((track1.px() + track2.px()) * (track1.px() + track2.px()) + (track1.py() + track2.py()) * (track1.py() + track2.py())); //// Resonance reconstruction lDecayDaughter1.SetXYZM(track1.px(), track1.py(), track1.pz(), massKa); @@ -935,10 +935,10 @@ struct kstarqa { } } } - PROCESS_SWITCH(kstarqa, processRec, "Process Reconstructed", false); + PROCESS_SWITCH(Kstarqa, processRec, "Process Reconstructed", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; }