Skip to content

Commit 6140844

Browse files
authored
Generalize Cluster task to also accept KrClusters (#794)
Depends on AliceO2Group/AliceO2#6798
1 parent 262d2c2 commit 6140844

3 files changed

Lines changed: 86 additions & 2 deletions

File tree

Modules/TPC/include/TPC/Clusters.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class Clusters /*final*/ : public TaskInterface // todo add back the "final" whe
6262
std::vector<std::unique_ptr<TCanvas>> mSigmaTimeCanvasVec{}; ///< summary canvases of the SigmaTime object
6363
std::vector<std::unique_ptr<TCanvas>> mSigmaPadCanvasVec{}; ///< summary canvases of the SigmaPad object
6464
std::vector<std::unique_ptr<TCanvas>> mTimeBinCanvasVec{}; ///< summary canvases of the TimeBin object
65+
66+
void processClusterNative(o2::framework::InputRecord& inputs);
67+
void processKrClusters(o2::framework::InputRecord& inputs);
6568
};
6669

6770
} // namespace o2::quality_control_modules::tpc
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"qc": {
3+
"config": {
4+
"database": {
5+
"implementation": "CCDB",
6+
"host": "ccdb-test.cern.ch:8080",
7+
"username": "not_applicable",
8+
"password": "not_applicable",
9+
"name": "not_applicable"
10+
},
11+
"Activity": {
12+
"number": "42",
13+
"type": "2"
14+
},
15+
"monitoring": {
16+
"url": "infologger:///debug?qc"
17+
},
18+
"consul": {
19+
"url": "http://consul-test.cern.ch:8500"
20+
},
21+
"conditionDB": {
22+
"url": "ccdb-test.cern.ch:8080"
23+
}
24+
},
25+
"tasks": {
26+
"KrClusters": {
27+
"active": "true",
28+
"className": "o2::quality_control_modules::tpc::Clusters",
29+
"moduleName": "QcTPC",
30+
"detectorName": "TPC",
31+
"cycleDurationSeconds": "10",
32+
"maxNumberCycles": "-1",
33+
"resetAfterCycles": "5",
34+
"dataSource": {
35+
"type": "direct",
36+
"query" : "krClusters:TPC/KRCLUSTERS"
37+
},
38+
"taskParameters": {
39+
"NClustersNBins": "100", "NClustersXMin": "0", "NClustersXMax": "100",
40+
"QmaxNBins": "200", "QmaxXMin": "0", "QmaxXMax": "1024",
41+
"QtotNBins": "600", "QtotXMin": "0", "QtotXMax": "6000",
42+
"SigmaPadNBins": "200", "SigmaPadXMin": "0", "SigmaPadXMax": "3.8",
43+
"SigmaTimeNBins": "200", "SigmaTimeXMin": "0", "SigmaTimeXMax": "2.5",
44+
"TimeBinNBins": "1000", "TimeBinXMin": "0", "TimeBinXMax": "100000"
45+
},
46+
"location": "remote"
47+
}
48+
}
49+
},
50+
"dataSamplingPolicies": [
51+
]
52+
}

Modules/TPC/src/Clusters.cxx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@
1616

1717
// O2 includes
1818
#include "Framework/ProcessingContext.h"
19+
#include "DataFormatsTPC/KrCluster.h"
1920
#include "DataFormatsTPC/ClusterNative.h"
2021
#include "TPCBase/Painter.h"
22+
#include "Framework/InputRecordWalker.h"
2123

2224
// QC includes
2325
#include "QualityControl/QcInfoLogger.h"
2426
#include "TPC/Clusters.h"
2527
#include "TPC/Utility.h"
2628

29+
using namespace o2::framework;
30+
using namespace o2::tpc;
31+
2732
namespace o2::quality_control_modules::tpc
2833
{
2934

@@ -63,9 +68,12 @@ void Clusters::startOfCycle()
6368
QcInfoLogger::GetInstance() << "startOfCycle" << AliceO2::InfoLogger::InfoLogger::endm;
6469
}
6570

66-
void Clusters::monitorData(o2::framework::ProcessingContext& ctx)
71+
void Clusters::processClusterNative(o2::framework::InputRecord& inputs)
6772
{
68-
o2::tpc::ClusterNativeAccess clusterIndex = clusterHandler(ctx.inputs());
73+
o2::tpc::ClusterNativeAccess clusterIndex = clusterHandler(inputs);
74+
if (!clusterIndex.nClustersTotal) {
75+
return;
76+
}
6977

7078
for (int isector = 0; isector < o2::tpc::constants::MAXSECTOR; ++isector) {
7179
for (int irow = 0; irow < o2::tpc::constants::MAXGLOBALPADROW; ++irow) {
@@ -76,6 +84,27 @@ void Clusters::monitorData(o2::framework::ProcessingContext& ctx)
7684
}
7785
}
7886
}
87+
}
88+
89+
void Clusters::processKrClusters(o2::framework::InputRecord& inputs)
90+
{
91+
std::vector<InputSpec> filterKr = {
92+
{ "krClusters", ConcreteDataTypeMatcher{ "TPC", "KRCLUSTERS" }, Lifetime::Timeframe },
93+
{ "sampled-krClusters", ConcreteDataTypeMatcher{ "DS", "KRCLUSTERS" }, Lifetime::Timeframe },
94+
};
95+
96+
for (auto const& inputRef : InputRecordWalker(inputs, filterKr)) {
97+
auto krClusters = inputs.get<gsl::span<o2::tpc::KrCluster>>(inputRef);
98+
for (const auto& cl : krClusters) {
99+
mQCClusters.processCluster(cl, o2::tpc::Sector(cl.sector), int(cl.meanRow));
100+
}
101+
}
102+
}
103+
104+
void Clusters::monitorData(o2::framework::ProcessingContext& ctx)
105+
{
106+
processClusterNative(ctx.inputs());
107+
processKrClusters(ctx.inputs());
79108

80109
mQCClusters.analyse();
81110

0 commit comments

Comments
 (0)