Skip to content

Conversation

@fengyvoid
Copy link
Contributor

EBPMT Tool in EventBuildingV2 tool set.

This is also splitted from PR #307.

@S81D S81D self-assigned this Aug 22, 2025
@S81D
Copy link
Collaborator

S81D commented Aug 25, 2025

Looks good to me. The time tolerances seem somewhat arbitrary but I know you have tested these and I can confirm they work for all different types of runs (source + beam). Given it's a standalone tool and is in use for the eventbuilder, I think we can merge.

@marc1uk
Copy link
Collaborator

marc1uk commented Sep 19, 2025

i'm not highlighting all instances here, generally it's a few small changes to be made in many places.
Almost all of your printouts are warnings!

#include "AssignBunchTimingMC.h"
#include "FitRWMWaveform.h"
#include "EBTriggerGrouper.h"
#include "EBTriggerGrouper.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

duplicate

m_variables.Get("GroupTolerance", GroupTolerance);
m_variables.Get("GroupTrigWord", GroupTrigWord);

TimeToTriggerWordMap = new std::map<uint64_t, std::vector<uint32_t>>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

these are leaked, no reason to declare new, just nullptr


bool EBTriggerGrouper::GroupByTolerance()
{
Log("EBTG: GroupByTolerance()", v_warning, verbosityEBTG);
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this a warning?

else if (found && dt < tolerance)
{
// if found TrigWordForGroup in TrigWords, insert to ThisGroup
if (std::find(TrigWords.begin(), TrigWords.end(), TrigWordForGroup[i]) != TrigWords.end())
Copy link
Collaborator

Choose a reason for hiding this comment

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

use std::map.count instead of find

if (verbosityEBTG > 11)
cout << "EBTG: FillByTrigWord: mainTrigWord = " << mainTrigWord << ", TrigWordForGroup[i] = " << TrigWordForGroup[i] << ", TrigTimeForGroup[i] = " << TrigTimeForGroup[i] << ", tolerance = " << tolerance << endl;
// check is current trigger word in TrigWords
if (std::find(TrigWords.begin(), TrigWords.end(), TrigWordForGroup[i]) == TrigWords.end())
Copy link
Collaborator

Choose a reason for hiding this comment

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

.count rather than find

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.

4 participants