-
Notifications
You must be signed in to change notification settings - Fork 59
Add EBMRD for EventBuildingV2 tool chain #334
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
jminock
left a comment
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.
Looks good! This is already in use. So it has been tested and works.
| Log("EBMRD: Current buffer size is " + std::to_string(MRDEventsBuffer.size()), v_message, verbosityEBMRD); | ||
| // loop the MRDEvents, save every event to MRDEventsBuffer if it's not already in the buffer | ||
| int newLoadedEvents = 0; | ||
| for (std::pair<uint64_t, std::vector<std::pair<unsigned long, int>>> p : MRDEvents) |
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 reference to avoid copying
| for (std::pair<uint64_t, std::vector<std::pair<unsigned long, int>>> p : MRDEvents) | ||
| { | ||
| uint64_t MTCtime = p.first; | ||
| std::vector<std::pair<unsigned long, int>> WaveMap = p.second; |
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 reference to avoid copying
| if (PairedMRDTimeStamps.size() > 0) | ||
| { | ||
| bool skip = false; | ||
| for (std::pair<int, std::vector<uint64_t>> pair : PairedMRDTimeStamps) |
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 reference to avoid copying
| if (skip) | ||
| continue; | ||
| } | ||
| if (MRDEventsBuffer.find(MTCtime) == MRDEventsBuffer.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
| Matching(matchTargetTrigger, 14); | ||
| if (CosmicTriggerGroupped) | ||
| { | ||
| Matching(36, 36); |
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.
i presume these are trigger types - ideally use enums instead of magic numbers
| if (verbosityEBMRD > 11) | ||
| cout << "******************EBMRD: new MRD event: " << loopNum << endl; | ||
| uint64_t MTCtime = mrdpair.first; | ||
| std::vector<std::pair<unsigned long, int>> WaveMap = mrdpair.second; |
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.
make reference to avoid copy
| uint32_t matchedTrigWord = 0; | ||
| int matchedTrack = 0; | ||
| int matchedIndex = 0; | ||
| for (std::pair<int, std::vector<std::map<uint64_t, uint32_t>>> pair : GroupedTriggersInTotal) |
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.
reference to avoid ocpy
| Log("EBMRD: Skipping TrackTriggerWord " + std::to_string(TrackTriggerWord), v_debug, verbosityEBMRD); | ||
| continue; | ||
| } | ||
| if (matchedNumberInTrack.find(TrackTriggerWord) == matchedNumberInTrack.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.
map.count instead of find
| if (matchedNumberInTrack.find(TrackTriggerWord) == matchedNumberInTrack.end()) | ||
| matchedNumberInTrack.emplace(TrackTriggerWord, 0); | ||
|
|
||
| vector<std::map<uint64_t, uint32_t>> groupedTriggers = pair.second; |
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 reference to avoid copy
|
|
||
| for (int i = 0; i < groupedTriggers.size(); i++) | ||
| { | ||
| map<uint64_t, uint32_t> groupedTrigger = groupedTriggers.at(i); |
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 reference to avoid copy
EBMRD Tool in EventBuildingV2 tool set.
This is splitted from PR #307
Seems you don't have comment for this one! :)