TOF: add trigger efficiency#733
Conversation
|
Ciao @ercolessi great work as usual. I have few very minor comments to improve the code but other than that outstanding job! |
| static const char* DRMDiagnosticName[nwords]; /// DRM Counter names | ||
| static const char* LTMDiagnosticName[nwords]; /// LTM Counter names | ||
| static const char* TRMDiagnosticName[nwords]; /// TRM Counter names | ||
| // Diagnostic counters |
There was a problem hiding this comment.
Great job, what about defining a constexpr counter for the RDH names?
|
|
||
| // Names of diagnostic counters | ||
| static const char* RDHDiagnosticsName[2]; /// RDH Counter names | ||
| static const char* RDHDiagnosticsName[3]; /// RDH Counter names |
There was a problem hiding this comment.
something like static constexpr unsigned int nRDHwords = 3
| Counter<nequipments, nullptr> mCounterNoisyChannels; /// Counter for noisy channels | ||
| Counter<1024, nullptr> mCounterTimeBC; /// Counter for the Bunch Crossing Time | ||
| Counter<91, nullptr> mCounterNoiseMap[ncrates][4]; /// Counter for the Noise Hit Map | ||
| Counter<ncrates, nullptr> mCounterRDHTriggers[2]; /// Counter for RDH served and received triggers |
There was a problem hiding this comment.
Perfect! Maybe in the comment you could say why we need 2 of these
| @@ -83,6 +83,7 @@ class RawDataDecoder final : public DecoderBase | |||
| Counter<nequipments, nullptr> mCounterNoisyChannels; /// Counter for noisy channels | |||
| Counter<1024, nullptr> mCounterTimeBC; /// Counter for the Bunch Crossing Time | |||
| Counter<91, nullptr> mCounterNoiseMap[ncrates][4]; /// Counter for the Noise Hit Map | |||
There was a problem hiding this comment.
If you feel particularly majestic you could add in the comment that we have one per crate and one per FEA (the documentation will pay off in the future!)
| std::shared_ptr<TH1F> mHistoIndexEO; /// Index in electronic | ||
| std::shared_ptr<TH1F> mHistoIndexEOInTimeWin; /// Index in electronic for noise analysis | ||
| std::shared_ptr<TH1F> mHistoIndexEOIsNoise; /// Noise hit map x channel | ||
| std::shared_ptr<TH1F> mHistoRDHTriggers; /// RDH served and received trigger efficiency |
There was a problem hiding this comment.
Does this have also the trigger efficiency? The comment is not so clear I fear
| { | ||
| mCounterRDH[rdh->feeId & 0xFF].Count(0); | ||
|
|
||
| //Fatal |
There was a problem hiding this comment.
Maybe here it is worth to extend a bit the comment, fatal is a bit too harsh maybe and we can consider printing warning messages, what do you think?
There was a problem hiding this comment.
Ciao @njacazio, many thanks for the comments!
So, fatal is how Roberto refers to it in AliceO2Group/AliceO2@90c8e48 .
How would you suggest to change it?
For the warning: sounds great, where you thinking of a LOG(WARNING) or using a checker?
There was a problem hiding this comment.
I mean, I don't think we want to throw a fatal error if we encounter this word here, therefore I would at least call it Case for the RDH word: fatal or something that to explain that it is not an error in our task.
I guess you can put the LOG and we will implement the checker as well to inform the QC crew.
Does it seem reasonable?
There was a problem hiding this comment.
Everything clear, sounds perfect! I'm on it
|
|
||
| //Trigger expected and served | ||
| if (rdh->stop) { // if RDH close | ||
| int triggerserved = ((rdh->detectorField & 0xFF00070F) >> 24); |
There was a problem hiding this comment.
let's const these bad boys
| //Trigger error | ||
| mCounterRDH[rdh->feeId & 0xFF].Count(2); | ||
| } | ||
| //Trigger efficiency |
There was a problem hiding this comment.
This is not strictly the trigger efficiency, maybe you can consider adding: Ingredients for the trigger efficiency (also for the future)
| } | ||
| mHistoSlotParticipating->SetBinContent(crate + 1, 1, mDecoderRaw.mCounterRDH[crate].HowMany(0)); | ||
| if (mDecoderRaw.mCounterRDHTriggers[1].HowMany(crate) != 0) { | ||
| mHistoRDHTriggers->SetBinContent(crate + 1, (double)mDecoderRaw.mCounterRDHTriggers[0].HowMany(crate) / mDecoderRaw.mCounterRDHTriggers[1].HowMany(crate)); |
There was a problem hiding this comment.
maybe consider using the explicitly the cast i.e. static_cast<double>(... ) or float
|
@Barthelemy @knopers8 now that we have more people working on the TOF QC project could we have some codeowners for the TOF directory so that we are triggered when something is changed ? Is this possible? |
- Add protection
njacazio
left a comment
There was a problem hiding this comment.
Ciao Francesca, for me it's top quality. Few suggestions but I would go forth.
Thanks a lot!
Nicolo'
| static const char* TRMDiagnosticName[nwords]; /// TRM Counter names | ||
| // Diagnostic counters | ||
| Counter<2, RDHDiagnosticsName> mCounterRDH[ncrates]; /// RDH Counters | ||
| Counter<3, RDHDiagnosticsName> mCounterRDH[ncrates]; /// RDH Counters |
There was a problem hiding this comment.
Maybe you could use the new nRDHwords
There was a problem hiding this comment.
yes indeed thanks!
| } | ||
|
|
||
| const char* RawDataDecoder::RDHDiagnosticsName[2] = { "RDH_HAS_DATA", "RDH_DECODER_FATAL" }; | ||
| const char* RawDataDecoder::RDHDiagnosticsName[3] = { "RDH_HAS_DATA", "RDH_DECODER_FATAL", "RDH_TRIGGER_ERROR" }; |
There was a problem hiding this comment.
Maybe you could use the new nRDHwords
|
@Barthelemy @knopers8 I think we are done now and are ready to merge as soon as the tests are passed. |
|
@njacazio I am going to take a quick look and approve it. Concerning CODEOWNERS I think that it is a good idea. I'll look into it (no idea how it works). |
| //Case for the RDH word "fatal" | ||
| if ((rdh->detectorField & 0x00010000) != 0) { | ||
| mCounterRDH[rdh->feeId & 0xFF].Count(1); | ||
| LOG(WARNING) << "RDH flag \"fatal\" error occurred in crate " << static_cast<int>(rdh->feeId & 0xFF); |
There was a problem hiding this comment.
InfoLogger is used in some places and FairLogger in some others. It is ok for me, just raising your awareness about it.
There was a problem hiding this comment.
Thanks! We will address it in the next PR
@njacazio