Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TPC: Reductor for Atmos. Pressure in the Cavern #2488

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Modules/TPC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ target_sources(O2QcTPC PRIVATE src/PID.cxx
src/VDriftCalibReductor.cxx
src/SeparationPowerReductor.cxx
src/TimeGainCalibReductor.cxx
src/DCSPTempReductor.cxx)
src/DCSPTempReductor.cxx
src/AtmosPressureReductor.cxx)

target_include_directories(
O2QcTPC
Expand Down Expand Up @@ -99,6 +100,7 @@ add_root_dictionary(O2QcTPC
include/TPC/SeparationPowerReductor.h
include/TPC/TimeGainCalibReductor.h
include/TPC/DCSPTempReductor.h
include/TPC/AtmosPressureReductor.h
LINKDEF include/TPC/LinkDef.h)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/TPC
Expand Down Expand Up @@ -183,4 +185,5 @@ install(FILES run/tpcQCPID_sampled.json
run/tpcQCTrending_separationpower.json
run/tpcQCTimeGainCalibTrending.json
run/tpcDCSPTempTrending.json
run/tpcQCAtmosPressureTrending.json
DESTINATION etc)
53 changes: 53 additions & 0 deletions Modules/TPC/include/TPC/AtmosPressureReductor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// 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: "cavernPressure1/F:errCavernPressure1:cavernPressure2:errCavernPressure2:surfacePressure:errSurfacePressure"

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 cavernPressure1;
Float_t errCavernPressure1;
Float_t cavernPressure2;
Float_t errCavernPressure2;
Float_t surfacePressure;
Float_t errSurfacePressure;
} mStats;
};

} // namespace o2::quality_control_modules::tpc

#endif // QUALITYCONTROL_ATMOSPRESSUREREDUCTOR_H
1 change: 1 addition & 0 deletions Modules/TPC/include/TPC/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#pragma link C++ class o2::quality_control_modules::tpc::SeparationPowerReductor + ;
#pragma link C++ class o2::quality_control_modules::tpc::TimeGainCalibReductor + ;
#pragma link C++ class o2::quality_control_modules::tpc::DCSPTempReductor + ;
#pragma link C++ class o2::quality_control_modules::tpc::AtmosPressureReductor + ;

#pragma link C++ function o2::quality_control_modules::tpc::addAndPublish + ;
#pragma link C++ function o2::quality_control_modules::tpc::toVector + ;
Expand Down
80 changes: 80 additions & 0 deletions Modules/TPC/run/tpcQCAtmosPressureTrending.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"qc": {
"config": {
"database": {
"implementation": "CCDB",
"host": "ccdb-test.cern.ch:8080",
"username": "not_applicable",
"password": "not_applicable",
"name": "not_applicable"
},
"Activity": {
"number": "",
"type": "",
"start": "",
"end": ""
},
"monitoring": {
"url": "infologger:///debug?qc"
},
"consul": {
"url": ""
},
"conditionDB": {
"url": "ccdb-test.cern.ch:8080"
},
"postprocessing": {
"periodSeconds": "10"
}
},
"postprocessing": {
"AtmosPressure": {
"active": "true",
"resumeTrend": "false",
"className": "o2::quality_control::postprocessing::TrendingTask",
"moduleName": "QualityControl",
"detectorName": "TPC",
"producePlotsOnUpdate": "true",
"dataSources": [
{
"type": "condition",
"path": "GLO/Config/",
"names": [ "EnvVars" ],
"reductorName": "o2::quality_control_modules::tpc::AtmosPressureReductor",
"moduleName": "QcTPC"
}
],
"plots": [
{
"name": "atmosPressure1_Trending",
"title": "Trend of atmospheric cavern pressure 1 over time",
"varexp": "EnvVars.cavernPressure1:time",
"selection": "",
"option": "*L",
"graphAxisLabel": "atmospheric Cavern Pressure:time",
"graphErrors": "EnvVars.errCavernPressure1:0"
},
{
"name": "atmosPressure2_Trending",
"title": "Trend of atmospheric cavern pressure 2 over time",
"varexp": "EnvVars.cavernPressure2:time",
"selection": "",
"option": "*L",
"graphAxisLabel": "atmospheric Cavern Pressure:time",
"graphErrors": "EnvVars.errCavernPressure2:0"
}
],
"initTrigger": [
"userorcontrol"
],
"updateTrigger": [
"foreachlatest:ccdb:GLO/Config/EnvVars/"
],
"stopTrigger": [
"userorcontrol"
]
}
}
}
}

63 changes: 63 additions & 0 deletions Modules/TPC/src/AtmosPressureReductor.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// 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 "cavernPressure1/F:errCavernPressure1:cavernPressure2:errCavernPressure2:surfacePressure:errSurfacePressure";
}

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

// Cavern pressure 1
for (const auto& [time, p] : env->mEnvVars["CavernAtmosPressure"]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (const auto& [time, p] : env->mEnvVars["CavernAtmosPressure"]) {
for ([[maybe_unused]] const auto& [time, p] : env->mEnvVars["CavernAtmosPressure"]) {

pressureValues.emplace_back((float)p);
}
calcMeanAndStddev(pressureValues, mStats.cavernPressure1, mStats.errCavernPressure1);
pressureValues.clear();

// Cavern pressure 2
for (const auto& [time, p] : env->mEnvVars["CavernAtmosPressure2"]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (const auto& [time, p] : env->mEnvVars["CavernAtmosPressure2"]) {
for ([[maybe_unused]] const auto& [time, p] : env->mEnvVars["CavernAtmosPressure2"]) {

pressureValues.emplace_back((float)p);
}
calcMeanAndStddev(pressureValues, mStats.cavernPressure2, mStats.errCavernPressure2);
pressureValues.clear();

// Surface pressure
for (const auto& [time, p] : env->mEnvVars["SurfaceAtmosPressure"]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (const auto& [time, p] : env->mEnvVars["SurfaceAtmosPressure"]) {
for ([[maybe_unused]] const auto& [time, p] : env->mEnvVars["SurfaceAtmosPressure"]) {

pressureValues.emplace_back((float)p);
}
calcMeanAndStddev(pressureValues, mStats.surfacePressure, mStats.errSurfacePressure);
return true;
}
return false;
}

} // namespace o2::quality_control_modules::tpc