-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
straw digis from artdaq fragments #1402
base: main
Are you sure you want to change the base?
Conversation
pavel1murat
commented
Jan 24, 2025
- add module reconstructing straw digis from artdaq fragments
- known missing pieces:
- correct assignment of strawID's :
- need to have that uploaded to FPGAs
- need to decide how to assign the straw IDs to the existing panels
- lower bits of the TDC words - to be fixed in firmware
- bit ordering in ADC samples - to be fixed in the firmware
Hi @pavel1murat,
which require these tests: build. @Mu2e/write, @Mu2e/fnalbuild-users have access to CI actions on main. ⌛ The following tests have been triggered for ccfef14: build (Build queue has 1 jobs) |
☀️ The build tests passed at ccfef14.
N.B. These results were obtained from a build of this Pull Request at ccfef14 after being merged into the base branch at df7782c. For more information, please check the job page here. |
@pavel1murat Thanks for pushing this, Pasha. I can confirm that this runs and produces digis. I will take a look at the code a bit later, but one question to clarify:
what does this mean for data we have already taken? I thought there was an effectively-fixed straw <-> id mapping, but this implies (to me) that we don't currently know which straws are being hit. Am I misunderstanding? |
I want to add there is only one map (~ROC number to ~panel number) in offline. Data with only small parts of the detector can be handled in different way for things like calibrations. Please keep me (and I'd also suggest Richie) in the loop for any channel numbering discussions, if it might effect offline. Thanks |
📝 The HEAD of |
Is there anyone besides Ed who should review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments trying to think ahead to dealing with a nonzero error rate in the payload. I'm inclined to say that the ProtonBunchTime
and IntensityInfoTrackerHits
aren't necessary in this module, but if they fit into a larger pattern then it's ok.
auto adc_packet = (mu2e::TrackerDataDecoder::TrackerADCPacket*)((char*) hit + 16); // the packet size is 16 bytes | ||
while (npackets < nADCPackets_) { | ||
wf[++idx] = adc_packet->ADC0; | ||
wf[++idx] = adc_packet->ADC1(); | ||
wf[++idx] = adc_packet->ADC2; | ||
wf[++idx] = adc_packet->ADC3; | ||
wf[++idx] = adc_packet->ADC4(); | ||
wf[++idx] = adc_packet->ADC5; | ||
wf[++idx] = adc_packet->ADC6; | ||
wf[++idx] = adc_packet->ADC7(); | ||
wf[++idx] = adc_packet->ADC8; | ||
wf[++idx] = adc_packet->ADC9; | ||
wf[++idx] = adc_packet->ADC10(); | ||
wf[++idx] = adc_packet->ADC11; | ||
npackets++; | ||
adc_packet++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only general concern I have is that I don't see any integrity checks. It is an efficient deserialization assuming the fragments are error-free, but it may produce uncaught exceptions, or even terminate ungracefully, if there is an error in the payload. The canonical example being the missing-packet problem we've encountered, which L248 for example assumes cannot happen. Without considering that, then this will eventually read an out-of-bounds address, which will either cause process termination or silent data corruption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DJ will bring this up at the pass1 workshop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guys, I'm trying to reply, but am having difficulties. would be happy to talk - shall we have this discussion on ZOOM or on slack , where there are threads, at the very least ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following an offline discussion, I had misunderstood the nature of the errors we currently expect to encounter. We may go out-of-sequence when parsing the packed data, but there is not a mechanism by which we foresee encountering an out-of-bounds read like I suggested. Pasha will implement a simple check for having gone out-of-sequence, and utilize the StrawDigiFlag
data product to mark digis in such an event as having been part of problematic event.
@rlcee Following a discussion with Richie, we think the channel-numbering business amounts to applying the mapping you reference to a per-panel DCS write during configuration, so I don't foresee needing any to tweak anything in Offline. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this module relate to the existing StrawRecoFromFragments?
#define TRACEMF_USE_VERBATIM 1 | ||
|
||
#include "TRACE/tracemf.h" | ||
#define TRACE_NAME "StrawRecoFromArtdaqFragments" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this would be the first actual use of TRACE in offline. If it just being used to log steps, that should be messagelogger. If it is being used for timing studies, then I'd like to have a discussion in the reco meeting on whether we will converge on offline tools or allow developer preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pasha agree to comment out trace for now, there is no specific need
} | ||
// ====================================================================== | ||
|
||
class art::StrawRecoFromArtdaqFragments : public EDProducer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preference would be to call this "StrawDigiFrom" instead of "StrawRecoFrom" since there is no reco in the way I'd use the word.
|
||
public: | ||
|
||
struct RocDataHeaderPacket_t { // 8 16-byte words in total |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this the sort of thing that goes in artdaq_core_mu2e?
// HV side has an extra bit in teh straw ID | ||
//----------------------------------------------------------------------------- | ||
uint16_t straw_id = hit->StrawIndex; | ||
if (straw_id >= 0x80) straw_id = straw_id - 0x80; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes from just how the panel id registers are set on powerup right now - if those are written to correctly by the DAQ before taking data this fix is not needed
One thing that seems to be missing here is the ability to deal with different packet formats - the artdaq_core_mu2e decoder has code to automatically upgrade older formats, how would that work here? |