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-QC] Add functionality to query the PV position from CCDB. #2505

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions Modules/TPC/include/TPC/Tracks.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Tracks final : public TaskInterface

private:
o2::tpc::qc::Tracks mQCTracks{}; ///< TPC QC class from o2
bool usePVfromCCDB = false;
};

} // namespace o2::quality_control_modules::tpc
Expand Down
32 changes: 20 additions & 12 deletions Modules/TPC/run/tpcQCTracks_sampled.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,28 @@
"detectorName": "TPC",
"cycleDurationSeconds": "10",
"dataSource_comment": "The other type of dataSource is \"direct\", see basic-no-sampling.json.",
"dataSource": {
"type": "dataSamplingPolicy",
"name": "tpc-tracks"
},
"dataSources": [
{ "type": "dataSamplingPolicy", "name": "tpc-tracks" },
{
"type": "direct",
"query": "meanvertex:CTP/MEANVERTEX/0?lifetime=condition&ccdb-path=CTP/Calib/MeanVertex"
}
],
"taskParameters": {
"cutAbsEta": "1.", "cutMinNCluster": "60", "cutMindEdxTot": "20."
"cutAbsEta": "1.",
"cutMinNCluster": "60",
"cutMindEdxTot": "20.",
"usePVfromCCDB": "true"
},
"grpGeomRequest" : {
"grpGeomRequest": {
"geomRequest": "None",
"askGRPECS": "false",
"askGRPLHCIF": "false",
"askGRPMagField": "true",
"askMatLUT": "true",
"askTime": "false",
"askOnceAllButField": "true",
"needPropagatorD": "false"
"needPropagatorD": "false"
},
"location": "remote"
}
Expand All @@ -56,11 +62,13 @@
"moduleName": "QcSkeleton",
"policy": "OnAny",
"detectorName": "TPC",
"dataSource": [{
"type": "Task",
"name": "Tracks",
"MOs": ["example"]
}]
"dataSource": [
{
"type": "Task",
"name": "Tracks",
"MOs": ["example"]
}
]
}
}
},
Expand Down
13 changes: 13 additions & 0 deletions Modules/TPC/src/Tracks.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// O2 includes
#include "Framework/ProcessingContext.h"
#include "DataFormatsTPC/TrackTPC.h"
#include "DataFormatsCalibration/MeanVertexObject.h"
#include "TPCQC/Helpers.h"
#include <Framework/InputRecord.h>

Expand All @@ -46,6 +47,8 @@ void Tracks::initialize(o2::framework::InitContext& /*ctx*/)
const float cutMaxAbsDCAr = o2::quality_control_modules::common::getFromConfig<float>(mCustomParameters, "cutMaxAbsDCAr", 0.1);
const bool useCutMaxAbsDCArOnHistos = o2::quality_control_modules::common::getFromConfig<bool>(mCustomParameters, "useCutMaxAbsDCArOnHistos");

usePVfromCCDB = o2::quality_control_modules::common::getFromConfig<bool>(mCustomParameters, "usePVfromCCDB");

// set track cuts defaults are (AbsEta = 1.0, nCluster = 60, MindEdxTot = 20)
mQCTracks.setTrackCuts(cutAbsEta, cutMinNCluster, cutMindEdxTot, cutPtForDCAr, samplingFractionDCAr, runAsyncAndTurnOffSomeHistos, cutMaxAbsDCAr, useCutMaxAbsDCArOnHistos);

Expand All @@ -70,6 +73,16 @@ void Tracks::startOfCycle()

void Tracks::monitorData(o2::framework::ProcessingContext& ctx)
{
// set the coordinates of the PV (extracted from CCDB)
if (usePVfromCCDB) {
auto coordinatesOfPV = ctx.inputs().get<o2::dataformats::MeanVertexObject*>("CTP/Calib/MeanVertex");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be

Suggested change
auto coordinatesOfPV = ctx.inputs().get<o2::dataformats::MeanVertexObject*>("CTP/Calib/MeanVertex");
auto coordinatesOfPV = ctx.inputs().get<o2::dataformats::MeanVertexObject*>("meanvertex");

if (!coordinatesOfPV) {
LOGP(error, "Failed to retrieve MeanVertexObject, using default (0,0,0) instead!");
} else {
mQCTracks.setPVposition(coordinatesOfPV->getPos());
}
}

using TrackType = std::vector<o2::tpc::TrackTPC>;
auto tracks = ctx.inputs().get<TrackType>("inputTracks");

Expand Down