@@ -71,9 +71,12 @@ using namespace o2::aod::pwgem::photon;
7171using namespace o2 ::aod::pwgem::dilepton::utils::emtrackutil;
7272using namespace o2 ::aod::pwgem::dilepton::utils;
7373
74- using MyCollisions = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec, aod::EMEventsWeight >;
74+ using MyCollisions = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec>;
7575using MyCollision = MyCollisions::iterator;
7676
77+ using MyCollisionsWithJJMC = soa::Join<MyCollisions, aod::EMEventsWeight>;
78+ using MyCollisionWithJJMC = MyCollisionsWithJJMC::iterator;
79+
7780using MyV0Photons = soa::Filtered<soa::Join<aod::V0PhotonsKF, aod::V0KFEMEventIds, aod::V0PhotonsKFPrefilterBitDerived>>;
7881using MyV0Photon = MyV0Photons::iterator;
7982
@@ -142,18 +145,18 @@ struct Pi0EtaToGammaGamma {
142145 Configurable<float > cfg_max_v0radius{" cfg_max_v0radius" , 90.0 , " max v0 radius" };
143146 Configurable<float > cfg_max_alpha_ap{" cfg_max_alpha_ap" , 0.95 , " max alpha for AP cut" };
144147 Configurable<float > cfg_max_qt_ap{" cfg_max_qt_ap" , 0.01 , " max qT for AP cut" };
145- Configurable<float > cfg_min_cospa{" cfg_min_cospa" , 0.997 , " min V0 CosPA" };
146- Configurable<float > cfg_max_pca{" cfg_max_pca" , 3.0 , " max distance btween 2 legs" };
148+ Configurable<float > cfg_min_cospa{" cfg_min_cospa" , 0.999 , " min V0 CosPA" };
149+ Configurable<float > cfg_max_pca{" cfg_max_pca" , 1.5 , " max distance btween 2 legs" };
147150 Configurable<float > cfg_max_chi2kf{" cfg_max_chi2kf" , 1e+10 , " max chi2/ndf with KF" };
148- Configurable<bool > cfg_require_v0_with_correct_xz{" cfg_require_v0_with_correct_xz" , true , " flag to select V0s with correct xz" };
151+ Configurable<bool > cfg_require_v0_with_correct_xz{" cfg_require_v0_with_correct_xz" , false , " flag to select V0s with correct xz" };
149152 Configurable<bool > cfg_reject_v0_on_itsib{" cfg_reject_v0_on_itsib" , true , " flag to reject V0s on ITSib" };
150153 Configurable<bool > cfg_apply_cuts_from_prefilter_derived{" cfg_apply_cuts_from_prefilter_derived" , false , " flag to apply prefilter to V0" };
151154
152- Configurable<int > cfg_min_ncluster_tpc{" cfg_min_ncluster_tpc" , 10 , " min ncluster tpc" };
155+ Configurable<int > cfg_min_ncluster_tpc{" cfg_min_ncluster_tpc" , 0 , " min ncluster tpc" };
153156 Configurable<int > cfg_min_ncrossedrows{" cfg_min_ncrossedrows" , 40 , " min ncrossed rows" };
154157 Configurable<float > cfg_max_frac_shared_clusters_tpc{" cfg_max_frac_shared_clusters_tpc" , 999 .f , " max fraction of shared clusters in TPC" };
155158 Configurable<float > cfg_max_chi2tpc{" cfg_max_chi2tpc" , 4.0 , " max chi2/NclsTPC" };
156- Configurable<float > cfg_max_chi2its{" cfg_max_chi2its" , 5 .0 , " max chi2/NclsITS" };
159+ Configurable<float > cfg_max_chi2its{" cfg_max_chi2its" , 36 .0 , " max chi2/NclsITS" };
157160 Configurable<float > cfg_min_TPCNsigmaEl{" cfg_min_TPCNsigmaEl" , -3.0 , " min. TPC n sigma for electron" };
158161 Configurable<float > cfg_max_TPCNsigmaEl{" cfg_max_TPCNsigmaEl" , +3.0 , " max. TPC n sigma for electron" };
159162 Configurable<bool > cfg_disable_itsonly_track{" cfg_disable_itsonly_track" , false , " flag to disable ITSonly tracks" };
@@ -177,7 +180,7 @@ struct Pi0EtaToGammaGamma {
177180 Configurable<int > cfg_min_ncluster_its{" cfg_min_ncluster_its" , 5 , " min ncluster its" };
178181 Configurable<int > cfg_min_ncrossedrows{" cfg_min_ncrossedrows" , 70 , " min ncrossed rows" };
179182 Configurable<float > cfg_max_chi2tpc{" cfg_max_chi2tpc" , 4.0 , " max chi2/NclsTPC" };
180- Configurable<float > cfg_max_chi2its{" cfg_max_chi2its" , 5 .0 , " max chi2/NclsITS" };
183+ Configurable<float > cfg_max_chi2its{" cfg_max_chi2its" , 36 .0 , " max chi2/NclsITS" };
181184 Configurable<float > cfg_max_dcaxy{" cfg_max_dcaxy" , 0.05 , " max dca XY for single track in cm" };
182185 Configurable<float > cfg_max_dcaz{" cfg_max_dcaz" , 0.05 , " max dca Z for single track in cm" };
183186 Configurable<float > cfg_max_dca3dsigma_track{" cfg_max_dca3dsigma_track" , 1.5 , " max DCA 3D in sigma" };
@@ -548,8 +551,8 @@ struct Pi0EtaToGammaGamma {
548551 Preslice<MyPHOSClusters> perCollision_phos = aod::phoscluster::emeventId;
549552
550553 Preslice<MyPrimaryElectrons> perCollision_electron = aod::emprimaryelectron::emeventId;
551- Partition<MyPrimaryElectrons> positrons = o2::aod::emprimaryelectron::sign > int8_t (0 ) && static_cast<float>( dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast<float>( dileptoncuts.cfg_max_eta_track) && static_cast<float>(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast<float>(dileptoncuts.cfg_max_TPCNsigmaEl) ;
552- Partition<MyPrimaryElectrons> electrons = o2::aod::emprimaryelectron::sign < int8_t (0 ) && static_cast < float >( dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast < float >( dileptoncuts.cfg_max_eta_track) && static_cast < float >(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast < float >(dileptoncuts.cfg_max_TPCNsigmaEl) ;
554+ Partition<MyPrimaryElectrons> positrons = o2::aod::emprimaryelectron::sign > int8_t (0 ) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt&& nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track;
555+ Partition<MyPrimaryElectrons> electrons = o2::aod::emprimaryelectron::sign < int8_t (0 ) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt && nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track;
553556
554557 using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int , int , int , int >, std::pair<int , int >, EMTrack>;
555558 MyEMH* emh1 = nullptr ;
@@ -572,7 +575,12 @@ struct Pi0EtaToGammaGamma {
572575 continue ;
573576 }
574577
575- if (eventcuts.onlyKeepWeightedEvents && std::fabs (collision.weight () - 1 .) < 1E-10 ) {
578+ float weight = 1 .f ;
579+ if constexpr (std::is_same_v<std::decay_t <TCollisions>, FilteredMyCollisionsWithJJMC>) {
580+ weight = collision.weight ();
581+ }
582+
583+ if (eventcuts.onlyKeepWeightedEvents && std::fabs (weight - 1 .f ) < 1E-10 ) {
576584 continue ;
577585 }
578586
@@ -581,13 +589,13 @@ struct Pi0EtaToGammaGamma {
581589 continue ;
582590 }
583591
584- o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0 >(&fRegistry , collision, collision. weight () );
592+ o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0 >(&fRegistry , collision, weight);
585593 if (!fEMEventCut .IsSelected (collision)) {
586594 continue ;
587595 }
588- o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1 >(&fRegistry , collision, collision. weight () );
589- fRegistry .fill (HIST (" Event/before/hCollisionCounter" ), 12.0 , collision. weight () ); // accepted
590- fRegistry .fill (HIST (" Event/after/hCollisionCounter" ), 12.0 , collision. weight () ); // accepted
596+ o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1 >(&fRegistry , collision, weight);
597+ fRegistry .fill (HIST (" Event/before/hCollisionCounter" ), 12.0 , weight); // accepted
598+ fRegistry .fill (HIST (" Event/after/hCollisionCounter" ), 12.0 , weight); // accepted
591599
592600 int zbin = lower_bound (zvtx_bin_edges.begin (), zvtx_bin_edges.end (), collision.posZ ()) - zvtx_bin_edges.begin () - 1 ;
593601 if (zbin < 0 ) {
@@ -655,10 +663,10 @@ struct Pi0EtaToGammaGamma {
655663 }
656664 }
657665
658- fRegistry .fill (HIST (" Pair/same/hs" ), v12.M (), v12.Pt (), collision. weight () );
666+ fRegistry .fill (HIST (" Pair/same/hs" ), v12.M (), v12.Pt (), weight);
659667
660668 if constexpr (pairtype == PairType::kEMCEMC ) {
661- RotationBackground<MyEMCClusters>(v12, v1, v2, photons2_per_collision, g1.globalIndex (), g2.globalIndex (), collision. weight () );
669+ RotationBackground<MyEMCClusters>(v12, v1, v2, photons2_per_collision, g1.globalIndex (), g2.globalIndex (), weight);
662670 }
663671
664672 std::pair<int , int > pair_tmp_id1 = std::make_pair (ndf, g1.globalIndex ());
@@ -712,7 +720,7 @@ struct Pi0EtaToGammaGamma {
712720 continue ;
713721 }
714722
715- fRegistry .fill (HIST (" Pair/same/hs" ), veeg.M (), veeg.Pt (), collision. weight () );
723+ fRegistry .fill (HIST (" Pair/same/hs" ), veeg.M (), veeg.Pt (), weight);
716724
717725 std::pair<int , int > pair_tmp_id1 = std::make_pair (ndf, g1.globalIndex ());
718726 std::tuple<int , int , int , int > tuple_tmp_id2 = std::make_tuple (ndf, collision.globalIndex (), pos2.trackId (), ele2.trackId ());
@@ -742,7 +750,7 @@ struct Pi0EtaToGammaGamma {
742750 continue ;
743751 }
744752
745- fRegistry .fill (HIST (" Pair/same/hs" ), v12.M (), v12.Pt (), collision. weight () );
753+ fRegistry .fill (HIST (" Pair/same/hs" ), v12.M (), v12.Pt (), weight);
746754
747755 std::pair<int , int > pair_tmp_id1 = std::make_pair (ndf, g1.globalIndex ());
748756 std::pair<int , int > pair_tmp_id2 = std::make_pair (ndf, g2.globalIndex ());
@@ -799,7 +807,7 @@ struct Pi0EtaToGammaGamma {
799807 continue ;
800808 }
801809
802- fRegistry .fill (HIST (" Pair/mix/hs" ), v12.M (), v12.Pt (), collision. weight () );
810+ fRegistry .fill (HIST (" Pair/mix/hs" ), v12.M (), v12.Pt (), weight);
803811 }
804812 }
805813 } // end of loop over mixed event pool
@@ -834,7 +842,7 @@ struct Pi0EtaToGammaGamma {
834842 if (std::fabs (v12.Rapidity ()) > maxY) {
835843 continue ;
836844 }
837- fRegistry .fill (HIST (" Pair/mix/hs" ), v12.M (), v12.Pt (), collision. weight () );
845+ fRegistry .fill (HIST (" Pair/mix/hs" ), v12.M (), v12.Pt (), weight);
838846 }
839847 }
840848 } // end of loop over mixed event pool
@@ -867,7 +875,7 @@ struct Pi0EtaToGammaGamma {
867875 if (std::fabs (v12.Rapidity ()) > maxY) {
868876 continue ;
869877 }
870- fRegistry .fill (HIST (" Pair/mix/hs" ), v12.M (), v12.Pt (), collision. weight () );
878+ fRegistry .fill (HIST (" Pair/mix/hs" ), v12.M (), v12.Pt (), weight);
871879 }
872880 }
873881 } // end of loop over mixed event pool
@@ -925,9 +933,46 @@ struct Pi0EtaToGammaGamma {
925933 // }
926934 ndf++;
927935 }
928- PROCESS_SWITCH (Pi0EtaToGammaGamma, processAnalysis, " process pair analysis" , false );
936+ PROCESS_SWITCH (Pi0EtaToGammaGamma, processAnalysis, " process pair analysis" , true );
937+
938+ using FilteredMyCollisionsWithJJMC = soa::Filtered<MyCollisionsWithJJMC>;
939+ void processAnalysisJJMC (FilteredMyCollisionsWithJJMC const & collisions, Types const &... args)
940+ {
941+ // LOGF(info, "ndf = %d", ndf);
942+ if constexpr (pairtype == PairType::kPCMPCM ) {
943+ auto v0photons = std::get<0 >(std::tie (args...));
944+ auto v0legs = std::get<1 >(std::tie (args...));
945+ runPairing (collisions, v0photons, v0photons, v0legs, v0legs, perCollision_pcm, perCollision_pcm, fV0PhotonCut , fV0PhotonCut );
946+ } else if constexpr (pairtype == PairType::kPCMDalitzEE ) {
947+ auto v0photons = std::get<0 >(std::tie (args...));
948+ auto v0legs = std::get<1 >(std::tie (args...));
949+ auto emprimaryelectrons = std::get<2 >(std::tie (args...));
950+ // LOGF(info, "electrons.size() = %d, positrons.size() = %d", electrons.size(), positrons.size());
951+ runPairing (collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut , fDileptonCut );
952+ } else if constexpr (pairtype == PairType::kEMCEMC ) {
953+ auto emcclusters = std::get<0 >(std::tie (args...));
954+ runPairing (collisions, emcclusters, emcclusters, nullptr , nullptr , perCollision_emc, perCollision_emc, fEMCCut , fEMCCut );
955+ } else if constexpr (pairtype == PairType::kPHOSPHOS ) {
956+ auto phosclusters = std::get<0 >(std::tie (args...));
957+ runPairing (collisions, phosclusters, phosclusters, nullptr , nullptr , perCollision_phos, perCollision_phos, fPHOSCut , fPHOSCut );
958+ }
959+ // else if constexpr (pairtype == PairType::kPCMEMC) {
960+ // auto v0photons = std::get<0>(std::tie(args...));
961+ // auto v0legs = std::get<1>(std::tie(args...));
962+ // auto emcclusters = std::get<2>(std::tie(args...));
963+ // auto emcmatchedtracks = std::get<3>(std::tie(args...));
964+ // runPairing(collisions, v0photons, emcclusters, v0legs, nullptr, perCollision_pcm, perCollision_emc, fV0PhotonCut, fEMCCut, emcmatchedtracks, nullptr);
965+ // } else if constexpr (pairtype == PairType::kPCMPHOS) {
966+ // auto v0photons = std::get<0>(std::tie(args...));
967+ // auto v0legs = std::get<1>(std::tie(args...));
968+ // auto phosclusters = std::get<2>(std::tie(args...));
969+ // runPairing(collisions, v0photons, phosclusters, v0legs, nullptr, perCollision_pcm, perCollision_phos, fV0PhotonCut, fPHOSCut, nullptr, nullptr);
970+ // }
971+ ndf++;
972+ }
973+ PROCESS_SWITCH (Pi0EtaToGammaGamma, processAnalysisJJMC, " process pair analysis" , false );
929974
930975 void processDummy (MyCollisions const &) {}
931- PROCESS_SWITCH (Pi0EtaToGammaGamma, processDummy, " Dummy function" , true );
976+ PROCESS_SWITCH (Pi0EtaToGammaGamma, processDummy, " Dummy function" , false );
932977};
933978#endif // PWGEM_PHOTONMESON_CORE_PI0ETATOGAMMAGAMMA_H_
0 commit comments