-
Notifications
You must be signed in to change notification settings - Fork 59
Add EBTriggerGrouper tool for EBV2 #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: Application
Are you sure you want to change the base?
Conversation
|
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. |
|
i'm not highlighting all instances here, generally it's a few small changes to be made in many places. |
| #include "AssignBunchTimingMC.h" | ||
| #include "FitRWMWaveform.h" | ||
| #include "EBTriggerGrouper.h" | ||
| #include "EBTriggerGrouper.h" |
There was a problem hiding this comment.
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>>; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.count rather than find
EBPMT Tool in EventBuildingV2 tool set.
This is also splitted from PR #307.