Skip to content

Commit 48ebf74

Browse files
wpierozakwpierozak
authored andcommitted
Migrated changes from AFIT-11 branch
1 parent ef59a77 commit 48ebf74

26 files changed

Lines changed: 523 additions & 498 deletions

‎Detectors/FIT/FDD/dcsmonitoring/CMakeLists.txt‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# or submit itself to any jurisdiction.
1111

1212
o2_add_library(FDDDCSMonitoring
13-
SOURCES src/FDDDCSDataProcessor.cxx
14-
PUBLIC_LINK_LIBRARIES O2::FITDCSMonitoring)
13+
SOURCES src/FDDDCSDataProcessor.cxx src/FDDDCSConfigProcessor.cxx
14+
PUBLIC_LINK_LIBRARIES O2::FITDCSMonitoring O2::DataFormatsFDD)
1515

1616
o2_add_executable(dcs-sim-workflow
1717
COMPONENT_NAME fdd
@@ -30,4 +30,5 @@ o2_add_executable(dcs-config-workflow
3030
SOURCES workflow/fdd-dcs-config-workflow.cxx
3131
PUBLIC_LINK_LIBRARIES O2::DetectorsCalibration
3232
O2::FITDCSMonitoring
33-
O2::Framework)
33+
O2::Framework
34+
O2::FDDDCSMonitoring)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
/// \author Wiktor Pierożak <wiktor.pierozak@cern.ch>, AGH University of Krakow, Poland
13+
14+
#ifndef O2_FDD_DCS_CONFIG_PROCESSOR_H
15+
#define O2_FDD_DCS_CONFIG_PROCESSOR_H
16+
17+
#include "FITDCSMonitoring/FITDCSConfigProcessor.h"
18+
19+
namespace o2::fdd
20+
{
21+
class FDDDCSConfigProcessor : public o2::fit::FITDCSConfigProcessor
22+
{
23+
public:
24+
FDDDCSConfigProcessor(const std::string& detectorName, const o2::header::DataDescription& dataDescriptionDChM, const o2::header::DataDescription& dataDescriptionFeeConfig)
25+
: o2::fit::FITDCSConfigProcessor(detectorName, dataDescriptionDChM, dataDescriptionFeeConfig) {}
26+
27+
void init(o2::framework::InitContext& ic) final;
28+
void run(o2::framework::ProcessingContext& pc) final;
29+
void endOfStream(o2::framework::EndOfStreamContext& ec) final;
30+
};
31+
} // namespace o2::fdd
32+
#endif
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
#include "FDDDCSMonitoring/FDDDCSConfigProcessor.h"
13+
14+
namespace o2::fdd
15+
{
16+
void FDDDCSConfigProcessor::init(o2::framework::InitContext& ic)
17+
{
18+
initDeadChannelMapReader();
19+
setupDeadChannelMapReader(ic);
20+
}
21+
22+
void FDDDCSConfigProcessor::run(o2::framework::ProcessingContext& pc)
23+
{
24+
try {
25+
long dataTime = getValidityTime(pc);
26+
27+
gsl::span<const char> dataBuffer = pc.inputs().get<gsl::span<char>>("inputConfig");
28+
std::string configFileName = pc.inputs().get<std::string>("inputConfigFileName");
29+
LOG(info) << "Got input file " << configFileName << " of size " << dataBuffer.size();
30+
31+
if (!configFileName.compare(mDeadChannelMapReader->getFileNameDChM())) {
32+
handleDeadChannelMapUpdate(pc, dataTime, dataBuffer);
33+
} else {
34+
LOG(error) << "Unknown input file: " << configFileName;
35+
}
36+
} catch (std::exception& e) {
37+
LOG(error) << "Exception: " << e.what();
38+
}
39+
}
40+
41+
void FDDDCSConfigProcessor::endOfStream(o2::framework::EndOfStreamContext& ec)
42+
{
43+
}
44+
} // namespace o2::fdd

‎Detectors/FIT/FDD/dcsmonitoring/workflow/FDDDCSConfigProcessorSpec.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
///
1515
/// \author Andreas Molander <andreas.molander@cern.ch>, University of Jyvaskyla, Finland
1616

17-
#ifndef O2_FDD_DCSCONFIGPROCESSOR_H
18-
#define O2_FDD_DCSCONFIGPROCESSOR_H
17+
#ifndef O2_FDD_DCSCONFIGPROCESSORSPEC_H
18+
#define O2_FDD_DCSCONFIGPROCESSORSPEC_H
1919

20-
#include "FITDCSMonitoring/FITDCSConfigProcessorSpec.h"
20+
#include "FDDDCSMonitoring/FDDDCSConfigProcessor.h"
2121
#include "DetectorsCalibration/Utils.h"
2222
#include "Framework/WorkflowSpec.h"
2323
#include "Headers/DataHeader.h"
@@ -43,7 +43,7 @@ DataProcessorSpec getFDDDCSConfigProcessorSpec()
4343
Inputs{{"inputConfig", o2::header::gDataOriginFDD, "DCS_CONFIG_FILE", Lifetime::Sporadic},
4444
{"inputConfigFileName", o2::header::gDataOriginFDD, "DCS_CONFIG_NAME", Lifetime::Sporadic}},
4545
outputs,
46-
AlgorithmSpec{adaptFromTask<o2::fit::FITDCSConfigProcessor>("FDD", ddDChM)},
46+
AlgorithmSpec{adaptFromTask<o2::fdd::FDDDCSConfigProcessor>("FDD", ddDChM, o2::header::DataDescription{})},
4747
Options{{"use-verbose-mode", VariantType::Bool, false, {"Use verbose mode"}},
4848
{"filename-dchm", VariantType::String, "FDD-deadchannels.txt", {"Dead channel map file name"}},
4949
{"valid-days-dchm", VariantType::UInt32, 180u, {"Dead channel map validity in days"}},
@@ -53,4 +53,4 @@ DataProcessorSpec getFDDDCSConfigProcessorSpec()
5353
} // namespace framework
5454
} // namespace o2
5555

56-
#endif // O2_FDD_DCSCONFIGPROCESSOR_H
56+
#endif // O2_FDD_DCSCONFIGPROCESSORSPEC_H

‎Detectors/FIT/FT0/dcsmonitoring/CMakeLists.txt‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@
1010
# or submit itself to any jurisdiction.
1111

1212
o2_add_library(FT0DCSMonitoring
13-
SOURCES src/FT0DCSDataProcessor.cxx
14-
PUBLIC_LINK_LIBRARIES O2::FITDCSMonitoring)
15-
16-
o2_target_root_dictionary(FT0DCSMonitoring
17-
HEADERS include/FT0DCSMonitoring/FT0DCSConfigReader.h)
13+
SOURCES src/FT0DCSDataProcessor.cxx src/FT0DCSConfigProcessor.cxx
14+
PUBLIC_LINK_LIBRARIES O2::FITDCSMonitoring O2::DataFormatsFT0)
1815

1916
o2_add_executable(dcs-sim-workflow
2017
COMPONENT_NAME ft0
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 O2_FT0_DCSCONFIGPROCESSOR_H
13+
#define O2_FT0_DCSCONFIGPROCESSOR_H
14+
15+
#include "FITDCSMonitoring/FITDCSConfigProcessor.h"
16+
#include "DetectorsCalibration/Utils.h"
17+
#include "Framework/WorkflowSpec.h"
18+
#include "Headers/DataHeader.h"
19+
20+
#include <string>
21+
#include <vector>
22+
23+
namespace o2::ft0
24+
{
25+
class FT0DCSConfigProcessor : public o2::fit::FITDCSConfigProcessor
26+
{
27+
public:
28+
FT0DCSConfigProcessor(const std::string& detectorName, const o2::header::DataDescription& dataDescriptionDChM, const o2::header::DataDescription& dataDescriptionFeeConfig)
29+
: o2::fit::FITDCSConfigProcessor(detectorName, dataDescriptionDChM, dataDescriptionFeeConfig) {}
30+
31+
void init(o2::framework::InitContext& ic) final;
32+
void run(o2::framework::ProcessingContext& pc) final;
33+
void endOfStream(o2::framework::EndOfStreamContext& ec) final;
34+
};
35+
} // namespace o2::ft0
36+
#endif // O2_FT0_DCSCONFIGPROCESSOR_H

‎Detectors/FIT/FT0/dcsmonitoring/include/FT0DCSMonitoring/FT0DCSConfigReader.h‎

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
#include "FT0DCSMonitoring/FT0DCSConfigProcessor.h"
13+
14+
namespace o2::ft0
15+
{
16+
void FT0DCSConfigProcessor::init(o2::framework::InitContext& ic)
17+
{
18+
initDeadChannelMapReader();
19+
setupDeadChannelMapReader(ic);
20+
}
21+
22+
void FT0DCSConfigProcessor::run(o2::framework::ProcessingContext& pc)
23+
{
24+
try {
25+
long dataTime = getValidityTime(pc);
26+
27+
gsl::span<const char> dataBuffer = pc.inputs().get<gsl::span<char>>("inputConfig");
28+
std::string configFileName = pc.inputs().get<std::string>("inputConfigFileName");
29+
LOG(info) << "Got input file " << configFileName << " of size " << dataBuffer.size();
30+
if (!configFileName.compare(mDeadChannelMapReader->getFileNameDChM())) {
31+
handleDeadChannelMapUpdate(pc, dataTime, dataBuffer);
32+
} else {
33+
LOG(error) << "Unknown input file: " << configFileName;
34+
}
35+
} catch (std::exception& e) {
36+
LOG(error) << "Exception: " << e.what();
37+
}
38+
}
39+
40+
void FT0DCSConfigProcessor::endOfStream(o2::framework::EndOfStreamContext& ec)
41+
{
42+
}
43+
} // namespace o2::ft0

‎Detectors/FIT/FT0/dcsmonitoring/src/FT0DCSMonitoringLinkDef.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@
1515
#pragma link off all classes;
1616
#pragma link off all functions;
1717

18-
#pragma link C++ class o2::ft0::FT0DCSConfigReader + ;
19-
2018
#endif

‎Detectors/FIT/FT0/dcsmonitoring/workflow/FT0DCSConfigProcessorSpec.h‎

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
///
1515
/// \author Andreas Molander <andreas.molander@cern.ch>, University of Jyvaskyla, Finland
1616

17-
#ifndef O2_FT0_DCSCONFIGPROCESSOR_H
18-
#define O2_FT0_DCSCONFIGPROCESSOR_H
17+
#ifndef O2_FT0_DCSCONFIGPROCESSORSPEC_H
18+
#define O2_FT0_DCSCONFIGPROCESSORSPEC_H
1919

20-
#include "FITDCSMonitoring/FITDCSConfigProcessorSpec.h"
21-
#include "FT0DCSMonitoring/FT0DCSConfigReader.h"
20+
#include "FT0DCSMonitoring/FT0DCSConfigProcessor.h"
2221
#include "DetectorsCalibration/Utils.h"
2322
#include "Framework/WorkflowSpec.h"
2423
#include "Headers/DataHeader.h"
@@ -28,25 +27,6 @@
2827

2928
namespace o2
3029
{
31-
namespace ft0
32-
{
33-
34-
class FT0DCSConfigProcessor : public o2::fit::FITDCSConfigProcessor
35-
{
36-
// Example of how to use another DCS config reader (subclass of o2::fit::FITDCSConfigReader)
37-
public:
38-
FT0DCSConfigProcessor(const std::string& detectorName, const o2::header::DataDescription& dataDescriptionDChM)
39-
: o2::fit::FITDCSConfigProcessor(detectorName, dataDescriptionDChM) {}
40-
41-
protected:
42-
void initDCSConfigReader() override
43-
{
44-
mDCSConfigReader = std::make_unique<FT0DCSConfigReader>(FT0DCSConfigReader());
45-
}
46-
};
47-
48-
} // namespace ft0
49-
5030
namespace framework
5131
{
5232

@@ -62,7 +42,7 @@ DataProcessorSpec getFT0DCSConfigProcessorSpec()
6242
Inputs{{"inputConfig", o2::header::gDataOriginFT0, "DCS_CONFIG_FILE", Lifetime::Sporadic},
6343
{"inputConfigFileName", o2::header::gDataOriginFT0, "DCS_CONFIG_NAME", Lifetime::Sporadic}},
6444
outputs,
65-
AlgorithmSpec{adaptFromTask<o2::ft0::FT0DCSConfigProcessor>("FT0", ddDChM)},
45+
AlgorithmSpec{adaptFromTask<o2::ft0::FT0DCSConfigProcessor>("FT0", ddDChM, o2::header::DataDescription{})},
6646
Options{{"use-verbose-mode", VariantType::Bool, false, {"Use verbose mode"}},
6747
{"filename-dchm", VariantType::String, "FT0-deadchannels.txt", {"Dead channel map file name"}},
6848
{"valid-days-dchm", VariantType::UInt32, 180u, {"Dead channel map validity in days"}},
@@ -72,4 +52,4 @@ DataProcessorSpec getFT0DCSConfigProcessorSpec()
7252
} // namespace framework
7353
} // namespace o2
7454

75-
#endif // O2_FT0_DCSCONFIGPROCESSOR_H
55+
#endif // O2_FT0_DCSCONFIGPROCESSORSPEC_H

0 commit comments

Comments
 (0)