Skip to content

Commit 29f6d9b

Browse files
authored
MRRTF-218: add separate MCH cluster task (#1791)
1 parent fc03e5b commit 29f6d9b

5 files changed

Lines changed: 357 additions & 4 deletions

File tree

Modules/MUON/MCH/CMakeLists.txt

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ set(SRCS
3939
src/MCHAggregator.cxx
4040
src/QualityPostProcessing.cxx
4141
src/QualityCheck.cxx
42+
src/ClustersTask.cxx
4243
)
4344

4445
set(HEADERS
@@ -81,6 +82,7 @@ set(HEADERS
8182
include/MCH/MCHAggregator.h
8283
include/MCH/QualityPostProcessing.h
8384
include/MCH/QualityCheck.h
85+
include/MCH/ClustersTask.h
8486

8587
# legacy tasks
8688
include/MCH/PhysicsTaskDigits.h
@@ -98,8 +100,24 @@ target_include_directories(
98100
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
99101
)
100102

101-
target_link_libraries(${MODULE_NAME} PUBLIC O2QualityControl O2QcMUONCommon O2::CommonDataFormat O2::GPUCommon O2::MCHGlobalMapping
102-
$<TARGET_NAME_IF_EXISTS:O2::MCHMappingFactory> O2::MCHMappingImpl4 O2::MCHMappingSegContour O2::MCHBase O2::DataFormatsMCH O2::MCHRawDecoder O2::MCHCalibration O2::MCHDigitFiltering O2::MCHPreClustering O2::MCHTracking O2::MCHConstants)
103+
target_link_libraries(${MODULE_NAME} PUBLIC
104+
$<TARGET_NAME_IF_EXISTS:O2::MCHMappingFactory>
105+
O2::CommonDataFormat
106+
O2::DataFormatsMCH
107+
O2::GPUCommon
108+
O2::MCHBase
109+
O2::MCHCalibration
110+
O2::MCHConstants
111+
O2::MCHDigitFiltering
112+
O2::MCHGlobalMapping
113+
O2::MCHMappingImpl4
114+
O2::MCHMappingSegContour
115+
O2::MCHPreClustering
116+
O2::MCHRawDecoder
117+
O2::MCHTracking
118+
O2QcMUONCommon
119+
O2QualityControl
120+
)
103121

104122
target_compile_definitions(${MODULE_NAME} PRIVATE $<$<TARGET_EXISTS:O2::MCHMappingFactory>:MCH_HAS_MAPPING_FACTORY>)
105123

@@ -128,7 +146,7 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/MCH
128146
# ---- ROOT dictionary ----
129147

130148
add_root_dictionary(${MODULE_NAME}
131-
HEADERS
149+
HEADERS
132150
include/MCH/TH2ElecMapReductor.h
133151
include/MCH/ClusterChargeReductor.h
134152
include/MCH/GlobalHistogram.h
@@ -152,7 +170,8 @@ add_root_dictionary(${MODULE_NAME}
152170
include/MCH/MCHAggregator.h
153171
include/MCH/QualityPostProcessing.h
154172
include/MCH/QualityCheck.h
155-
173+
include/MCH/ClustersTask.h
174+
156175
# legacy tasks
157176
include/MCH/PhysicsTaskDigits.h
158177
include/MCH/PhysicsTaskRofs.h
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"qc": {
3+
"config": {
4+
"database": {
5+
"implementation": "CCDB",
6+
"host": "http://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+
},
16+
"tasks": {
17+
"Clusters": {
18+
"active": "true",
19+
"className": "o2::quality_control_modules::muonchambers::ClustersTask",
20+
"moduleName": "QcMuonChambers",
21+
"detectorName": "MCH",
22+
"cycleDurationSeconds": "300",
23+
"maxNumberCycles": "-1",
24+
"dataSource": {
25+
"type": "direct",
26+
"query": "tracks:MCH/TRACKS;trackrofs:MCH/TRACKROFS;trackclusters:MCH/TRACKCLUSTERS"
27+
},
28+
"taskParameters": {
29+
},
30+
"grpGeomRequest": {
31+
"geomRequest": "Aligned",
32+
"askGRPECS": "false",
33+
"askGRPLHCIF": "false",
34+
"askGRPMagField": "false",
35+
"askMatLUT": "false",
36+
"askTime": "false",
37+
"askOnceAllButField": "true",
38+
"needPropagatorD": "false"
39+
},
40+
"location": "remote"
41+
}
42+
},
43+
"checks": {}
44+
},
45+
"dataSamplingPolicies": []
46+
}
47+
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#ifndef QC_MODULE_MCH_CLUSTERS_TASK_H
13+
#define QC_MODULE_MCH_CLUSTERS_TASK_H
14+
15+
#include "QualityControl/TaskInterface.h"
16+
#include <MCHRawElecMap/Mapper.h>
17+
#include <TH1F.h>
18+
#include <TProfile.h>
19+
#include <gsl/span>
20+
#include <memory>
21+
#include "MCHGeometryTransformer/Transformations.h"
22+
#include "MUONCommon/HistPlotter.h"
23+
24+
namespace o2::mch
25+
{
26+
class Cluster;
27+
class TrackMCH;
28+
} // namespace o2::mch
29+
30+
using namespace o2::quality_control::core;
31+
32+
class TH1F;
33+
34+
namespace o2::quality_control_modules::muonchambers
35+
{
36+
37+
class ClustersTask /*final*/ : public TaskInterface
38+
{
39+
public:
40+
ClustersTask();
41+
~ClustersTask() override;
42+
43+
void initialize(o2::framework::InitContext& ctx) override;
44+
void startOfActivity(Activity& activity) override;
45+
void startOfCycle() override;
46+
void monitorData(o2::framework::ProcessingContext& ctx) override;
47+
void endOfCycle() override;
48+
void endOfActivity(Activity& activity) override;
49+
void reset() override;
50+
51+
private:
52+
/** check whether all the expected inputs are present.*/
53+
bool assertInputs(o2::framework::ProcessingContext& ctx);
54+
55+
/** create one histogram with relevant drawing options / stat box status.*/
56+
template <typename T>
57+
std::unique_ptr<T> createHisto(const char* name, const char* title,
58+
int nbins, double xmin, double xmax,
59+
bool statBox = false,
60+
const char* drawOptions = "",
61+
const char* displayHints = "");
62+
63+
/** create histograms related to clusters (those attached to tracks) */
64+
void createClusterHistos();
65+
66+
/** fill histogram related to each cluster */
67+
void fillClusterHistos(gsl::span<const o2::mch::Cluster> clusters);
68+
69+
private:
70+
int dsbinx(int deid, int dsid) const;
71+
72+
std::unique_ptr<TH1F> mNofClustersPerDualSampa; //< aka cluster map
73+
std::unique_ptr<TH1F> mNofClustersPerTrack; ///< number of clusters per track
74+
std::unique_ptr<TProfile> mClusterSizePerChamber; ///< mean cluster size per chamber
75+
std::unique_ptr<TProfile> mNofClustersPerChamber; ///< mean number of clusters per chamber
76+
77+
o2::mch::raw::Det2ElecMapper mDet2ElecMapper;
78+
o2::mch::raw::Solar2FeeLinkMapper mSolar2FeeLinkMapper;
79+
std::unique_ptr<o2::mch::geo::TransformationCreator> mTransformation;
80+
81+
muon::HistPlotter mHistPlotter;
82+
};
83+
84+
} // namespace o2::quality_control_modules::muonchambers
85+
86+
#endif

Modules/MUON/MCH/include/MCH/LinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#pragma link C++ class o2::quality_control_modules::muonchambers::DecodingTask + ;
1313
#pragma link C++ class o2::quality_control_modules::muonchambers::TracksTask + ;
1414
#pragma link C++ class o2::quality_control_modules::muonchambers::ErrorTask + ;
15+
#pragma link C++ class o2::quality_control_modules::muonchambers::ClustersTask + ;
1516
// Post-processing
1617
#pragma link C++ class o2::quality_control_modules::muonchambers::DecodingPostProcessing + ;
1718
#pragma link C++ class o2::quality_control_modules::muonchambers::DigitsPostProcessing + ;

0 commit comments

Comments
 (0)