Skip to content

Commit 10c5af2

Browse files
commiting from grid server after adding check PH and t0 trend (#1885)
1 parent 1edc2a9 commit 10c5af2

12 files changed

Lines changed: 672 additions & 15 deletions

Modules/TRD/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
add_library(O2QcTRD)
44

5-
target_sources(O2QcTRD PRIVATE src/TrackingTask.cxx src/PulseHeightTrackMatch.cxx src/TrackletsCheck.cxx src/TrackletsTask.cxx src/PulseHeightCheck.cxx src/PulseHeight.cxx src/RawData.cxx src/DigitsTask.cxx
5+
target_sources(O2QcTRD PRIVATE src/TRDReductor.cxx src/PulsePositionCheck.cxx src/TrackingTask.cxx src/PulseHeightTrackMatch.cxx src/TrackletsCheck.cxx src/TrackletsTask.cxx src/PulseHeightCheck.cxx src/PulseHeight.cxx src/RawData.cxx src/DigitsTask.cxx
66
src/DigitsCheck.cxx src/TRDTrending.cxx src/TrendingTaskConfigTRD.cxx src/PulseHeightPostProcessing.cxx)
77

88
target_include_directories(
@@ -20,6 +20,8 @@ install(TARGETS O2QcTRD
2020

2121
add_root_dictionary(O2QcTRD
2222
HEADERS
23+
include/TRD/TRDReductor.h
24+
include/TRD/PulsePositionCheck.h
2325
include/TRD/TrackingTask.h
2426
include/TRD/PulseHeightTrackMatch.h
2527
include/TRD/TrackletsCheck.h
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
{
2+
"qc": {
3+
"config": {
4+
"database": {
5+
"implementation": "CCDB",
6+
"host": "ccdb-test.cern.ch:8080",
7+
"username": "not_applicable",
8+
"password": "not_applicable",
9+
"name": "not_applicable",
10+
"maxObjectSize": "2097152", "": "[Bytes, default=2MB] Maximum size allowed, larger objects are rejected."
11+
},
12+
"Activity": {
13+
"number": "42",
14+
"type": "2",
15+
"periodName": "", "": "Period name - e.g. LHC22c, LHC22c1b_test",
16+
"passName": "", "": "Pass type - e.g. spass, cpass1",
17+
"provenance": "qc", "": "Provenance - qc or qc_mc depending whether it is normal data or monte carlo data"
18+
},
19+
"monitoring": {
20+
"url": "infologger:///debug?qc"
21+
},
22+
"consul": {
23+
"url": ""
24+
},
25+
"conditionDB": {
26+
"url": "ccdb-test.cern.ch:8080"
27+
},
28+
"infologger": { "": "Configuration of the Infologger (optional).",
29+
"filterDiscardDebug": "false", "": "Set to true to discard debug and trace messages (default: false)",
30+
"filterDiscardLevel": "11", "": "Message at this level or above are discarded (default: 21 - Trace)",
31+
"filterDiscardFile": "/tmp/_ID_.txt", "": ["If set, the messages discarded because of filterDiscardLevel",
32+
"will go to this file (default: <none>); The keyword _ID_ is replaced by the device id. Discarded Debug ",
33+
"messages won't go there."]
34+
},
35+
"bookkeeping": {
36+
"url": ""
37+
},
38+
"postprocessing": {
39+
"periodSeconds": "60"
40+
}
41+
},
42+
"tasks": {
43+
"PulseHeight": {
44+
"active": "true",
45+
"className": "o2::quality_control_modules::trd::PulseHeight",
46+
"moduleName": "QcTRD",
47+
"detectorName": "TRD",
48+
"cycleDurationSeconds": "60",
49+
"maxNumberCycles": "-1",
50+
"dataSource": {
51+
"type": "direct",
52+
"query": "tracklets:TRD/TRACKLETS;digits:TRD/DIGITS;triggers:TRD/TRKTRGRD" ,"":"digits:TRD/DIGITS;tracklets:TRD/TRACKLETS;triggers:TRD/TRKTRGRD;rawstats:TRD/RAWSTATS"
53+
},
54+
"taskParameters": {
55+
"peakregionstart": "7.0",
56+
"peakregionend": "20.0",
57+
"pulseheightpeaklower": "1.0",
58+
"pulseheightpeakupper": "5.0"
59+
},
60+
"location": "remote",
61+
"saveObjectsToFile": "qc_pulse_hight_task.root"
62+
}
63+
},
64+
"checks": {
65+
"PulsePositionCheck": {
66+
"active": "true",
67+
"className": "o2::quality_control_modules::trd::PulsePositionCheck",
68+
"moduleName": "QcTRD",
69+
"policy": "OnAny",
70+
"detectorName": "TRD",
71+
"dataSource": [{
72+
"type": "Task",
73+
"name": "PulseHeight",
74+
"MOs": [ "mPulseHeight" ]
75+
}],
76+
"stopTrigger_comment":[],
77+
"checkParameters":{
78+
"FitParameter0":"100000.0",
79+
"FitParameter1":"100000.0",
80+
"FitParameter2":"1.48",
81+
"FitParameter3":"1.09",
82+
"Chi2byNDF_threshold":"0.22",
83+
"DefinedFunctionRangeL":"0.0",
84+
"DefinedFunctionRangeU":"6.0",
85+
"FitRangeL":"0.0",
86+
"FitRangeU":"4.0"
87+
}
88+
}
89+
},
90+
"aggregators": {
91+
"TRDQuality": {
92+
"active": "true",
93+
"className": "o2::quality_control_modules::common::WorstOfAllAggregator",
94+
"moduleName": "QualityControl",
95+
"policy": "OnAll",
96+
"detectorName": "TRD",
97+
"dataSource": [
98+
{
99+
"type": "Check",
100+
"name": "PulsePositionCheck"
101+
}
102+
]
103+
}
104+
},
105+
"postprocessing":{
106+
"Quality": {
107+
"active": "true",
108+
"className": "o2::quality_control_modules::common::QualityTask",
109+
"moduleName": "QualityControl",
110+
"detectorName": "TRD",
111+
"qualityGroups": [
112+
{
113+
"name" : "global",
114+
"title" : "GLOBAL TRD QUALITY",
115+
"path": "TRD/QO",
116+
"ignoreQualitiesDetails" : ["Null", "Good", "Medium", "Bad"],
117+
"inputObjects": [
118+
{
119+
"name" : "TRDQuality/TRDQuality",
120+
"title" : "TRD Quality",
121+
"messageBad" : "Inform TRD on-call immediately",
122+
"messageMedium": "Add bookkeeping entry",
123+
"messageGood": "All checks are OK",
124+
"messageNull": "Some histograms are empty!!!"
125+
}
126+
]
127+
},
128+
{
129+
"name" : "PulsePositionQuality",
130+
"title" : "TRD Pulse Position Quality",
131+
"path": "TRD/QO",
132+
"ignoreQualitiesDetails" : [],
133+
"inputObjects": [
134+
{
135+
"name" : "PulsePositionCheck",
136+
"title" : "Peak Position Quality",
137+
"messageBad" : "Inform TRD on-call immediately",
138+
"messageMedium": "Add bookkeeping entry",
139+
"messageGood": "PulsePosition check is OK",
140+
"messageNull": "Some histograms are empty!!!"
141+
}
142+
]
143+
}
144+
],
145+
"initTrigger": [
146+
"userorcontrol","60sec","SOR"
147+
],
148+
"updateTrigger": [
149+
"60 seconds"
150+
],
151+
"stopTrigger": [
152+
"userorcontrol","EOR"
153+
]
154+
}
155+
}
156+
}
157+
}
158+
159+

Modules/TRD/include/TRD/LinkDef.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#pragma link C++ class o2::quality_control_modules::trd::TrackletsCheck + ;
1414
#pragma link C++ class o2::quality_control::postprocessing::TRDTrending + ;
1515
#pragma link C++ class o2::quality_control::postprocessing::PulseHeightPostProcessing + ;
16-
#pragma link C++ class o2::quality_control_modules::trd::PulseHeightTrackMatch+;
17-
#pragma link C++ class o2::quality_control_modules::trd::TrackingTask+;
16+
#pragma link C++ class o2::quality_control_modules::trd::PulseHeightTrackMatch + ;
17+
#pragma link C++ class o2::quality_control_modules::trd::TrackingTask + ;
18+
#pragma link C++ class o2::quality_control_modules::trd::PulsePositionCheck + ;
19+
#pragma link C++ class o2::quality_control_modules::trd::TRDReductor + ;
1820
#endif
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
///
13+
/// \file PulsePositionCheck.h
14+
/// \author Deependra (deependra.sharma@cern.ch)
15+
///
16+
17+
#ifndef QC_MODULE_TRD_TRDPULSEPOSITIONCHECK_H
18+
#define QC_MODULE_TRD_TRDPULSEPOSITIONCHECK_H
19+
20+
#include "QualityControl/CheckInterface.h"
21+
22+
namespace o2::quality_control_modules::trd
23+
{
24+
25+
/// \brief Example QC Check
26+
/// \author My Name
27+
class PulsePositionCheck : public o2::quality_control::checker::CheckInterface
28+
{
29+
public:
30+
/// Default constructor
31+
PulsePositionCheck() = default;
32+
/// Destructor
33+
~PulsePositionCheck() override = default;
34+
35+
// Override interface
36+
void configure() override;
37+
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
38+
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
39+
std::string getAcceptedType() override;
40+
long int mTimeStamp;
41+
std::pair<float, float> mPulseHeightPeakRegion;
42+
double chi2byNDF_threshold;
43+
double FitParam0;
44+
double FitParam1;
45+
double FitParam2;
46+
double FitParam3;
47+
double FunctionRange[2];
48+
double FitRange[2];
49+
50+
ClassDefOverride(PulsePositionCheck, 2);
51+
};
52+
53+
} // namespace o2::quality_control_modules::trd
54+
55+
#endif // QC_MODULE_TRD_TRDPULSEPOSITIONCHECK_H

Modules/TRD/include/TRD/RawData.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class RawData final : public TaskInterface
6565
TH1F* mParsingErrors = nullptr;
6666
std::array<TH2F*, 10> mLinkErrors;
6767
std::array<TH2F*, o2::trd::ParsingErrors::TRDLastParsingError> mParsingErrors2d;
68-
6968
};
7069

7170
} // namespace o2::quality_control_modules::trd
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
///
13+
/// \file TRDReductor.h
14+
///
15+
#ifndef TRD_REDUCTOR_H
16+
#define TRD_REDUCTOR_H
17+
18+
#include "QualityControl/Reductor.h"
19+
20+
namespace o2::quality_control_modules::trd
21+
{
22+
23+
/// \brief A Reductor which fetch PulseHeight mo (hist) and find position of t0 peak
24+
25+
class TRDReductor : public quality_control::postprocessing::Reductor
26+
{
27+
public:
28+
TRDReductor() = default;
29+
~TRDReductor() = default;
30+
31+
void* getBranchAddress() override;
32+
const char* getBranchLeafList() override;
33+
void update(TObject* obj) override;
34+
35+
private:
36+
struct {
37+
Double_t t0peak;
38+
Double_t chi2byNDF;
39+
Int_t BinWithMaxContent;
40+
} mStats;
41+
};
42+
43+
} // namespace o2::quality_control_modules::trd
44+
45+
#endif // TRD_REDUCTOR_H

Modules/TRD/src/PulseHeightCheck.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Quality PulseHeightCheck::check(std::map<std::string, std::shared_ptr<MonitorObj
104104

105105
result = Quality::Good;
106106

107-
//check max bin is in the spike on left.
107+
// check max bin is in the spike on left.
108108
auto max = h->GetMaximum();
109109
auto maxbin = h->GetMaximumBin();
110110
auto average = 0.0;
@@ -137,7 +137,7 @@ Quality PulseHeightCheck::check(std::map<std::string, std::shared_ptr<MonitorObj
137137
return result;
138138
}
139139
if (max < average) {
140-
//if the peak maximum is below the average height of the drift region, we have a problem.
140+
// if the peak maximum is below the average height of the drift region, we have a problem.
141141
result = Quality::Bad;
142142
result.addReason(FlagReasonFactory::Invalid(),
143143
"Peak is below the drift region average peak : " + std::to_string(max) + " average of drift:" + std::to_string(average));
@@ -162,7 +162,7 @@ void PulseHeightCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality check
162162
auto* h = dynamic_cast<TH1F*>(mo->getObject());
163163
TPaveText* msg = new TPaveText(0.3, 0.9, 0.7, 0.95, "NDC");
164164
h->GetListOfFunctions()->Add(msg);
165-
//std::string message = fmt::format("Pulseheight message");
165+
// std::string message = fmt::format("Pulseheight message");
166166
std::string message = "Pulseheight message";
167167
msg->SetName(message.c_str());
168168

@@ -178,7 +178,7 @@ void PulseHeightCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality check
178178
h->SetFillColor(kOrange);
179179
h->SetLineColor(kOrange);
180180
}
181-
//h->SetLineColor(kBlack);
181+
// h->SetLineColor(kBlack);
182182
h->Draw();
183183
}
184184
}

0 commit comments

Comments
 (0)