Skip to content

Commit

Permalink
Merge pull request #1499 from VinzenzBildstein/main
Browse files Browse the repository at this point in the history
Fixing bug in TAnalysisWriteLoop (#1498)
  • Loading branch information
VinzenzBildstein authored Jan 21, 2025
2 parents 3306a28 + 40d8328 commit 38b2206
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libraries/TLoops/TAnalysisWriteLoop.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void TAnalysisWriteLoop::AddBranch(TClass* cls)
newBranch->Fill();
}

std::cout << "\r" << std::string(30, ' ') << "\r" << Name() << ": added \"" << cls->GetName() << R"(" branch)" << std::endl;
std::cout << "\r" << std::string(30, ' ') << "\r" << Name() << ": added \"" << cls->GetName() << R"(" branch, )" << det_pp << ", " << det_p << std::string(30, ' ') << std::endl;

// Unlock after we are done.
TThread::UnLock();
Expand All @@ -203,12 +203,13 @@ void TAnalysisWriteLoop::WriteEvent(std::shared_ptr<TUnpackedEvent>& event)
// Load current events
for(const auto& det : event->GetDetectors()) {
TClass* cls = det->IsA();
// attempt to copy this detector into the detector map
// if that fails (because the detector isn't in the map yet), create the branch and then copy this detector
try {
*fDetMap.at(cls) = det.get();
//**fDetMap.at(cls) = *det;
**fDetMap.at(cls) = *det;
} catch(std::out_of_range& e) {
AddBranch(cls);
**fDetMap.at(cls) = *det; //(det.get());
**fDetMap.at(cls) = *det;
}
(*fDetMap.at(cls))->ClearTransients();
}
Expand Down

0 comments on commit 38b2206

Please sign in to comment.