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

[TRD]: Check on hc2d #2152

Closed

Conversation

deependra170598
Copy link
Contributor

Hi @martenole and others!
In this PR, I tried to implement check on Half Chamber status.
It contains two sub checks...

  • Checks if any bin of trackletsperHC2D is empty
  • Checks if any chamber is masked.

Any masked half-chamber or empty chamber results in bad quality otherwise good.

Copy link
Contributor

@martenole martenole left a comment

Choose a reason for hiding this comment

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

Thanks for the work Deependra, but I think we need to refine the check a bit. And please make check if other checkers are not using the DPL CCDB fetching mechanism as well.

ILOG(Debug, Support) << "configure() : using default timestam of now = " << mTimestamp << ENDM;
}
auto& mgr = o2::ccdb::BasicCCDBManager::instance();
mgr.setTimestamp(mTimestamp);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should checks still use the BasicCCDBManager? Should one not use the DPL CCDB fetching mechanism instead? This we do for example in the TrackletsTask or DigitsTask

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I discussed with Piotr, He told me this is not possible.

double content = h->GetBinContent(i, j);
if (content == 0) {
result1 = Quality::Bad;
result1.addReason(FlagReasonFactory::Unknown(), "some half chambers are empty");
Copy link
Contributor

Choose a reason for hiding this comment

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

But if the bin is empty and the half-chamber is already flagged as bad, then the quality should not be bad. It should still be good.

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 tried to address this issue. Please let me know something is wrong in new commit.

if (TRDHelpers::isHalfChamberMasked(hcid, mChamberStatus)) {
ILOG(Debug, Trace) << "Masked half Chamber id =" << hcid << ENDM;
result2 = Quality::Bad;
result2.addReason(FlagReasonFactory::Unknown(), "some chmabers are masked");
Copy link
Contributor

Choose a reason for hiding this comment

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

For some masked chambers everything is still OK. We will always have that, so your check would never yield good quality. I would change quality to bad based on masked chambers only if we have either a full sector masked or more than 40% of all half-chambers masked from DCS side

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 tried to address this also. let me know if something wrong.

Copy link
Contributor Author

@deependra170598 deependra170598 Mar 9, 2024

Choose a reason for hiding this comment

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

Screenshot 2024-03-10 012209
I am having issue with timestamp which need to correctly given as input in config. I need to learn about it. May be I need to talk piotr again.

…40% of chambers are masked or any entire sector is masked
@martenole
Copy link
Contributor

Hi @deependra170598 do you have time for a debug session maybe tomorrow at some point? Concerning the timestamp I saw this code in MFT where they obtain the time directly from the MO. That makes more sense to me then setting it as parameter..

long timestamp = mo->getValidity().getMin();
map<string, string> headers;
map<std::string, std::string> filter;
auto calib = UserCodeInterface::retrieveConditionAny<o2::itsmft::NoiseMap>("MFT/Calib/DeadMap/", filter, timestamp);

@deependra170598
Copy link
Contributor Author

deependra170598 commented Mar 14, 2024

Hi Ole, I used the same way of fetching ccdbTimeStamp as you mentioned. Right now I am getting the same flag message as shown in the above picture for the chamber map shown in this picture.
Screenshot 2024-03-15 023917. If you find everything is okay then I can clean the code and remove commented lines.

Copy link
Contributor

@martenole martenole left a comment

Choose a reason for hiding this comment

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

I am adding some small comments now. But I think we can also go through this PR together next week

namespace o2::quality_control_modules::trd
{

void CheckOnHc2d::configure()
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need this method at all?

if (TRDHelpers::isHalfChamberMasked(hcid, mChamberStatus)) {
ILOG(Debug, Trace) << "Masked half Chamber id =" << hcid << ENDM;
nMaskedHC++;
if (nMaskedHC > (NCHAMBER * 2 * 0.4)) { // if nMaskedHC is greator than 40% of all chambers
Copy link
Contributor

Choose a reason for hiding this comment

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

The 40% should be a parameter that we can change from the json file

auto* h = dynamic_cast<TH2F*>(mo->getObject());

if (checkResult == Quality::Good) {
h->SetFillColor(kGreen);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does one see it if the histogram fill color for a TH2 changes if we draw it with COLZ option? I think we need a text box here

@deependra170598
Copy link
Contributor Author

Right now I am closing this PR. I will first merge TrackletsCheck and TrackletCountsCheck then will work on 2DHC check.

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.

2 participants