BEMC data in bfc->picoDst production

Introduction:

BEMC data were not filled in daq->picoDst production. The production had to be done in two steps: daq->MuDst, and MuDst->picoDst conversion (genDst.C). In the second step, StEmcADCtoEMaker and StTriggerSimuMaker are called and BEMC information could be filled properly.
BEMC data in picoDst includes three branches (BTOWHit, EmcPidTraits, EmcTrigger). The first two require calibrated EMC energy information, while the last one needs StTriggerSimuMaker.

This blog documents how the issue was resolved and BEMC data is now filled in daq->picoDst production in one step.

Pull Request #314

This PR addressed the main issue.
1) missing EMC energy information in BTOWHit and EmcPidTraits:  this was done by an update in StPicoDstMaker to obtain the StEmcCollection pointer from StEvent directly. The StEmcCollection has been filled in the standard daq production chain in StEmcRawMaker including both raw and calibrated information.
2) trgSimu option added to BFC chain options for StTriggerSimuMaker. It will be loaded between StMuDstMaker and StPicoDstMaker during the production chain.
3) To have valid EmcTrigger information in daq->picoDst production, StTriggerSimuMaker has been modified to obtain tables through StEmcRawMaker (default was StEmcADCtoEMaker used on MuDst). However, default StTriggerSimuMaker requires a check on number of BTOW hits = 4800 (maximum), while in the EmcCollection obtained from StEmcRawMaker, number of BTOW hits is reduced (probably due to masking). To avoid crash in StTriggerSimuMaker, StEmcRawMaker is configured to mSaveAllStEvent = kTRUE.
4) In order to have reasonable EmcTrigger data, one needs to also update two DB tables for each run: under Calibrations_trg, table triggerCondition and triggerThreshold. Please refer to StRoot/StTriggerUtilities/macros/ for instructions (maintainer: Zilong Chang)

The PR was merged into main on 3/7/2022, and included in SL22a release used for Run19 AuAu200GeV production.

After the merge, Gene soon reported that from the DEV nightly test production, the MuDst data size increased by x2 for some datasets.

Pull Request #329

This issue is related to the mSaveAllStEvent = kTRUE configuration for StEmcRawMaker, so that many unsuppressed data are dumped into StEvent (size increases too) and MuDst. In MuDst, a few additional branches: EmcPrs (array size 4800) and EmcSmde, EmcSmdp (both arrays with size of 18000) were added.
This PR addresses the MuDst size issue by modifying the StEmcRawMaker configuration. A new switch was added (mSaveAllBTOW) to enable saving all BTOW only in picoDst production (no other PRS or SMD detectors). Code has been tested with several different datasets. Here are comparisons

1) Current DEV:

-rw-r--r-- 1 dongx rhstar 11449085 Mar 16 15:47 st_physics_17155014_raw_3000009.MuDst.root
-rw-r--r-- 1 dongx rhstar  7964331 Mar 16 14:15 st_physics_18069061_raw_2000021.MuDst.root
-rw-r--r-- 1 dongx rhstar  3302263 Mar 16 14:35 st_physics_19099012_raw_1000031.MuDst.root
-rw-r--r-- 1 dongx rhstar 16238052 Mar 17 17:15 st_physics_20192002_raw_1500018.MuDst.root
-rw-r--r-- 1 dongx rhstar  1480149 Mar 16 13:56 st_physics_22134030_raw_4500015.MuDst.root
-rw-r--r-- 1 dongx rhstar 15298647 Mar 16 14:59 st_physics_adc_23032031_raw_6500079.MuDst.root

2) Update with this PR:

-rw-r--r-- 1 dongx rhstar  4712069 Mar 16 16:28 st_physics_17155014_raw_3000009.MuDst.root
-rw-r--r-- 1 dongx rhstar  7288959 Mar 16 16:48 st_physics_18069061_raw_2000021.MuDst.root
-rw-r--r-- 1 dongx rhstar  2626757 Mar 16 16:47 st_physics_19099012_raw_1000031.MuDst.root
-rw-r--r-- 1 dongx rhstar 12866023 Mar 17 18:08 st_physics_20192002_raw_1500018.MuDst.root
-rw-r--r-- 1 dongx rhstar   804701 Mar 16 16:56 st_physics_22134030_raw_4500015.MuDst.root
-rw-r--r-- 1 dongx rhstar 14623278 Mar 16 17:13 st_physics_adc_23032031_raw_6500079.MuDst.root

3) DEV after removing the StTriggerSimuMaker related changes in PR 314 (basically old version)

-rw-r--r-- 1 dongx rhstar  4712076 Mar 16 15:46 st_physics_17155014_raw_3000009.MuDst.root
-rw-r--r-- 1 dongx rhstar  7288968 Mar 16 15:37 st_physics_18069061_raw_2000021.MuDst.root
-rw-r--r-- 1 dongx rhstar  2625205 Mar 16 15:23 st_physics_19099012_raw_1000031.MuDst.root
-rw-r--r-- 1 dongx rhstar 12866043 Mar 17 17:15 st_physics_20192002_raw_1500018.MuDst.root
-rw-r--r-- 1 dongx rhstar   804686 Mar 16 14:45 st_physics_22134030_raw_4500015.MuDst.root

-rw-r--r-- 1 dongx rhstar 14623278 Mar 16 15:10 st_physics_adc_23032031_raw_6500079.MuDst.root

4) SL21d production

-rw-r--r-- 1 dongx rhstar  4689692 Mar 17 18:05 st_physics_17155014_raw_3000009.MuDst.root
-rw-r--r-- 1 dongx rhstar  7268004 Mar 17 18:07 st_physics_18069061_raw_2000021.MuDst.root
-rw-r--r-- 1 dongx rhstar  2604266 Mar 17 18:02 st_physics_19099012_raw_1000031.MuDst.root
-rw-r--r-- 1 dongx rhstar 12842941 Mar 17 18:07 st_physics_20192002_raw_1500018.MuDst.root
-rw-r--r-- 1 dongx rhstar   783647 Mar 17 17:59 st_physics_22134030_raw_4500015.MuDst.root
  - (SL21d library doesn't work with pp2022 chain option)


One can see the new MuDst size has reduced from 1) to 2), and 2) is very close to 3) (small difference in the valid EmcTrigger data now in 2)) and SL21d production. I also compared the output picoDst data entries between 1) and 2) and they are identical with eyeball test for first few entries.