Skip to content

Commit 4319ef9

Browse files
committed
removed magic number
1 parent 5c8225a commit 4319ef9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

PWGLF/Tasks/Nuspex/antinucleiInJets.cxx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ struct AntinucleiInJets {
151151
Configurable<std::string> weightsXi{"weightsXi", "", "weightsXi"};
152152
Configurable<std::string> weightsOmega{"weightsOmega", "", "weightsOmega"};
153153

154+
// Number of events
155+
Configurable<int> shrinkInterval{"shrinkInterval", 1000, "variable that controls how often shrinking happens"};
156+
154157
// Reweighting histograms
155158
TH1F* primaryAntiprotons;
156159
TH1F* primaryAntiLambda;
@@ -1767,8 +1770,8 @@ struct AntinucleiInJets {
17671770
registryMC.fill(HIST("genEvents"), 3.5);
17681771
}
17691772

1770-
// Shrink large vectors every 1000 events
1771-
if (eventCounter % 1000 == 0) {
1773+
// Shrink large vectors
1774+
if (eventCounter % shrinkInterval == 0) {
17721775
fjParticles.shrink_to_fit();
17731776
protonMomentum.shrink_to_fit();
17741777
}
@@ -2059,8 +2062,8 @@ struct AntinucleiInJets {
20592062
registryMC.fill(HIST("recEvents"), 9.5);
20602063
}
20612064

2062-
// Shrink large vectors every 1000 events
2063-
if (eventCounter % 1000 == 0) {
2065+
// Shrink large vectors
2066+
if (eventCounter % shrinkInterval == 0) {
20642067
fjParticles.shrink_to_fit();
20652068
antiprotonTrackIndex.shrink_to_fit();
20662069
}

0 commit comments

Comments
 (0)