|
42 | 42 | #include <Framework/AnalysisHelpers.h> |
43 | 43 | #include <Framework/AnalysisTask.h> |
44 | 44 | #include <Framework/Configurable.h> |
| 45 | +#include <Framework/HistogramRegistry.h> |
| 46 | +#include <Framework/HistogramSpec.h> |
45 | 47 | #include <Framework/InitContext.h> |
46 | 48 | #include <Framework/runDataProcessing.h> |
47 | 49 | #include <ReconstructionDataFormats/PID.h> |
@@ -106,12 +108,15 @@ struct TreeWriterTpcV0 { |
106 | 108 | // Configurables for output tables reservation size |
107 | 109 | Configurable<float> reserveV0Ratio{"reserveV0Ratio", 0.06, "Ratio of how many tracks from V0s are expected in the output table to the input V0 table size"}; |
108 | 110 | Configurable<float> reserveCascRatio{"reserveCascRatio", 0.003, "Ratio of how many tracks from cascades are expected in the output table to the input Cascade table size"}; |
| 111 | + Configurable<bool> saveReserveQaHisto{"saveReserveQaHisto", true, "Flag to save the DF-wise ratio of output table size to that of input table"}; |
109 | 112 | // Configurables for run condtion table |
110 | 113 | Configurable<std::string> rctLabel{"rctLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; |
111 | 114 | Configurable<bool> checkZdc{"checkZdc", false, "set ZDC flag for PbPb"}; |
112 | 115 | Configurable<bool> treatLimitedAcceptanceAsBad{"treatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; |
113 | 116 | Configurable<bool> requireGoodRct{"requireGoodRct", false, "require good detector flag in run condtion table"}; |
114 | 117 |
|
| 118 | + HistogramRegistry registry{"registry", {}}; |
| 119 | + |
115 | 120 | // an arbitrary value of N sigma TOF assigned by TOF task to tracks which are not matched to TOF hits |
116 | 121 | constexpr static float NSigmaTofUnmatched{o2::aod::v0data::kNoTOFValue}; |
117 | 122 | const float nSigmaTofUnmatchedEqualityTolerance{std::fabs(NSigmaTofUnmatched) / 1e4f}; |
@@ -185,6 +190,11 @@ struct TreeWriterTpcV0 { |
185 | 190 | ccdb->setFatalWhenNull(false); |
186 | 191 |
|
187 | 192 | rctChecker.init(rctLabel, checkZdc, treatLimitedAcceptanceAsBad); |
| 193 | + |
| 194 | + if (saveReserveQaHisto) { |
| 195 | + registry.add("hV0OutputRatio", "V0 out/in ratio;V0 out/in ratio;Entries", {HistType::kTH1F, {{100, 0, reserveV0Ratio}}}); |
| 196 | + registry.add("hCascOutputRatio", "Casc out/in ratio;Casc out/in ratio;Entries", {HistType::kTH1F, {{100, 0, reserveCascRatio}}}); |
| 197 | + } |
188 | 198 | } |
189 | 199 |
|
190 | 200 | template <bool IsCorrectedDeDx, typename V0Casc, typename T> |
@@ -535,6 +545,11 @@ struct TreeWriterTpcV0 { |
535 | 545 | LOG(info) << "nCascEntries = " << nCascEntries; |
536 | 546 | LOG(info) << "nV0Entries / V0 table size = " << static_cast<double>(nV0Entries) / myV0s.size(); |
537 | 547 | LOG(info) << "nCascEntries / Cascade table size = " << static_cast<double>(nCascEntries) / myCascs.size(); |
| 548 | + |
| 549 | + if (saveReserveQaHisto) { |
| 550 | + registry.fill(HIST("hV0OutputRatio"), static_cast<double>(nV0Entries) / myV0s.size()); |
| 551 | + registry.fill(HIST("hCascOutputRatio"), static_cast<double>(nCascEntries) / myCascs.size()); |
| 552 | + } |
538 | 553 | } /// runV0 |
539 | 554 |
|
540 | 555 | void processStandard(Colls const& collisions, |
@@ -660,12 +675,15 @@ struct TreeWriterTpcTof { |
660 | 675 | Configurable<float> downsamplingTsalisPions{"downsamplingTsalisPions", -1., "Downsampling factor to reduce the number of pions"}; |
661 | 676 | // Configurable for output table reservation size |
662 | 677 | Configurable<float> reserveTrackRatio{"reserveTrackRatio", 0.005, "Ratio of how many tracks are expected in the output table to the input Tracks table size"}; |
| 678 | + Configurable<bool> saveReserveQaHisto{"saveReserveQaHisto", true, "Flag to save the DF-wise ratio of output table size to that of input table"}; |
663 | 679 | // Configurables for run condtion table |
664 | 680 | Configurable<std::string> rctLabel{"rctLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; |
665 | 681 | Configurable<bool> checkZdc{"checkZdc", false, "set ZDC flag for PbPb"}; |
666 | 682 | Configurable<bool> treatLimitedAcceptanceAsBad{"treatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; |
667 | 683 | Configurable<bool> requireGoodRct{"requireGoodRct", false, "require good detector flag in run condtion table"}; |
668 | 684 |
|
| 685 | + HistogramRegistry registry{"registry", {}}; |
| 686 | + |
669 | 687 | struct TofTrack { |
670 | 688 | bool isApplyHardCutOnly; |
671 | 689 | double maxMomHardCutOnly; |
@@ -720,6 +738,10 @@ struct TreeWriterTpcTof { |
720 | 738 | ccdb->setFatalWhenNull(false); |
721 | 739 |
|
722 | 740 | rctChecker.init(rctLabel, checkZdc, treatLimitedAcceptanceAsBad); |
| 741 | + |
| 742 | + if (saveReserveQaHisto) { |
| 743 | + registry.add("hTrackOutputRatio", "Track out/in ratio;Track out/in ratio;Entries", {HistType::kTH1F, {{100, 0, reserveTrackRatio}}}); |
| 744 | + } |
723 | 745 | } |
724 | 746 |
|
725 | 747 | template <bool DoCorrectDeDx, int ModeId, typename T, typename C> |
@@ -913,6 +935,10 @@ struct TreeWriterTpcTof { |
913 | 935 | LOG(info) << "Track table size = " << myTracks.size(); |
914 | 936 | LOG(info) << "nTrackEntries = " << rowTPCTOFTree.lastIndex() + 1; |
915 | 937 | LOG(info) << "nTrackEntries / Track table size = " << static_cast<double>((rowTPCTOFTree.lastIndex() + 1)) / myTracks.size(); |
| 938 | + |
| 939 | + if (saveReserveQaHisto) { |
| 940 | + registry.fill(HIST("hTrackOutputRatio"), static_cast<double>((rowTPCTOFTree.lastIndex() + 1)) / myTracks.size()); |
| 941 | + } |
916 | 942 | } /// runTof |
917 | 943 |
|
918 | 944 | void processStandard(Colls const& collisions, |
|
0 commit comments