Skip to content

Commit dc9d987

Browse files
maciaccoGiorgioAlbertoLucia
authored andcommitted
fix digitizer workflow skeleton (use correct namespaces and tree columns)
1 parent 81c6889 commit dc9d987

11 files changed

Lines changed: 61 additions & 50 deletions

File tree

Detectors/Upgrades/ALICE3/IOTOF/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
add_subdirectory(base)
1313
add_subdirectory(simulation)
1414
add_subdirectory(DataFormatsIOTOF)
15-
# add_subdirectory(workflow)
15+
add_subdirectory(workflow)
1616
add_subdirectory(macros)

Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/DPLDigitizerParam.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#ifndef ALICEO2_TRKDPLDIGITIZERPARAM_H_
13-
#define ALICEO2_TRKDPLDIGITIZERPARAM_H_
12+
#ifndef ALICEO2_TF3DPLDIGITIZERPARAM_H_
13+
#define ALICEO2_TF3DPLDIGITIZERPARAM_H_
1414

1515
#include "DetectorsCommonDataFormats/DetID.h"
1616
#include "CommonUtils/ConfigurableParam.h"
@@ -19,15 +19,15 @@
1919

2020
namespace o2
2121
{
22-
namespace trk
22+
namespace iotof
2323
{
2424
template <int N>
2525
struct DPLDigitizerParam : public o2::conf::ConfigurableParamHelper<DPLDigitizerParam<N>> {
2626
static_assert(N == o2::detectors::DetID::TF3, "only DetID::TF3 is allowed");
2727

2828
static constexpr std::string_view getParamName()
2929
{
30-
return N == o2::detectors::DetID::TF3 ? ParamName[0] : ParamName[1];
30+
return ParamName[0];
3131
}
3232

3333
bool continuous = true; ///< flag for continuous simulation
@@ -54,16 +54,16 @@ struct DPLDigitizerParam : public o2::conf::ConfigurableParamHelper<DPLDigitizer
5454
private:
5555
static constexpr float DEFNoisePerPixel()
5656
{
57-
return N == o2::detectors::DetID::TF3 ? 1e-7 : 1e-8; // ITS/MFT values here!!
57+
return 1e-8; // ITS/MFT values here!!
5858
}
5959

60-
static constexpr std::string_view ParamName[2] = {"TRKDigitizerParam", "FT3DigitizerParam"};
60+
static constexpr std::string_view ParamName[1] = {"TF3DigitizerParam"};
6161
};
6262

6363
template <int N>
6464
DPLDigitizerParam<N> DPLDigitizerParam<N>::sInstance;
6565

66-
} // namespace trk
66+
} // namespace iotof
6767
} // namespace o2
6868

6969
#endif

Detectors/Upgrades/ALICE3/IOTOF/simulation/src/DPLDigitizerParam.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ namespace iotof
1717
{
1818
// this makes sure that the constructor of the parameters is statically called
1919
// so that these params are part of the parameter database
20-
static auto& sDigitizerParamTF3 = o2::trk::DPLDigitizerParam<o2::detectors::DetID::TF3>::Instance();
20+
static auto& sDigitizerParamTF3 = o2::iotof::DPLDigitizerParam<o2::detectors::DetID::TF3>::Instance();
2121
} // namespace iotof
2222
} // namespace o2

Detectors/Upgrades/ALICE3/IOTOF/workflow/CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
o2_add_library(IOTOFWorkflow
1313
TARGETVARNAME targetName
1414
SOURCES src/DigitReaderSpec.cxx
15-
# src/DigitWriterSpec.cxx
15+
src/DigitWriterSpec.cxx
1616
PUBLIC_LINK_LIBRARIES O2::Framework
1717
O2::DataFormatsIOTOF
18+
O2::DataFormatsITSMFT
19+
O2::DPLUtils
1820
)
1921

20-
o2_add_executable(reco-workflow
21-
SOURCES src/iotof-reco-workflow.cxx
22-
COMPONENT_NAME alice3-iotof
23-
PUBLIC_LINK_LIBRARIES O2::IOTOFWorkflow
24-
O2::IOTOFSimulation
25-
)
22+
#o2_add_executable(reco-workflow
23+
# SOURCES src/iotof-reco-workflow.cxx
24+
# COMPONENT_NAME alice3-iotof
25+
# PUBLIC_LINK_LIBRARIES O2::IOTOFWorkflow
26+
# O2::IOTOFSimulation
27+
# )

Detectors/Upgrades/ALICE3/IOTOF/workflow/include/IOTOFWorkflow/DigitReaderSpec.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ class TF3DigitReader : public o2::framework::Task
3737
void connectTree(const std::string& filename);
3838

3939
std::vector<o2::iotof::Digit> mDigits, *mDigitsPtr = &mDigits;
40-
o2::header::DataOrigin mOrigin = o2::header::gDataOriginInvalid;
40+
std::vector<std::vector<o2::itsmft::ROFRecord>*> mDigROFRec, *mDigROFRecPtr = &mDigROFRec;
41+
std::vector<std::vector<o2::itsmft::MC2ROFRecord>*> mDigMC2ROFs, *mDigMC2ROFsPtr = &mDigMC2ROFs;
42+
o2::header::DataOrigin mOrigin = o2::header::gDataOriginTF3;
4143

4244
std::unique_ptr<TFile> mFile;
4345
std::unique_ptr<TTree> mTree;

Detectors/Upgrades/ALICE3/IOTOF/workflow/include/IOTOFWorkflow/DigitWriterSpec.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#ifndef STEER_TRKDIGITWRITER_H_
13-
#define STEER_TRKDIGITWRITER_H_
12+
#ifndef STEER_TF3DIGITWRITER_H_
13+
#define STEER_TF3DIGITWRITER_H_
1414

1515
#include "Framework/DataProcessorSpec.h"
1616

1717
namespace o2
1818
{
19-
namespace trk
19+
namespace iotof
2020
{
2121

22-
o2::framework::DataProcessorSpec getTRKDigitWriterSpec(bool mctruth = true, bool dec = false, bool calib = false);
23-
} // namespace trk
22+
o2::framework::DataProcessorSpec getIOTOFDigitWriterSpec(bool mctruth = true, bool dec = false, bool calib = false);
23+
} // namespace iotof
2424
} // end namespace o2
2525

26-
#endif /* STEER_TRKDIGITWRITER_H_ */
26+
#endif /* STEER_TF3DIGITWRITER_H_ */

Detectors/Upgrades/ALICE3/IOTOF/workflow/src/DigitReaderSpec.cxx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
#include "SimulationDataFormat/ConstMCTruthContainer.h"
2222
#include "SimulationDataFormat/IOMCTruthContainerView.h"
2323

24+
using namespace o2::framework;
25+
2426
namespace o2::iotof
2527
{
2628

2729
TF3DigitReader::TF3DigitReader(o2::detectors::DetID id, bool useMC, bool useCalib)
2830
{
29-
assert(id == o2::detectors::DetID::TRK);
31+
assert(id == o2::detectors::DetID::TF3);
3032
mDetNameLC = mDetName = id.getName();
3133
mDigTreeName = "o2sim";
3234

@@ -66,7 +68,7 @@ void TF3DigitReader::run(o2::framework::ProcessingContext& pc)
6668
pc.outputs().snapshot(Output{mOrigin, "DIGITSROF", 0}, mDigROFRec);
6769
pc.outputs().snapshot(Output{mOrigin, "DIGITS", 0}, mDigits);
6870
if (mUseCalib) {
69-
pc.outputs().snapshot(Output{mOrigin, "GBTCALIB", 0}, mCalib);
71+
// pc.outputs().snapshot(Output{mOrigin, "GBTCALIB", 0}, mCalib);
7072
}
7173

7274
if (mUseMC) {
@@ -96,35 +98,35 @@ void TF3DigitReader::connectTree(const std::string& filename)
9698
if (!mTree->GetBranch(mCalibBranchName.c_str())) {
9799
throw std::runtime_error("GBT calibration data requested but not found in the tree");
98100
}
99-
mTree->SetBranchAddress(mCalibBranchName.c_str(), &mCalibPtr);
101+
// mTree->SetBranchAddress(mCalibBranchName.c_str(), &mCalibPtr);
100102
}
101103
if (mUseMC) {
102-
if (!mTree->GetBranch(mDigtMC2ROFBranchName.c_str()) || !mTree->GetBranch(mDigtMCTruthBranchName.c_str())) {
104+
if (!mTree->GetBranch(mDigtMCTruthBranchName.c_str())) {
103105
throw std::runtime_error("MC data requested but not found in the tree");
104106
}
105107
mTree->SetBranchAddress(mDigtMC2ROFBranchName.c_str(), &mDigMC2ROFsPtr);
106108
}
107109
LOG(info) << "Loaded tree from " << filename << " with " << mTree->GetEntries() << " entries";
108110
}
109111

110-
DataProcessorSpec getTRKDigitReaderSpec(bool useMC, bool useCalib, std::string defname)
112+
DataProcessorSpec getIOTOFDigitReaderSpec(bool useMC, bool useCalib, std::string defname)
111113
{
112114
std::vector<OutputSpec> outputSpec;
113-
outputSpec.emplace_back("TRK", "DIGITS", 0, Lifetime::Timeframe);
114-
outputSpec.emplace_back("TRK", "DIGITSROF", 0, Lifetime::Timeframe);
115+
outputSpec.emplace_back("TF3", "DIGITS", 0, Lifetime::Timeframe);
116+
outputSpec.emplace_back("TF3", "DIGITSROF", 0, Lifetime::Timeframe);
115117
if (useCalib) {
116-
outputSpec.emplace_back("TRK", "GBTCALIB", 0, Lifetime::Timeframe);
118+
// outputSpec.emplace_back("TF3", "GBTCALIB", 0, Lifetime::Timeframe);
117119
}
118120
if (useMC) {
119-
outputSpec.emplace_back("TRK", "DIGITSMCTR", 0, Lifetime::Timeframe);
120-
outputSpec.emplace_back("TRK", "DIGITSMC2ROF", 0, Lifetime::Timeframe);
121+
outputSpec.emplace_back("TF3", "DIGITSMCTR", 0, Lifetime::Timeframe);
122+
outputSpec.emplace_back("TF3", "DIGITSMC2ROF", 0, Lifetime::Timeframe);
121123
}
122124

123125
return DataProcessorSpec{
124126
"iotof-digit-reader",
125127
Inputs{},
126128
outputSpec,
127-
AlgorithmSpec{adaptFromTask<TRKDigitReader>(useMC, useCalib)},
129+
AlgorithmSpec{adaptFromTask<TF3DigitReader>(o2::detectors::DetID::TF3, useMC, useCalib)},
128130
Options{
129131
{"iotof-digit-infile", VariantType::String, defname, {"Name of the input digit file"}}}};
130132
}

Detectors/Upgrades/ALICE3/IOTOF/workflow/src/DigitWriterSpec.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/// @brief Processor spec for a ROOT file writer for ITSMFT digits
1313

14-
#include "TRKWorkflow/DigitWriterSpec.h"
14+
#include "IOTOFWorkflow/DigitWriterSpec.h"
1515
#include "DPLUtils/MakeRootTreeWriterSpec.h"
1616
#include "DataFormatsITSMFT/Digit.h"
1717
#include "DataFormatsITSMFT/GBTCalibData.h"
@@ -30,7 +30,7 @@ using SubSpecificationType = o2::framework::DataAllocator::SubSpecificationType;
3030

3131
namespace o2
3232
{
33-
namespace trk
33+
namespace iotof
3434
{
3535

3636
template <typename T>
@@ -94,17 +94,17 @@ DataProcessorSpec getDigitWriterSpec(bool mctruth, bool dec, bool calib, o2::hea
9494
BranchDefinition<std::vector<itsmft::Digit>>{InputSpec{"digits", detOrig, "DIGITS", 0},
9595
(detStr + "Digit").c_str(),
9696
logger},
97-
BranchDefinition<std::vector<itsmft::GBTCalibData>>{InputSpec{"calib", detOrig, "GBTCALIB", 0},
98-
(detStr + "Calib").c_str(),
99-
(calib ? 1 : 0)},
97+
// BranchDefinition<std::vector<itsmft::GBTCalibData>>{InputSpec{"calib", detOrig, "GBTCALIB", 0},
98+
// (detStr + "Calib").c_str(),
99+
// (calib ? 1 : 0)},
100100
BranchDefinition<std::vector<itsmft::ROFRecord>>{InputSpec{"digitsROF", detOrig, "DIGITSROF", 0},
101101
(detStr + "DigitROF").c_str()})();
102102
}
103103

104-
DataProcessorSpec getTRKDigitWriterSpec(bool mctruth, bool dec, bool calib)
104+
DataProcessorSpec getIOTOFDigitWriterSpec(bool mctruth, bool dec, bool calib)
105105
{
106-
return getDigitWriterSpec(mctruth, dec, calib, o2::header::gDataOriginTRK, o2::detectors::DetID::TRK);
106+
return getDigitWriterSpec(mctruth, dec, calib, o2::header::gDataOriginTF3, o2::detectors::DetID::TF3);
107107
}
108108

109-
} // end namespace trk
109+
} // end namespace iotof
110110
} // end namespace o2

Steer/DigitizerWorkflow/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ o2_add_executable(digitizer-workflow
7272
$<$<BOOL:${ENABLE_UPGRADES}>:O2::TRKSimulation>
7373
$<$<BOOL:${ENABLE_UPGRADES}>:O2::TRKWorkflow>
7474
$<$<BOOL:${ENABLE_UPGRADES}>:O2::IOTOFSimulation>
75-
# $<$<BOOL:${ENABLE_UPGRADES}>:O2::IOTOFWorkflow>
75+
$<$<BOOL:${ENABLE_UPGRADES}>:O2::IOTOFWorkflow>
7676
)
7777

7878

Steer/DigitizerWorkflow/src/IOTOFDigitizerSpec.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class IOTOFDPLDigitizerTask : o2::base::BaseDPLDigitizer
5353

5454
void run(framework::ProcessingContext& pc)
5555
{
56+
LOG(info) << "Ciao";
5657
}
5758

5859
private:

0 commit comments

Comments
 (0)