Skip to content

Commit 79391f4

Browse files
committed
Propagate PV MCLabel to extended PV in the trackingStudy
1 parent 7dc1b63 commit 79391f4

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

DataFormats/Reconstruction/include/ReconstructionDataFormats/PrimaryVertexExt.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "ReconstructionDataFormats/PrimaryVertex.h"
1616
#include "ReconstructionDataFormats/GlobalTrackID.h"
17+
#include "SimulationDataFormat/MCEventLabel.h"
1718

1819
namespace o2
1920
{
@@ -27,6 +28,7 @@ struct PrimaryVertexExt : public PrimaryVertex {
2728
std::array<uint16_t, o2::dataformats::GlobalTrackID::Source::NSources> nSrc{}; // N contributors for each source type
2829
std::array<uint16_t, o2::dataformats::GlobalTrackID::Source::NSources> nSrcA{}; // N associated and passing cuts for each source type
2930
std::array<uint16_t, o2::dataformats::GlobalTrackID::Source::NSources> nSrcAU{}; // N ambgous associated and passing cuts for each source type
31+
o2::MCEventLabel mcLb{};
3032
double FT0Time = -1.; // time of closest FT0 trigger
3133
float FT0A = -1; // amplitude of closest FT0 A side
3234
float FT0C = -1; // amplitude of closest FT0 C side
@@ -41,7 +43,7 @@ struct PrimaryVertexExt : public PrimaryVertex {
4143
std::string asString() const;
4244
#endif
4345

44-
ClassDefNV(PrimaryVertexExt, 6);
46+
ClassDefNV(PrimaryVertexExt, 7);
4547
};
4648

4749
#ifndef GPUCA_GPUCODE_DEVICE

Detectors/GlobalTrackingWorkflow/study/src/TrackingStudy.cxx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
369369
if (iv != nv - 1) {
370370
auto& pve = pveVec[iv];
371371
static_cast<o2::dataformats::PrimaryVertex&>(pve) = pvvec[iv];
372+
if (mUseMC) {
373+
pve.mcLb = recoData.getPrimaryVertexMCLabel(iv);
374+
}
372375
// find best matching FT0 signal
373376
float bestTimeDiff = 1000, bestTime = -999;
374377
int bestFTID = -1;
@@ -611,13 +614,16 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
611614
vid[slot] = id;
612615
};
613616

617+
std::vector<o2::dataformats::PrimaryVertexExt> pveT; // neighbours in time
618+
std::vector<o2::dataformats::PrimaryVertexExt> pveZ; // neighbours in Z
619+
std::vector<int> idT(mMaxNeighbours), idZ(mMaxNeighbours);
620+
std::vector<float> dT(mMaxNeighbours), dZ(mMaxNeighbours);
614621
for (int cnt = 0; cnt < nvtot; cnt++) {
622+
pveT.clear(); // neighbours in time
623+
pveZ.clear(); // neighbours in Z
624+
615625
const auto& pve = pveVec[cnt];
616626
float tv = pve.getTimeStamp().getTimeStamp();
617-
std::vector<o2::dataformats::PrimaryVertexExt> pveT(mMaxNeighbours); // neighbours in time
618-
std::vector<o2::dataformats::PrimaryVertexExt> pveZ(mMaxNeighbours); // neighbours in Z
619-
std::vector<int> idT(mMaxNeighbours), idZ(mMaxNeighbours);
620-
std::vector<float> dT(mMaxNeighbours), dZ(mMaxNeighbours);
621627
for (int i = 0; i < mMaxNeighbours; i++) {
622628
idT[i] = idZ[i] = -1;
623629
dT[i] = mMaxVTTimeDiff;
@@ -666,14 +672,14 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
666672
}
667673
for (int i = 0; i < mMaxNeighbours; i++) {
668674
if (idT[i] != -1) {
669-
pveT[i] = pveVec[idT[i]];
675+
pveT.push_back(pveVec[idT[i]]);
670676
} else {
671677
break;
672678
}
673679
}
674680
for (int i = 0; i < mMaxNeighbours; i++) {
675681
if (idZ[i] != -1) {
676-
pveZ[i] = pveVec[idZ[i]];
682+
pveZ.push_back(pveVec[idZ[i]]);
677683
} else {
678684
break;
679685
}

0 commit comments

Comments
 (0)