Skip to content

Conversation

@starsdong
Copy link
Member

In processMuDst() function, MuDst::setVertexIndex is missing when picking a different primary vertex in FXT events. This leads to dcaGlobal values (gDcaMag) to be all default (-999..). The cut on the variable gDcaMag seems to be only used in mPPPAMode. Not sure how much it may affect the afterburner production in this mode.

The issue seems to be NOT relevant for processStEvent() (normal daq production) as the calculations are using different accessing methods.

@genevb
Copy link
Contributor

genevb commented Jul 30, 2025

Good find, @starsdong ...

However, I thought @YannickSoehngen was using this same code for other FXT datasets (processed from MuDst), if I understand correctly, so I would have expected him to run into this same issue earlier. Maybe I do not understand correctly?

@starsdong
Copy link
Member Author

This issue appears (from what I found so far) in the dcaGlobal calculation. Now this calculation will be using the default mCurrVertexIndex (-2). This still won't crash the code most of the time since it will check the vertex at this index. If it is null, the code will skip the calculation and returns default values (-999....). But it seems in Yannick's test case, the calculation when checking Vertex at (-2) index returns some memory address (not sure why), then when it performs the dca calculation, it fails and crashes the code.

More interestingly, when I simply copy the StBTofCalibMaker from lib and compile, the program won't crash although all dcaGlobal values are not correct.

I still don't fully understand why it crashes specifically at that particular event, but not on most others. Anyway, this PR should fix dcaGlobal calculation issue which is related to the crash of the code. I tested with the specific file Yannick provided, it runs OK in both 32-bit and 64-bit cases. I would suggest Yannick to go ahead and test in massive jobs.

@starsdong
Copy link
Member Author

Also just to add, the cut on dca values from what I see in the BTofCalibMaker is only used in the mPPPAMode. Would be interesting whether anyone else saw the issue with dca calculation before in this mode.

@plexoos plexoos requested a review from Copilot August 15, 2025 00:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in the StBTofCalibMaker where the MuDst vertex index was not being set when selecting FXT vertices, causing dcaGlobal values to remain at default (-999). The fix adds the missing setVertexIndex() call and includes a log message for better debugging.

  • Adds missing setVertexIndex() call when selecting FXT primary vertices
  • Includes informational logging when a vertex is selected
  • Reformats the conditional block with proper braces

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants