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 vdrift #2153

Merged
merged 2 commits into from
Feb 29, 2024
Merged
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 @@ -35,7 +35,8 @@ target_sources(O2QcTPC PRIVATE src/PID.cxx
src/SACs.cxx
src/TPCAggregator.cxx
src/SACZeroScaleReductor.cxx
src/TrackClusters.cxx)
src/TrackClusters.cxx
src/VDriftCalibReductor.cxx)

target_include_directories(
O2QcTPC
Expand Down Expand Up @@ -91,6 +92,7 @@ add_root_dictionary(O2QcTPC
include/TPC/TPCAggregator.h
include/TPC/SACZeroScaleReductor.h
include/TPC/TrackClusters.h
include/TPC/VDriftCalibReductor.h
LINKDEF include/TPC/LinkDef.h)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/TPC
Expand Down Expand Up @@ -171,4 +173,5 @@ install(FILES run/tpcQCPID_sampled.json
run/tpcQCSACs.json
run/tpcQCSACScaleTrend.json
run/tpcQCTrackClusters.json
run/tpcQCvDriftTrending.json
DESTINATION etc)
1 change: 1 addition & 0 deletions Modules/TPC/include/TPC/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#pragma link C++ class o2::quality_control_modules::tpc::TPCAggregator + ;
#pragma link C++ class o2::quality_control_modules::tpc::SACZeroScaleReductor + ;
#pragma link C++ class o2::quality_control_modules::tpc::TrackClusters + ;
#pragma link C++ class o2::quality_control_modules::tpc::VDriftCalibReductor + ;

#pragma link C++ function o2::quality_control_modules::tpc::addAndPublish + ;
#pragma link C++ function o2::quality_control_modules::tpc::toVector + ;
Expand Down
49 changes: 49 additions & 0 deletions Modules/TPC/include/TPC/VDriftCalibReductor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// 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 VDriftCalibReductor.h
/// \author Marcel Lesch
///

#ifndef QUALITYCONTROL_VDRIFTCALIBREDUCTOR_H
#define QUALITYCONTROL_VDRIFTCALIBREDUCTOR_H

#include "QualityControl/ReductorConditionAny.h"

namespace o2::quality_control_modules::tpc
{

/// \brief A Reductor for calibration objects of the TPC drift velocity
///
/// A Reductor for calibration objects of the TPC drift velocity.
/// It produces a branch in the format: "vdrift/F:vdrifterror"

class VDriftCalibReductor : public quality_control::postprocessing::ReductorConditionAny
{
public:
VDriftCalibReductor() = default;
~VDriftCalibReductor() = default;

void* getBranchAddress() override;
const char* getBranchLeafList() override;
bool update(ConditionRetriever& retriever) override;

private:
struct {
Float_t vdrift;
Float_t vdrifterror;
} mStats;
};

} // namespace o2::quality_control_modules::tpc

#endif // QUALITYCONTROL_VDRIFTCALIBREDUCTOR_H
70 changes: 70 additions & 0 deletions Modules/TPC/run/tpcQCvDriftTrending.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"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": {
"CalibQC": {
"active": "true",
"resumeTrend": "false",
"className": "o2::quality_control::postprocessing::TrendingTask",
"moduleName": "QualityControl",
"detectorName": "TPC",
"producePlotsOnUpdate": "true",
"dataSources": [
{
"type": "condition",
"path": "TPC/Calib/",
"names": [ "VDriftTgl" ],
"reductorName": "o2::quality_control_modules::tpc::VDriftCalibReductor",
"moduleName": "QcTPC"
}
],
"plots": [
{
"name": "vDrift_Trending",
"title": "Trend of vDrift over time",
"varexp": "VDriftTgl.vdrift:time",
"selection": "",
"option": "*L",
"graphAxisLabel": "v_Drift:time"
}
],
"initTrigger": [
"userorcontrol"
],
"updateTrigger": [
"newobject:ccdb:TPC/Calib/VDriftTgl/"
],
"stopTrigger": [
"userorcontrol"
]
}
}
}
}

44 changes: 44 additions & 0 deletions Modules/TPC/src/VDriftCalibReductor.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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 VDriftCalibReductor.cxx
/// \author Marcel Lesch
///

#include "TPC/VDriftCalibReductor.h"

#include <DataFormatsTPC/VDriftCorrFact.h>

namespace o2::quality_control_modules::tpc
{

void* VDriftCalibReductor::getBranchAddress()
{
return &mStats;
}

const char* VDriftCalibReductor::getBranchLeafList()
{
return "vdrift/F:vdrifterror";
}

bool VDriftCalibReductor::update(ConditionRetriever& retriever)
{
if (auto vdriftCalib = retriever.retrieve<o2::tpc::VDriftCorrFact>()) {
mStats.vdrift = vdriftCalib->getVDrift();
mStats.vdrifterror = vdriftCalib->getVDriftError();
return true;
}
return false;
}

} // namespace o2::quality_control_modules::tpc
Loading