1717#define PWGCF_FEMTO_CORE_CLOSEPAIRREJECTION_H_
1818
1919#include " PWGCF/Femto/Core/histManager.h"
20+ #include " PWGCF/Femto/Core/modes.h"
2021
2122#include " Common/Core/RecoDecay.h"
2223
@@ -61,7 +62,8 @@ enum CprHist {
6162
6263// template configurable group for Cpr
6364// DefaultCutAverage: default of cutAverage (e.g. false for pairs of generated particles, where no detector effects are present)
64- template <auto & Prefix, bool DefaultCutAverage = true >
65+ // DefaultKinematicVariable: default of kinematicVariable (e.g. Q3 for triplets, kstar for pairs)
66+ template <auto & Prefix, bool DefaultCutAverage = true , modes::KinematicVariable DefaultKinematicVariable = modes::KinematicVariable::kKstar >
6567struct ConfCpr : o2::framework::ConfigurableGroup {
6668 std::string prefix = std::string(Prefix);
6769 o2::framework::Configurable<bool > cutAverage{" cutAverage" , DefaultCutAverage, " Apply CPR if the average deta-dphistar is below the configured values" };
@@ -71,6 +73,7 @@ struct ConfCpr : o2::framework::ConfigurableGroup {
7173 o2::framework::Configurable<bool > plotAverage{" plotAverage" , true , " Plot average deta dphi distribution" };
7274 o2::framework::Configurable<bool > plotAngularCorrelation{" plotAngularCorrelation" , false , " Plot angular correlation of particles (eta1 vs eta2 & phi1 vs phi2)" };
7375 o2::framework::Configurable<bool > plotKinematic{" plotKinematic" , true , " Plot kinematic (kstar/Q3) distribution of blocked pairs/triplets" };
76+ o2::framework::Configurable<int > kinematicVariable{" kinematicVariable" , static_cast <int >(DefaultKinematicVariable), " Type of kinematic variable (0->kstar, 1->kT, 2->mT, 3->Q3) reported by the kinematic plot" };
7477 o2::framework::Configurable<float > detaMax{" detaMax" , 0 .01f , " Maximium deta" };
7578 o2::framework::Configurable<float > dphistarMax{" dphistarMax" , 0 .01f , " Maximum dphistar" };
7679 o2::framework::Configurable<float > detaCenter{" detaCenter" , 0 .f , " Center of deta cut" };
@@ -241,6 +244,7 @@ class CloseTrackRejection
241244
242245 mPlotAngularCorrelation = confCpr.plotAngularCorrelation .value ;
243246 mPlotKinematic = confCpr.plotKinematic .value ;
247+ mKinematicVariable = static_cast <modes::KinematicVariable>(confCpr.kinematicVariable .value );
244248
245249 if (confCpr.seed .value >= 0 ) {
246250 uint64_t randomSeed = 0 ;
@@ -259,7 +263,8 @@ class CloseTrackRejection
259263 mHistogramRegistry = registry;
260264
261265 if (mPlotKinematic ) {
262- mHistogramRegistry ->add (std::string (prefix) + getHistNameV2 (kKinematic , HistTable), getHistDesc (kKinematic , HistTable), getHistType (kKinematic , HistTable), {specs.at (kKinematic )});
266+ std::string kinematicDesc = histmanager::replaceFirstAxisTitle (getHistDesc (kKinematic , HistTable), modes::kinematicVariableToAxisTitle (mKinematicVariable ));
267+ mHistogramRegistry ->add (std::string (prefix) + getHistNameV2 (kKinematic , HistTable), kinematicDesc.c_str (), getHistType (kKinematic , HistTable), {specs.at (kKinematic )});
263268 }
264269
265270 if (mPlotAverage ) {
@@ -301,9 +306,9 @@ class CloseTrackRejection
301306 bool isClose = mUseEpisoidalCut ? isClosePairEpisoidalCut () : isClosePairRectengularCut ();
302307
303308 if (isClose) {
304- fillBlocked (pairHistManager.getKinematic ());
309+ fillBlocked (pairHistManager.getKinematic (mKinematicVariable ));
305310 } else {
306- fillPassed (pairHistManager.getKinematic ());
311+ fillPassed (pairHistManager.getKinematic (mKinematicVariable ));
307312 }
308313
309314 return isClose;
@@ -493,6 +498,7 @@ class CloseTrackRejection
493498 bool mPlotAverage = false ;
494499 bool mPlotAngularCorrelation = false ;
495500 bool mPlotKinematic = false ;
501+ modes::KinematicVariable mKinematicVariable = modes::KinematicVariable::kKstar ;
496502
497503 float mKinematicMin = -1 .f;
498504 float mKinematicMax = -1 .f;
@@ -531,10 +537,10 @@ template <auto& prefix>
531537class ClosePairRejectionTrackTrack
532538{
533539 public:
534- template <typename T >
540+ template <typename T1 >
535541 void init (o2::framework::HistogramRegistry* registry,
536542 std::map<CprHist, std::vector<o2::framework::AxisSpec>> const & specs,
537- T const & confCpr,
543+ T1 const & confCpr,
538544 int absChargeTrack1,
539545 int absChargeTrack2)
540546 {
@@ -597,10 +603,10 @@ template <auto& prefixTrackV0>
597603class ClosePairRejectionTrackV0 // can also be used for any particle type that has pos/neg daughters, like resonances
598604{
599605 public:
600- template <typename T >
606+ template <typename T1 >
601607 void init (o2::framework::HistogramRegistry* registry,
602608 std::map<CprHist, std::vector<o2::framework::AxisSpec>> const & specs,
603- T const & confCpr,
609+ T1 const & confCpr,
604610 int absChargeTrack)
605611 {
606612 mCtr .init (registry, specs, confCpr, absChargeTrack, 1 );
@@ -719,10 +725,10 @@ template <auto& prefix>
719725class ClosePairRejectionTrackKink
720726{
721727 public:
722- template <typename T >
728+ template <typename T1 >
723729 void init (o2::framework::HistogramRegistry* registry,
724730 std::map<CprHist, std::vector<o2::framework::AxisSpec>> const & specs,
725- T const & confCpr,
731+ T1 const & confCpr,
726732 int absChargeTrack)
727733 {
728734 mCtr .init (registry, specs, confCpr, absChargeTrack, 1 );
@@ -753,10 +759,10 @@ template <auto& prefix>
753759class ClosePairRejectionTrackTwoPhotonResonance
754760{
755761 public:
756- template <typename T >
762+ template <typename T1 >
757763 void init (o2::framework::HistogramRegistry* /* registry*/ ,
758764 std::map<CprHist, std::vector<o2::framework::AxisSpec>> const & /* specs*/ ,
759- T const & /* confCpr*/ ,
765+ T1 const & /* confCpr*/ ,
760766 int /* absChargeTrack*/ )
761767 {
762768 }
@@ -774,10 +780,10 @@ template <auto& prefix>
774780class ClosePairRejectionMcParticleMcParticle
775781{
776782 public:
777- template <typename T >
783+ template <typename T1 >
778784 void init (o2::framework::HistogramRegistry* registry,
779785 std::map<CprHist, std::vector<o2::framework::AxisSpec>> const & specs,
780- T const & confCpr)
786+ T1 const & confCpr)
781787 {
782788 mCtr .init (registry, specs, confCpr, 1 , 1 );
783789 mCtr .setMagField (confCpr.magField .value );
0 commit comments