diff --git a/PWGCF/Femto/Core/cascadeBuilder.h b/PWGCF/Femto/Core/cascadeBuilder.h index 2b409b2200e..2a7e7f0180a 100644 --- a/PWGCF/Femto/Core/cascadeBuilder.h +++ b/PWGCF/Femto/Core/cascadeBuilder.h @@ -115,7 +115,6 @@ struct ConfOmegaSelection : o2::framework::ConfigurableGroup { #undef CASCADE_DEFAULT_SELECTION - /// The different selections this task is capable of doing enum CascadeSels { // selections for cascades diff --git a/PWGCF/Femto/Core/cascadeHistManager.h b/PWGCF/Femto/Core/cascadeHistManager.h index 25bfbabc8c4..686a46cd29f 100644 --- a/PWGCF/Femto/Core/cascadeHistManager.h +++ b/PWGCF/Femto/Core/cascadeHistManager.h @@ -170,46 +170,45 @@ constexpr std::array, kCascadeHistLast> HistT {kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}}, }; - // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define CASCADE_HIST_ANALYSIS_MAP(conf) \ - {kPt, {(conf).pt}}, \ - {kEta, {(conf).eta}}, \ - {kPhi, {(conf).phi}}, \ - {kMass, {(conf).mass}}, \ - {kSign, {(conf).sign}}, \ + {kPt, {(conf).pt}}, \ + {kEta, {(conf).eta}}, \ + {kPhi, {(conf).phi}}, \ + {kMass, {(conf).mass}}, \ + {kSign, {(conf).sign}}, \ {kPtVsMass, {(conf).pt, (conf).mass}}, // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define CASCADE_HIST_MC_MAP(conf) \ +#define CASCADE_HIST_MC_MAP(conf) \ {kTruePtVsPt, {(conf).pt, (conf).pt}}, \ {kTrueEtaVsEta, {(conf).eta, (conf).eta}}, \ {kTruePhiVsPhi, {(conf).phi, (conf).phi}}, \ - {kPdg, {(conf).pdgCodes}}, \ - {kPdgMother, {(conf).pdgCodes}}, \ + {kPdg, {(conf).pdgCodes}}, \ + {kPdgMother, {(conf).pdgCodes}}, \ {kPdgPartonicMother, {(conf).pdgCodes}}, // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define CASCADE_HIST_QA_MAP(confAnalysis, confQa) \ - {kCosPa, {(confQa).cosPa}}, \ - {kDecayDauDca, {(confQa).dauDcaAtDecay}}, \ - {kTransRadius, {(confQa).transRadius}}, \ - {kLambdaCosPa, {(confQa).lambdaCosPa}}, \ - {kLambdaDauDca, {(confQa).lambdaDauDca}}, \ - {kLambdaTransRadius, {(confQa).lambdaTransRadius}}, \ - {kLambdaDcaToPv, {(confQa).lambdaDcaToPv}}, \ +#define CASCADE_HIST_QA_MAP(confAnalysis, confQa) \ + {kCosPa, {(confQa).cosPa}}, \ + {kDecayDauDca, {(confQa).dauDcaAtDecay}}, \ + {kTransRadius, {(confQa).transRadius}}, \ + {kLambdaCosPa, {(confQa).lambdaCosPa}}, \ + {kLambdaDauDca, {(confQa).lambdaDauDca}}, \ + {kLambdaTransRadius, {(confQa).lambdaTransRadius}}, \ + {kLambdaDcaToPv, {(confQa).lambdaDcaToPv}}, \ {kPtVsEta, {(confAnalysis).pt, (confAnalysis).eta}}, \ {kPtVsPhi, {(confAnalysis).pt, (confAnalysis).phi}}, \ {kPhiVsEta, {(confAnalysis).phi, (confAnalysis).eta}}, \ {kPtVsCosPa, {(confAnalysis).pt, (confQa).cosPa}}, \ - {kMassXi, {(confQa).massXi}}, \ - {kMassOmega, {(confQa).massOmega}}, \ + {kMassXi, {(confQa).massXi}}, \ + {kMassOmega, {(confQa).massOmega}}, \ {kPtVsMassXi, {(confAnalysis).pt, (confQa).massXi}}, \ {kPtVsMassOmega, {(confAnalysis).pt, (confQa).massOmega}}, \ {kMassXiVsMassOmega, {(confQa).massXi, (confQa).massOmega}}, // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define CASCADE_HIST_MC_QA_MAP(confAnalysis, confQa) \ +#define CASCADE_HIST_MC_QA_MAP(confAnalysis, confQa) \ {kNoMcParticle, {(confAnalysis).pt, (confQa).cosPa}}, \ {kPrimary, {(confAnalysis).pt, (confQa).cosPa}}, \ {kFromWrongCollision, {(confAnalysis).pt, (confQa).cosPa}}, \ @@ -258,7 +257,6 @@ std::map> makeCascadeMcQaHistS #undef CASCADE_HIST_QA_MAP #undef CASCADE_HIST_MC_QA_MAP - constexpr char PrefixXiQa[] = "XiQA/"; constexpr char PrefixXi[] = "Xi/"; constexpr char PrefixOmegaQa[] = "OmegaQa/"; diff --git a/PWGCF/Femto/Core/closePairRejection.h b/PWGCF/Femto/Core/closePairRejection.h index dc855334b79..67facb07423 100644 --- a/PWGCF/Femto/Core/closePairRejection.h +++ b/PWGCF/Femto/Core/closePairRejection.h @@ -38,600 +38,600 @@ #include #include - namespace o2::analysis::femto::closepairrejection +namespace o2::analysis::femto::closepairrejection { - // enum for track histograms - enum CprHist { - // kinemtics - kAverage, - kRadius0, - kRadius1, - kRadius2, - kRadius3, - kRadius4, - kRadius5, - kRadius6, - kRadius7, - kRadius8, - kPhi1VsPhi2, - kEta1VsEta2, - kCprHistogramLast - }; - - // template configurable group for Cpr - template - struct ConfCpr : o2::framework::ConfigurableGroup { - std::string prefix = std::string(Prefix); - o2::framework::Configurable cutAverage{"cutAverage", true, "Apply CPR if the average deta-dphistar is below the configured values"}; - o2::framework::Configurable cutAnyRadius{"cutAnyRadius", false, "Apply CPR if the deta-dphistar is below the configured values at any radius"}; - o2::framework::Configurable plotAllRadii{"plotAllRadii", true, "Plot deta-dphi distribution at all radii"}; - o2::framework::Configurable plotAverage{"plotAverage", true, "Plot average deta dphi distribution"}; - o2::framework::Configurable plotAngularCorrelation{"plotAngularCorrelation", false, "Plot angular correlation of particles (eta1 vs eta2 & phi1 vs phi2"}; - o2::framework::Configurable detaMax{"detaMax", 0.01f, "Maximium deta"}; - o2::framework::Configurable dphistarMax{"dphistarMax", 0.01f, "Maximum dphistar"}; - o2::framework::Configurable detaCenter{"detaCenter", 0.f, "Center of deta cut"}; - o2::framework::Configurable dphistarCenter{"dphistarCenter", 0.f, "Center of dphistar cut"}; - o2::framework::Configurable kinematicMin{"kinematicMin", -1.f, "Minimum kstar/Q3 of pair/triplet for plotting (Set to negative value to turn off the cut)"}; - o2::framework::Configurable kinematicMax{"kinematicMax", -1.f, "Maximum kstar/Q3 of pair/triplet for plotting (Set to negative value to turn off the cut)"}; - o2::framework::ConfigurableAxis binningDeta{"binningDeta", {{250, -0.5, 0.5}}, "deta"}; - o2::framework::ConfigurableAxis binningDphistar{"binningDphistar", {{250, -0.5, 0.5}}, "dphi"}; - o2::framework::ConfigurableAxis binningCorrelationPhi{"binningCorrelationPhi", {{720, 0, o2::constants::math::TwoPI}}, "Phi binning for correlation plot"}; - o2::framework::ConfigurableAxis binningCorrelationEta{"binningCorrelationEta", {{160, -0.8, 0.8}}, "Eta binning for correlation plot"}; - o2::framework::Configurable seed{"seed", -1, "Seed to randomize particle 1 and particle 2. Set to negative value to deactivate. Set to 0 to generate unique seed in time."}; - o2::framework::Configurable magField{"magField", 5, "MC ONLY: In case of pure MC processing (no reconstruction), set magnetic field in kG"}; +// enum for track histograms +enum CprHist { + // kinemtics + kAverage, + kRadius0, + kRadius1, + kRadius2, + kRadius3, + kRadius4, + kRadius5, + kRadius6, + kRadius7, + kRadius8, + kPhi1VsPhi2, + kEta1VsEta2, + kCprHistogramLast +}; + +// template configurable group for Cpr +template +struct ConfCpr : o2::framework::ConfigurableGroup { + std::string prefix = std::string(Prefix); + o2::framework::Configurable cutAverage{"cutAverage", true, "Apply CPR if the average deta-dphistar is below the configured values"}; + o2::framework::Configurable cutAnyRadius{"cutAnyRadius", false, "Apply CPR if the deta-dphistar is below the configured values at any radius"}; + o2::framework::Configurable plotAllRadii{"plotAllRadii", true, "Plot deta-dphi distribution at all radii"}; + o2::framework::Configurable plotAverage{"plotAverage", true, "Plot average deta dphi distribution"}; + o2::framework::Configurable plotAngularCorrelation{"plotAngularCorrelation", false, "Plot angular correlation of particles (eta1 vs eta2 & phi1 vs phi2"}; + o2::framework::Configurable detaMax{"detaMax", 0.01f, "Maximium deta"}; + o2::framework::Configurable dphistarMax{"dphistarMax", 0.01f, "Maximum dphistar"}; + o2::framework::Configurable detaCenter{"detaCenter", 0.f, "Center of deta cut"}; + o2::framework::Configurable dphistarCenter{"dphistarCenter", 0.f, "Center of dphistar cut"}; + o2::framework::Configurable kinematicMin{"kinematicMin", -1.f, "Minimum kstar/Q3 of pair/triplet for plotting (Set to negative value to turn off the cut)"}; + o2::framework::Configurable kinematicMax{"kinematicMax", -1.f, "Maximum kstar/Q3 of pair/triplet for plotting (Set to negative value to turn off the cut)"}; + o2::framework::ConfigurableAxis binningDeta{"binningDeta", {{250, -0.5, 0.5}}, "deta"}; + o2::framework::ConfigurableAxis binningDphistar{"binningDphistar", {{250, -0.5, 0.5}}, "dphi"}; + o2::framework::ConfigurableAxis binningCorrelationPhi{"binningCorrelationPhi", {{720, 0, o2::constants::math::TwoPI}}, "Phi binning for correlation plot"}; + o2::framework::ConfigurableAxis binningCorrelationEta{"binningCorrelationEta", {{160, -0.8, 0.8}}, "Eta binning for correlation plot"}; + o2::framework::Configurable seed{"seed", -1, "Seed to randomize particle 1 and particle 2. Set to negative value to deactivate. Set to 0 to generate unique seed in time."}; + o2::framework::Configurable magField{"magField", 5, "MC ONLY: In case of pure MC processing (no reconstruction), set magnetic field in kG"}; +}; + +constexpr const char PrefixCprTrackTrack[] = "CprTrackTrack"; +constexpr const char PrefixCprTrackV0Daughter[] = "CprTrackV0Daughter"; +constexpr const char PrefixCprTrackResonanceDaughter[] = "CprTrackResonanceDaughter"; +constexpr const char PrefixCprTrackKinkDaughter[] = "CprTrackKinkDaughter"; +constexpr const char PrefixCprV0DaughterV0DaughterPos[] = "CprV0DaughterV0DaughterPos"; +constexpr const char PrefixCprV0DaughterV0DaughterNeg[] = "CprV0DaughterV0DaughterNeg"; +constexpr const char PrefixCprV0DaughterResoDaughterPos[] = "CprV0DaughterResoDaughterPos"; +constexpr const char PrefixCprV0DaughterResoDaughterNeg[] = "CprV0DaughterResoDaughterNeg"; +constexpr const char PrefixCprTrackCascadeBachelor[] = "CprTrackCascadeBachelor"; + +// pairs +using ConfCprTrackTrack = ConfCpr; +using ConfCprTrackV0Daughter = ConfCpr; +using ConfCprTrackResonanceDaughter = ConfCpr; +using ConfCprTrackKinkDaughter = ConfCpr; +using ConfCprV0DaugherV0DaughterPos = ConfCpr; +using ConfCprV0DaugherV0DaughterNeg = ConfCpr; +using ConfCprV0DaughterResoDaughterPos = ConfCpr; +using ConfCprV0DaughterResoDaughterNeg = ConfCpr; +using ConfCprTrackCascadeBachelor = ConfCpr; + +// tpc radii for computing phistar +constexpr int Nradii = 9; +constexpr std::array TpcRadii = {85., 105., 125., 145., 165., 185., 205., 225., 245.}; // in cm + +// directory names +constexpr char PrefixTrackTrackSe[] = "CPR_TrackTrack/SE/"; +constexpr char PrefixTrackTrackMe[] = "CPR_TrackTrack/ME/"; +constexpr char PrefixTrackV0DaughterSe[] = "CPR_TrackV0Dau/SE/"; +constexpr char PrefixTrackV0DaughterMe[] = "CPR_TrackV0Dau/ME/"; +constexpr char PrefixV0V0PosSe[] = "CPR_V0V0_PosDau/SE/"; +constexpr char PrefixV0V0NegSe[] = "CPR_V0V0_NegDau/SE/"; +constexpr char PrefixV0V0PosMe[] = "CPR_V0V0_PosDau/ME/"; +constexpr char PrefixV0V0NegMe[] = "CPR_V0V0_NegDau/ME/"; +constexpr char PrefixV0TwoTrackResonancePosSe[] = "CPR_V0Resonance_PosDau/SE/"; +constexpr char PrefixV0TwoTrackResonanceNegSe[] = "CPR_V0Resonance_NegDau/SE/"; +constexpr char PrefixV0TwoTrackResonancePosMe[] = "CPR_V0Resonance_PosDau/ME/"; +constexpr char PrefixV0TwoTrackResonanceNegMe[] = "CPR_V0Resonance_NegDau/ME/"; +constexpr char PrefixTrackTwoTrackResonanceSe[] = "CPR_TrackResonanceDau/SE/"; +constexpr char PrefixTrackTwoTrackResonanceMe[] = "CPR_TrackResonanceDau/ME/"; +constexpr char PrefixTrackCascadeBachelorSe[] = "CPR_TrackCascadeBachelor/SE/"; +constexpr char PrefixTrackCascadeBachelorMe[] = "CPR_TrackCascadeBachelor/ME/"; +constexpr char PrefixTrackKinkSe[] = "CPR_TrackKink/SE/"; +constexpr char PrefixTrackKinkMe[] = "CPR_TrackKink/ME/"; +constexpr char PrefixMcParticleMcParticleSe[] = "CPR_McParticleMcParticle/SE/"; +constexpr char PrefixMcParticleMcParticleMe[] = "CPR_McParticleMcParticle/ME/"; + +// must be in sync with enum TrackVariables +// the enum gives the correct index in the array +constexpr std::array, kCprHistogramLast> HistTable = { + {{kAverage, o2::framework::HistType::kTH2F, "hAverage", "#Delta #eta vs #Delta #phi* (averaged over all radii); #Delta #eta; #Delta #phi*"}, + {kRadius0, o2::framework::HistType::kTH2F, "hRadius0", "Radius 0: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, + {kRadius1, o2::framework::HistType::kTH2F, "hRadius1", "Radius 1: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, + {kRadius2, o2::framework::HistType::kTH2F, "hRadius2", "Radius 2: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, + {kRadius3, o2::framework::HistType::kTH2F, "hRadius3", "Radius 3: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, + {kRadius4, o2::framework::HistType::kTH2F, "hRadius4", "Radius 4: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, + {kRadius5, o2::framework::HistType::kTH2F, "hRadius5", "Radius 5: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, + {kRadius6, o2::framework::HistType::kTH2F, "hRadius6", "Radius 6: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, + {kRadius7, o2::framework::HistType::kTH2F, "hRadius7", "Radius 7: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, + {kRadius8, o2::framework::HistType::kTH2F, "hRadius8", "Radius 8: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, + {kPhi1VsPhi2, o2::framework::HistType::kTH2F, "hPhi1vsPhi2", "#phi_{1} vs #phi_{2}; #phi_{1}; #phi_{2}"}, + {kEta1VsEta2, o2::framework::HistType::kTH2F, "hEta1VsEta2", "#eta_{1} vs #eta_{2}; #eta_{1}; #eta_{2}"}}}; + +template +auto makeCprHistSpecMap(const T& confCpr) +{ + return std::map>{ + {kAverage, {confCpr.binningDeta, confCpr.binningDphistar}}, + {kRadius0, {confCpr.binningDeta, confCpr.binningDphistar}}, + {kRadius1, {confCpr.binningDeta, confCpr.binningDphistar}}, + {kRadius2, {confCpr.binningDeta, confCpr.binningDphistar}}, + {kRadius3, {confCpr.binningDeta, confCpr.binningDphistar}}, + {kRadius4, {confCpr.binningDeta, confCpr.binningDphistar}}, + {kRadius5, {confCpr.binningDeta, confCpr.binningDphistar}}, + {kRadius6, {confCpr.binningDeta, confCpr.binningDphistar}}, + {kRadius7, {confCpr.binningDeta, confCpr.binningDphistar}}, + {kRadius8, {confCpr.binningDeta, confCpr.binningDphistar}}, + {kPhi1VsPhi2, {confCpr.binningCorrelationPhi, confCpr.binningCorrelationPhi}}, + {kEta1VsEta2, {confCpr.binningCorrelationEta, confCpr.binningCorrelationEta}}, }; +}; - constexpr const char PrefixCprTrackTrack[] = "CprTrackTrack"; - constexpr const char PrefixCprTrackV0Daughter[] = "CprTrackV0Daughter"; - constexpr const char PrefixCprTrackResonanceDaughter[] = "CprTrackResonanceDaughter"; - constexpr const char PrefixCprTrackKinkDaughter[] = "CprTrackKinkDaughter"; - constexpr const char PrefixCprV0DaughterV0DaughterPos[] = "CprV0DaughterV0DaughterPos"; - constexpr const char PrefixCprV0DaughterV0DaughterNeg[] = "CprV0DaughterV0DaughterNeg"; - constexpr const char PrefixCprV0DaughterResoDaughterPos[] = "CprV0DaughterResoDaughterPos"; - constexpr const char PrefixCprV0DaughterResoDaughterNeg[] = "CprV0DaughterResoDaughterNeg"; - constexpr const char PrefixCprTrackCascadeBachelor[] = "CprTrackCascadeBachelor"; - - // pairs - using ConfCprTrackTrack = ConfCpr; - using ConfCprTrackV0Daughter = ConfCpr; - using ConfCprTrackResonanceDaughter = ConfCpr; - using ConfCprTrackKinkDaughter = ConfCpr; - using ConfCprV0DaugherV0DaughterPos = ConfCpr; - using ConfCprV0DaugherV0DaughterNeg = ConfCpr; - using ConfCprV0DaughterResoDaughterPos = ConfCpr; - using ConfCprV0DaughterResoDaughterNeg = ConfCpr; - using ConfCprTrackCascadeBachelor = ConfCpr; - - // tpc radii for computing phistar - constexpr int Nradii = 9; - constexpr std::array TpcRadii = {85., 105., 125., 145., 165., 185., 205., 225., 245.}; // in cm - - // directory names - constexpr char PrefixTrackTrackSe[] = "CPR_TrackTrack/SE/"; - constexpr char PrefixTrackTrackMe[] = "CPR_TrackTrack/ME/"; - constexpr char PrefixTrackV0DaughterSe[] = "CPR_TrackV0Dau/SE/"; - constexpr char PrefixTrackV0DaughterMe[] = "CPR_TrackV0Dau/ME/"; - constexpr char PrefixV0V0PosSe[] = "CPR_V0V0_PosDau/SE/"; - constexpr char PrefixV0V0NegSe[] = "CPR_V0V0_NegDau/SE/"; - constexpr char PrefixV0V0PosMe[] = "CPR_V0V0_PosDau/ME/"; - constexpr char PrefixV0V0NegMe[] = "CPR_V0V0_NegDau/ME/"; - constexpr char PrefixV0TwoTrackResonancePosSe[] = "CPR_V0Resonance_PosDau/SE/"; - constexpr char PrefixV0TwoTrackResonanceNegSe[] = "CPR_V0Resonance_NegDau/SE/"; - constexpr char PrefixV0TwoTrackResonancePosMe[] = "CPR_V0Resonance_PosDau/ME/"; - constexpr char PrefixV0TwoTrackResonanceNegMe[] = "CPR_V0Resonance_NegDau/ME/"; - constexpr char PrefixTrackTwoTrackResonanceSe[] = "CPR_TrackResonanceDau/SE/"; - constexpr char PrefixTrackTwoTrackResonanceMe[] = "CPR_TrackResonanceDau/ME/"; - constexpr char PrefixTrackCascadeBachelorSe[] = "CPR_TrackCascadeBachelor/SE/"; - constexpr char PrefixTrackCascadeBachelorMe[] = "CPR_TrackCascadeBachelor/ME/"; - constexpr char PrefixTrackKinkSe[] = "CPR_TrackKink/SE/"; - constexpr char PrefixTrackKinkMe[] = "CPR_TrackKink/ME/"; - constexpr char PrefixMcParticleMcParticleSe[] = "CPR_McParticleMcParticle/SE/"; - constexpr char PrefixMcParticleMcParticleMe[] = "CPR_McParticleMcParticle/ME/"; - - // must be in sync with enum TrackVariables - // the enum gives the correct index in the array - constexpr std::array, kCprHistogramLast> HistTable = { - {{kAverage, o2::framework::HistType::kTH2F, "hAverage", "#Delta #eta vs #Delta #phi* (averaged over all radii); #Delta #eta; #Delta #phi*"}, - {kRadius0, o2::framework::HistType::kTH2F, "hRadius0", "Radius 0: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, - {kRadius1, o2::framework::HistType::kTH2F, "hRadius1", "Radius 1: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, - {kRadius2, o2::framework::HistType::kTH2F, "hRadius2", "Radius 2: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, - {kRadius3, o2::framework::HistType::kTH2F, "hRadius3", "Radius 3: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, - {kRadius4, o2::framework::HistType::kTH2F, "hRadius4", "Radius 4: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, - {kRadius5, o2::framework::HistType::kTH2F, "hRadius5", "Radius 5: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, - {kRadius6, o2::framework::HistType::kTH2F, "hRadius6", "Radius 6: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, - {kRadius7, o2::framework::HistType::kTH2F, "hRadius7", "Radius 7: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, - {kRadius8, o2::framework::HistType::kTH2F, "hRadius8", "Radius 8: #Delta #eta vs #Delta #phi*; #Delta #eta; #Delta #phi*"}, - {kPhi1VsPhi2, o2::framework::HistType::kTH2F, "hPhi1vsPhi2", "#phi_{1} vs #phi_{2}; #phi_{1}; #phi_{2}"}, - {kEta1VsEta2, o2::framework::HistType::kTH2F, "hEta1VsEta2", "#eta_{1} vs #eta_{2}; #eta_{1}; #eta_{2}"}}}; +template +class CloseTrackRejection +{ + public: + CloseTrackRejection() = default; + ~CloseTrackRejection() = default; template - auto makeCprHistSpecMap(const T& confCpr) + void init(o2::framework::HistogramRegistry* registry, + std::map> const& specs, + T const& confCpr, + int chargeAbsTrack1, + int chargeAbsTrack2) { - return std::map>{ - {kAverage, {confCpr.binningDeta, confCpr.binningDphistar}}, - {kRadius0, {confCpr.binningDeta, confCpr.binningDphistar}}, - {kRadius1, {confCpr.binningDeta, confCpr.binningDphistar}}, - {kRadius2, {confCpr.binningDeta, confCpr.binningDphistar}}, - {kRadius3, {confCpr.binningDeta, confCpr.binningDphistar}}, - {kRadius4, {confCpr.binningDeta, confCpr.binningDphistar}}, - {kRadius5, {confCpr.binningDeta, confCpr.binningDphistar}}, - {kRadius6, {confCpr.binningDeta, confCpr.binningDphistar}}, - {kRadius7, {confCpr.binningDeta, confCpr.binningDphistar}}, - {kRadius8, {confCpr.binningDeta, confCpr.binningDphistar}}, - {kPhi1VsPhi2, {confCpr.binningCorrelationPhi, confCpr.binningCorrelationPhi}}, - {kEta1VsEta2, {confCpr.binningCorrelationEta, confCpr.binningCorrelationEta}}, - }; - }; + mDetaMax = confCpr.detaMax.value; + mDphistarMax = confCpr.dphistarMax.value; - template - class CloseTrackRejection - { - public: - CloseTrackRejection() = default; - ~CloseTrackRejection() = default; - - template - void init(o2::framework::HistogramRegistry* registry, - std::map> const& specs, - T const& confCpr, - int chargeAbsTrack1, - int chargeAbsTrack2) - { - mDetaMax = confCpr.detaMax.value; - mDphistarMax = confCpr.dphistarMax.value; - - // check the limits - if (mDetaMax <= 0 || mDphistarMax <= 0) { - LOG(fatal) << "Limits for Close Pair Rejection are invalid (0 or negative). Breaking..."; - } + // check the limits + if (mDetaMax <= 0 || mDphistarMax <= 0) { + LOG(fatal) << "Limits for Close Pair Rejection are invalid (0 or negative). Breaking..."; + } - mDetaCenter = confCpr.detaCenter.value; - mDphistarCenter = confCpr.dphistarCenter.value; + mDetaCenter = confCpr.detaCenter.value; + mDphistarCenter = confCpr.dphistarCenter.value; - mChargeAbsTrack1 = std::abs(chargeAbsTrack1); - mChargeAbsTrack2 = std::abs(chargeAbsTrack2); + mChargeAbsTrack1 = std::abs(chargeAbsTrack1); + mChargeAbsTrack2 = std::abs(chargeAbsTrack2); - mCutAverage = confCpr.cutAverage.value; - mCutAnyRadius = confCpr.cutAnyRadius.value; + mCutAverage = confCpr.cutAverage.value; + mCutAnyRadius = confCpr.cutAnyRadius.value; - mKinematicMin = confCpr.kinematicMin.value; - mKinematicMax = confCpr.kinematicMax.value; + mKinematicMin = confCpr.kinematicMin.value; + mKinematicMax = confCpr.kinematicMax.value; - mPlotAverage = confCpr.plotAverage.value; - mPlotAllRadii = confCpr.plotAllRadii.value; + mPlotAverage = confCpr.plotAverage.value; + mPlotAllRadii = confCpr.plotAllRadii.value; - mPlotAngularCorrelation = confCpr.plotAngularCorrelation.value; + mPlotAngularCorrelation = confCpr.plotAngularCorrelation.value; - if (confCpr.seed.value >= 0) { - uint64_t randomSeed = 0; - mRandomizeTracks = true; - if (confCpr.seed.value == 0) { - randomSeed = static_cast(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); - } else { - randomSeed = static_cast(confCpr.seed.value); - } - mRng = std::mt19937(randomSeed); + if (confCpr.seed.value >= 0) { + uint64_t randomSeed = 0; + mRandomizeTracks = true; + if (confCpr.seed.value == 0) { + randomSeed = static_cast(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + } else { + randomSeed = static_cast(confCpr.seed.value); } + mRng = std::mt19937(randomSeed); + } - // check if we need to apply any cut a plot is requested - mIsActivated = mCutAverage || mCutAnyRadius || mPlotAverage || mPlotAllRadii; + // check if we need to apply any cut a plot is requested + mIsActivated = mCutAverage || mCutAnyRadius || mPlotAverage || mPlotAllRadii; - mHistogramRegistry = registry; + mHistogramRegistry = registry; - if (mPlotAverage) { - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kAverage, HistTable), getHistDesc(kAverage, HistTable), getHistType(kAverage, HistTable), {specs.at(kAverage)}); - } - if (mPlotAllRadii) { - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius0, HistTable), getHistDesc(kRadius0, HistTable), getHistType(kRadius0, HistTable), {specs.at(kRadius0)}); - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius1, HistTable), getHistDesc(kRadius1, HistTable), getHistType(kRadius1, HistTable), {specs.at(kRadius1)}); - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius2, HistTable), getHistDesc(kRadius2, HistTable), getHistType(kRadius2, HistTable), {specs.at(kRadius2)}); - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius3, HistTable), getHistDesc(kRadius3, HistTable), getHistType(kRadius3, HistTable), {specs.at(kRadius3)}); - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius4, HistTable), getHistDesc(kRadius4, HistTable), getHistType(kRadius4, HistTable), {specs.at(kRadius4)}); - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius5, HistTable), getHistDesc(kRadius5, HistTable), getHistType(kRadius5, HistTable), {specs.at(kRadius5)}); - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius6, HistTable), getHistDesc(kRadius6, HistTable), getHistType(kRadius6, HistTable), {specs.at(kRadius6)}); - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius7, HistTable), getHistDesc(kRadius7, HistTable), getHistType(kRadius7, HistTable), {specs.at(kRadius7)}); - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius8, HistTable), getHistDesc(kRadius8, HistTable), getHistType(kRadius8, HistTable), {specs.at(kRadius8)}); - } + if (mPlotAverage) { + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kAverage, HistTable), getHistDesc(kAverage, HistTable), getHistType(kAverage, HistTable), {specs.at(kAverage)}); + } + if (mPlotAllRadii) { + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius0, HistTable), getHistDesc(kRadius0, HistTable), getHistType(kRadius0, HistTable), {specs.at(kRadius0)}); + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius1, HistTable), getHistDesc(kRadius1, HistTable), getHistType(kRadius1, HistTable), {specs.at(kRadius1)}); + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius2, HistTable), getHistDesc(kRadius2, HistTable), getHistType(kRadius2, HistTable), {specs.at(kRadius2)}); + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius3, HistTable), getHistDesc(kRadius3, HistTable), getHistType(kRadius3, HistTable), {specs.at(kRadius3)}); + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius4, HistTable), getHistDesc(kRadius4, HistTable), getHistType(kRadius4, HistTable), {specs.at(kRadius4)}); + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius5, HistTable), getHistDesc(kRadius5, HistTable), getHistType(kRadius5, HistTable), {specs.at(kRadius5)}); + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius6, HistTable), getHistDesc(kRadius6, HistTable), getHistType(kRadius6, HistTable), {specs.at(kRadius6)}); + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius7, HistTable), getHistDesc(kRadius7, HistTable), getHistType(kRadius7, HistTable), {specs.at(kRadius7)}); + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kRadius8, HistTable), getHistDesc(kRadius8, HistTable), getHistType(kRadius8, HistTable), {specs.at(kRadius8)}); + } - if (mPlotAngularCorrelation) { - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kPhi1VsPhi2, HistTable), getHistDesc(kPhi1VsPhi2, HistTable), getHistType(kPhi1VsPhi2, HistTable), {specs.at(kPhi1VsPhi2)}); - mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kEta1VsEta2, HistTable), getHistDesc(kEta1VsEta2, HistTable), getHistType(kEta1VsEta2, HistTable), {specs.at(kEta1VsEta2)}); - } + if (mPlotAngularCorrelation) { + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kPhi1VsPhi2, HistTable), getHistDesc(kPhi1VsPhi2, HistTable), getHistType(kPhi1VsPhi2, HistTable), {specs.at(kPhi1VsPhi2)}); + mHistogramRegistry->add(std::string(prefix) + getHistNameV2(kEta1VsEta2, HistTable), getHistDesc(kEta1VsEta2, HistTable), getHistType(kEta1VsEta2, HistTable), {specs.at(kEta1VsEta2)}); } + } - void setMagField(float magField) { mMagField = magField; } + void setMagField(float magField) { mMagField = magField; } - template - void compute(T1 const& track1, T2 const& track2) - { - if (!mIsActivated) { - return; - } - // reset values - mAverageDphistar = 0.f; - int count = 0; - mDeta = 0.f; - mDphistar.fill(0.f); - mDphistarMask.fill(false); - - bool swapTracks = false; - if (mRandomizeTracks) { - swapTracks = (mSwapDist(mRng) == 1); - } + template + void compute(T1 const& track1, T2 const& track2) + { + if (!mIsActivated) { + return; + } + // reset values + mAverageDphistar = 0.f; + int count = 0; + mDeta = 0.f; + mDphistar.fill(0.f); + mDphistarMask.fill(false); + + bool swapTracks = false; + if (mRandomizeTracks) { + swapTracks = (mSwapDist(mRng) == 1); + } - auto const& t1 = swapTracks ? track2 : track1; - auto const& t2 = swapTracks ? track1 : track2; + auto const& t1 = swapTracks ? track2 : track1; + auto const& t2 = swapTracks ? track1 : track2; - mDeta = t1.eta() - t2.eta(); + mDeta = t1.eta() - t2.eta(); - for (size_t i = 0; i < TpcRadii.size(); i++) { - auto phistar1 = phistar(mMagField, TpcRadii[i], mChargeAbsTrack1 * t1.signedPt(), t1.phi()); - auto phistar2 = phistar(mMagField, TpcRadii[i], mChargeAbsTrack2 * t2.signedPt(), t2.phi()); - if (phistar1 && phistar2) { - mDphistar.at(i) = RecoDecay::constrainAngle(phistar1.value() - phistar2.value(), -o2::constants::math::PI); // constrain angular difference between -pi and pi - mDphistarMask.at(i) = true; - count++; - } - } - // for small momemeta the calculation of phistar might fail, if the particle did not reach one or more of the outer radii - if (count > 0) { - mAverageDphistar = std::accumulate(mDphistar.begin(), mDphistar.end(), 0.f) / count; // only average values if phistar could be computed - } else { - mAverageDphistar = 0.f; // if computation at all radii fail, set it 0 + for (size_t i = 0; i < TpcRadii.size(); i++) { + auto phistar1 = phistar(mMagField, TpcRadii[i], mChargeAbsTrack1 * t1.signedPt(), t1.phi()); + auto phistar2 = phistar(mMagField, TpcRadii[i], mChargeAbsTrack2 * t2.signedPt(), t2.phi()); + if (phistar1 && phistar2) { + mDphistar.at(i) = RecoDecay::constrainAngle(phistar1.value() - phistar2.value(), -o2::constants::math::PI); // constrain angular difference between -pi and pi + mDphistarMask.at(i) = true; + count++; } + } + // for small momemeta the calculation of phistar might fail, if the particle did not reach one or more of the outer radii + if (count > 0) { + mAverageDphistar = std::accumulate(mDphistar.begin(), mDphistar.end(), 0.f) / count; // only average values if phistar could be computed + } else { + mAverageDphistar = 0.f; // if computation at all radii fail, set it 0 + } - if (mPlotAngularCorrelation) { - mPhi1 = t1.phi(); - mPhi2 = t2.phi(); - mEta1 = t1.eta(); - mEta2 = t2.eta(); - } + if (mPlotAngularCorrelation) { + mPhi1 = t1.phi(); + mPhi2 = t2.phi(); + mEta1 = t1.eta(); + mEta2 = t2.eta(); } + } - void fill(float kinematic) - { - if (!mIsActivated) { - return; - } + void fill(float kinematic) + { + if (!mIsActivated) { + return; + } - if (mKinematicMin > 0.f && kinematic < mKinematicMin) { - return; - } + if (mKinematicMin > 0.f && kinematic < mKinematicMin) { + return; + } - if (mKinematicMax > 0.f && kinematic > mKinematicMax) { - return; - } + if (mKinematicMax > 0.f && kinematic > mKinematicMax) { + return; + } - if (mPlotAngularCorrelation) { - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kPhi1VsPhi2, HistTable)), mPhi1, mPhi2); - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kEta1VsEta2, HistTable)), mEta1, mEta2); - } + if (mPlotAngularCorrelation) { + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kPhi1VsPhi2, HistTable)), mPhi1, mPhi2); + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kEta1VsEta2, HistTable)), mEta1, mEta2); + } - // fill average hist - if (mPlotAverage) { - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kAverage, HistTable)), mDeta, mAverageDphistar); - } + // fill average hist + if (mPlotAverage) { + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kAverage, HistTable)), mDeta, mAverageDphistar); + } - // fill radii hists - if (mPlotAllRadii) { - if (mDphistarMask.at(0)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius0, HistTable)), mDeta, mDphistar.at(0)); - } - if (mDphistarMask.at(1)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius1, HistTable)), mDeta, mDphistar.at(1)); - } - if (mDphistarMask.at(2)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius2, HistTable)), mDeta, mDphistar.at(2)); - } - if (mDphistarMask.at(3)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius3, HistTable)), mDeta, mDphistar.at(3)); - } - if (mDphistarMask.at(4)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius4, HistTable)), mDeta, mDphistar.at(4)); - } - if (mDphistarMask.at(5)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius5, HistTable)), mDeta, mDphistar.at(5)); - } - if (mDphistarMask.at(6)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius6, HistTable)), mDeta, mDphistar.at(6)); - } - if (mDphistarMask.at(7)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius7, HistTable)), mDeta, mDphistar.at(7)); - } - if (mDphistarMask.at(8)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius8, HistTable)), mDeta, mDphistar.at(8)); - } + // fill radii hists + if (mPlotAllRadii) { + if (mDphistarMask.at(0)) { + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius0, HistTable)), mDeta, mDphistar.at(0)); + } + if (mDphistarMask.at(1)) { + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius1, HistTable)), mDeta, mDphistar.at(1)); + } + if (mDphistarMask.at(2)) { + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius2, HistTable)), mDeta, mDphistar.at(2)); + } + if (mDphistarMask.at(3)) { + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius3, HistTable)), mDeta, mDphistar.at(3)); + } + if (mDphistarMask.at(4)) { + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius4, HistTable)), mDeta, mDphistar.at(4)); + } + if (mDphistarMask.at(5)) { + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius5, HistTable)), mDeta, mDphistar.at(5)); + } + if (mDphistarMask.at(6)) { + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius6, HistTable)), mDeta, mDphistar.at(6)); + } + if (mDphistarMask.at(7)) { + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius7, HistTable)), mDeta, mDphistar.at(7)); + } + if (mDphistarMask.at(8)) { + mHistogramRegistry->fill(HIST(prefix) + HIST(getHistName(kRadius8, HistTable)), mDeta, mDphistar.at(8)); } } + } - [[nodiscard]] bool isClosePair() const - { - if (!mIsActivated) { - return false; - } - bool isCloseAverage = false; - bool isCloseAnyRadius = false; + [[nodiscard]] bool isClosePair() const + { + if (!mIsActivated) { + return false; + } + bool isCloseAverage = false; + bool isCloseAnyRadius = false; - if (mCutAverage) { - isCloseAverage = std::hypot((mAverageDphistar - mDphistarCenter) / mDphistarMax, (mDeta - mDetaCenter) / mDetaMax) < 1.f; - } + if (mCutAverage) { + isCloseAverage = std::hypot((mAverageDphistar - mDphistarCenter) / mDphistarMax, (mDeta - mDetaCenter) / mDetaMax) < 1.f; + } - if (mCutAnyRadius) { - for (size_t i = 0; i < TpcRadii.size(); i++) { - if (isCloseAnyRadius) { - break; - } - if (mDphistarMask.at(i)) { - isCloseAnyRadius = std::hypot((mDphistar.at(i) - mDphistarCenter) / mDphistarMax, (mDeta - mDetaCenter) / mDetaMax) < 1.f; - } + if (mCutAnyRadius) { + for (size_t i = 0; i < TpcRadii.size(); i++) { + if (isCloseAnyRadius) { + break; + } + if (mDphistarMask.at(i)) { + isCloseAnyRadius = std::hypot((mDphistar.at(i) - mDphistarCenter) / mDphistarMax, (mDeta - mDetaCenter) / mDetaMax) < 1.f; } } - return isCloseAverage || isCloseAnyRadius; } + return isCloseAverage || isCloseAnyRadius; + } - [[nodiscard]] bool isActivated() const { return mIsActivated; } + [[nodiscard]] bool isActivated() const { return mIsActivated; } - private: - std::optional phistar(float magfield, float radius, float signedPt, float phi) - { - double arg = 0.3 * (0.1 * magfield) * (0.01 * radius) / (2. * signedPt); - if (std::fabs(arg) <= 1.) { - double angle = phi - std::asin(arg); - return static_cast(RecoDecay::constrainAngle(angle)); - } - return std::nullopt; + private: + std::optional phistar(float magfield, float radius, float signedPt, float phi) + { + double arg = 0.3 * (0.1 * magfield) * (0.01 * radius) / (2. * signedPt); + if (std::fabs(arg) <= 1.) { + double angle = phi - std::asin(arg); + return static_cast(RecoDecay::constrainAngle(angle)); } + return std::nullopt; + } - o2::framework::HistogramRegistry* mHistogramRegistry = nullptr; - bool mPlotAllRadii = false; - bool mPlotAverage = false; - bool mPlotAngularCorrelation = false; + o2::framework::HistogramRegistry* mHistogramRegistry = nullptr; + bool mPlotAllRadii = false; + bool mPlotAverage = false; + bool mPlotAngularCorrelation = false; - float mKinematicMin = -1.f; - float mKinematicMax = -1.f; + float mKinematicMin = -1.f; + float mKinematicMax = -1.f; - bool mCutAverage = false; - bool mCutAnyRadius = false; + bool mCutAverage = false; + bool mCutAnyRadius = false; - bool mIsActivated = false; + bool mIsActivated = false; - int mChargeAbsTrack1 = 0; - int mChargeAbsTrack2 = 0; - float mMagField = 0.f; - float mDetaMax = 0.f; - float mDphistarMax = 0.f; - float mDetaCenter = 0.f; - float mDphistarCenter = 0.f; + int mChargeAbsTrack1 = 0; + int mChargeAbsTrack2 = 0; + float mMagField = 0.f; + float mDetaMax = 0.f; + float mDphistarMax = 0.f; + float mDetaCenter = 0.f; + float mDphistarCenter = 0.f; - float mAverageDphistar = 0.f; - float mDeta = 0.f; + float mAverageDphistar = 0.f; + float mDeta = 0.f; - float mPhi1 = 0.f; - float mPhi2 = 0.f; - float mEta1 = 0.f; - float mEta2 = 0.f; + float mPhi1 = 0.f; + float mPhi2 = 0.f; + float mEta1 = 0.f; + float mEta2 = 0.f; - std::array mDphistar = {0.f}; - std::array mDphistarMask = {false}; + std::array mDphistar = {0.f}; + std::array mDphistarMask = {false}; - bool mRandomizeTracks = false; - std::mt19937 mRng; - std::uniform_int_distribution mSwapDist{0, 1}; - }; + bool mRandomizeTracks = false; + std::mt19937 mRng; + std::uniform_int_distribution mSwapDist{0, 1}; +}; - template - class ClosePairRejectionTrackTrack +template +class ClosePairRejectionTrackTrack +{ + public: + template + void init(o2::framework::HistogramRegistry* registry, + std::map> const& specs, + T const& confCpr, + int absChargeTrack1, + int absChargeTrack2) { - public: - template - void init(o2::framework::HistogramRegistry* registry, - std::map> const& specs, - T const& confCpr, - int absChargeTrack1, - int absChargeTrack2) - { - mCtr.init(registry, specs, confCpr, absChargeTrack1, absChargeTrack2); - } + mCtr.init(registry, specs, confCpr, absChargeTrack1, absChargeTrack2); + } - void setMagField(float magField) { mCtr.setMagField(magField); } - template - void setPair(T1 const& track1, T2 const& track2, T3 const& /*tracks*/) // pass track table for compatibility with other classes - { - mCtr.compute(track1, track2); - } - [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } - void fill(float kstar) { mCtr.fill(kstar); } + void setMagField(float magField) { mCtr.setMagField(magField); } + template + void setPair(T1 const& track1, T2 const& track2, T3 const& /*tracks*/) // pass track table for compatibility with other classes + { + mCtr.compute(track1, track2); + } + [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } + void fill(float kstar) { mCtr.fill(kstar); } - private: - CloseTrackRejection mCtr; - }; + private: + CloseTrackRejection mCtr; +}; - template - class ClosePairRejectionV0V0 +template +class ClosePairRejectionV0V0 +{ + public: + template + void init(o2::framework::HistogramRegistry* registry, + std::map> const& specsPos, + std::map> const& specsNeg, + T1 const& confCprPos, + T2 const& confCprNeg) { - public: - template - void init(o2::framework::HistogramRegistry* registry, - std::map> const& specsPos, - std::map> const& specsNeg, - T1 const& confCprPos, - T2 const& confCprNeg) - { - mCtrPos.init(registry, specsPos, confCprPos, 1, 1); - mCtrNeg.init(registry, specsNeg, confCprNeg, 1, 1); - } + mCtrPos.init(registry, specsPos, confCprPos, 1, 1); + mCtrNeg.init(registry, specsNeg, confCprNeg, 1, 1); + } - void setMagField(float magField) - { - mCtrPos.setMagField(magField); - mCtrNeg.setMagField(magField); - } + void setMagField(float magField) + { + mCtrPos.setMagField(magField); + mCtrNeg.setMagField(magField); + } - template - void setPair(T1 const& v01, T2 const& v02, T3 const& tracks) - { - auto posDau1 = tracks.rawIteratorAt(v01.posDauId() - tracks.offset()); - auto posDau2 = tracks.rawIteratorAt(v02.posDauId() - tracks.offset()); - mCtrPos.compute(posDau1, posDau2); + template + void setPair(T1 const& v01, T2 const& v02, T3 const& tracks) + { + auto posDau1 = tracks.rawIteratorAt(v01.posDauId() - tracks.offset()); + auto posDau2 = tracks.rawIteratorAt(v02.posDauId() - tracks.offset()); + mCtrPos.compute(posDau1, posDau2); - auto negDau1 = tracks.rawIteratorAt(v01.negDauId() - tracks.offset()); - auto negDau2 = tracks.rawIteratorAt(v02.negDauId() - tracks.offset()); - mCtrNeg.compute(negDau1, negDau2); - } + auto negDau1 = tracks.rawIteratorAt(v01.negDauId() - tracks.offset()); + auto negDau2 = tracks.rawIteratorAt(v02.negDauId() - tracks.offset()); + mCtrNeg.compute(negDau1, negDau2); + } - [[nodiscard]] bool isClosePair() const { return mCtrPos.isClosePair() || mCtrNeg.isClosePair(); } + [[nodiscard]] bool isClosePair() const { return mCtrPos.isClosePair() || mCtrNeg.isClosePair(); } - void fill(float kstar) - { - mCtrPos.fill(kstar); - mCtrNeg.fill(kstar); - } + void fill(float kstar) + { + mCtrPos.fill(kstar); + mCtrNeg.fill(kstar); + } - private: - CloseTrackRejection mCtrPos; - CloseTrackRejection mCtrNeg; - }; + private: + CloseTrackRejection mCtrPos; + CloseTrackRejection mCtrNeg; +}; - template - class ClosePairRejectionTrackV0 // can also be used for any particle type that has pos/neg daughters, like resonances +template +class ClosePairRejectionTrackV0 // can also be used for any particle type that has pos/neg daughters, like resonances +{ + public: + template + void init(o2::framework::HistogramRegistry* registry, + std::map> const& specs, + T const& confCpr, + int absChargeTrack) { - public: - template - void init(o2::framework::HistogramRegistry* registry, - std::map> const& specs, - T const& confCpr, - int absChargeTrack) - { - mCtr.init(registry, specs, confCpr, absChargeTrack, 1); - } + mCtr.init(registry, specs, confCpr, absChargeTrack, 1); + } - void setMagField(float magField) { mCtr.setMagField(magField); } + void setMagField(float magField) { mCtr.setMagField(magField); } - template - void setPair(T1 const& track, T2 const& v0, T3 const& trackTable) - { - if (track.sign() > 0) { - auto posDau = trackTable.rawIteratorAt(v0.posDauId() - trackTable.offset()); - mCtr.compute(track, posDau); - } else { - auto negDau = trackTable.rawIteratorAt(v0.negDauId() - trackTable.offset()); - mCtr.compute(track, negDau); - } + template + void setPair(T1 const& track, T2 const& v0, T3 const& trackTable) + { + if (track.sign() > 0) { + auto posDau = trackTable.rawIteratorAt(v0.posDauId() - trackTable.offset()); + mCtr.compute(track, posDau); + } else { + auto negDau = trackTable.rawIteratorAt(v0.negDauId() - trackTable.offset()); + mCtr.compute(track, negDau); } + } - [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } + [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } - void fill(float kstar) { mCtr.fill(kstar); } + void fill(float kstar) { mCtr.fill(kstar); } - private: - CloseTrackRejection mCtr; - }; + private: + CloseTrackRejection mCtr; +}; - template - class ClosePairRejectionTrackCascade +template +class ClosePairRejectionTrackCascade +{ + public: + template + void init(o2::framework::HistogramRegistry* registry, + std::map> const& specsBachelor, + std::map> const& specsV0Daughter, + T1 const& confCprBachelor, + T2 const& confCprV0Daughter, + int absChargeTrack) { - public: - template - void init(o2::framework::HistogramRegistry* registry, - std::map> const& specsBachelor, - std::map> const& specsV0Daughter, - T1 const& confCprBachelor, - T2 const& confCprV0Daughter, - int absChargeTrack) - { - mCtrBachelor.init(registry, specsBachelor, confCprBachelor, absChargeTrack, 1); - mCtrV0Daughter.init(registry, specsV0Daughter, confCprV0Daughter, absChargeTrack, 1); - } + mCtrBachelor.init(registry, specsBachelor, confCprBachelor, absChargeTrack, 1); + mCtrV0Daughter.init(registry, specsV0Daughter, confCprV0Daughter, absChargeTrack, 1); + } - void setMagField(float magField) - { - mCtrBachelor.setMagField(magField); - mCtrV0Daughter.setMagField(magField); - } - - template - void setPair(T1 const& track, T2 const& cascade, T3 const& trackTable) - { - auto bachelor = trackTable.rawIteratorAt(cascade.bachelorId() - trackTable.offset()); - mCtrBachelor.compute(track, bachelor); + void setMagField(float magField) + { + mCtrBachelor.setMagField(magField); + mCtrV0Daughter.setMagField(magField); + } - if (track.sign() > 0) { - auto posDau = trackTable.rawIteratorAt(cascade.posDauId() - trackTable.offset()); - mCtrV0Daughter.compute(track, posDau); - } else { - auto negDau = trackTable.rawIteratorAt(cascade.negDauId() - trackTable.offset()); - mCtrV0Daughter.compute(track, negDau); - } + template + void setPair(T1 const& track, T2 const& cascade, T3 const& trackTable) + { + auto bachelor = trackTable.rawIteratorAt(cascade.bachelorId() - trackTable.offset()); + mCtrBachelor.compute(track, bachelor); + + if (track.sign() > 0) { + auto posDau = trackTable.rawIteratorAt(cascade.posDauId() - trackTable.offset()); + mCtrV0Daughter.compute(track, posDau); + } else { + auto negDau = trackTable.rawIteratorAt(cascade.negDauId() - trackTable.offset()); + mCtrV0Daughter.compute(track, negDau); } + } - [[nodiscard]] bool isClosePair() const { return mCtrBachelor.isClosePair(); } + [[nodiscard]] bool isClosePair() const { return mCtrBachelor.isClosePair(); } - void fill(float kstar) - { - mCtrBachelor.fill(kstar); - mCtrV0Daughter.fill(kstar); - } + void fill(float kstar) + { + mCtrBachelor.fill(kstar); + mCtrV0Daughter.fill(kstar); + } - private: - CloseTrackRejection mCtrBachelor; - CloseTrackRejection mCtrV0Daughter; - }; + private: + CloseTrackRejection mCtrBachelor; + CloseTrackRejection mCtrV0Daughter; +}; - template - class ClosePairRejectionTrackKink +template +class ClosePairRejectionTrackKink +{ + public: + template + void init(o2::framework::HistogramRegistry* registry, + std::map> const& specs, + T const& confCpr, + int absChargeTrack) { - public: - template - void init(o2::framework::HistogramRegistry* registry, - std::map> const& specs, - T const& confCpr, - int absChargeTrack) - { - mCtr.init(registry, specs, confCpr, absChargeTrack, 1); - } + mCtr.init(registry, specs, confCpr, absChargeTrack, 1); + } - void setMagField(float magField) - { - mCtr.setMagField(magField); - } + void setMagField(float magField) + { + mCtr.setMagField(magField); + } - template - void setPair(T1 const& track, T2 const& kink, T3 const& trackTable) - { - auto daughter = trackTable.rawIteratorAt(kink.chaDauId() - trackTable.offset()); - mCtr.compute(track, daughter); - } + template + void setPair(T1 const& track, T2 const& kink, T3 const& trackTable) + { + auto daughter = trackTable.rawIteratorAt(kink.chaDauId() - trackTable.offset()); + mCtr.compute(track, daughter); + } - [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } - void fill(float kstar) { mCtr.fill(kstar); } + [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } + void fill(float kstar) { mCtr.fill(kstar); } - private: - CloseTrackRejection mCtr; - }; + private: + CloseTrackRejection mCtr; +}; - template - class ClosePairRejectionMcParticleMcParticle +template +class ClosePairRejectionMcParticleMcParticle +{ + public: + template + void init(o2::framework::HistogramRegistry* registry, + std::map> const& specs, + T const& confCpr) { - public: - template - void init(o2::framework::HistogramRegistry* registry, - std::map> const& specs, - T const& confCpr) - { - mCtr.init(registry, specs, confCpr, 1, 1); - mCtr.setMagField(confCpr.magField.value); - } - template - void setPair(T1 const& mcParticle1, T2 const& mcParticle2) - { - mCtr.compute(mcParticle1, mcParticle2); - } - [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } - void fill(float kstar) { mCtr.fill(kstar); } - - private: - CloseTrackRejection mCtr; - }; + mCtr.init(registry, specs, confCpr, 1, 1); + mCtr.setMagField(confCpr.magField.value); + } + template + void setPair(T1 const& mcParticle1, T2 const& mcParticle2) + { + mCtr.compute(mcParticle1, mcParticle2); + } + [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } + void fill(float kstar) { mCtr.fill(kstar); } + + private: + CloseTrackRejection mCtr; +}; }; // namespace o2::analysis::femto::closepairrejection #endif // PWGCF_FEMTO_CORE_CLOSEPAIRREJECTION_H_ diff --git a/PWGCF/Femto/Core/collisionHistManager.h b/PWGCF/Femto/Core/collisionHistManager.h index 3f8194470b0..338da0ac63c 100644 --- a/PWGCF/Femto/Core/collisionHistManager.h +++ b/PWGCF/Femto/Core/collisionHistManager.h @@ -91,18 +91,18 @@ constexpr std::array, kColHistLast> HistTable = { // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define COL_HIST_ANALYSIS_MAP(conf) \ - {kPosZ, {(conf).vtxZ}}, \ - {kMult, {(conf).mult}}, \ - {kCent, {(conf).cent}}, \ + {kPosZ, {(conf).vtxZ}}, \ + {kMult, {(conf).mult}}, \ + {kCent, {(conf).cent}}, \ {kMagField, {(conf).magField}}, // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define COL_HIST_QA_MAP(confAnalysis, confQa) \ - {kPosX, {(confQa).vtxXY}}, \ - {kPosY, {(confQa).vtxXY}}, \ - {kPos, {(confQa).vtx}}, \ - {kSphericity, {(confQa).sphericity}}, \ - {kOccupancy, {(confQa).occupancy}}, \ +#define COL_HIST_QA_MAP(confAnalysis, confQa) \ + {kPosX, {(confQa).vtxXY}}, \ + {kPosY, {(confQa).vtxXY}}, \ + {kPos, {(confQa).vtx}}, \ + {kSphericity, {(confQa).sphericity}}, \ + {kOccupancy, {(confQa).occupancy}}, \ {kPoszVsMult, {(confAnalysis).vtxZ, (confAnalysis).mult}}, \ {kPoszVsCent, {(confAnalysis).vtxZ, (confAnalysis).cent}}, \ {kCentVsMult, {(confAnalysis).cent, (confAnalysis).mult}}, \ @@ -110,10 +110,10 @@ constexpr std::array, kColHistLast> HistTable = { {kCentVsSphericity, {confBinningAnalysis.cent, (confQa).sphericity}}, // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define COL_HIST_MC_MAP(conf) \ - {kTruePosZ, {(conf).vtxZ}}, \ - {kTrueCent, {(conf).cent}}, \ - {kTrueMult, {(conf).mult}}, \ +#define COL_HIST_MC_MAP(conf) \ + {kTruePosZ, {(conf).vtxZ}}, \ + {kTrueCent, {(conf).cent}}, \ + {kTrueMult, {(conf).mult}}, \ {kTruePosZVsPosZ, {(conf).vtxZ, (conf).vtxZ}}, \ {kTrueCentVsCent, {(conf).cent, (conf).cent}}, \ {kTrueMultVsMult, {(conf).mult, (conf).mult}}, diff --git a/PWGCF/Femto/Core/histManager.h b/PWGCF/Femto/Core/histManager.h index a0b5285d684..a0070a08f9f 100644 --- a/PWGCF/Femto/Core/histManager.h +++ b/PWGCF/Femto/Core/histManager.h @@ -37,7 +37,8 @@ struct HistInfo { std::string_view n, std::string_view d) : hist(h), histtype(t), histname(n), histdesc(d) - {} + { + } Hist hist{}; o2::framework::HistType histtype{o2::framework::kUndefinedHist}; diff --git a/PWGCF/Femto/Core/kinkHistManager.h b/PWGCF/Femto/Core/kinkHistManager.h index 6d1cf219f15..1ffe73e272b 100644 --- a/PWGCF/Femto/Core/kinkHistManager.h +++ b/PWGCF/Femto/Core/kinkHistManager.h @@ -190,14 +190,14 @@ constexpr std::array, kKinkHistLast> HistTable = // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define KINK_HIST_QA_MAP(confAnalysis, confQa) \ - {kKinkAngle, {(confQa).kinkAngle}}, \ - {kDcaMothToPV, {(confQa).dcaMothToPV}}, \ - {kDcaDaugToPV, {(confQa).dcaDaugToPV}}, \ - {kDecayVtxX, {(confQa).decayVertex}}, \ - {kDecayVtxY, {(confQa).decayVertex}}, \ - {kDecayVtxZ, {(confQa).decayVertex}}, \ - {kDecayVtx, {(confQa).decayVertex}}, \ - {kTransRadius, {(confQa).transRadius}}, \ + {kKinkAngle, {(confQa).kinkAngle}}, \ + {kDcaMothToPV, {(confQa).dcaMothToPV}}, \ + {kDcaDaugToPV, {(confQa).dcaDaugToPV}}, \ + {kDecayVtxX, {(confQa).decayVertex}}, \ + {kDecayVtxY, {(confQa).decayVertex}}, \ + {kDecayVtxZ, {(confQa).decayVertex}}, \ + {kDecayVtx, {(confQa).decayVertex}}, \ + {kTransRadius, {(confQa).transRadius}}, \ {kPtVsEta, {(confAnalysis).pt, (confAnalysis).eta}}, \ {kPtVsPhi, {(confAnalysis).pt, (confAnalysis).phi}}, \ {kPhiVsEta, {(confAnalysis).phi, (confAnalysis).eta}}, \ diff --git a/PWGCF/Femto/Core/particleCleaner.h b/PWGCF/Femto/Core/particleCleaner.h index e2575afafaf..9974c20cb47 100644 --- a/PWGCF/Femto/Core/particleCleaner.h +++ b/PWGCF/Femto/Core/particleCleaner.h @@ -120,8 +120,8 @@ class ParticleCleaner // since that lookup now goes through the mc particle row. if (!particle.has_fMcParticle()) { return !mRejectParticleWithoutMcParticle && mRequiredPdgCodes.empty() && - !mRejectParticleWithoutMcMother && mRequiredMotherPdgCodes.empty() && - !mRejectParticleWithoutMcPartonicMother && mRequiredPartonicMotherPdgCodes.empty(); + !mRejectParticleWithoutMcMother && mRequiredMotherPdgCodes.empty() && + !mRejectParticleWithoutMcPartonicMother && mRequiredPartonicMotherPdgCodes.empty(); } auto mcParticle = particle.template fMcParticle_as(); diff --git a/PWGCF/Femto/Core/tripletCleaner.h b/PWGCF/Femto/Core/tripletCleaner.h index a786b99303a..c40a0760bbb 100644 --- a/PWGCF/Femto/Core/tripletCleaner.h +++ b/PWGCF/Femto/Core/tripletCleaner.h @@ -60,7 +60,7 @@ class TrackTrackV0TripletCleaner : public paircleaner::BasePairCleaner { public: TrackTrackV0TripletCleaner() = default; - ~TrackTrackV0TripletCleaner() override = default; + ~TrackTrackV0TripletCleaner() override = default; template bool isCleanTriplet(T1 const& track1, T2 const& track2, T3 const& v0, T4 const& trackTable) const diff --git a/PWGCF/Femto/Core/twoTrackResonanceBuilder.h b/PWGCF/Femto/Core/twoTrackResonanceBuilder.h index 2c98e53b926..126f447b7d0 100644 --- a/PWGCF/Femto/Core/twoTrackResonanceBuilder.h +++ b/PWGCF/Femto/Core/twoTrackResonanceBuilder.h @@ -58,16 +58,16 @@ using ConfPhiFilters = ConfTwoTrackResonanceFilters; using ConfKstarFilters = ConfTwoTrackResonanceFilters; // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define TWOTRACKRESONANCE_DEFAULT_SELECTION(defaultPdgCode, defaultMassMin, defaultMassMax) \ - o2::framework::Configurable pdgCodeAbs{"pdgCodeAbs", (defaultPdgCode), "Resonance PDG code. Set sign to minus 1 for antiparticle"}; \ - o2::framework::Configurable ptMin{"ptMin", 0.f, "Minimum pT"}; \ - o2::framework::Configurable ptMax{"ptMax", 6.f, "Maximum pT"}; \ - o2::framework::Configurable etaMin{"etaMin", -0.9f, "Minimum eta"}; \ - o2::framework::Configurable etaMax{"etaMax", 0.9f, "Maximum eta"}; \ - o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum phi"}; \ - o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \ - o2::framework::Configurable massMin{"massMin", (defaultMassMin), "Minimum invariant mass for Resonance"}; \ - o2::framework::Configurable massMax{"massMax", (defaultMassMax), "Maximum invariant mass for Resonance"}; \ +#define TWOTRACKRESONANCE_DEFAULT_SELECTION(defaultPdgCode, defaultMassMin, defaultMassMax) \ + o2::framework::Configurable pdgCodeAbs{"pdgCodeAbs", (defaultPdgCode), "Resonance PDG code. Set sign to minus 1 for antiparticle"}; \ + o2::framework::Configurable ptMin{"ptMin", 0.f, "Minimum pT"}; \ + o2::framework::Configurable ptMax{"ptMax", 6.f, "Maximum pT"}; \ + o2::framework::Configurable etaMin{"etaMin", -0.9f, "Minimum eta"}; \ + o2::framework::Configurable etaMax{"etaMax", 0.9f, "Maximum eta"}; \ + o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum phi"}; \ + o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \ + o2::framework::Configurable massMin{"massMin", (defaultMassMin), "Minimum invariant mass for Resonance"}; \ + o2::framework::Configurable massMax{"massMax", (defaultMassMax), "Maximum invariant mass for Resonance"}; \ o2::framework::Configurable posDauMaskBelowThres{"posDauMaskBelowThres", 0x10u, "Bitmask for positive daughter below threshold"}; \ o2::framework::Configurable posDauMaskAboveThres{"posDauMaskAboveThres", 0x8u, "Bitmask for positive daughter above threshold"}; \ o2::framework::Configurable negDauMaskBelowThres{"negDauMaskBelowThres", 0x2u, "Bitmask for negative daughter below threshold"}; \