Skip to content

Commit 86246ba

Browse files
authored
Update AODProducerWorkflowSpec.cxx
1 parent 646e45a commit 86246ba

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

Detectors/AOD/src/AODProducerWorkflowSpec.cxx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ void AODProducerWorkflowDPL::fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTr
10831083
};
10841084

10851085
if (GIndex::includesSource(src, mInputSources)) {
1086-
auto mcTruth = data.getTrackMCLabel(trackIndex);
1086+
const auto& mcTruth = data.getTrackMCLabel(trackIndex);
10871087
MCLabels labelHolder;
10881088
if ((src == GIndex::Source::MFT) || (src == GIndex::Source::MFTMCH) || (src == GIndex::Source::MCH) || (src == GIndex::Source::MCHMID)) { // treating mft and fwd labels separately
10891089
if (!needToStore(src == GIndex::Source::MFT ? mGIDToTableMFTID : mGIDToTableFwdID)) {
@@ -1113,30 +1113,30 @@ void AODProducerWorkflowDPL::fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTr
11131113
labelHolder.labelID = (mToStore[mcTruth.getSourceID()][mcTruth.getEventID()])[mcTruth.getTrackID()];
11141114
}
11151115
// treating possible mismatches and fakes for global tracks
1116-
auto contributorsGID = data.getSingleDetectorRefs(trackIndex);
1117-
bool isSetTPC = contributorsGID[GIndex::Source::TPC].isIndexSet();
1118-
bool isSetITS = contributorsGID[GIndex::Source::ITS].isIndexSet();
1119-
bool isSetTOF = contributorsGID[GIndex::Source::TOF].isIndexSet();
1116+
const auto& contributorsGID = data.getSingleDetectorRefs(trackIndex);
1117+
const bool isSetTPC = contributorsGID[GIndex::Source::TPC].isIndexSet();
1118+
const bool isSetITS = contributorsGID[GIndex::Source::ITS].isIndexSet();
1119+
const bool isSetTOF = contributorsGID[GIndex::Source::TOF].isIndexSet();
11201120
bool isTOFFake = true;
11211121
if (isSetTPC && (isSetITS || isSetTOF)) {
1122-
auto mcTruthTPC = data.getTrackMCLabel(contributorsGID[GIndex::Source::TPC]);
1122+
const auto& mcTruthTPC = data.getTrackMCLabel(contributorsGID[GIndex::Source::TPC]);
11231123
if (mcTruthTPC.isValid()) {
11241124
labelHolder.labelTPC = (mToStore[mcTruthTPC.getSourceID()][mcTruthTPC.getEventID()])[mcTruthTPC.getTrackID()];
11251125
labelHolder.labelID = labelHolder.labelTPC;
11261126
}
11271127
if (isSetITS) {
1128-
auto mcTruthITS = data.getTrackMCLabel(contributorsGID[GIndex::Source::ITS]);
1128+
const auto& mcTruthITS = data.getTrackMCLabel(contributorsGID[GIndex::Source::ITS]);
11291129
if (mcTruthITS.isValid()) {
11301130
labelHolder.labelITS = (mToStore[mcTruthITS.getSourceID()][mcTruthITS.getEventID()])[mcTruthITS.getTrackID()];
11311131
}
11321132
if (labelHolder.labelITS != labelHolder.labelTPC) {
11331133
LOG(debug) << "ITS-TPC MCTruth: labelIDs do not match at " << trackIndex.getIndex() << ", src = " << src;
1134-
labelHolder.labelMask |= (0x1 << 13);
1134+
labelHolder.labelMask |= o2::aod::mctracklabel::McMaskEnum::MismatchInITS0;
11351135
}
11361136
}
11371137
if (isSetTOF) {
11381138
const auto& labelsTOF = data.getTOFClustersMCLabels()->getLabels(contributorsGID[GIndex::Source::TOF]);
1139-
for (auto& mcLabel : labelsTOF) {
1139+
for (const auto& mcLabel : labelsTOF) {
11401140
if (!mcLabel.isValid()) {
11411141
continue;
11421142
}
@@ -1145,13 +1145,16 @@ void AODProducerWorkflowDPL::fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTr
11451145
break;
11461146
}
11471147
}
1148+
if (isTOFFake) {
1149+
labelHolder.labelMask |= o2::aod::mctracklabel::McMaskEnum::MismatchInTOF;
1150+
}
11481151
}
11491152
}
1150-
if (mcTruth.isFake() || (isSetTOF && isTOFFake)) {
1151-
labelHolder.labelMask |= (0x1 << 15);
1153+
if (mcTruth.isFake()) {
1154+
labelHolder.labelMask |= o2::aod::mctracklabel::McMaskEnum::Fake;
11521155
}
11531156
if (mcTruth.isNoise()) {
1154-
labelHolder.labelMask |= (0x1 << 14);
1157+
labelHolder.labelMask |= o2::aod::mctracklabel::McMaskEnum::Noise;
11551158
}
11561159
mcTrackLabelCursor(labelHolder.labelID,
11571160
labelHolder.labelMask);
@@ -2493,6 +2496,8 @@ AODProducerWorkflowDPL::TrackExtraInfo AODProducerWorkflowDPL::processBarrelTrac
24932496
if (contributorsGID[GIndex::Source::TOF].isIndexSet()) { // ITS-TPC-TRD-TOF, ITS-TPC-TOF, TPC-TRD-TOF, TPC-TOF
24942497
const auto& tofMatch = data.getTOFMatch(trackIndex);
24952498
extraInfoHolder.tofChi2 = tofMatch.getChi2();
2499+
// const auto& patternUpDown = tofMatch.getHitPatternUpDown();
2500+
// const auto& patternLeftRight = tofMatch.getHitPatternLeftRight();
24962501
const auto& tofInt = tofMatch.getLTIntegralOut();
24972502
float intLen = tofInt.getL();
24982503
extraInfoHolder.length = intLen;

0 commit comments

Comments
 (0)