DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
PDVDEffectiveChannelMap.cpp
Go to the documentation of this file.
2
3namespace triggeralgs {
4
5PDVDEffectiveChannelMap::PDVDEffectiveChannelMap(unsigned int first_channel, unsigned int n_channels) :
6 m_first_channel(first_channel), m_n_channels(n_channels) {
7
8 m_n_channels_crp_block = m_n_channels / 4; // four crps in a plane, should = 292
9 m_n_effective_channels = m_n_channels / 2; // # effective channels half # true channels, should = 584
10}
11
12unsigned int PDVDEffectiveChannelMap::remapCollectionPlaneChannel(unsigned int original_channel) {
13 // subtract first channel on CRP from original_channel
14 // add first channel back at the end
15 unsigned int sub_original_channel = original_channel - m_first_channel;
16
17 const unsigned int crp_block = sub_original_channel / m_n_channels_crp_block; // 0..3
18
19 const unsigned int local_channel = sub_original_channel % m_n_channels_crp_block; // 0..291
20
21 // get the base channel based on which CRP block the originial channel is in
22 const unsigned int base_channel = (crp_block >= 2) ? m_n_channels_crp_block : 0;
23
24 // remapped channel is the base plus the local channel in the block
25 // and plus the first channel in the CRP plane
26 return base_channel + local_channel + m_first_channel;
27}
28
29} // triggeralgs
PDVDEffectiveChannelMap(unsigned int first_channel, unsigned int n_channels)
unsigned int remapCollectionPlaneChannel(unsigned int original_channel)