Skip to content

Commit b7ec3fe

Browse files
authored
TPC: Reductor for Atmos. Pressure in the Cavern (#2488)
TPC: AtmosPressure Reductor
1 parent 8ea13a1 commit b7ec3fe

File tree

5 files changed

+201
-1
lines changed

5 files changed

+201
-1
lines changed

Modules/TPC/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ target_sources(O2QcTPC PRIVATE src/PID.cxx
3939
src/VDriftCalibReductor.cxx
4040
src/SeparationPowerReductor.cxx
4141
src/TimeGainCalibReductor.cxx
42-
src/DCSPTempReductor.cxx)
42+
src/DCSPTempReductor.cxx
43+
src/AtmosPressureReductor.cxx)
4344

4445
target_include_directories(
4546
O2QcTPC
@@ -99,6 +100,7 @@ add_root_dictionary(O2QcTPC
99100
include/TPC/SeparationPowerReductor.h
100101
include/TPC/TimeGainCalibReductor.h
101102
include/TPC/DCSPTempReductor.h
103+
include/TPC/AtmosPressureReductor.h
102104
LINKDEF include/TPC/LinkDef.h)
103105

104106
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/TPC
@@ -183,4 +185,5 @@ install(FILES run/tpcQCPID_sampled.json
183185
run/tpcQCTrending_separationpower.json
184186
run/tpcQCTimeGainCalibTrending.json
185187
run/tpcDCSPTempTrending.json
188+
run/tpcQCAtmosPressureTrending.json
186189
DESTINATION etc)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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 AtmosPressureReductor.h
14+
/// \author Marcel Lesch
15+
///
16+
17+
#ifndef QUALITYCONTROL_ATMOSPRESSUREREDUCTOR_H
18+
#define QUALITYCONTROL_ATMOSPRESSUREREDUCTOR_H
19+
20+
#include "QualityControl/ReductorConditionAny.h"
21+
22+
namespace o2::quality_control_modules::tpc
23+
{
24+
25+
/// \brief A reductor for atmospheric pressure
26+
///
27+
/// A reductor for atmospheric pressure
28+
/// It produces a branch in the format: "cavernPressure1/F:errCavernPressure1:cavernPressure2:errCavernPressure2:surfacePressure:errSurfacePressure"
29+
30+
class AtmosPressureReductor : public quality_control::postprocessing::ReductorConditionAny
31+
{
32+
public:
33+
AtmosPressureReductor() = default;
34+
~AtmosPressureReductor() = default;
35+
36+
void* getBranchAddress() override;
37+
const char* getBranchLeafList() override;
38+
bool update(ConditionRetriever& retriever) override;
39+
40+
private:
41+
struct {
42+
Float_t cavernPressure1;
43+
Float_t errCavernPressure1;
44+
Float_t cavernPressure2;
45+
Float_t errCavernPressure2;
46+
Float_t surfacePressure;
47+
Float_t errSurfacePressure;
48+
} mStats;
49+
};
50+
51+
} // namespace o2::quality_control_modules::tpc
52+
53+
#endif // QUALITYCONTROL_ATMOSPRESSUREREDUCTOR_H

Modules/TPC/include/TPC/LinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#pragma link C++ class o2::quality_control_modules::tpc::SeparationPowerReductor + ;
4545
#pragma link C++ class o2::quality_control_modules::tpc::TimeGainCalibReductor + ;
4646
#pragma link C++ class o2::quality_control_modules::tpc::DCSPTempReductor + ;
47+
#pragma link C++ class o2::quality_control_modules::tpc::AtmosPressureReductor + ;
4748

4849
#pragma link C++ function o2::quality_control_modules::tpc::addAndPublish + ;
4950
#pragma link C++ function o2::quality_control_modules::tpc::toVector + ;
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
},
11+
"Activity": {
12+
"number": "",
13+
"type": "",
14+
"start": "",
15+
"end": ""
16+
},
17+
"monitoring": {
18+
"url": "infologger:///debug?qc"
19+
},
20+
"consul": {
21+
"url": ""
22+
},
23+
"conditionDB": {
24+
"url": "ccdb-test.cern.ch:8080"
25+
},
26+
"postprocessing": {
27+
"periodSeconds": "10"
28+
}
29+
},
30+
"postprocessing": {
31+
"AtmosPressure": {
32+
"active": "true",
33+
"resumeTrend": "false",
34+
"className": "o2::quality_control::postprocessing::TrendingTask",
35+
"moduleName": "QualityControl",
36+
"detectorName": "TPC",
37+
"producePlotsOnUpdate": "true",
38+
"dataSources": [
39+
{
40+
"type": "condition",
41+
"path": "GLO/Config/",
42+
"names": [ "EnvVars" ],
43+
"reductorName": "o2::quality_control_modules::tpc::AtmosPressureReductor",
44+
"moduleName": "QcTPC"
45+
}
46+
],
47+
"plots": [
48+
{
49+
"name": "atmosPressure1_Trending",
50+
"title": "Trend of atmospheric cavern pressure 1 over time",
51+
"varexp": "EnvVars.cavernPressure1:time",
52+
"selection": "",
53+
"option": "*L",
54+
"graphAxisLabel": "atmospheric Cavern Pressure:time",
55+
"graphErrors": "EnvVars.errCavernPressure1:0"
56+
},
57+
{
58+
"name": "atmosPressure2_Trending",
59+
"title": "Trend of atmospheric cavern pressure 2 over time",
60+
"varexp": "EnvVars.cavernPressure2:time",
61+
"selection": "",
62+
"option": "*L",
63+
"graphAxisLabel": "atmospheric Cavern Pressure:time",
64+
"graphErrors": "EnvVars.errCavernPressure2:0"
65+
}
66+
],
67+
"initTrigger": [
68+
"userorcontrol"
69+
],
70+
"updateTrigger": [
71+
"foreachlatest:ccdb:GLO/Config/EnvVars/"
72+
],
73+
"stopTrigger": [
74+
"userorcontrol"
75+
]
76+
}
77+
}
78+
}
79+
}
80+
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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 AtmosPressureReductor.cxx
14+
/// \author Marcel Lesch
15+
///
16+
17+
#include "TPC/AtmosPressureReductor.h"
18+
#include "GRPCalibration/GRPDCSDPsProcessor.h"
19+
#include "TPC/Utility.h"
20+
21+
namespace o2::quality_control_modules::tpc
22+
{
23+
24+
void* AtmosPressureReductor::getBranchAddress()
25+
{
26+
return &mStats;
27+
}
28+
29+
const char* AtmosPressureReductor::getBranchLeafList()
30+
{
31+
return "cavernPressure1/F:errCavernPressure1:cavernPressure2:errCavernPressure2:surfacePressure:errSurfacePressure";
32+
}
33+
34+
bool AtmosPressureReductor::update(ConditionRetriever& retriever)
35+
{
36+
if (auto env = retriever.retrieve<o2::grp::GRPEnvVariables>()) {
37+
std::vector<float> pressureValues;
38+
39+
// Cavern pressure 1
40+
for ([[maybe_unused]] const auto& [time, p] : env->mEnvVars["CavernAtmosPressure"]) {
41+
pressureValues.emplace_back((float)p);
42+
}
43+
calcMeanAndStddev(pressureValues, mStats.cavernPressure1, mStats.errCavernPressure1);
44+
pressureValues.clear();
45+
46+
// Cavern pressure 2
47+
for ([[maybe_unused]] const auto& [time, p] : env->mEnvVars["CavernAtmosPressure2"]) {
48+
pressureValues.emplace_back((float)p);
49+
}
50+
calcMeanAndStddev(pressureValues, mStats.cavernPressure2, mStats.errCavernPressure2);
51+
pressureValues.clear();
52+
53+
// Surface pressure
54+
for ([[maybe_unused]] const auto& [time, p] : env->mEnvVars["SurfaceAtmosPressure"]) {
55+
pressureValues.emplace_back((float)p);
56+
}
57+
calcMeanAndStddev(pressureValues, mStats.surfacePressure, mStats.errSurfacePressure);
58+
return true;
59+
}
60+
return false;
61+
}
62+
63+
} // namespace o2::quality_control_modules::tpc

0 commit comments

Comments
 (0)