Skip to content
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
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
34 changes: 21 additions & 13 deletions Modules/TPC/run/tpcQCTracks_sampled.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"name": "not_applicable"
},
"Activity": {
"number": "592390"
"number": "560401"
},
"monitoring": {
"url": "infologger:///debug?qc"
Expand All @@ -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:GLO/MEANVERTEX/0?lifetime=condition&ccdb-path=GLO/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*>("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