−Table of Contents
Where Triggers Are Written in Midas
It looks like the triggers are written on line 935 of the code “towerfe3.c.” Is that the trigger front-end we are currently using? The code is located at `/home/hep/cdmssoft/scdmsDAQ/MidasDAQ/online/src/RevC/towerfe3.c`
- Branch: DCRC1trigmod
- Commit: 0x8a9b0ee
The triggers are stored into an intermediate object called “trigsource” and then written into the “pdata32” object which looks like it's written into a bank on line 673.
So, this was a red herring. The “trigsource” variable is indeed written to the file, but if I look in `/home/hep/cdmssoft/scdmsDAQ/MidasDAQ/online/src/RevC/triggerfe2.c` lines 858 - 865, I can see the encoding of that trigger information.
The moral of the story is that we only have access to event type (which is already fed through properly to the RQs), tower (which is useless because we only have one “tower”), and DCRC for all of the triggers.
However, for Run 68 we only trigger on one DCRC. So we can't get any more fine-grained information. This might be useful in the future if we decide to have a run where multiple DCRCs are triggering.
Where Can We Pick Up The Info in CDMSBATS
I confirmed that we can feed the info through CDMSBATS to the RQs fairly easily. Basically, in v5.7.6 or earlier of BatCommon, we have to modify the object “TriggerData” specified in the file `BatCommon/datareader/TriggerData.h` to have new RQs for Midas data.
We can then transfer information into those RQs in lines 684 - 835 of `BatCommon/datareader/RawDataReader.cxx`, then the RQs will automatically be written by BatRoot.
NOTE: in versions of BatCommon v5.8.0 and later, the code in RawDataReader.cxx has been replaced with a library call to the external library “IOLibrary,” so if we ever want to make these changes the code changes above should be applied to the IOLibrary code instead of RawDataReader.cxx and TriggerData.h/.cxx. One awkward fact right now is that no cdmsbats release currently works with the IOLibrary. That's why above I said to do the changes to BatCommon v5.7.6 or earlier. In the future it will probably make sense to do the changes to IOLibrary instead, after cdmsbats has been made to work with IOLibrary fully.
Recommendation
Don't do any of the CDMSBATS code modification at this time because we have nothing to gain for Run 68.