Skip to content

Commit 1003026

Browse files
authored
TRD: Trending of calibration parameters (vdrift and exB) (#2162)
* vdrift-trend * exb-trend * 2Dvdrift_trend * added 2d plot * merge_conflict
1 parent f1968fb commit 1003026

5 files changed

Lines changed: 192 additions & 0 deletions

File tree

Modules/TRD/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
add_library(O2QcTRD)
44

55
target_sources(O2QcTRD PRIVATE
6+
src/CalibReductorTRD.cxx
67
src/TrackletCountCheck.cxx
78
src/PulsePositionCheck.cxx
89
src/TrackingTask.cxx
@@ -31,6 +32,7 @@ install(TARGETS O2QcTRD
3132
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
3233

3334
add_root_dictionary(O2QcTRD HEADERS
35+
include/TRD/CalibReductorTRD.h
3436
include/TRD/TrackletCountCheck.h
3537
include/TRD/PulsePositionCheck.h
3638
include/TRD/TrackingTask.h

Modules/TRD/calibParamTRD.json

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"qc": {
3+
"config": {
4+
"database": {
5+
"implementation": "CCDB",
6+
"host": "ccdb-test.cern.ch:8080"
7+
},
8+
"Activity": {
9+
"number": "526486"
10+
},
11+
"conditionDB": {
12+
"url": "alice-ccdb.cern.ch"
13+
},
14+
"postprocessing": {
15+
"matchAnyRunNumber": "true"
16+
}
17+
},
18+
"postprocessing": {
19+
"CalibTrendTRD": {
20+
"active": "true",
21+
"className": "o2::quality_control::postprocessing::TrendingTask",
22+
"moduleName": "QualityControl",
23+
"detectorName": "TRD",
24+
"producePlotsOnUpdate": "false",
25+
"dataSources": [
26+
{
27+
"type": "condition",
28+
"path": "TRD/Calib",
29+
"names": [
30+
"CalVdriftExB"
31+
],
32+
"reductorName": "o2::quality_control_modules::trd::CalibReductorTRD",
33+
"moduleName": "QcTRD"
34+
}
35+
],
36+
"plots": [
37+
{
38+
"name": "vdrift_trend",
39+
"title": "vDrift mean trend",
40+
"varexp": "CalVdriftExB.vdriftmean:time",
41+
"selection": "",
42+
"option": "*L",
43+
"graphYRange": "0:3.5",
44+
"graphXRange": "",
45+
"graphAxisLabel": "vdrift:time",
46+
"graphErrors": "0:CalVdriftExB.vdrifterr"
47+
},
48+
{
49+
"name": "vdrift_trend2D",
50+
"title": "vDrift trend",
51+
"varexp": "CalVdriftExB.vdrift:time",
52+
"selection": "",
53+
"option": "colz logz"
54+
},
55+
{
56+
"name": "exb_trend",
57+
"title": "ExB mean trend",
58+
"varexp": "CalVdriftExB.exbmean:time",
59+
"selection": "",
60+
"option": "*L",
61+
"graphYRange": "-2.0:2.0",
62+
"graphXRange": "",
63+
"graphAxisLabel": "ExB:time",
64+
"graphErrors": "0:CalVdriftExB.exberr"
65+
}
66+
],
67+
"initTrigger": [
68+
"userorcontrol"
69+
],
70+
"updateTrigger": [
71+
"newobject:ccdb:TRD/Calib/CalVdriftExB"
72+
],
73+
"stopTrigger": [
74+
"userorcontrol"
75+
]
76+
}
77+
}
78+
}
79+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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 CalibReductorTRD.h
14+
/// \author Salman Malik
15+
///
16+
17+
#ifndef QUALITYCONTROL_CALIBREDUCTORTRD_H
18+
#define QUALITYCONTROL_CALIBREDUCTORTRD_H
19+
20+
#include "QualityControl/ReductorConditionAny.h"
21+
22+
#include <DataFormatsTRD/Constants.h>
23+
24+
namespace o2::quality_control_modules::trd
25+
{
26+
27+
/// \brief A Reductor which obtains the calibration parameters of TRD from ccdb
28+
///
29+
class CalibReductorTRD : public quality_control::postprocessing::ReductorConditionAny
30+
{
31+
public:
32+
CalibReductorTRD() = default;
33+
~CalibReductorTRD() = default;
34+
35+
void* getBranchAddress() override;
36+
const char* getBranchLeafList() override;
37+
bool update(ConditionRetriever& retriever) override;
38+
39+
private:
40+
struct {
41+
float vdrift[o2::trd::constants::MAXCHAMBER];
42+
float vdriftmean;
43+
float vdrifterr;
44+
float exbmean;
45+
float exberr;
46+
} mStats;
47+
};
48+
49+
} // namespace o2::quality_control_modules::trd
50+
51+
#endif // QUALITYCONTROL_CALIBREDUCTORTRD_H

Modules/TRD/include/TRD/LinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
#pragma link C++ class o2::quality_control_modules::trd::TrackletCountCheck + ;
1818
#pragma link C++ class o2::quality_control_modules::trd::RawDataCheckStats + ;
1919
#pragma link C++ class o2::quality_control_modules::trd::RawDataCheckSizes + ;
20+
#pragma link C++ class o2::quality_control_modules::trd::CalibReductorTRD + ;
2021
#endif
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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 CalibReductorTRD.cxx
14+
/// \author Salman Malik
15+
///
16+
17+
#include "TRD/CalibReductorTRD.h"
18+
19+
#include <DataFormatsTRD/CalVdriftExB.h>
20+
21+
namespace o2::quality_control_modules::trd
22+
{
23+
24+
void* CalibReductorTRD::getBranchAddress()
25+
{
26+
return &mStats;
27+
}
28+
29+
const char* CalibReductorTRD::getBranchLeafList()
30+
{
31+
return Form("vdrift[%i]:vdriftmean/F:vdrifterr:exbmean/F:exberr", o2::trd::constants::MAXCHAMBER);
32+
}
33+
34+
bool CalibReductorTRD::update(ConditionRetriever& retriever)
35+
{
36+
if (auto retvdrift = retriever.retrieve<o2::trd::CalVdriftExB>()) {
37+
double sumVdrift = 0, sumSqVdrift = 0;
38+
double sumExb = 0, sumSqExb = 0;
39+
40+
for (int i = 0; i < o2::trd::constants::MAXCHAMBER; i++) {
41+
mStats.vdrift[i] = retvdrift->getVdrift(i);
42+
sumVdrift += retvdrift->getVdrift(i);
43+
sumSqVdrift += retvdrift->getVdrift(i) * retvdrift->getVdrift(i);
44+
sumExb += retvdrift->getExB(i);
45+
sumSqExb += retvdrift->getExB(i) * retvdrift->getExB(i);
46+
}
47+
48+
mStats.vdriftmean = sumVdrift / o2::trd::constants::MAXCHAMBER;
49+
mStats.vdrifterr = std::sqrt(sumSqVdrift / o2::trd::constants::MAXCHAMBER - mStats.vdriftmean * mStats.vdriftmean);
50+
51+
mStats.exbmean = sumExb / o2::trd::constants::MAXCHAMBER;
52+
mStats.exberr = std::sqrt(sumSqExb / o2::trd::constants::MAXCHAMBER - mStats.exbmean * mStats.exbmean);
53+
54+
return true;
55+
}
56+
return false;
57+
}
58+
59+
} // namespace o2::quality_control_modules::trd

0 commit comments

Comments
 (0)