Add EBMRD for EventBuildingV2 tool chain#334
Add EBMRD for EventBuildingV2 tool chain#334fengyvoid wants to merge 1 commit intoANNIEsoft:Applicationfrom
Conversation
jminock
left a comment
There was a problem hiding this comment.
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.
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.
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.
use reference to avoid copying
| if (skip) | ||
| continue; | ||
| } | ||
| if (MRDEventsBuffer.find(MTCtime) == MRDEventsBuffer.end()) |
There was a problem hiding this comment.
use std::map.count instead of find
| Matching(matchTargetTrigger, 14); | ||
| if (CosmicTriggerGroupped) | ||
| { | ||
| Matching(36, 36); |
There was a problem hiding this comment.
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.
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) |
| 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.
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.
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.
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! :)