You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LOG(fatal) << "You are trying to fill histograms, but they are not in the histogram registry. Call the function HfEventSelection::addHistograms() to fix.";
458
+
}
459
+
431
460
hCollisions->Fill(EventRejection::None);
432
461
constauto posZ = collision.posZ();
433
462
hPosZBeforeEvSel->Fill(posZ);
@@ -480,6 +509,8 @@ struct HfEventSelectionMc {
480
509
std::string rctLabel; // RCT selection flag
481
510
bool rctCheckZDC{false}; // require ZDC from RCT
482
511
bool rctTreatLimitedAcceptanceAsBad{false}; // RCT flag to reject events with limited acceptance for selected detectors
512
+
bool isInitCalled{false}; // guard variable to guarantee full configuration, important for RCT
513
+
bool areHistosInRegistry{false}; // guard variable to guarantee that histograms are added to the registry before filling them
// Puts labels on the collision monitoring histogram.
507
538
setEventRejectionLabels(hGenCollisions);
539
+
540
+
// histograms in registry
541
+
// let's update the guard variable
542
+
areHistosInRegistry = true;
508
543
}
509
544
510
545
/// \brief Configures the object from the reco workflow
@@ -557,6 +592,9 @@ struct HfEventSelectionMc {
557
592
558
593
// we initialise histograms
559
594
addHistograms(registry);
595
+
596
+
// full configuration complete: update the guard variable
597
+
isInitCalled = true;
560
598
}
561
599
562
600
/// \brief Function to apply event selections to generated MC collisions
@@ -583,6 +621,10 @@ struct HfEventSelectionMc {
583
621
584
622
/// RCT condition
585
623
if (requireGoodRct) {
624
+
if (!isInitCalled) {
625
+
// protect against incomplete configuration
626
+
LOG(fatal) << "Checking RCT flags w/o full HF event-selection configuration (MC). Call the function HfEventSelectionMc::init() to fix.";
627
+
}
586
628
if (!rctChecker.checkTable(bc)) {
587
629
SETBIT(rejectionMask, EventRejection::Rct);
588
630
}
@@ -619,6 +661,11 @@ struct HfEventSelectionMc {
619
661
const HfCollisionRejectionMask rejectionMask,
620
662
constint nSplitColl = 0)
621
663
{
664
+
if (!areHistosInRegistry) {
665
+
// protect against missing histograms in registry
666
+
LOG(fatal) << "You are trying to fill histograms, but they are not in the histogram registry. Call the function HfEventSelectionMc::addHistograms() to fix.";
0 commit comments