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