Skip to content

TOF: add trigger efficiency#733

Merged
Barthelemy merged 4 commits into
AliceO2Group:masterfrom
ercolessi:master
Jun 24, 2021
Merged

TOF: add trigger efficiency#733
Barthelemy merged 4 commits into
AliceO2Group:masterfrom
ercolessi:master

Conversation

@ercolessi
Copy link
Copy Markdown
Collaborator

@njacazio
Copy link
Copy Markdown
Collaborator

njacazio commented Jun 17, 2021

Ciao @ercolessi great work as usual. I have few very minor comments to improve the code but other than that outstanding job!
If you can consider my suggestions I would move this to ready for review from the QC team

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, what about defining a constexpr counter for the RDH names?

Comment thread Modules/TOF/include/TOF/TaskRaw.h Outdated

// Names of diagnostic counters
static const char* RDHDiagnosticsName[2]; /// RDH Counter names
static const char* RDHDiagnosticsName[3]; /// RDH Counter names
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like static constexpr unsigned int nRDHwords = 3

Comment thread Modules/TOF/include/TOF/TaskRaw.h Outdated
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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Maybe in the comment you could say why we need 2 of these

Comment thread Modules/TOF/include/TOF/TaskRaw.h Outdated
@@ -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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!)

Comment thread Modules/TOF/include/TOF/TaskRaw.h Outdated
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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have also the trigger efficiency? The comment is not so clear I fear

Comment thread Modules/TOF/src/TaskRaw.cxx Outdated
{
mCounterRDH[rdh->feeId & 0xFF].Count(0);

//Fatal
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything clear, sounds perfect! I'm on it

Comment thread Modules/TOF/src/TaskRaw.cxx Outdated

//Trigger expected and served
if (rdh->stop) { // if RDH close
int triggerserved = ((rdh->detectorField & 0xFF00070F) >> 24);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's const these bad boys

Comment thread Modules/TOF/src/TaskRaw.cxx Outdated
//Trigger error
mCounterRDH[rdh->feeId & 0xFF].Count(2);
}
//Trigger efficiency
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not strictly the trigger efficiency, maybe you can consider adding: Ingredients for the trigger efficiency (also for the future)

Comment thread Modules/TOF/src/TaskRaw.cxx Outdated
}
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));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe consider using the explicitly the cast i.e. static_cast<double>(... ) or float

@njacazio
Copy link
Copy Markdown
Collaborator

@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
@ercolessi ercolessi changed the title [WIP] TOF: add trigger efficiency TOF: add trigger efficiency Jun 23, 2021
@ercolessi ercolessi marked this pull request as ready for review June 23, 2021 11:58
Copy link
Copy Markdown
Collaborator

@njacazio njacazio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ciao Francesca, for me it's top quality. Few suggestions but I would go forth.
Thanks a lot!
Nicolo'

Comment thread Modules/TOF/include/TOF/TaskRaw.h Outdated
static const char* TRMDiagnosticName[nwords]; /// TRM Counter names
// Diagnostic counters
Counter<2, RDHDiagnosticsName> mCounterRDH[ncrates]; /// RDH Counters
Counter<3, RDHDiagnosticsName> mCounterRDH[ncrates]; /// RDH Counters
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could use the new nRDHwords

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes indeed thanks!

Comment thread Modules/TOF/src/TaskRaw.cxx Outdated
}

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" };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could use the new nRDHwords

@njacazio
Copy link
Copy Markdown
Collaborator

@Barthelemy @knopers8 I think we are done now and are ready to merge as soon as the tests are passed.
Btw, 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 ? Would that be possible?

@Barthelemy
Copy link
Copy Markdown
Collaborator

@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).

@Barthelemy
Copy link
Copy Markdown
Collaborator

https://alice.its.cern.ch/jira/browse/QC-605

//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);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InfoLogger is used in some places and FairLogger in some others. It is ok for me, just raising your awareness about it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! We will address it in the next PR

@Barthelemy Barthelemy merged commit e3b29da into AliceO2Group:master Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants