Skip to content

Conversation

@nzardosh
Copy link
Collaborator

No description provided.

@github-actions
Copy link

github-actions bot commented Dec 16, 2025

O2 linter results: ❌ 51 errors, ⚠️ 75 warnings, 🔕 0 disabled

@github-actions github-actions bot changed the title adding upc selections [PWGJE,PWGUD] adding upc selections Dec 16, 2025
@nzardosh
Copy link
Collaborator Author

Dear UD experts, I have added a small modification to your isSelected function which allows one to optionally extract a vector with the amplitude values of the FIT detectors in bcs compatible with a UPC event. These can then be used later by analysers to make tighter event selections. However the functionality of the task should be unchanged by this addition

@nzardosh nzardosh force-pushed the upc branch 2 times, most recently from 2f81f28 to edb13a4 Compare December 16, 2025 13:59
@nzardosh nzardosh changed the title [PWGJE,PWGUD] adding upc selections [PWGJE,PWGUD] adding upc selections to JE framework Dec 16, 2025
namespace jetderiveddatautilities
{

static constexpr float mPion = 0.139; // TDatabasePDG::Instance()->GetParticle(211)->Mass(); //can be removed when pion mass becomes default for unidentified tracks
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be fixed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i will fix it in a seperate PR

@nzardosh
Copy link
Collaborator Author

@rolavick and @amatyja can you take a look please?

Configurable<float> dcaZMax{"dcaZMax", 0.2, "maximum DCAZ selection for tracks - only applied for reassociation"};
Configurable<int> upcBCRangeTimeWindow{"upcBCRangeTimeWindow", 1000, "time range in ns for bunch crossing range checking in upc gap determination"};
Configurable<int> upcminNBCs{"upcminNBCs", 7, "minuimum number of bunch crossing to check in upc gap determination"};
Configurable<int> upcMinNTracks{"upcMinNBC", 0, "minuimum number of tracks in upc event"};
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is a copy paste error. The Laben should be "upcMinNTracks"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks

if (collision.isCollisionSelected()) {

products.storedJCollisionsTable(collision.posX(), collision.posY(), collision.posZ(), collision.multFV0A(), collision.multFV0C(), collision.multFT0A(), collision.multFT0C(), collision.centFV0A(), collision.centFV0M(), collision.centFT0A(), collision.centFT0C(), collision.centFT0M(), collision.centFT0CVariant1(), collision.hadronicRate(), collision.trackOccupancyInTimeRange(), collision.alias_raw(), collision.eventSel(), collision.rct_raw(), collision.triggerSel());
std::vector<float> amplitudesFV0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

vector creation and destruction in for each collision creates unnecessary heap allocation overhead. Consider instead something like:

// Outside loop
std::vector<float> amplitudesFV0;
// ... define others ...

for (auto const& collision : collisions) {
    if (collision.isCollisionSelected()) {
        amplitudesFV0.clear();
        // ... clear others ...
        
        // Copy data
        auto amplitudesFV0Span = collision.amplitudesFV0();
        amplitudesFV0.assign(amplitudesFV0Span.begin(), amplitudesFV0Span.end()); // More efficient than back_inserter
        
        // ...
    }
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the problem with this is that the task is flirting with the 100 member limit as it is

Copy link
Collaborator

Choose a reason for hiding this comment

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

How is this related to members?

@vkucera
Copy link
Collaborator

vkucera commented Dec 18, 2025

@nzardosh Don't waste CPU.

@rolavick
Copy link
Collaborator

Dear @nzardosh, the modification of the UD part looks ok to me, so I approve, but one question on the usage: Do you put some constraints on the bcrange? I wonder if one can hit a large range, and then the vectors would go large, which may cause some memory issues.
Roman

rolavick
rolavick previously approved these changes Dec 18, 2025
@nzardosh
Copy link
Collaborator Author

Dear @nzardosh, the modification of the UD part looks ok to me, so I approve, but one question on the usage: Do you put some constraints on the bcrange? I wonder if one can hit a large range, and then the vectors would go large, which may cause some memory issues. Roman

Dear @rolavick thanks! If I understand correctly this upcCuts.SetNDtcoll(config.upcBCRangeTimeWindow); should set the range? or is there a better way you would recommend i can do it?

thanks

@nzardosh nzardosh marked this pull request as ready for review December 19, 2025 01:20
@nzardosh nzardosh enabled auto-merge (squash) December 19, 2025 01:59
@nzardosh nzardosh disabled auto-merge December 19, 2025 01:59
@nzardosh nzardosh requested a review from rolavick December 19, 2025 11:03
@nzardosh nzardosh enabled auto-merge (squash) December 19, 2025 13:35
Copy link
Collaborator

@rolavick rolavick left a comment

Choose a reason for hiding this comment

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

Could you please incorporate this MegaLinter error
PWGUD/Core/SGSelector.h:65: Add #include for vector<> [build/include_what_you_use] [4]
thanks

rolavick
rolavick previously approved these changes Dec 19, 2025
@nzardosh nzardosh disabled auto-merge December 19, 2025 14:30
@nzardosh nzardosh enabled auto-merge (squash) December 19, 2025 14:30
Copy link
Collaborator

@alibuild alibuild left a comment

Choose a reason for hiding this comment

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

Auto-approving on behalf of @nzardosh.

@nzardosh nzardosh merged commit 1ad7e33 into AliceO2Group:master Dec 19, 2025
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants