Skip to content

Commit 4b772a5

Browse files
iouribelikovshahor02
authored andcommitted
Initializing the vertexer at the beginning of run
1 parent 468d81d commit 4b772a5

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/CookedTrackerSpec.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include "Framework/DataProcessorSpec.h"
1818
#include "ITSReconstruction/CookedTracker.h"
19+
#include "ITStracking/Vertexer.h"
20+
#include "ITStracking/VertexerTraits.h"
1921
#include "DataFormatsParameters/GRPObject.h"
2022
#include "DataFormatsITSMFT/TopologyDictionary.h"
2123
#include "Framework/Task.h"
@@ -44,6 +46,8 @@ class CookedTrackerDPL : public Task
4446
o2::itsmft::TopologyDictionary mDict;
4547
std::unique_ptr<o2::parameters::GRPObject> mGRP = nullptr;
4648
o2::its::CookedTracker mTracker;
49+
std::unique_ptr<VertexerTraits> mVertexerTraitsPtr = nullptr;
50+
std::unique_ptr<Vertexer> mVertexerPtr = nullptr;
4751
TStopwatch mTimer;
4852
};
4953

Detectors/ITSMFT/ITS/workflow/src/CookedTrackerSpec.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
#include "CommonDataFormat/IRFrame.h"
3434
#include "ITStracking/ROframe.h"
3535
#include "ITStracking/IOUtils.h"
36-
#include "ITStracking/Vertexer.h"
37-
#include "ITStracking/VertexerTraits.h"
3836
#include "DetectorsCommonDataFormats/NameConf.h"
3937
#include "CommonUtils/StringUtils.h"
4038

@@ -58,6 +56,8 @@ CookedTrackerDPL::CookedTrackerDPL(bool useMC, const std::string& trMode) : mUse
5856
mTracker.setParametersCosmics();
5957
mRunVertexer = false;
6058
}
59+
mVertexerTraitsPtr = std::make_unique<VertexerTraits>();
60+
mVertexerPtr = std::make_unique<Vertexer>(mVertexerTraitsPtr.get());
6161
}
6262

6363
void CookedTrackerDPL::init(InitContext& ic)
@@ -69,6 +69,8 @@ void CookedTrackerDPL::init(InitContext& ic)
6969
auto filename = ic.options().get<std::string>("grp-file");
7070
const auto grp = o2::parameters::GRPObject::loadFrom(filename);
7171
if (grp) {
72+
mVertexerPtr->getGlobalConfiguration();
73+
7274
mGRP.reset(grp);
7375
o2::base::Propagator::initFieldFromGRP(grp);
7476
auto field = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
@@ -129,8 +131,6 @@ void CookedTrackerDPL::run(ProcessingContext& pc)
129131
mTracker.setMCTruthContainers(labels.get(), &trackLabels);
130132
}
131133

132-
o2::its::VertexerTraits vertexerTraits;
133-
o2::its::Vertexer vertexer(&vertexerTraits);
134134
o2::its::ROframe event(0, 7);
135135

136136
auto& vertROFvec = pc.outputs().make<std::vector<o2::itsmft::ROFRecord>>(Output{"ITS", "VERTICESROF", 0, Lifetime::Timeframe});
@@ -164,9 +164,9 @@ void CookedTrackerDPL::run(ProcessingContext& pc)
164164

165165
if (mRunVertexer) {
166166
o2::its::ioutils::loadROFrameData(rof, event, compClusters, pattIt, mDict, labels.get());
167-
vertexer.clustersToVertices(event, false, [&](std::string s) { LOG(INFO) << s; });
167+
mVertexerPtr->clustersToVertices(event, false, [&](std::string s) { LOG(INFO) << s; });
168168
}
169-
auto vtxVecLoc = vertexer.exportVertices();
169+
auto vtxVecLoc = mVertexerPtr->exportVertices();
170170

171171
if (multEstConf.cutMultVtxLow > 0 || multEstConf.cutMultVtxHigh > 0) { // cut was requested
172172
std::vector<o2::dataformats::Vertex<o2::dataformats::TimeStamp<int>>> vtxVecSel;

0 commit comments

Comments
 (0)