Skip to content

Commit a705a58

Browse files
authored
[Common] Add dowscaling factor for derived table (#13778)
1 parent 1468eda commit a705a58

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Common/TableProducer/zdcExtraTableProducer.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include <TH1.h>
3333
#include <TH2.h>
34+
#include <TRandom3.h>
3435

3536
#include <cstdint>
3637

@@ -64,7 +65,9 @@ struct ZdcExtraTableProducer {
6465
Configurable<bool> cfgEvSelsNoCollInTimeRangeStandard{"cfgEvSelsNoCollInTimeRangeStandard", true, "Event selection: no collision in time range standard"};
6566
Configurable<bool> cfgEvSelsIsVertexITSTPC{"cfgEvSelsIsVertexITSTPC", true, "Event selection: is vertex ITSTPC"};
6667
Configurable<bool> cfgEvSelsIsGoodITSLayersAll{"cfgEvSelsIsGoodITSLayersAll", true, "Event selection: is good ITS layers all"};
67-
//
68+
// Calibration settings
69+
Configurable<float> cfgCalibrationDownscaling{"cfgCalibrationDownscaling", 1.f, "Percentage of events to be saved to derived table"};
70+
6871
HistogramRegistry registry{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
6972

7073
enum SelectionCriteria {
@@ -311,7 +314,7 @@ struct ZdcExtraTableProducer {
311314
auto vx = collision.posX();
312315
auto vy = collision.posY();
313316

314-
if (isZNAhit || isZNChit) {
317+
if ((isZNAhit || isZNChit) && (gRandom->Uniform() < cfgCalibrationDownscaling)) {
315318
zdcextras(pmcZNA, pmqZNA[0], pmqZNA[1], pmqZNA[2], pmqZNA[3], tdcZNA, centroidZNA[0], centroidZNA[1], pmcZNC, pmqZNC[0], pmqZNC[1], pmqZNC[2], pmqZNC[3], tdcZNC, centroidZNC[0], centroidZNC[1], centrality, vx, vy, vz, foundBC.timestamp(), foundBC.runNumber(), evSelection);
316319
}
317320
}

0 commit comments

Comments
 (0)