BD and QA event flag overhaul#89
Conversation
… these events in revan
…updated variable names
| //! Set the energy-calibration-Error flag | ||
| void SetEnergyCalibrationError(bool Flag = true, MString Text = "") { m_EnergyCalibrationError = Flag; m_EnergyCalibrationErrorString = Text; } | ||
| //! Get the energy-calibration-Error flag | ||
| bool IsEnergyCalibrationError() const { return m_EnergyCalibrationError; } |
There was a problem hiding this comment.
HasEnergyCalibrationError() - same for all below
| //Track BD Flags | ||
|
|
||
| //! Set the energy-calibration-Error flag | ||
| void SetEnergyCalibrationError(bool Flag = true, MString Text = "") { m_EnergyCalibrationError = Flag; m_EnergyCalibrationErrorString = Text; } |
There was a problem hiding this comment.
We are overwriting the string if we have multiples. Is that OK? Otherwise the error text should be a vector and we add to it.
Do we ever want to remove the error flag? If no, we don't need the "bool Flag = true". If yes, then it might be better to have a ClearEnergyCalibrationError() function?
There was a problem hiding this comment.
This comment is the same for everthing below
| int GetStripHitBelowThreshold_Number() const { return m_StripHitBelowThreshold_Number;} | ||
|
|
||
| //! Set the Reduced Chi^2 used in MultiRoundChiSquare module | ||
| void SetReducedChiSquare(double ReducedChiSquare) { m_ReducedChiSquare = ReducedChiSquare; } |
There was a problem hiding this comment.
SetStripPairingReducedChiSquare
|
|
||
| //! Set the Quality of this Event used in Greedy Strip pairing module | ||
| //! TODO Change name of this variable to be more descriptive | ||
| void SetEventQuality(double EventQuality){ m_EventQuality = EventQuality; } |
There was a problem hiding this comment.
Do we still want to keep Clio's approach around?
I don't like to have 2 strip pairing quality factors...
Think about it. I am ready to jettison it...
|
|
||
| // Add the depth to the GUI histogram. | ||
| if (Event->IsStripPairingIncomplete()==false) { | ||
| if (Event->IsStripPairingError()==false) { |
There was a problem hiding this comment.
White space: ..() == false
There was a problem hiding this comment.
The fixes to the depth calibration module will be accounted for in the Metrology PR since I did lots of formating changes there.
| for (unsigned int side = 0; side <=1; ++side) { // side loop | ||
| if (StripHits[d][side].size() > MaxStripHits) { | ||
| Event->SetStripPairingIncomplete(true, "More than 6 hit strIps on one side"); | ||
| Event->SetStripPairingError(true, "More than 6 hit strIps on one side"); |
There was a problem hiding this comment.
I'll leave this for @julianmgerber to fix in his next PR since he's touching the strip pairing errors/quality flags
|
|
||
| if (StripHits[d][0].size() == 0 || StripHits[d][1].size() == 0) { | ||
| Event->SetStripPairingIncomplete(true, "One detector side has not strip hits"); | ||
| Event->SetStripPairingError(true, "One detector side has not strip hits"); |
|
Think also about to remove the old greedy strip paring approach and the old depth calibration modules. |
|
I've added an issue for removing the old greedy strip pairing method since I didn't want to do too much more with this PR. This should now address your comments @zoglauer . The only thing I wasn't sure of was the proper way to overload the << operator to print out the contents of the vectorized error messages. I've added some code to the MReadoutAssembly.cxx to do that locally, and it works well. But let me know if that should go somewhere else. |
| //Track BD Flags | ||
|
|
||
| //! Set the energy-calibration-Error flag | ||
| void SetEnergyCalibrationError(bool Flag = true, MString Text = "") { m_EnergyCalibrationError = Flag; m_EnergyCalibrationErrorString.push_back(Text); } |
There was a problem hiding this comment.
- Don't push an empty string
- If the error flag is set to true, and strings are set - if we set the flag to false, do we want to clear all events and clear the string vector? Is there a way we want to clear the calibration error?
This holds for all the other errors below
There was a problem hiding this comment.
We don't have anything in the code that would remove any of the BD or QA flags. Not sure if we ever would want that. So I don't know that we want to create the capability to clear the error flag and string until we have a use case for it.
Could this line then just be:
void SetEnergyCalibrationError(bool Flag, MString Text) { m_EnergyCalibrationError = Flag; m_EnergyCalibrationErrorString.push_back(Text); }
There was a problem hiding this comment.
If we do not want to remove this flag, then I would do:
void SetEnergyCalibrationError(MString Text = "") { m_EnergyCalibrationError = true; if (Text != "") { m_EnergyCalibrationErrorString.push_back(Text); } }
There was a problem hiding this comment.
Okay, got it! Thanks for the help!
|
|
||
| bool m_EnergyResolutionCalibrationIncomplete; | ||
| MString m_EnergyResolutionCalibrationIncompleteString; | ||
| // Flags indicating bad events: |
There was a problem hiding this comment.
Please describe each flag and parameter - since people might just read the oxygen documentation
Holds for everything below
| delete m_Aspect; | ||
| m_Aspect = nullptr; | ||
| } | ||
| }// |
| return os; | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
No.... !!!
There is a reason there is no such converter, since S can be anything.
Just do your little for loop in the Streamer
| if (m_EnergyCalibrationIncompleteString != "") S<<" ("<<m_EnergyCalibrationIncompleteString<<")"; | ||
| if (m_EnergyCalibrationError == true) { | ||
| S<<"BD EnergyCalibrationError"; | ||
| if (m_EnergyCalibrationErrorString.empty() == false) S<<" ("<<m_EnergyCalibrationErrorString<<")"; |
There was a problem hiding this comment.
You just have a space between the strings - this makes them indistinguishable.
Do it in this format, so that we can more easily distinguish the messages:
[Error Message 1] [Error Message 2]
|
Email me when I can review it again. |
|
@zoglauer should be good to review again. Thanks! |
I've done an overhaul on the BD and QA (quality) event flags, and MReadoutAssembly in general. I remove balloon code relics. And updated variable names so they're a bit easier to understand.
We now have 4 BD errors:
where each error flag can come with text that describes the error in more detail, i.e. "No calibration coefficients", or "Out of Range", etc.
We now have QA flags indicating potentially suspect events, i.e. with strip hits removed below threshold, or poor quality strip pairing. These should be used elsewhere in the code whenever an event is altered (TAC cut).