Skip to content

Commit 9a91afd

Browse files
authored
[PWGDQ] Add protections when getting mcCollision assigned to collision (#9041)
1 parent 5ec7118 commit 9a91afd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ struct TableMakerMC {
476476
VarManager::ResetValues(0, VarManager::kNEventWiseVariables);
477477
VarManager::FillBC(bc);
478478
VarManager::FillEvent<TEventFillMap>(collision); // extract event information and place it in the fValues array
479-
VarManager::FillEvent<VarManager::ObjTypes::CollisionMC>(collision.mcCollision());
479+
if (collision.has_mcCollision()) {
480+
VarManager::FillEvent<VarManager::ObjTypes::CollisionMC>(collision.mcCollision());
481+
}
480482
if (fDoDetailedQA) {
481483
fHistMan->FillHistClass("Event_BeforeCuts", VarManager::fgValues);
482484
}

PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ struct AnalysisEventSelection {
217217
// Reset the fValues array and fill event observables
218218
VarManager::ResetValues(0, VarManager::kNEventWiseVariables);
219219
VarManager::FillEvent<TEventFillMap>(event);
220-
VarManager::FillEvent<VarManager::ObjTypes::ReducedEventMC>(event.reducedMCevent());
220+
if (event.has_reducedMCevent()) {
221+
VarManager::FillEvent<VarManager::ObjTypes::ReducedEventMC>(event.reducedMCevent());
222+
}
221223

222224
bool decision = false;
223225
// if QA is requested fill histograms before event selections

0 commit comments

Comments
 (0)