|
29 | 29 | #include "PWGCF/Femto/Core/pairProcessHelpers.h" |
30 | 30 | #include "PWGCF/Femto/Core/particleCleaner.h" |
31 | 31 | #include "PWGCF/Femto/Core/trackHistManager.h" |
| 32 | +#include "PWGCF/Femto/Core/twoPhotonResonanceHistManager.h" |
32 | 33 | #include "PWGCF/Femto/Core/twoTrackResonanceHistManager.h" |
33 | 34 | #include "PWGCF/Femto/Core/v0HistManager.h" |
34 | 35 | #include "PWGCF/Femto/DataModel/FemtoTables.h" |
@@ -1384,6 +1385,129 @@ class PairTrackV0Builder |
1384 | 1385 | int mMixingDepth = 5; |
1385 | 1386 | }; |
1386 | 1387 |
|
| 1388 | +// Track-TwoPhotonResonance pair builder. |
| 1389 | +// Note: close pair rejection is a no-op (ClosePairRejectionTrackTwoPhotonResonance) and pair cleaning |
| 1390 | +// reuses the plain TrackTrackPairCleaner (globalIndex-only), since photon daughters are, for |
| 1391 | +// now, not indexed into FTracks: they are TPC-only tracks, so they cannot be confused for a |
| 1392 | +// global track the way two V0 daughters or a track and a V0 daughter can. |
| 1393 | +template <auto& prefixTrack, |
| 1394 | + auto& prefixResonance, |
| 1395 | + auto& prefixDau1, |
| 1396 | + auto& prefixDau2, |
| 1397 | + auto& prefixSe, |
| 1398 | + auto& prefixMe, |
| 1399 | + auto& prefixCprSe, |
| 1400 | + auto& prefixCprMe, |
| 1401 | + modes::TwoPhotonResonance resonanceType> |
| 1402 | +class PairTrackTwoPhotonResonanceBuilder |
| 1403 | +{ |
| 1404 | + public: |
| 1405 | + PairTrackTwoPhotonResonanceBuilder() = default; |
| 1406 | + ~PairTrackTwoPhotonResonanceBuilder() = default; |
| 1407 | + |
| 1408 | + template <modes::Mode modeSe, |
| 1409 | + modes::Mode modeMe, |
| 1410 | + typename T1, |
| 1411 | + typename T2, |
| 1412 | + typename T3, |
| 1413 | + typename T4, |
| 1414 | + typename T5, |
| 1415 | + typename T6, |
| 1416 | + typename T7, |
| 1417 | + typename T8, |
| 1418 | + typename T9, |
| 1419 | + typename T10, |
| 1420 | + typename T11, |
| 1421 | + typename T12, |
| 1422 | + typename T13, |
| 1423 | + typename T14, |
| 1424 | + typename T15> |
| 1425 | + void init(o2::framework::HistogramRegistry* registry, |
| 1426 | + T1 const& confCollisionBinning, |
| 1427 | + T2 const& confTrackSelection, |
| 1428 | + T3 const& confResonanceSelection, |
| 1429 | + T4 const& confCpr, |
| 1430 | + T5 const& confMixing, |
| 1431 | + T6 const& confPairBinning, |
| 1432 | + T7 const& confPairCuts, |
| 1433 | + T8 const& confDauQaBinning, |
| 1434 | + std::map<T9, std::vector<o2::framework::AxisSpec>> const& colHistSpec, |
| 1435 | + std::map<T10, std::vector<o2::framework::AxisSpec>> const& trackHistSpec, |
| 1436 | + std::map<T11, std::vector<o2::framework::AxisSpec>> const& resonanceHistSpec, |
| 1437 | + std::map<T12, std::vector<o2::framework::AxisSpec>> const& dauHistSpec, |
| 1438 | + std::map<T13, std::vector<o2::framework::AxisSpec>> const& pairHistSpec, |
| 1439 | + std::map<T14, std::vector<o2::framework::AxisSpec>> const& cprHistSpec, |
| 1440 | + std::map<T15, std::vector<o2::framework::AxisSpec>> const& pairCleanerHistSpec) |
| 1441 | + { |
| 1442 | + mColHistManager.template init<modeSe>(registry, colHistSpec, confCollisionBinning); |
| 1443 | + |
| 1444 | + mTrackHistManager.template init<modeSe>(registry, trackHistSpec, confTrackSelection); |
| 1445 | + mResonanceHistManager.template init<modeSe>(registry, resonanceHistSpec, dauHistSpec, confDauQaBinning); |
| 1446 | + |
| 1447 | + mPairHistManagerSe.template init<modeSe>(registry, pairHistSpec, confPairBinning, confPairCuts, confMixing); |
| 1448 | + mPairHistManagerSe.setMass(confTrackSelection.pdgCodeAbs.value, confResonanceSelection.pdgCodeAbs.value); |
| 1449 | + mPairHistManagerSe.setCharge(confTrackSelection.chargeAbs.value, 1); |
| 1450 | + mCprSe.init(registry, cprHistSpec, confCpr, confTrackSelection.chargeAbs.value); |
| 1451 | + |
| 1452 | + mPairHistManagerMe.template init<modeMe>(registry, pairHistSpec, confPairBinning, confPairCuts, confMixing); |
| 1453 | + mPairHistManagerMe.setMass(confTrackSelection.pdgCodeAbs.value, confResonanceSelection.pdgCodeAbs.value); |
| 1454 | + mPairHistManagerMe.setCharge(confTrackSelection.chargeAbs.value, 1); |
| 1455 | + mCprMe.init(registry, cprHistSpec, confCpr, confTrackSelection.chargeAbs.value); |
| 1456 | + |
| 1457 | + mPcSe.template init<modeSe>(registry, pairCleanerHistSpec, confPairCuts); |
| 1458 | + mPcMe.template init<modeMe>(registry, pairCleanerHistSpec, confPairCuts); |
| 1459 | + |
| 1460 | + // setup mixing |
| 1461 | + mMixingPolicy = static_cast<pairhistmanager::MixingPolicy>(confMixing.policy.value); |
| 1462 | + mMixingDepth = confMixing.depth.value; |
| 1463 | + } |
| 1464 | + |
| 1465 | + /// \return true if at least one pair passed all pair selections (usable as pair trigger) |
| 1466 | + template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5> |
| 1467 | + bool processSameEvent(T1 const& col, T2& trackPartition, T3& resonancePartition, T4& photonTable, T5& cache) |
| 1468 | + { |
| 1469 | + auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); |
| 1470 | + auto resonanceSlice = resonancePartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); |
| 1471 | + if (trackSlice.size() < nLimitPartitionParticles || resonanceSlice.size() < nLimitPartitionParticles) { |
| 1472 | + return false; |
| 1473 | + } |
| 1474 | + mColHistManager.template fill<mode>(col); |
| 1475 | + mCprSe.setMagField(col.magField()); |
| 1476 | + return pairprocesshelpers::processSameEvent<mode>(trackSlice, resonanceSlice, photonTable, col, mTrackHistManager, mResonanceHistManager, mPairHistManagerSe, mCprSe, mPcSe); |
| 1477 | + } |
| 1478 | + |
| 1479 | + template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> |
| 1480 | + void processMixedEvent(T1 const& cols, T2& trackPartition, T3& resonancePartition, T4& photonTable, T5& cache, T6& binsVtxMult, T7& binsVtxCent, T8& binsVtxMultCent) |
| 1481 | + { |
| 1482 | + switch (mMixingPolicy) { |
| 1483 | + case static_cast<int>(pairhistmanager::kVtxMult): |
| 1484 | + pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, resonancePartition, photonTable, cache, binsVtxMult, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe); |
| 1485 | + break; |
| 1486 | + case static_cast<int>(pairhistmanager::kVtxCent): |
| 1487 | + pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, resonancePartition, photonTable, cache, binsVtxCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe); |
| 1488 | + break; |
| 1489 | + case static_cast<int>(pairhistmanager::kVtxMultCent): |
| 1490 | + pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, resonancePartition, photonTable, cache, binsVtxMultCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe); |
| 1491 | + break; |
| 1492 | + default: |
| 1493 | + LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; |
| 1494 | + } |
| 1495 | + } |
| 1496 | + |
| 1497 | + private: |
| 1498 | + colhistmanager::CollisionHistManager mColHistManager; |
| 1499 | + trackhistmanager::TrackHistManager<prefixTrack> mTrackHistManager; |
| 1500 | + twophotonresonancehistmanager::TwoPhotonResonanceHistManager<prefixResonance, prefixDau1, prefixDau2, resonanceType> mResonanceHistManager; |
| 1501 | + pairhistmanager::PairHistManager<prefixSe, modes::Particle::kTrack, modes::Particle::kTwoPhotonResonance> mPairHistManagerSe; |
| 1502 | + pairhistmanager::PairHistManager<prefixMe, modes::Particle::kTrack, modes::Particle::kTwoPhotonResonance> mPairHistManagerMe; |
| 1503 | + closepairrejection::ClosePairRejectionTrackTwoPhotonResonance<prefixCprSe> mCprSe; |
| 1504 | + closepairrejection::ClosePairRejectionTrackTwoPhotonResonance<prefixCprMe> mCprMe; |
| 1505 | + paircleaner::TrackTrackPairCleaner<paircleaner::PrefixPairCleanerTrackTwoPhotonResonanceSe> mPcSe; |
| 1506 | + paircleaner::TrackTrackPairCleaner<paircleaner::PrefixPairCleanerTrackTwoPhotonResonanceMe> mPcMe; |
| 1507 | + pairhistmanager::MixingPolicy mMixingPolicy = pairhistmanager::MixingPolicy::kVtxMult; |
| 1508 | + int mMixingDepth = 5; |
| 1509 | +}; |
| 1510 | + |
1387 | 1511 | template <auto& prefixTrack, |
1388 | 1512 | auto& prefixResonance, |
1389 | 1513 | auto& prefixPosDau, |
|
0 commit comments