Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mask for fake/mismatch hits #13902

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft

Conversation

njacazio
Copy link
Contributor

No description provided.

Copy link
Contributor

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass4
async-2023-pp-apass4
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0
async-2024-PbPb-apass1
async-2024-ppRef-apass1

@njacazio njacazio changed the title Update DataTypes.h Add mask for fake/mismatch hits Jan 27, 2025
@njacazio
Copy link
Contributor Author

@shahor02 this should handle the issue spotted. This is something I realized back in December. I think we could add one header with the mask.
Tagging also @noferini

Copy link
Collaborator

@shahor02 shahor02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @njacazio thanks, I agree that the fake/correct flags should be rectified, but there are some points I don't understand, see below.
Most important: in the current code I see bit 15 always fired when the TOF is present, I suspect some bug in TOFFake extraction. Did you check if your PR fixes that?

@@ -1083,7 +1083,7 @@ void AODProducerWorkflowDPL::fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTr
};

if (GIndex::includesSource(src, mInputSources)) {
auto mcTruth = data.getTrackMCLabel(trackIndex);
const auto& mcTruth = data.getTrackMCLabel(trackIndex);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding const is fine but I don't see why reference in this case is better than the value: label object is 8 bytes, the reference also but it needs dereferencing.

if (mcTruthITS.isValid()) {
labelHolder.labelITS = (mToStore[mcTruthITS.getSourceID()][mcTruthITS.getEventID()])[mcTruthITS.getTrackID()];
}
if (labelHolder.labelITS != labelHolder.labelTPC) {
LOG(debug) << "ITS-TPC MCTruth: labelIDs do not match at " << trackIndex.getIndex() << ", src = " << src;
labelHolder.labelMask |= (0x1 << 13);
labelHolder.labelMask |= o2::aod::mctracklabel::McMaskEnum::MismatchInITS0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why it goes to ITS0?

Comment on lines +1148 to +1150
if (isTOFFake) {
labelHolder.labelMask |= o2::aod::mctracklabel::McMaskEnum::MismatchInTOF;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the data I checked (when discussing with Sebastian) the TOFFake was always set to true when the TOF was present, I don't see what should be fixed here, except that it will not overwrite the general isFake bit 15 as before).

namespace o2::aod::mctracklabel
{
// ! Bit mask to indicate detector mismatches (bit ON means mismatch). Bit 0-6: mismatch at ITS layer. Bit 7-9: # of TPC mismatches in the ranges 0, 1, 2-3, 4-7, 8-15, 16-31, 32-63, >64. Bit 10: TRD, bit 11: TOF, bit 15: indicates negative label
enum McMaskEnum : uint16_t {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the correspondence between these enums and what is actually filled? Note that the ITS track per see may have no fakes (all clusters having the same label) but can be matched to TPC track with a different label. In this case ITS-TPC label will have isFake()==true. With your PR it will be flagged in bit0, why?

@@ -1145,13 +1145,16 @@ void AODProducerWorkflowDPL::fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTr
break;
}
}
if (isTOFFake) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@njacazio the line https://github.com/AliceO2Group/AliceO2/pull/13902/files#diff-6dc278732c5ed5f43d5567ad2c469ac11acf0e85339ae708bdf977ddd8fba392R1143 is simply wrong: it compares the original full MCCompLabel of TOF cluster with uint label of TPC assigned for storage in the AOD! All these manipulations with mToStore container are extremely heavy and unnecessary: the MCCompLabel are much lighter. I'll fix this part, then let's continue from that point on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants