|
17 | 17 | #define PWGCF_FEMTO_CORE_PAIRBUILDER_H_ |
18 | 18 |
|
19 | 19 | #include "PWGCF/Femto/Core/cascadeHistManager.h" |
| 20 | +#include "PWGCF/Femto/Core/charmHadronHistManager.h" |
20 | 21 | #include "PWGCF/Femto/Core/closePairRejection.h" |
21 | 22 | #include "PWGCF/Femto/Core/collisionHistManager.h" |
22 | 23 | #include "PWGCF/Femto/Core/kinkHistManager.h" |
@@ -540,6 +541,140 @@ class PairV0V0Builder |
540 | 541 | std::uniform_int_distribution<> mDist; |
541 | 542 | }; |
542 | 543 |
|
| 544 | +template <auto& prefixTrack, |
| 545 | + auto& prefixD0, |
| 546 | + auto& prefixPosDau, |
| 547 | + auto& prefixNegDau, |
| 548 | + auto& prefixSe, |
| 549 | + auto& prefixMe, |
| 550 | + auto& prefixCprSe, |
| 551 | + auto& prefixCprMe, |
| 552 | + modes::CharmHadron charmHadronType> |
| 553 | +class PairTrackD0Builder |
| 554 | +{ |
| 555 | + public: |
| 556 | + PairTrackD0Builder() = default; |
| 557 | + ~PairTrackD0Builder() = default; |
| 558 | + |
| 559 | + template <modes::Mode modeSe, |
| 560 | + modes::Mode modeMe, |
| 561 | + typename T1, |
| 562 | + typename T2, |
| 563 | + typename T3, |
| 564 | + typename T4, |
| 565 | + typename T5, |
| 566 | + typename T6, |
| 567 | + typename T7, |
| 568 | + typename T8, |
| 569 | + typename T9, |
| 570 | + typename T10, |
| 571 | + typename T11, |
| 572 | + typename T12, |
| 573 | + typename T13, |
| 574 | + typename T14, |
| 575 | + typename T15, |
| 576 | + typename T16> |
| 577 | + void init(o2::framework::HistogramRegistry* registry, |
| 578 | + T1 const& confCollisionBinning, |
| 579 | + T2 const& confTrackSelection, |
| 580 | + T3 const& confTrackCleaner, |
| 581 | + T4 const& confD0Selection, |
| 582 | + T5 const& confD0Cleaner, |
| 583 | + T6 const& confCpr, |
| 584 | + T7 const& confMixing, |
| 585 | + T8 const& confPairBinning, |
| 586 | + T9 const& confPairCuts, |
| 587 | + std::map<T10, std::vector<o2::framework::AxisSpec>>& colHistSpec, |
| 588 | + std::map<T11, std::vector<o2::framework::AxisSpec>>& trackHistSpec, |
| 589 | + std::map<T12, std::vector<o2::framework::AxisSpec>>& d0HistSpec, |
| 590 | + std::map<T13, std::vector<o2::framework::AxisSpec>>& posDauHistSpec, |
| 591 | + std::map<T14, std::vector<o2::framework::AxisSpec>>& negDauHistSpec, |
| 592 | + std::map<T15, std::vector<o2::framework::AxisSpec>>& pairHistSpec, |
| 593 | + std::map<T16, std::vector<o2::framework::AxisSpec>>& cprHistSpec) |
| 594 | + { |
| 595 | + mColHistManager.template init<modeSe>(registry, colHistSpec, confCollisionBinning); |
| 596 | + |
| 597 | + mTrackHistManager.template init<modeSe>(registry, trackHistSpec, confTrackSelection); |
| 598 | + mD0HistManager.template init<modeSe>(registry, d0HistSpec, confD0Selection, posDauHistSpec, negDauHistSpec); |
| 599 | + |
| 600 | + mTrackCleaner.init(confTrackCleaner); |
| 601 | + mD0Cleaner.init(confD0Cleaner); |
| 602 | + |
| 603 | + // PDG codes of the D0 prongs depend on the hypothesis (set via confD0Selection.sign): |
| 604 | + // D0 -> pi+ K- => PosDau = pion, NegDau = kaon |
| 605 | + // D0bar -> K+ pi- => PosDau = kaon, NegDau = pion |
| 606 | + int posDauPdg = 0; |
| 607 | + int negDauPdg = 0; |
| 608 | + if (confD0Selection.sign.value > 0) { |
| 609 | + posDauPdg = PDG_t::kPiPlus; |
| 610 | + negDauPdg = PDG_t::kKMinus; |
| 611 | + } else { |
| 612 | + posDauPdg = PDG_t::kKPlus; |
| 613 | + negDauPdg = PDG_t::kPiMinus; |
| 614 | + } |
| 615 | + |
| 616 | + mPairHistManagerSe.template init<modeSe>(registry, pairHistSpec, confPairBinning, confPairCuts, confMixing); |
| 617 | + mPairHistManagerSe.setMass(confTrackSelection.pdgCodeAbs.value, 0, 0, confD0Selection.pdgCodeAbs.value, posDauPdg, negDauPdg); |
| 618 | + mPairHistManagerSe.setCharge(confTrackSelection.chargeAbs.value, 1); |
| 619 | + mCprSe.init(registry, cprHistSpec, confCpr, confTrackSelection.chargeAbs.value); |
| 620 | + |
| 621 | + mPairHistManagerMe.template init<modeMe>(registry, pairHistSpec, confPairBinning, confPairCuts, confMixing); |
| 622 | + mPairHistManagerMe.setMass(confTrackSelection.pdgCodeAbs.value, 0, 0, confD0Selection.pdgCodeAbs.value, posDauPdg, negDauPdg); |
| 623 | + mPairHistManagerMe.setCharge(confTrackSelection.chargeAbs.value, 1); |
| 624 | + mCprMe.init(registry, cprHistSpec, confCpr, confTrackSelection.chargeAbs.value); |
| 625 | + mPc.template init<modeSe>(confPairCuts); |
| 626 | + |
| 627 | + // setup mixing |
| 628 | + mMixingPolicy = static_cast<pairhistmanager::MixingPolicy>(confMixing.policy.value); |
| 629 | + mMixingDepth = confMixing.depth.value; |
| 630 | + } |
| 631 | + |
| 632 | + template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> |
| 633 | + void processSameEvent(T1 const& col, T2& trackTable, T3& trackPartition, T4& /*d0table*/, T5& d0Partition, T6& cache) |
| 634 | + { |
| 635 | + auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); |
| 636 | + auto d0Slice = d0Partition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); |
| 637 | + if (trackSlice.size() < nLimitPartitionParticles || d0Slice.size() < nLimitPartitionParticles) { |
| 638 | + return; |
| 639 | + } |
| 640 | + mColHistManager.template fill<mode>(col); |
| 641 | + mCprSe.setMagField(col.magField()); |
| 642 | + pairprocesshelpers::processSameEvent<mode>(trackSlice, d0Slice, trackTable, col, mTrackHistManager, mD0HistManager, mPairHistManagerSe, mCprSe, mPc); |
| 643 | + } |
| 644 | + |
| 645 | + template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> |
| 646 | + void processMixedEvent(T1 const& cols, T2& trackTable, T3& trackPartition, T4& d0Partition, T5& cache, T6& binsVtxMult, T7& binsVtxCent, T8& binsVtxMultCent) |
| 647 | + { |
| 648 | + switch (mMixingPolicy) { |
| 649 | + case static_cast<int>(pairhistmanager::kVtxMult): |
| 650 | + pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, d0Partition, trackTable, cache, binsVtxMult, mMixingDepth, mPairHistManagerMe, mCprMe, mPc); |
| 651 | + break; |
| 652 | + case static_cast<int>(pairhistmanager::kVtxCent): |
| 653 | + pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, d0Partition, trackTable, cache, binsVtxCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPc); |
| 654 | + break; |
| 655 | + case static_cast<int>(pairhistmanager::kVtxMultCent): |
| 656 | + pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, d0Partition, trackTable, cache, binsVtxMultCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPc); |
| 657 | + break; |
| 658 | + default: |
| 659 | + LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; |
| 660 | + } |
| 661 | + } |
| 662 | + |
| 663 | + private: |
| 664 | + colhistmanager::CollisionHistManager mColHistManager; |
| 665 | + trackhistmanager::TrackHistManager<prefixTrack> mTrackHistManager; |
| 666 | + charmhadronhistmanager::CharmHadronHistManager<prefixD0, prefixPosDau, prefixNegDau, charmHadronType> mD0HistManager; |
| 667 | + particlecleaner::ParticleCleaner mTrackCleaner; |
| 668 | + particlecleaner::ParticleCleaner mD0Cleaner; |
| 669 | + pairhistmanager::PairHistManager<prefixSe, modes::Particle::kTrack, modes::Particle::kV0> mPairHistManagerSe; |
| 670 | + pairhistmanager::PairHistManager<prefixMe, modes::Particle::kTrack, modes::Particle::kV0> mPairHistManagerMe; |
| 671 | + closepairrejection::ClosePairRejectionTrackV0<prefixCprSe> mCprSe; |
| 672 | + closepairrejection::ClosePairRejectionTrackV0<prefixCprMe> mCprMe; |
| 673 | + paircleaner::TrackV0PairCleaner mPc; |
| 674 | + pairhistmanager::MixingPolicy mMixingPolicy = pairhistmanager::MixingPolicy::kVtxMult; |
| 675 | + int mMixingDepth = 5; |
| 676 | +}; |
| 677 | + |
543 | 678 | template <auto& prefixTrack, |
544 | 679 | auto& prefixV0, |
545 | 680 | auto& prefixPosDau, |
|
0 commit comments