Add EBTriggerGrouper tool for EBV2#335
Open
fengyvoid wants to merge 1 commit intoANNIEsoft:Applicationfrom
Open
Add EBTriggerGrouper tool for EBV2#335fengyvoid wants to merge 1 commit intoANNIEsoft:Applicationfrom
fengyvoid wants to merge 1 commit intoANNIEsoft:Applicationfrom
Conversation
Collaborator
|
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. |
Collaborator
|
i'm not highlighting all instances here, generally it's a few small changes to be made in many places. |
marc1uk
reviewed
Sep 19, 2025
| #include "AssignBunchTimingMC.h" | ||
| #include "FitRWMWaveform.h" | ||
| #include "EBTriggerGrouper.h" | ||
| #include "EBTriggerGrouper.h" |
| m_variables.Get("GroupTolerance", GroupTolerance); | ||
| m_variables.Get("GroupTrigWord", GroupTrigWord); | ||
|
|
||
| TimeToTriggerWordMap = new std::map<uint64_t, std::vector<uint32_t>>; |
Collaborator
There was a problem hiding this comment.
these are leaked, no reason to declare new, just nullptr
|
|
||
| bool EBTriggerGrouper::GroupByTolerance() | ||
| { | ||
| Log("EBTG: GroupByTolerance()", v_warning, verbosityEBTG); |
| else if (found && dt < tolerance) | ||
| { | ||
| // if found TrigWordForGroup in TrigWords, insert to ThisGroup | ||
| if (std::find(TrigWords.begin(), TrigWords.end(), TrigWordForGroup[i]) != TrigWords.end()) |
Collaborator
There was a problem hiding this comment.
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()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EBPMT Tool in EventBuildingV2 tool set.
This is also splitted from PR #307.