-
Notifications
You must be signed in to change notification settings - Fork 218
Fix for issue #245, support removal of digits in NDigits2 trigger. #247
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
Conversation
…Digits loop over times from a for loop to an iterator loop. This should support stacked triggers where some keys may be removed.
include/WCSimWCDigi.hh
Outdated
| void SortHitTimes() { sort(time_float.begin(),time_float.end()); } | ||
|
|
||
|
|
||
| void SortArrayByHitTime() { |
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 agree that where SortArrayByHitTime() is called currently, we don't need to sort fDigiComp. But maybe we want to future proof ourselves for potentially using this sorting method elsewhere in the future by keeping it in. And maybe making the method name more descriptive such as:
| void SortArrayByHitTime() { | |
| void SortAllMapsByHitTime() { |
Alternatively, we could do as you suggest and get rid of fDigiComp sorting here, and rename to
| void SortArrayByHitTime() { | |
| void SortMapsByHitTimeForDigitizer() { |
include/WCSimWCDigi.hh
Outdated
| void SortHitTimes() { sort(time_float.begin(),time_float.end()); } | ||
|
|
||
|
|
||
| void SortArrayByHitTime() { |
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 agree that where SortArrayByHitTime() is called currently, we don't need to sort fDigiComp. But maybe we want to future proof ourselves for potentially using this sorting method elsewhere in the future by keeping it in. And maybe making the method name more descriptive such as:
| void SortArrayByHitTime() { | |
| void SortAllMapsByHitTime() { |
Alternatively, we could do as you suggest and get rid of fDigiComp sorting here, and rename to
| void SortArrayByHitTime() { | |
| void SortMapsByHitTimeForDigitizer() { |
include/WCSimWCDigi.hh
Outdated
| catch (...) { | ||
| G4cerr<<"Exception occurred while attempting to use WCSimWCDigi::GetTime to retrieve time for pe " | ||
| << gate << " from map of times. The time map has "<<time.size()<<" entries:" << G4endl; | ||
| for (auto& x: time){ |
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.
@eosullivan can comment, but I'm not sure WCSim is using C++11 yet
include/WCSimWCDigi.hh
Outdated
| catch (...) { | ||
| G4cerr<<"Exception occurred while attempting to use WCSimWCDigi::GetTime to retrieve time for pe " | ||
| << gate << " from map of times. The time map has "<<time.size()<<" entries:" << G4endl; | ||
| for (auto& x: time){ |
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.
@eosullivan can comment, but I'm not sure WCSim is using C++11 yet
|
The Travis build hasn't started for this. Any ideas @brichards64 or @eosullivan? |
…f WCSimWCDigi::SortArraysByHitTime to WCSimWCDigi::SortDigiMapsByHitTime, and re-enable sorting of digi composition provided it is populated.
|
Thanks for the feedback. Pushed a new commit to remove c++11 and re-enable sorting of the fDigiComp map, provided its size is the same as the other maps. |
|
Great! Thanks for this @marc1uk! |
Fix missed a float -> double
Loops in WCSimWCTrigger::AlgNDigits and WCSimWCTrigger::FillDigitsCollection now use an iterator to loop over the times map and retrieve the keys present.
In WCSimWCDigi.hh several uses of the operator[] were replaced with map::at.
fDigiComp was removed from the sort in WCSimWCDigi::SortArrayByHitTime as this has no entries at the time when it is called (so switching use to fDigiComp.at() produces an exception).
#245