Skip to content

Commit c167684

Browse files
Fix memory-related bug by increasing size of trigger branch. Also throw an exception in case this happens again
1 parent 284f5b6 commit c167684

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

inc/TrigInfo.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace mu2e
99
{
1010
struct TrigInfo {
1111

12-
static const unsigned int ntrig_ = 30;
12+
static const unsigned int ntrig_ = 35;
1313

1414
bool _triggerArray[ntrig_];
1515

src/EventNtupleMaker_module.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,9 @@ namespace mu2e {
932932
TriggerResultsNavigator tnav(trigResults);
933933

934934
if (firstEvent) {
935+
if (tnav.getTrigPaths().size() > TrigInfo::ntrig_) {
936+
throw cet::exception("EventNtuple") << "More trigger paths in TriggerResultsNavigator than maximum allowed by TrigInfo::ntrig_. Increase TrigInfo::ntrig_ and rebuild\n";
937+
}
935938
for (unsigned int i = 0; i < tnav.getTrigPaths().size(); ++i) {
936939
const std::string name = "trig_"+tnav.getTrigPathName(i);
937940
_ntuple->Branch(name.c_str(), &_triggerResults._triggerArray[i], _buffsize,_splitlevel);

0 commit comments

Comments
 (0)