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 HfEventSelectionMc::addHistograms() to fix.";
458
+
}
459
+
448
460
hCollisions->Fill(EventRejection::None);
449
461
constauto posZ = collision.posZ();
450
462
hPosZBeforeEvSel->Fill(posZ);
@@ -498,6 +510,7 @@ struct HfEventSelectionMc {
498
510
bool rctCheckZDC{false}; // require ZDC from RCT
499
511
bool rctTreatLimitedAcceptanceAsBad{false}; // RCT flag to reject events with limited acceptance for selected detectors
500
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.
525
538
setEventRejectionLabels(hGenCollisions);
539
+
540
+
// histograms in registry
541
+
// let's update the guard variable
542
+
areHistosInRegistry = true;
526
543
}
527
544
528
545
/// \brief Configures the object from the reco workflow
@@ -644,6 +661,11 @@ struct HfEventSelectionMc {
644
661
const HfCollisionRejectionMask rejectionMask,
645
662
constint nSplitColl = 0)
646
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