Skip to content

feat(g249 tracking): Add method to select the VFTX.#1316

Merged
jose-luis-rs merged 1 commit into
R3BRootGroup:devfrom
pgrusell:first_vtx
Jan 15, 2026
Merged

feat(g249 tracking): Add method to select the VFTX.#1316
jose-luis-rs merged 1 commit into
R3BRootGroup:devfrom
pgrusell:first_vtx

Conversation

@pgrusell
Copy link
Copy Markdown
Contributor

Classes R3BFootHit2Track and R3BTrackingG249 only use data taken with the second VFTX. This PR adds a method to select the VFTX. The second VFTX is the default one, though.


Checklist:

@pgrusell pgrusell requested review from Copilot and removed request for Copilot January 12, 2026 13:34
Copilot AI review requested due to automatic review settings January 15, 2026 10:44
doc(tracking): change licenses

fix: Fix classdefoverride

fix: Fix typo

fix(tracking): Add correct date in the copyright

fix: Fixed minor errors suggested by copilot
Copy link
Copy Markdown

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 adds the ability to select which VFTX (time-to-digital converter) to use in tracking classes. Previously, the code was hardcoded to use VFTX #2. The changes introduce a configurable setter method while maintaining backward compatibility by keeping VFTX #2 as the default.

Changes:

  • Added SetVFTXNumber() method to configure which VFTX data to use
  • Replaced hardcoded VFTX number (2) with configurable vftxNumber member variable
  • Updated copyright years to 2025-2026

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
tracking/R3BTrackingG249.h Added SetVFTXNumber() setter and vftxNumber private member; changed include guards to pragma once; incremented ClassDef version
tracking/R3BTrackingG249.cxx Updated FRS data filtering to use vftxNumber variable; removed trailing semicolon from ClassImp
ssd/calibration/R3BFootHit2Track.h Added SetVFTXNumber() setter and vftxNumber private member; incremented ClassDef version
ssd/calibration/R3BFootHit2Track.cxx Updated FRS data filtering to use vftxNumber variable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

void SetAnglesTofd(double x, double y, double z) { tofd_angles.SetXYZ(x, y, z); } // rad

// Setter for the VFTX number
void SetVFTXNumber(int nb) { vftxNumber = nb; }
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The trailing semicolon after the closing brace is unnecessary for inline member function definitions. While not an error in C++, it's inconsistent with the coding style used for other setter methods in the same file (lines 50, 53, 57-58) which don't have trailing semicolons.

Copilot uses AI. Check for mistakes.
Comment on lines +192 to 194
int vftxNumber = 2;

//-- Input hit data from the TClonesArray
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The vftxNumber member variable is placed in the private section but appears after the public ClassDefOverride at line 299. According to typical C++ class organization and ROOT conventions, all data members should be grouped together in the private section before the ClassDefOverride macro. Consider moving this declaration to a more logical position with other member variables (e.g., near line 194 where other private members begin).

Suggested change
int vftxNumber = 2;
//-- Input hit data from the TClonesArray
//-- Input hit data from the TClonesArray
int vftxNumber = 2;

Copilot uses AI. Check for mistakes.
void PrepareMinimizer(); // reset and set limits for the minimizer
bool RunMinimizer(); // execute minimzation

void SetVFTXNumber(int nb) { vftxNumber = nb; };
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The trailing semicolon after the closing brace is unnecessary for inline member function definitions. While not an error in C++, it's inconsistent with the coding style used for other methods in the class.

Suggested change
void SetVFTXNumber(int nb) { vftxNumber = nb; };
void SetVFTXNumber(int nb) { vftxNumber = nb; }

Copilot uses AI. Check for mistakes.
public:
ClassDefOverride(R3BFootHit2Track, 1);
private:
// Select the VFTX
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The vftxNumber member is declared in a public section (after line 149), which exposes it for direct modification. This breaks encapsulation since a setter method (SetVFTXNumber) is provided. The variable should be moved to a private section to enforce use of the setter method.

Copilot uses AI. Check for mistakes.
@jose-luis-rs jose-luis-rs merged commit c687043 into R3BRootGroup:dev Jan 15, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants