Skip to content

Commit 886f869

Browse files
author
Mattia Faggin
committed
Set random tmp folder for TrackTuner download.
1 parent c944411 commit 886f869

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

Common/TableProducer/trackPropagation.cxx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
//
1515

1616
#include "TableHelper.h"
17+
1718
#include "Common/Tools/TrackTuner.h"
1819

20+
#include "TRandom.h"
21+
1922
// The Run 3 AO2D stores the tracks at the point of innermost update. For a track with ITS this is the innermost (or second innermost)
2023
// ITS layer. For a track without ITS, this is the TPC inner wall or for loopers in the TPC even a radius beyond that.
2124
// In order to use the track parameters, the tracks have to be propagated to the collision vertex which is done by this task.
@@ -133,7 +136,13 @@ struct TrackPropagation {
133136
break;
134137
}
135138

136-
trackTunerObj.getDcaGraphs();
139+
// define the tmp directory to be used in case of download of the file from CCDB
140+
// random number extracted, to avoid file writing in the same tmp directory
141+
gRandom->SetSeed(0);
142+
unsigned int n = gRandom->Integer(100000);
143+
std::string tmpDirName = std::string("./") + std::to_string(n);
144+
LOG(info) << " --> rnd number extracted: " << n;
145+
trackTunerObj.getDcaGraphs(tmpDirName);
137146
trackTunedTracks->SetTitle(outputStringParams.c_str());
138147
trackTunedTracks->GetXaxis()->SetBinLabel(1, "all tracks");
139148
}

Common/Tools/TrackTuner.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ struct TrackTuner : o2::framework::ConfigurableGroup {
447447
return outputString;
448448
}
449449

450-
void getDcaGraphs()
450+
void getDcaGraphs(std::string tmpDir = ".")
451451
{
452452
std::string fullNameInputFile = "";
453453
std::string fullNameFileQoverPt = "";
@@ -456,7 +456,6 @@ struct TrackTuner : o2::framework::ConfigurableGroup {
456456
/// use input correction file from CCDB
457457

458458
// properly init the ccdb
459-
std::string tmpDir = ".";
460459
ccdbApi.init("http://alice-ccdb.cern.ch");
461460

462461
// get the DCA correction file from CCDB

0 commit comments

Comments
 (0)