-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mlesch
committed
Dec 10, 2024
1 parent
7b6a2f2
commit 9f91bdb
Showing
4 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// | ||
/// \file AtmosPressureReductor.h | ||
/// \author Marcel Lesch | ||
/// | ||
|
||
#ifndef QUALITYCONTROL_ATMOSPRESSUREREDUCTOR_H | ||
#define QUALITYCONTROL_ATMOSPRESSUREREDUCTOR_H | ||
|
||
#include "QualityControl/ReductorConditionAny.h" | ||
|
||
namespace o2::quality_control_modules::tpc | ||
{ | ||
|
||
/// \brief A Reductor for atmospheric pressure | ||
/// | ||
/// A Reductor for atmospheric pressure | ||
/// It produces a branch in the format: "pressure1/F:errPressure1:pressure2:errPressure2" | ||
|
||
class AtmosPressureReductor : public quality_control::postprocessing::ReductorConditionAny | ||
{ | ||
public: | ||
AtmosPressureReductor() = default; | ||
~AtmosPressureReductor() = default; | ||
|
||
void* getBranchAddress() override; | ||
const char* getBranchLeafList() override; | ||
bool update(ConditionRetriever& retriever) override; | ||
|
||
private: | ||
struct { | ||
Float_t pressure1; | ||
Float_t errPressure1; | ||
Float_t pressure2; | ||
Float_t errPressure2; | ||
} mStats; | ||
}; | ||
|
||
} // namespace o2::quality_control_modules::tpc | ||
|
||
#endif // QUALITYCONTROL_ATMOSPRESSUREREDUCTOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// | ||
/// \file AtmosPressureReductor.cxx | ||
/// \author Marcel Lesch | ||
/// | ||
|
||
#include "TPC/AtmosPressureReductor.h" | ||
#include "GRPCalibration/GRPDCSDPsProcessor.h" | ||
#include "TPC/Utility.h" | ||
|
||
namespace o2::quality_control_modules::tpc | ||
{ | ||
|
||
void* AtmosPressureReductor::getBranchAddress() | ||
{ | ||
return &mStats; | ||
} | ||
|
||
const char* AtmosPressureReductor::getBranchLeafList() | ||
{ | ||
return "pressure1/F:errPressure1:pressure2:errPressure2"; | ||
} | ||
|
||
bool AtmosPressureReductor::update(ConditionRetriever& retriever) | ||
{ | ||
if (auto env = retriever.retrieve<o2::grp::GRPEnvVariables>()) { | ||
std::vector<float> pressureValues; | ||
|
||
// pressure 1 | ||
for (const auto& [time, p] : env->mEnvVars["CavernAtmosPressure"]) { | ||
pressureValues.push_back(p); | ||
} | ||
calcMeanAndStddev(pressureValues, mStats.pressure1, mStats.errPressure1); | ||
pressureValues.clear(); | ||
|
||
// pressure 2 | ||
for (const auto& [time, p] : env->mEnvVars["CavernAtmosPressure2"]) { | ||
pressureValues.push_back(p); | ||
} | ||
calcMeanAndStddev(pressureValues, mStats.pressure2, mStats.errPressure2); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
} // namespace o2::quality_control_modules::tpc |