add pre-cut KL beam beta histogram#1122
Conversation
|
Thanks Keigo - could you please change making the histogram to the Init() function? This is generally where we define the histograms - you also don't have to worry about multithreading in that function. |
|
Thanks for the review. I’ve moved the pre-cut \beta histogram booking into DBeamKLong_factory::Init() as you suggested, and left BeginRun() for run-dependent geometry only; Fill() stays in Process() with the existing RootWriteLock. While testing with monitoring_hists and ReactionFilter together and NTHREADS>1, the job could still crash. The issue wasn’t the move to Init() by itself: in this JANA2 setup, Init() can run lazily on a worker thread the first time DBeamKLong is needed, while other threads are also using ROOT (gDirectory, etc.). Those directory operations aren’t thread-safe without the global ROOT lock. To fix that, the histogram booking block in Init() is now wrapped in JLockService::RootWriteLock() / RootUnLock() (same idea as elsewhere in halld_recon). With that, the same run configuration completes successfully multithreaded with monitoring_hists enabled. |
Add pre-cut KL beam beta histogram in
DBeamKLong_factory(filled beforebeta > 1cut).