In the MCH processing workflow we would like to define the time of the digits as “TimeFrame ID” + “number of bunch crossings since the beginning of the TimeFrame”.
While we have a solution fo the “number of bunch crossings”, I am not able to find a way to retrieve the current TimeFrame ID when processing the data coming from the TimeFrameBuilder.
My tests are based on some old VerticalSlice test data that we collected in March, replied via the subTimeFrameBuilder with the following command:
StfBuilder --id stf_builder-0 --transport shmem --detector MCH --dpl-channel-name=dpl-chan --channel-config "name=dpl-chan,type=push,method=bind,address=ipc:///tmp/stf-builder-dpl-pipe-0,transport=shmem,rateLogging=1" --data-source-dir=2020-03-10T16_09_42Z --data-source-enable
The input folder looks like this:
$> ls 2020-03-10T16_09_42Z/
2020-03-10_00002478.tf 2020-03-10_00002478.tf.info
and the beginning of the tf.info file is like this:
$> head 2020-03-10T16_09_42Z/2020-03-10_00002478.tf.info
TF_ID TF_OFFSET TF_SIZE ORIGIN DESC SUBSPEC DATA_IDX HDR_OFF HDR_SIZE DATA_OFF DATA_SIZE RDH_MEM_SIZE RDH_STOP_BIT RDH_FEE_ID RDH_ORBIT RDH_BC RDH_TRG
2478 0 140108136 MCH RAWDATA 0x000a0001 0 2536 80 2616 16384 128 1 4844 821853749 0 0x00000803
2478 0 140108136 MCH RAWDATA 0x000a0001 1 19000 80 19080 16384 128 1 4844 821853750 0 0x00000007
2478 0 140108136 MCH RAWDATA 0x000a0001 2 35464 80 35544 16384 128 1 4844 821853751 0 0x00000007
2478 0 140108136 MCH RAWDATA 0x000a0001 3 51928 80 52008 16384 128 1 4844 821853752 0 0x00000007
2478 0 140108136 MCH RAWDATA 0x000a0001 4 68392 80 68472 16384 128 1 4844 821853753 0 0x00000007
2478 0 140108136 MCH RAWDATA 0x000a0001 5 84856 80 84936 16384 128 1 4844 821853754 0 0x00000007
2478 0 140108136 MCH RAWDATA 0x000a0001 6 101320 80 101400 16384 128 1 4844 821853755 0 0x00000007
2478 0 140108136 MCH RAWDATA 0x000a0001 7 117784 80 117864 16384 128 1 4844 821853756 0 0x00000007
2478 0 140108136 MCH RAWDATA 0x000a0001 8 134248 80 134328 16384 128 1 4844 821853757 0 0x00000007
In a separate shell I am running the o2-dpl-raw-proxy to inject the TimeFrames into our DPL workflow:
o2-dpl-raw-proxy -b --dataspec "A:MCH/RAWDATA" --channel-config "name=readout-proxy,type=pull,method=connect,address=ipc:///tmp/stf-builder-dpl-pipe-0,transport=shmem,rateLogging=1" --session default | o2-mch-raw-to-digits-workflow -b --session default
The raw-to-digits workflow parses the input messages using the DPLRawParser
, like this:
DPLRawParser parser(inputs, o2::framework::select("TF:MCH/RAWDATA"));
for (auto it = parser.begin(), end = parser.end(); it != end; ++it) {
auto const* rdh = it.get_if<RDH>();
auto const* raw = it.raw();
size_t payloadSize = it.size();
const auto* dh = it.o2DataHeader();
}
Is there a way to access the current TF ID at this level? The DatahHeader
structure has a tfCounter
field, but it seems to be a simple incremental counter that does not match the actual TF ID…
Thanks!
Cheers, Andrea