Skip to content

Commit

Permalink
WIP TPC: Reductor for atmos. pressures
Browse files Browse the repository at this point in the history
  • Loading branch information
mlesch committed Dec 10, 2024
1 parent 01e7a58 commit 3dd2a70
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 23 deletions.
16 changes: 9 additions & 7 deletions Modules/TPC/include/TPC/AtmosPressureReductor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
namespace o2::quality_control_modules::tpc
{

/// \brief A Reductor for atmospheric pressure
/// \brief A reductor for atmospheric pressure
///
/// A Reductor for atmospheric pressure
/// It produces a branch in the format: "pressure1/F:errPressure1:pressure2:errPressure2"
/// A reductor for atmospheric pressure
/// It produces a branch in the format: "cavernPressure1/F:errCavernPressure1:cavernPressure2:errCavernPressure2:surfacePressure:errSurfacePressure"

class AtmosPressureReductor : public quality_control::postprocessing::ReductorConditionAny
{
Expand All @@ -39,10 +39,12 @@ class AtmosPressureReductor : public quality_control::postprocessing::ReductorCo

private:
struct {
Float_t pressure1;
Float_t errPressure1;
Float_t pressure2;
Float_t errPressure2;
Float_t cavernPressure1;
Float_t errCavernPressure1;
Float_t cavernPressure2;
Float_t errCavernPressure2;
Float_t surfacePressure;
Float_t errSurfacePressure;
} mStats;
};

Expand Down
16 changes: 8 additions & 8 deletions Modules/TPC/run/tpcQCAtmosPressureTrending.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@
"plots": [
{
"name": "atmosPressure1_Trending",
"title": "Trend of atmospheric pressure 1 over time",
"varexp": "EnvVars.pressure1:time",
"title": "Trend of atmospheric cavern pressure 1 over time",
"varexp": "EnvVars.cavernPressure1:time",
"selection": "",
"option": "*L",
"graphAxisLabel": "atmos. Pressure:time",
"graphErrors": "EnvVars.errPressure1:0"
"graphAxisLabel": "atmospheric Cavern Pressure:time",
"graphErrors": "EnvVars.errCavernPressure1:0"
},
{
"name": "atmosPressure2_Trending",
"title": "Trend of atmospheric pressure 2 over time",
"varexp": "EnvVars.pressure2:time",
"title": "Trend of atmospheric cavern pressure 2 over time",
"varexp": "EnvVars.cavernPressure2:time",
"selection": "",
"option": "*L",
"graphAxisLabel": "atmos. Pressure:time",
"graphErrors": "EnvVars.errPressure2:0"
"graphAxisLabel": "atmospheric Cavern Pressure:time",
"graphErrors": "EnvVars.errCavernPressure2:0"
}
],
"initTrigger": [
Expand Down
23 changes: 15 additions & 8 deletions Modules/TPC/src/AtmosPressureReductor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,33 @@ void* AtmosPressureReductor::getBranchAddress()

const char* AtmosPressureReductor::getBranchLeafList()
{
return "pressure1/F:errPressure1:pressure2:errPressure2";
return "cavernPressure1/F:errCavernPressure1:cavernPressure2:errCavernPressure2:surfacePressure:errSurfacePressure";
}

bool AtmosPressureReductor::update(ConditionRetriever& retriever)
{
if (auto env = retriever.retrieve<o2::grp::GRPEnvVariables>()) {
std::vector<float> pressureValues;
std::vector<float> pressureValues;

// pressure 1
// Cavern pressure 1
for (const auto& [time, p] : env->mEnvVars["CavernAtmosPressure"]) {
pressureValues.emplace_back(p);
pressureValues.emplace_back((float)p);
}
//calcMeanAndStddev(pressureValues, mStats.pressure1, mStats.errPressure1);
calcMeanAndStddev(pressureValues, mStats.cavernPressure1, mStats.errCavernPressure1);
pressureValues.clear();

// pressure 2
// Cavern pressure 2
for (const auto& [time, p] : env->mEnvVars["CavernAtmosPressure2"]) {
pressureValues.emplace_back(p);
pressureValues.emplace_back((float)p);
}
//calcMeanAndStddev(pressureValues, mStats.pressure2, mStats.errPressure2);
calcMeanAndStddev(pressureValues, mStats.cavernPressure2, mStats.errCavernPressure2);
pressureValues.clear();

// Surface pressure
for (const auto& [time, p] : env->mEnvVars["SurfaceAtmosPressure"]) {
pressureValues.emplace_back((float)p);
}
calcMeanAndStddev(pressureValues, mStats.surfacePressure, mStats.errSurfacePressure);
return true;
}
return false;
Expand Down

0 comments on commit 3dd2a70

Please sign in to comment.