Skip to content

Commit 24f7ad9

Browse files
cterrevoBarthelemy
authored andcommitted
[EMCAL-526] Initial version of the RawTask (#285)
* [EMCAL-526] Initial version of the RawTask Monitor objects - payload size - error counter - maximum ADC per SM - mean ADC per SM - ADC RMS per SM current version requires RDH version 4
1 parent f014a8a commit 24f7ad9

6 files changed

Lines changed: 414 additions & 9 deletions

File tree

Modules/EMCAL/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22

33
add_library(QcEMCAL)
44

5-
target_sources(QcEMCAL PRIVATE src/DigitsQcTask.cxx src/DigitCheck.cxx)
5+
target_sources(QcEMCAL PRIVATE src/RawTask.cxx src/DigitsQcTask.cxx src/DigitCheck.cxx)
66

77
target_include_directories(
88
QcEMCAL
99
PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
1010
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
1111
)
1212

13-
target_link_libraries(QcEMCAL PUBLIC QualityControl O2::EMCALBase)
13+
target_link_libraries(QcEMCAL PUBLIC QualityControl O2::EMCALBase O2::EMCALReconstruction)
1414

1515
add_root_dictionary(QcEMCAL
1616
HEADERS include/EMCAL/DigitsQcTask.h
1717
include/EMCAL/DigitCheck.h
18+
include/EMCAL/RawTask.h
1819
LINKDEF include/EMCAL/LinkDef.h
1920
BASENAME QcEMCAL)
2021

Modules/EMCAL/etc/readout.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"qc": {
3+
"config": {
4+
"database": {
5+
"implementation": "CCDB",
6+
"host": "emcccdb-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+
"RawTask": {
27+
"active": "true",
28+
"className": "o2::quality_control_modules::emcal::RawTask",
29+
"moduleName": "QcEMCAL",
30+
"detectorName": "EMC",
31+
"cycleDurationSeconds": "10",
32+
"maxNumberCycles": "-1",
33+
"dataSource": {
34+
"type": "dataSamplingPolicy",
35+
"name": "readout"
36+
},
37+
"location": "remote"
38+
}
39+
}
40+
},
41+
"dataSamplingPolicies": [
42+
{
43+
"id": "readout",
44+
"active": "true",
45+
"machines": [],
46+
"query" : "readout:ROUT/RAWDATA",
47+
"samplingConditions": [
48+
{
49+
"condition": "random",
50+
"fraction": "0.1",
51+
"seed": "1441"
52+
}
53+
],
54+
"blocking": "false"
55+
}
56+
]
57+
}

Modules/EMCAL/include/EMCAL/LinkDef.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77

88
#pragma link C++ class o2::quality_control_modules::emcal::DigitCheck + ;
99

10+
#pragma link C++ class o2::quality_control_modules::emcal::RawTask+;
11+
1012
#endif
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
///
12+
/// \file RawTask.h
13+
/// \author Cristina Terrevoli
14+
/// \author Markus Fasel
15+
///
16+
17+
#ifndef QC_MODULE_EMCAL_EMCALRAWTASK_H
18+
#define QC_MODULE_EMCAL_EMCALRAWTASK_H
19+
20+
#include "QualityControl/TaskInterface.h"
21+
#include "EMCALBase/Mapper.h"
22+
#include <memory>
23+
#include <array>
24+
25+
class TH1F;
26+
class TH2F;
27+
class TProfile2D;
28+
29+
using namespace o2::quality_control::core;
30+
31+
namespace o2::quality_control_modules::emcal
32+
{
33+
34+
/// \brief Example Quality Control DPL Task
35+
/// It is final because there is no reason to derive from it. Just remove it if needed.
36+
/// \author Barthelemy von Haller
37+
/// \author Piotr Konopka
38+
class RawTask /*final*/ : public TaskInterface // todo add back the "final" when doxygen is fixed
39+
{
40+
public:
41+
/// \brief Constructor
42+
RawTask() = default;
43+
/// Destructor
44+
~RawTask() override;
45+
46+
// Definition of the methods for the template method pattern
47+
void initialize(o2::framework::InitContext& ctx) override;
48+
void startOfActivity(Activity& activity) override;
49+
void startOfCycle() override;
50+
void monitorData(o2::framework::ProcessingContext& ctx) override;
51+
void endOfCycle() override;
52+
void endOfActivity(Activity& activity) override;
53+
void reset() override;
54+
55+
private:
56+
TH1F* mHistogram = nullptr;
57+
std::array<TH1*, 20> mRawAmplitudeEMCAL; /// Raw amplitude in EMCAL
58+
std::unique_ptr<o2::emcal::MappingHandler> mMappings; //
59+
std::array<TProfile2D*, 20> mRMSperSM; //ADC rms per SM
60+
std::array<TProfile2D*, 20> mMEANperSM; //ADC mean per SM
61+
std::array<TProfile2D*, 20> mMAXperSM; //ADC max per SM
62+
TH2F* mErrorTypeAltro = nullptr; //Error from AltroDecoder
63+
TH2F* mPayloadSizePerDDL = nullptr; //Payload size per ddl
64+
};
65+
66+
} // namespace o2::quality_control_modules::emcal
67+
68+
#endif // QC_MODULE_EMCAL_EMCALRAWTASK_H

Modules/EMCAL/src/DigitsQcTask.cxx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,8 @@ DigitsQcTask::~DigitsQcTask()
2626
}
2727
for (auto h : mDigitTime) {
2828
delete h;
29-
if (mDigitTime[0]) {
30-
delete mDigitTime[0];
31-
}
32-
if (mDigitTime[1]) {
33-
delete mDigitTime[1];
34-
}
3529
}
30+
3631
if (mDigitAmplitudeEMCAL)
3732
delete mDigitAmplitudeEMCAL;
3833
if (mDigitAmplitudeDCAL)
@@ -50,6 +45,7 @@ void DigitsQcTask::initialize(o2::framework::InitContext& /*ctx*/)
5045
// 1D histograms for showing the integrated spectrum
5146
mDigitAmplitudeEMCAL = new TH1F("digitAmplitudeEMCAL", "Digit amplitude in EMCAL", 100, 0., 100.);
5247
mDigitAmplitudeDCAL = new TH1F("digitAmplitudeDCAL", "Digit amplitude in DCAL", 100, 0., 100.);
48+
5349
//Puglishing histograms
5450
for (auto h : mDigitAmplitude)
5551
getObjectsManager()->startPublishing(h);
@@ -87,15 +83,19 @@ void DigitsQcTask::monitorData(o2::framework::ProcessingContext& ctx)
8783
//ctx.services().get<o2::framework::ControlService>().readyToQuit(false);
8884
return;
8985
}
86+
9087
// Get payload and loop over digits
9188
auto digitcontainer = ctx.inputs().get<std::vector<o2::emcal::Digit>>("emcal-digits");
89+
9290
// QcInfoLogger::GetInstance() << "Received " << digitcontainer.size() << " digits " << AliceO2::InfoLogger::InfoLogger::endm;
9391
for (auto digit : digitcontainer) {
9492
int index = digit.getHighGain() ? 0 : (digit.getLowGain() ? 1 : -1);
9593
if (index < 0)
9694
continue;
95+
9796
mDigitAmplitude[index]->Fill(digit.getEnergy(), digit.getTower());
9897
mDigitTime[index]->Fill(digit.getTimeStamp(), digit.getTower());
98+
//if we fill phy vs eta plots integrated: filled with eta phi GlobalRowColumnFromIndex from Geometry
9999

100100
// get the supermodule for filling EMCAL/DCAL spectra
101101
try {
@@ -132,7 +132,6 @@ void DigitsQcTask::reset()
132132
mDigitAmplitudeEMCAL->Reset();
133133
mDigitAmplitudeDCAL->Reset();
134134
}
135-
136135
} // namespace emcal
137136
} // namespace quality_control_modules
138137
} // namespace o2

0 commit comments

Comments
 (0)