Skip to content
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

correction to check function #1970

Merged

Conversation

deependra170598
Copy link
Contributor

Correcting check function but still investigating trend problem

@deependra170598 deependra170598 marked this pull request as ready for review September 11, 2023 15:54
@deependra170598
Copy link
Contributor Author

Hi @knopers8 and @martenole, May you review this PR?

@@ -102,10 +102,14 @@ Quality TrackletPerTriggerCheck::check(std::map<std::string, std::shared_ptr<Mon

// applying check
float MeanTracletPertrigger = h->GetMean();
if (MeanTracletPertrigger > mDesiredMeanRegion.second && MeanTracletPertrigger < mDesiredMeanRegion.first) {
if (MeanTracletPertrigger < mDesiredMeanRegion.second && MeanTracletPertrigger > mDesiredMeanRegion.first) {
Copy link
Contributor

@martenole martenole Sep 14, 2023

Choose a reason for hiding this comment

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

to avoid these kind of typos wouldn't it be better to use two variables in your checker class, e.g. mThresholdMeanLow and mThresholdMeanHigh or something like that? And then for reading the parameters from json file I'd prefer you use the common getFromConfig as it is done for example in

// this is how to get access to custom parameters defined in the config file at qc.tasks.<task_name>.taskParameters
mDriftRegion.first = getFromConfig<float>(mCustomParameters, "driftRegionStart", 7.f);
mDriftRegion.second = getFromConfig<float>(mCustomParameters, "driftRegionEnd", 20.f);
mPulseHeightPeakRegion.first = getFromConfig<float>(mCustomParameters, "peakRegionStart", 0.f);
mPulseHeightPeakRegion.second = getFromConfig<float>(mCustomParameters, "peakRegionEnd", 5.f);
mPulseHeightThreshold = getFromConfig<unsigned int>(mCustomParameters, "phThreshold", 400u);
mChambersToIgnore = getFromConfig<string>(mCustomParameters, "ignoreChambers", "16_3_0");
mLayerLabelsIgnore = getFromConfig<bool>(mCustomParameters, "ignoreLabels", true);
. You'll need to include Common/Utils.h for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated this PR with the above suggestions.

ILOG(Debug, Support) << "configure() : using default timestam of now = " << mTimeStamp << ENDM;
}
auto mTimeStamp = getFromConfig<long>(mCustomParameters, "ccdbtimestamp", o2::ccdb::getCurrentTimestamp());
ILOG(Debug, Support) << "using timestamp = " << mTimeStamp << ENDM;
auto& mgr = o2::ccdb::BasicCCDBManager::instance();
Copy link
Contributor

Choose a reason for hiding this comment

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

what are you using the BasicCCDBManager for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I try to explain how I understood the concept of BasicCCDBManager. Although I do not fully understand.

  1. instance() method of class BasicCCDBManager : public CCDBManagerInstance initialise the class with ccdb server.
  2. Then setTimestamp() method is used for setting timestamp manually if required to be given from config file otherwise current time stamp is used. It set timestamp cache for all queries (line no. 75 of BasicCCDBManager.h).
  3. I see that BasicCCDBManager class itself by default set current timestamp (line no. 189 of BasicCCDBManager.h), so if we remove it from checker class it run without any problem.
  4. In lack of knowledge, I kept these line because I did not know its consequences.
    I will do how you suggest.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had in my mind that in background of workflow, It set the timestamp of QO object generated by checker class. And if a specific object is needed by any postprocessing in future, It can use that timestamp to query that QO object. Although this thought needs validation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi Deependra, I would simply remove the CCDB manager completely from your task, because to me it does not look like you are using it. In some cases people are requesting CCDB objects in their tasks and use the CCDB manager for it, but I don't think you need any calibration objects for your check so I would get rid of it to keep the code as clean as possible. Later we will need some CCDB objects for more advanced checks, but also there not the CCDB manager should be used anymore, but the more modern DPL CCDB fetcher. But we can talk about this when we get there :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Ole, I removed that part.

@deependra170598 deependra170598 marked this pull request as ready for review September 17, 2023 21:33
@deependra170598
Copy link
Contributor Author

Hi @knopers8 , May you look at it if any review is required from your side?

@knopers8
Copy link
Collaborator

macOS CI errors seem legit:

/Volumes/build/alice-ci-workdir/qualitycontrol-o2/sw/SOURCES/QualityControl/1970/0/Modules/TRD/src/TrackletPerTriggerCheck.cxx:69:119: error: format specifies type 'long' but the argument has type 'int' [-Werror,-Wformat]
        msg1->AddText(TString::Format("Hist Can't be ignored. Stat is enough. Entries: %d > Threshold: %ld", Entries, mStatThreshold));
                                                                                                       ~~~            ^~~~~~~~~~~~~~
                                                                                                       %d
--
        msg1->AddText(TString::Format("Hist Can't be ignored. Stat is enough. Entries: %d > Threshold: %ld", Entries, mStatThreshold));
                                                                                                       ~~~            ^~~~~~~~~~~~~~
                                                                                                       %d
/Volumes/build/alice-ci-workdir/qualitycontrol-o2/sw/SOURCES/QualityControl/1970/0/Modules/TRD/src/TrackletPerTriggerCheck.cxx:72:114: error: format specifies type 'long' but the argument has type 'int' [-Werror,-Wformat]
        msg1->AddText(TString::Format("Hist Can be ignored. Stat is low. Entries: %d < Threshold: %ld", Entries, mStatThreshold));
                                                                                                  ~~~            
...

@deependra170598 deependra170598 marked this pull request as draft October 8, 2023 10:43
@deependra170598 deependra170598 force-pushed the Correction-to-trackletCheck branch from eebfc79 to 3feda19 Compare October 8, 2023 10:44
@deependra170598 deependra170598 marked this pull request as ready for review October 9, 2023 09:02
@martenole
Copy link
Contributor

Thanks, should be good to merge now

@knopers8 knopers8 merged commit 819f499 into AliceO2Group:master Oct 10, 2023
2 checks passed
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