-
Notifications
You must be signed in to change notification settings - Fork 151
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
mlesch
wants to merge
3
commits into
AliceO2Group:master
Choose a base branch
from
mlesch:AtmosPressureReductor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,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 |
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,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" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
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,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"]) { | ||||||
pressureValues.emplace_back((float)p); | ||||||
} | ||||||
calcMeanAndStddev(pressureValues, mStats.cavernPressure1, mStats.errCavernPressure1); | ||||||
pressureValues.clear(); | ||||||
|
||||||
// Cavern pressure 2 | ||||||
for (const auto& [time, p] : env->mEnvVars["CavernAtmosPressure2"]) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
pressureValues.emplace_back((float)p); | ||||||
} | ||||||
calcMeanAndStddev(pressureValues, mStats.cavernPressure2, mStats.errCavernPressure2); | ||||||
pressureValues.clear(); | ||||||
|
||||||
// Surface pressure | ||||||
for (const auto& [time, p] : env->mEnvVars["SurfaceAtmosPressure"]) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
pressureValues.emplace_back((float)p); | ||||||
} | ||||||
calcMeanAndStddev(pressureValues, mStats.surfacePressure, mStats.errSurfacePressure); | ||||||
return true; | ||||||
} | ||||||
return false; | ||||||
} | ||||||
|
||||||
} // namespace o2::quality_control_modules::tpc |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.