I was trying to enable run summary tree output for datahandlers. A few problems are observed in datahandlers. The first two are related with output tree entries. The last point proposes a possible way to enable mulc summary tree and tested with PREX run 4978 in develop branch using prompt config :
./build/qwparity -r 4978 -c prex_prompt.conf
Similar issue seems to happen in LRBcorrelator and burst tree output. The accumulating method for QwCorrelator causes ' number divided by zero error ' and probably related with not checking ErrorFlag. LRBCorrelator+burst feature may be still under development, so I didn't make further changes in them.
So, this post only works for run summary output for combiners, eg mulc.
1. VQwDataHandler constructed and to-be-filled tree name could be inconsistent if prefix is specified
2. In develop branch, datahandlerarray evt and mul fill duplicate events at the end of run
See in the snapshot, the last two rows showing the same values
Fixed in commit 724bc1605b5b8b58dcd3b21b68d3ecf226f72a71 and note that this problem doesn't exist in operations branch.
3. A few modifications needed to enable run summary tree output for combiners correctly
Current DataHandler's AccumulateRunningSum() method is not checking ErrorFlag and accumulates all events. I assume we only want to accumulate good combiner events and
proposed a possible solution in commit 45e769763459ec50df658d91daa7bb6b78f5a533 . LRBCorrelator may have similar issue with its AccumulateRunningSum() method and burst tree is still under test, I am not confident to make further changes.
Modified VQwDataHandler::AccumulateRunningSum() to accumulate ErrorFlag==0 patterns only;
Modified one QwCombiner::ConnectChannels() to propagate subsystem array ErrorFlag to 'this' QwCombiner object ;
Modified one LRB += operator to detour a problem of being divided by zero good event since QwCorrelator::AccumulateRunningSum is not checking ErrorFlag yet.
I was trying to enable run summary tree output for datahandlers. A few problems are observed in datahandlers. The first two are related with output tree entries. The last point proposes a possible way to enable mulc summary tree and tested with PREX run 4978 in develop branch using prompt config :
./build/qwparity -r 4978 -c prex_prompt.conf
Similar issue seems to happen in LRBcorrelator and burst tree output. The accumulating method for QwCorrelator causes ' number divided by zero error ' and probably related with not checking ErrorFlag. LRBCorrelator+burst feature may be still under development, so I didn't make further changes in them.
So, this post only works for run summary output for combiners, eg mulc.
1. VQwDataHandler constructed and to-be-filled tree name could be inconsistent if prefix is specified
VQwDataHandler:ConstructTreeBranches function doesn't re-assign tree name with prefix and FillTreeBranches function uses bare tree name, which will result in empty tree and filling incorrect target tree.
https://github.com/JeffersonLab/japan/blob/564bb5553ddcdbfe1464414653b488b8217deb51/Parity/src/VQwDataHandler.cc#L245 https://github.com/JeffersonLab/japan/blob/564bb5553ddcdbfe1464414653b488b8217deb51/Parity/src/VQwDataHandler.cc#L264 For example, in develop branch, it creates "burst_mulc" tree but entries are filled to "mulc". Together with the second bullet below. "mulc" tree has extra 5 events than "mul" tree and empty "burst_mulc" , see below snapshot
Also, QwVQWK_Channel extracts prefix upto "|" marker, so order between fPrefix and branchprefix needs to be swapped so that fPrefix is preserved https://github.com/JeffersonLab/japan/blob/564bb5553ddcdbfe1464414653b488b8217deb51/Parity/src/VQwDataHandler.cc#L245 https://github.com/JeffersonLab/japan/blob/564bb5553ddcdbfe1464414653b488b8217deb51/Analysis/src/QwVQWK_Channel.cc#L679 Fixed in commit 8228674f1934e726b549e2de331ed575a37e44ef
2. In develop branch, datahandlerarray evt and mul fill duplicate events at the end of run
See in the snapshot, the last two rows showing the same values
Fixed in commit 724bc1605b5b8b58dcd3b21b68d3ecf226f72a71 and note that this problem doesn't exist in operations branch.
3. A few modifications needed to enable run summary tree output for combiners correctly
Current DataHandler's AccumulateRunningSum() method is not checking ErrorFlag and accumulates all events. I assume we only want to accumulate good combiner events and proposed a possible solution in commit 45e769763459ec50df658d91daa7bb6b78f5a533 . LRBCorrelator may have similar issue with its AccumulateRunningSum() method and burst tree is still under test, I am not confident to make further changes.