Skip to content

Commit

Permalink
TPC: Update CheckOfTrendings (#1649)
Browse files Browse the repository at this point in the history
* WIP Update on Check of Trendings

* Update CheckOfTrendings (new checks, visualisation, uncertainty propagation)

* Remove unused member variable

* More removal

* Solve merge conflict

* Implementing changes

* Changing includes

* Fix for loop
  • Loading branch information
mlesch authored Mar 9, 2023
1 parent 61665b1 commit 8dc17a4
Show file tree
Hide file tree
Showing 3 changed files with 627 additions and 124 deletions.
29 changes: 26 additions & 3 deletions Modules/TPC/include/TPC/CheckOfTrendings.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

#include "QualityControl/CheckInterface.h"

class TGraph;
class TCanvas;

namespace o2::quality_control_modules::tpc
{

Expand All @@ -41,17 +44,37 @@ class CheckOfTrendings : public o2::quality_control::checker::CheckInterface

private:
ClassDefOverride(CheckOfTrendings, 2);
void calculateStatistics(const double* yValues, const double* yErrors, bool useErrors, const int firstPoint, const int lastPoint, double& mean, double& stddevOfMean);
TGraph* getGraph(TCanvas* canv);
std::string mCheckChoice;
float mExpectedPhysicsValue;
float mNSigmaExpectedPhysicsValue;
float mNSigmaBadExpectedPhysicsValue;
float mNSigmaMean;
float mNSigmaBadMean;
float mRangeMedium;
float mRangeBad;
bool mSliceTrend;

double mMean = 0;
float mStdev;

int mPointToTakeForExpectedValueCheck;
int mPointToTakeForMeanCheck;
static constexpr std::string_view CheckChoiceMean = "Mean";
static constexpr std::string_view CheckChoiceExpectedPhysicsValue = "ExpectedPhysicsValue";
static constexpr std::string_view CheckChoiceBoth = "Both";
int mPointToTakeForRangeCheck;
int mPointToTakeForZeroCheck;

std::string mBadString = "";
std::string mMediumString = "";
std::string mGoodString = "";
std::string mNullString = "";

std::string mMetadataComment;

bool mRangeCheck = false;
bool mExpectedValueCheck = false;
bool mMeanCheck = false;
bool mZeroCheck = false;
};

} // namespace o2::quality_control_modules::tpc
Expand Down
110 changes: 98 additions & 12 deletions Modules/TPC/run/tpcQCCheckTrending.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"checks" : {
"CheckOfPID_Trending" : {
"active" : "true",
"active" : "false",
"className" : "o2::quality_control_modules::tpc::CheckOfTrendings",
"moduleName" : "QcTPC",
"policy" : "OnEachSeparately",
Expand All @@ -35,14 +35,20 @@

"stopTrigger_comment": [ "Parameters are needed to choose if check should be performed only as last point comparison to average or average comparison to expected value." ],
"checkParameters": {
"chooseCheckMeanOrExpectedPhysicsValueOrBoth" : "Both",
"expectedPhysicsValue" : "0",
"CheckChoice" : "Mean",
"SliceTrending" : "false",
"expectedPhysicsValue" : "65",
"allowedNSigmaForExpectation" : "3",
"badNSigmaForExpectation" : "6",
"allowedNSigmaForMean" : "3",
"badNSigmaForMean" : "6",
"pointsToTakeForExpectedValueCheck" : "10",
"pointsToTakeForMeanCheck" : "10"
"pointsToTakeForMeanCheck" : "10",
"allowedRange" : "0.2",
"badRange" : "2",
"pointsToTakeForRangeCheck" : "10",
"MetadataComment" : "TestComment2",
"pointsToTakeForZeroCheck" : "8"
}
},
"CheckOfTrack_Trending" : {
Expand All @@ -54,25 +60,65 @@
"dataSource" : [ {
"type" : "PostProcessing",
"name" : "Tracks_Trending",
"MOs" : [ "hNClustersBeforeCuts_StatMean_Trend", "hNClustersAfterCuts_StatMean_Trend", "hEta_StatMean_Trend", "hPt_StatMean_Trend", "hSign_StatMean_Trend", "hPtNeg_StatMean_Trend", "hPtPos_StatMean_Trend", "h2DNClustersPhiAside_StatMean_Trend_Phi", "h2DNClustersPhiAside_StatMean_Trend_Nclusters", "h2DNClustersPhiCside_StatMean_Trend_Phi", "h2DNClustersPhiCside_StatMean_Trend_Nclusters" ]
"MOs" : [ "hEta_StatMean_Trend" ]
} ],

"stopTrigger_comment": [ "Parameters are needed to choose if check should be performed only as last point comparison to average or average comparison to expected value." ],
"checkParameters": {
"chooseCheckMeanOrExpectedPhysicsValueOrBoth" : "Mean",
"expectedPhysicsValue" : "0",
"CheckChoice" : "Mean, ExpectedValue, Range",
"SliceTrending" : "false",
"expectedPhysicsValue" : "0.1",
"EPV_comment" : "This value is used for the Expected Physics Value and the Range Check",
"allowedNSigmaForExpectation" : "3",
"badNSigmaForExpectation" : "6",
"allowedNSigmaForMean" : "3",
"badNSigmaForMean" : "6",
"allowedNSigmaForMean" : "1",
"badNSigmaForMean" : "2",
"pointsToTakeForExpectedValueCheck" : "10",
"pointsToTakeForMeanCheck" : "10",
"allowedRange" : "0.05",
"badRange" : "0.1",
"pointsToTakeForRangeCheck" : "1",
"MetadataComment" : "TestComment",
"pointsToTakeForZeroCheck" : "4"

}
},
"CheckOfTrack_Trending_Slice" : {
"active" : "true",
"className" : "o2::quality_control_modules::tpc::CheckOfTrendings",
"moduleName" : "QcTPC",
"policy" : "OnEachSeparately",
"detectorName" : "TPC",
"dataSource" : [ {
"type" : "PostProcessing",
"name" : "Tracks_Trending_Slice",
"MOs" : [ "hEta_StatMean_Trend" ]
} ],

"stopTrigger_comment": [ "Parameters are needed to choose if check should be performed only as last point comparison to average or average comparison to expected value." ],
"checkParameters": {
"CheckChoice" : "Mean, ExpectedValue, Range",
"SliceTrending" : "true",
"expectedPhysicsValue" : "0.1",
"EPV_comment" : "This value is used for the Expected Physics Value and the Range Check",
"allowedNSigmaForExpectation" : "3",
"badNSigmaForExpectation" : "6",
"allowedNSigmaForMean" : "1",
"badNSigmaForMean" : "2",
"pointsToTakeForExpectedValueCheck" : "10",
"pointsToTakeForMeanCheck" : "10"
"pointsToTakeForMeanCheck" : "10",
"allowedRange" : "0.05",
"badRange" : "0.1",
"pointsToTakeForRangeCheck" : "1",
"MetadataComment" : "TestComment",
"pointsToTakeForZeroCheck" : "4"

}
}
},
"postprocessing": {
"PID_Trending": {
"active": "true",
"active": "false",
"className": "o2::quality_control::postprocessing::TrendingTask",
"moduleName": "QualityControl",
"detectorName": "TPC",
Expand Down Expand Up @@ -355,7 +401,47 @@
"userorcontrol"
],
"updateTrigger": [
"30 seconds"
"10 seconds"
],
"stopTrigger": [
"userorcontrol"
]
},
"Tracks_Trending_Slice": {
"active": "true",
"className": "o2::quality_control::postprocessing::SliceTrendingTask",
"moduleName": "QualityControl",
"detectorName": "TPC",
"producePlotsOnUpdate": "true",
"resumeTrend": "false",
"dataSources": [
{
"type": "repository",
"path": "TPC/MO/Tracks",
"names": [ "hEta" ],
"reductorName": "o2::quality_control_modules::common::TH1SliceReductor",
"axisDivision": [ [ ] ],
"moduleName": "QcCommon"
}
],
"plots": [
{
"name": "hEta_StatMean_Trend",
"title": "Mean trend of the pseudorapidity",
"varexp": "hEta.meanX:time",
"selection": "",
"option": "*L",
"graphErrors": "errMeanX:0.",
"graphYRange": "-1.0:1.0",
"graphXRange": "",
"graphAxisLabel": "Mean Eta X:time"
}
],
"initTrigger": [
"userorcontrol"
],
"updateTrigger": [
"10 seconds"
],
"stopTrigger": [
"userorcontrol"
Expand Down
Loading

0 comments on commit 8dc17a4

Please sign in to comment.