|
19 | 19 |
|
20 | 20 | #include "tpcSkimsTableCreator.h" |
21 | 21 |
|
| 22 | +#include "utilsTpcSkimsTableCreator.h" |
| 23 | + |
22 | 24 | #include "PWGDQ/DataModel/ReducedInfoTables.h" |
23 | 25 | #include "PWGLF/DataModel/LFStrangenessPIDTables.h" |
24 | 26 | #include "PWGLF/DataModel/LFStrangenessTables.h" |
@@ -54,6 +56,7 @@ using namespace o2::framework; |
54 | 56 | using namespace o2::framework::expressions; |
55 | 57 | using namespace o2::track; |
56 | 58 | using namespace o2::dataformats; |
| 59 | +using namespace o2::dpg_tpcskimstablecreator; |
57 | 60 |
|
58 | 61 | struct TreeWriterTpcV0 { |
59 | 62 |
|
@@ -126,21 +129,6 @@ struct TreeWriterTpcV0 { |
126 | 129 | DaughterProton |
127 | 130 | }; |
128 | 131 |
|
129 | | - enum { |
130 | | - TrackSelectionNoCut = 0, |
131 | | - TrackSelectionGlobalTrack, |
132 | | - TrackSelectionTrackWoPtEta, |
133 | | - TrackSelectionGlobalTrackWoDCA, |
134 | | - TrackSelectionQualityTracks, |
135 | | - TrackSelectionInAcceptanceTracks |
136 | | - }; |
137 | | - |
138 | | - enum { |
139 | | - EventSelectionNo = 0, |
140 | | - EventSelectionRun2, |
141 | | - EventSelectionRun3 |
142 | | - }; |
143 | | - |
144 | 132 | Filter trackFilter = (trackSelection.node() == static_cast<int>(TrackSelectionNoCut)) || |
145 | 133 | ((trackSelection.node() == static_cast<int>(TrackSelectionGlobalTrack)) && requireGlobalTrackInFilter()) || |
146 | 134 | ((trackSelection.node() == static_cast<int>(TrackSelectionTrackWoPtEta)) && requireGlobalTrackWoPtEtaInFilter()) || |
@@ -428,22 +416,6 @@ struct TreeWriterTpcV0 { |
428 | 416 | } |
429 | 417 | }; |
430 | 418 |
|
431 | | - /// Event selection |
432 | | - template <typename CollisionType, typename TrackType> |
433 | | - bool isEventSelected(const CollisionType& collision, const TrackType& /*tracks*/) |
434 | | - { |
435 | | - if (applyEvSel == EventSelectionRun2) { |
436 | | - if (!collision.sel7()) { |
437 | | - return false; |
438 | | - } |
439 | | - } else if (applyEvSel == EventSelectionRun3) { |
440 | | - if (!collision.sel8()) { |
441 | | - return false; |
442 | | - } |
443 | | - } |
444 | | - return true; |
445 | | - }; |
446 | | - |
447 | 419 | void init(o2::framework::InitContext&) |
448 | 420 | { |
449 | 421 | const std::array<bool, 7> doprocess{doprocessStandard, doprocessStandardWithCorrecteddEdx, doprocessWithdEdxTrQA, doprocessWithdEdxTrQAWithCorrecteddEdx, doprocessWithTrQA, doprocessWithTrQAWithCorrecteddEdx, doprocessDummy}; |
@@ -497,7 +469,7 @@ struct TreeWriterTpcV0 { |
497 | 469 | void runStandard(Colls::iterator const& collision, soa::Filtered<TrksType> const& tracks, V0sWithID const& v0s, CascsWithID const& cascs) |
498 | 470 | { |
499 | 471 | /// Check event slection |
500 | | - if (!isEventSelected(collision, tracks)) { |
| 472 | + if (!isEventSelected(collision, applyEvSel)) { |
501 | 473 | return; |
502 | 474 | } |
503 | 475 | const auto& bc = collision.bc_as<aod::BCsWithTimestamps>(); |
@@ -574,7 +546,7 @@ struct TreeWriterTpcV0 { |
574 | 546 | for (const auto& collision : collisions) { |
575 | 547 | /// Check event slection |
576 | 548 | const auto& tracks = myTracks.sliceBy(perCollisionTracksType, collision.globalIndex()); |
577 | | - if (!isEventSelected(collision, tracks)) { |
| 549 | + if (!isEventSelected(collision, applyEvSel)) { |
578 | 550 | continue; |
579 | 551 | } |
580 | 552 | const auto& v0s = myV0s.sliceBy(perCollisionV0s, collision.globalIndex()); |
@@ -757,21 +729,6 @@ struct TreeWriterTPCTOF { |
757 | 729 | Configurable<float> downsamplingTsalisKaons{"downsamplingTsalisKaons", -1., "Downsampling factor to reduce the number of kaons"}; |
758 | 730 | Configurable<float> downsamplingTsalisPions{"downsamplingTsalisPions", -1., "Downsampling factor to reduce the number of pions"}; |
759 | 731 |
|
760 | | - enum { |
761 | | - TrackSelectionNoCut = 0, |
762 | | - TrackSelectionGlobalTrack, |
763 | | - TrackSelectionTrackWoPtEta, |
764 | | - TrackSelectionGlobalTrackWoDCA, |
765 | | - TrackSelectionQualityTracks, |
766 | | - TrackSelectionInAcceptanceTracks |
767 | | - }; |
768 | | - |
769 | | - enum { |
770 | | - EventSelectionNo = 0, |
771 | | - EventSelectionRun2, |
772 | | - EventSelectionRun3 |
773 | | - }; |
774 | | - |
775 | 732 | Filter trackFilter = (trackSelection.node() == static_cast<int>(TrackSelectionNoCut)) || |
776 | 733 | ((trackSelection.node() == static_cast<int>(TrackSelectionGlobalTrack)) && requireGlobalTrackInFilter()) || |
777 | 734 | ((trackSelection.node() == static_cast<int>(TrackSelectionTrackWoPtEta)) && requireGlobalTrackWoPtEtaInFilter()) || |
@@ -955,22 +912,6 @@ struct TreeWriterTPCTOF { |
955 | 912 | } |
956 | 913 | } |
957 | 914 |
|
958 | | - /// Event selection |
959 | | - template <typename CollisionType, typename TrackType> |
960 | | - bool isEventSelected(const CollisionType& collision, const TrackType& /*tracks*/) |
961 | | - { |
962 | | - if (applyEvSel == EventSelectionRun2) { |
963 | | - if (!collision.sel7()) { |
964 | | - return false; |
965 | | - } |
966 | | - } else if (applyEvSel == EventSelectionRun3) { |
967 | | - if (!collision.sel8()) { |
968 | | - return false; |
969 | | - } |
970 | | - } |
971 | | - return true; |
972 | | - }; |
973 | | - |
974 | 915 | void init(o2::framework::InitContext&) |
975 | 916 | { |
976 | 917 | const std::array<bool, 7> doprocess{doprocessStandard, doprocessStandardWithCorrecteddEdx, doprocessWithdEdxTrQA, doprocessWithdEdxTrQAWithCorrecteddEdx, doprocessWithTrQA, doprocessWithTrQAWithCorrecteddEdx, doprocessDummy}; |
@@ -998,7 +939,7 @@ struct TreeWriterTPCTOF { |
998 | 939 | void runStandard(Colls::iterator const& collision, soa::Filtered<TrksType> const& tracks) |
999 | 940 | { |
1000 | 941 | /// Check event selection |
1001 | | - if (!isEventSelected(collision, tracks)) { |
| 942 | + if (!isEventSelected(collision, applyEvSel)) { |
1002 | 943 | return; |
1003 | 944 | } |
1004 | 945 | const auto& bc = collision.bc_as<aod::BCsWithTimestamps>(); |
@@ -1055,7 +996,7 @@ struct TreeWriterTPCTOF { |
1055 | 996 | for (const auto& collision : collisions) { |
1056 | 997 | /// Check event selection |
1057 | 998 | const auto& tracks = myTracks.sliceBy(perCollisionTracksType, collision.globalIndex()); |
1058 | | - if (!isEventSelected(collision, tracks)) { |
| 999 | + if (!isEventSelected(collision, applyEvSel)) { |
1059 | 1000 | continue; |
1060 | 1001 | } |
1061 | 1002 | const auto& tracksWithITSPid = soa::Attach<TrksType, |
|
0 commit comments