Skip to content

Commit 2781187

Browse files
author
Maximilian Korwieser
committed
[TPC-QC] Add functionality to query the PV position from CCDB.
1 parent 697cda5 commit 2781187

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

Modules/TPC/include/TPC/Tracks.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Tracks final : public TaskInterface
5050

5151
private:
5252
o2::tpc::qc::Tracks mQCTracks{}; ///< TPC QC class from o2
53+
bool usePVfromCCDB = false;
5354
};
5455

5556
} // namespace o2::quality_control_modules::tpc

Modules/TPC/run/tpcQCTracks_sampled.json

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,24 @@
3131
"dataSource_comment": "The other type of dataSource is \"direct\", see basic-no-sampling.json.",
3232
"dataSource": {
3333
"type": "dataSamplingPolicy",
34-
"name": "tpc-tracks"
34+
"name": "tpc-tracks",
35+
"query": "meanvertex:CTP/MEANVERTEX/0?lifetime=condition&ccdb-path=CTP/Calib/MeanVertex"
3536
},
3637
"taskParameters": {
37-
"cutAbsEta": "1.", "cutMinNCluster": "60", "cutMindEdxTot": "20."
38+
"cutAbsEta": "1.",
39+
"cutMinNCluster": "60",
40+
"cutMindEdxTot": "20.",
41+
"usePVfromCCDB": "true"
3842
},
39-
"grpGeomRequest" : {
43+
"grpGeomRequest": {
4044
"geomRequest": "None",
4145
"askGRPECS": "false",
4246
"askGRPLHCIF": "false",
4347
"askGRPMagField": "true",
4448
"askMatLUT": "true",
4549
"askTime": "false",
4650
"askOnceAllButField": "true",
47-
"needPropagatorD": "false"
51+
"needPropagatorD": "false"
4852
},
4953
"location": "remote"
5054
}
@@ -56,11 +60,13 @@
5660
"moduleName": "QcSkeleton",
5761
"policy": "OnAny",
5862
"detectorName": "TPC",
59-
"dataSource": [{
60-
"type": "Task",
61-
"name": "Tracks",
62-
"MOs": ["example"]
63-
}]
63+
"dataSource": [
64+
{
65+
"type": "Task",
66+
"name": "Tracks",
67+
"MOs": ["example"]
68+
}
69+
]
6470
}
6571
}
6672
},

Modules/TPC/src/Tracks.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
// O2 includes
2323
#include "Framework/ProcessingContext.h"
2424
#include "DataFormatsTPC/TrackTPC.h"
25+
#include "DataFormatsCalibration/MeanVertexObject.h"
2526
#include "TPCQC/Helpers.h"
2627
#include <Framework/InputRecord.h>
2728

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

50+
usePVfromCCDB = o2::quality_control_modules::common::getFromConfig<bool>(mCustomParameters, "usePVfromCCDB");
51+
4952
// set track cuts defaults are (AbsEta = 1.0, nCluster = 60, MindEdxTot = 20)
5053
mQCTracks.setTrackCuts(cutAbsEta, cutMinNCluster, cutMindEdxTot, cutPtForDCAr, samplingFractionDCAr, runAsyncAndTurnOffSomeHistos, cutMaxAbsDCAr, useCutMaxAbsDCArOnHistos);
5154

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

7174
void Tracks::monitorData(o2::framework::ProcessingContext& ctx)
7275
{
76+
// set the coordinates of the PV (extracted from CCDB)
77+
if (usePVfromCCDB) {
78+
auto coordinatesOfPV = ctx.inputs().get<o2::dataformats::MeanVertexObject*>("CTP/Calib/MeanVertex");
79+
if (!coordinatesOfPV) {
80+
LOGP(error, "Failed to retrieve MeanVertexObject, using default (0,0,0) instead!");
81+
} else {
82+
mQCTracks.setPVposition(coordinatesOfPV->getPos());
83+
}
84+
}
85+
7386
using TrackType = std::vector<o2::tpc::TrackTPC>;
7487
auto tracks = ctx.inputs().get<TrackType>("inputTracks");
7588

0 commit comments

Comments
 (0)