Skip to content

Commit 7c5b6e7

Browse files
committed
Fix MID tracks labels request/fetching in RecoContainer
1 parent 751f7bd commit 7c5b6e7

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

DataFormats/Detectors/GlobalTracking/include/DataFormatsGlobalTracking/RecoContainer.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class Cluster;
8080
class ROFRecord;
8181
class Track;
8282
class MCClusterLabel;
83+
class MCLabel;
8384
} // namespace o2::mid
8485

8586
namespace o2::itsmft
@@ -299,6 +300,7 @@ struct RecoContainer {
299300
std::unique_ptr<const o2::dataformats::MCTruthContainer<o2::emcal::MCLabel>> mcEMCCells;
300301
std::unique_ptr<const o2::dataformats::MCTruthContainer<o2::mid::MCClusterLabel>> mcMIDTrackClusters;
301302
std::unique_ptr<const o2::dataformats::MCTruthContainer<o2::mid::MCClusterLabel>> mcMIDClusters;
303+
std::unique_ptr<const o2::dataformats::MCTruthContainer<o2::MCCompLabel>> mcMIDTracks; // temporary, why MID stores MCTruthContainer for tracks and not single label?
302304

303305
gsl::span<const unsigned char> clusterShMapTPC; ///< externally set TPC clusters sharing map
304306

@@ -477,7 +479,8 @@ struct RecoContainer {
477479
auto getMIDTracksROFRecords() const { return getSpan<o2::mid::ROFRecord>(GTrackID::MID, TRACKREFS); }
478480
auto getMIDTrackClusters() const { return getSpan<o2::mid::Cluster>(GTrackID::MID, INDICES); }
479481
auto getMIDTrackClustersROFRecords() const { return getSpan<o2::mid::ROFRecord>(GTrackID::MID, MATCHES); }
480-
auto getMIDTracksMCLabels() const { return getSpan<o2::MCCompLabel>(GTrackID::MID, MCLABELS); }
482+
// auto getMIDTracksMCLabels() const { return getSpan<o2::MCCompLabel>(GTrackID::MID, MCLABELS); }
483+
const o2::dataformats::MCTruthContainer<o2::MCCompLabel>* getMIDTracksMCLabels() const; // temporary?
481484
const o2::dataformats::MCTruthContainer<o2::mid::MCClusterLabel>* getMIDTracksClusterMCLabels() const;
482485

483486
// MID clusters

DataFormats/Detectors/GlobalTracking/include/DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "DataFormatsMID/Cluster.h"
3131
#include "DataFormatsMID/Track.h"
3232
#include "DataFormatsMID/MCClusterLabel.h"
33+
#include "DataFormatsMID/MCLabel.h"
3334

3435
#include "DataFormatsTPC/TrackTPC.h"
3536
#include "DataFormatsTOF/Cluster.h"

DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,11 +779,18 @@ void RecoContainer::addMIDTracks(ProcessingContext& pc, bool mc)
779779
commonPool[GTrackID::MID].registerContainer(pc.inputs().get<gsl::span<o2::mid::Cluster>>("trackMIDTRACKCLUSTERS"), INDICES);
780780
commonPool[GTrackID::MID].registerContainer(pc.inputs().get<gsl::span<o2::mid::ROFRecord>>("trackClMIDROF"), MATCHES);
781781
if (mc) {
782-
commonPool[GTrackID::MID].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackMIDMCTR"), MCLABELS);
782+
// commonPool[GTrackID::MID].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackMIDMCTR"), MCLABELS);
783+
mcMIDTracks = pc.inputs().get<const dataformats::MCTruthContainer<o2::MCCompLabel>*>("trackMIDMCTR");
783784
mcMIDTrackClusters = pc.inputs().get<const dataformats::MCTruthContainer<o2::mid::MCClusterLabel>*>("trackMIDMCTRCL");
784785
}
785786
}
786787

788+
//________________________________________________________
789+
const o2::dataformats::MCTruthContainer<o2::MCCompLabel>* RecoContainer::getMIDTracksMCLabels() const
790+
{
791+
return mcMIDTracks.get(); // temporary ? see comment on mcMIDTracks
792+
}
793+
787794
//________________________________________________________
788795
const o2::dataformats::MCTruthContainer<o2::mid::MCClusterLabel>* RecoContainer::getMIDTracksClusterMCLabels() const
789796
{

0 commit comments

Comments
 (0)