Skip to content

Commit 21fa8bf

Browse files
committed
Optionally assign non-0 subspect to EMC decoded cells data
1 parent de318ba commit 21fa8bf

4 files changed

Lines changed: 17 additions & 12 deletions

File tree

Detectors/CTF/workflow/include/CTFWorkflow/CTFReaderSpec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct CTFReaderInp {
3939
int maxLoops = 0;
4040
int maxTFs = -1;
4141
unsigned int subspec = 0;
42+
unsigned int decSSpecEMC = 0;
4243
int tfRateLimit = 0;
4344
size_t minSHM = 0;
4445
};

Detectors/CTF/workflow/src/ctf-reader-workflow.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
6666
//
6767
options.push_back(ConfigParamSpec{"its-digits", VariantType::Bool, false, {"convert ITS clusters to digits"}});
6868
options.push_back(ConfigParamSpec{"mft-digits", VariantType::Bool, false, {"convert MFT clusters to digits"}});
69-
69+
//
70+
options.push_back(ConfigParamSpec{"emcal-decoded-subspec", VariantType::Int, 0, {"subspec to use for decoded EMCAL data"}});
71+
//
7072
options.push_back(ConfigParamSpec{"timeframes-shm-limit", VariantType::String, "0", {"Minimum amount of SHM required in order to publish data"}});
7173
options.push_back(ConfigParamSpec{"metric-feedback-channel-format", VariantType::String, "name=metric-feedback,type=pull,method=connect,address=ipc://{}metric-feedback-{},transport=shmem,rateLogging=0", {"format for the metric-feedback channel for TF rate limiting"}});
7274
std::swap(workflowOptions, options);
@@ -92,6 +94,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
9294
ctfInput.detMask &= DetID::getMask(allowedDetectors);
9395
ctfInput.inpdata = configcontext.options().get<std::string>("ctf-input");
9496
ctfInput.subspec = (unsigned int)configcontext.options().get<int>("ctf-data-subspec");
97+
ctfInput.decSSpecEMC = (unsigned int)configcontext.options().get<int>("emcal-decoded-subspec");
9598
if (ctfInput.inpdata.empty() || ctfInput.inpdata == "none") {
9699
if (!configcontext.helpOnCommandLine()) {
97100
throw std::runtime_error("--ctf-input <file,...> is not provided");
@@ -161,7 +164,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
161164
specs.push_back(o2::mch::getEntropyDecoderSpec(verbosity, "mch-entropy-decoder", ctfInput.subspec));
162165
}
163166
if (ctfInput.detMask[DetID::EMC]) {
164-
specs.push_back(o2::emcal::getEntropyDecoderSpec(verbosity, ctfInput.subspec));
167+
specs.push_back(o2::emcal::getEntropyDecoderSpec(verbosity, ctfInput.subspec, ctfInput.decSSpecEMC));
165168
}
166169
if (ctfInput.detMask[DetID::PHS]) {
167170
specs.push_back(o2::phos::getEntropyDecoderSpec(verbosity, ctfInput.subspec));

Detectors/EMCAL/workflow/include/EMCALWorkflow/EntropyDecoderSpec.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace emcal
2828
class EntropyDecoderSpec : public o2::framework::Task
2929
{
3030
public:
31-
EntropyDecoderSpec(int verbosity);
31+
EntropyDecoderSpec(int verbosity, unsigned int sspecOut);
3232
~EntropyDecoderSpec() override = default;
3333
void run(o2::framework::ProcessingContext& pc) final;
3434
void init(o2::framework::InitContext& ic) final;
@@ -37,11 +37,12 @@ class EntropyDecoderSpec : public o2::framework::Task
3737

3838
private:
3939
o2::emcal::CTFCoder mCTFCoder;
40+
unsigned int mSSpecOut = 0;
4041
TStopwatch mTimer;
4142
};
4243

4344
/// create a processor spec
44-
framework::DataProcessorSpec getEntropyDecoderSpec(int verbosity, unsigned int sspec);
45+
framework::DataProcessorSpec getEntropyDecoderSpec(int verbosity, unsigned int sspecInp, unsigned int sspecOut = 0);
4546

4647
} // namespace emcal
4748
} // namespace o2

Detectors/EMCAL/workflow/src/EntropyDecoderSpec.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace o2
2525
namespace emcal
2626
{
2727

28-
EntropyDecoderSpec::EntropyDecoderSpec(int verbosity) : mCTFCoder(o2::ctf::CTFCoderBase::OpType::Decoder)
28+
EntropyDecoderSpec::EntropyDecoderSpec(int verbosity, unsigned int sspecOut) : mCTFCoder(o2::ctf::CTFCoderBase::OpType::Decoder), mSSpecOut(sspecOut)
2929
{
3030
mTimer.Stop();
3131
mTimer.Reset();
@@ -53,8 +53,8 @@ void EntropyDecoderSpec::run(ProcessingContext& pc)
5353
mCTFCoder.updateTimeDependentParams(pc);
5454
auto buff = pc.inputs().get<gsl::span<o2::ctf::BufferType>>("ctf");
5555

56-
auto& triggers = pc.outputs().make<std::vector<TriggerRecord>>(OutputRef{"triggers"});
57-
auto& cells = pc.outputs().make<std::vector<Cell>>(OutputRef{"cells"});
56+
auto& triggers = pc.outputs().make<std::vector<TriggerRecord>>(OutputRef{"triggers", mSSpecOut});
57+
auto& cells = pc.outputs().make<std::vector<Cell>>(OutputRef{"cells", mSSpecOut});
5858

5959
// since the buff is const, we cannot use EncodedBlocks::relocate directly, instead we wrap its data to another flat object
6060
if (buff.size()) {
@@ -72,22 +72,22 @@ void EntropyDecoderSpec::endOfStream(EndOfStreamContext& ec)
7272
mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
7373
}
7474

75-
DataProcessorSpec getEntropyDecoderSpec(int verbosity, unsigned int sspec)
75+
DataProcessorSpec getEntropyDecoderSpec(int verbosity, unsigned int sspecInp, unsigned int sspecOut)
7676
{
7777
std::vector<OutputSpec> outputs{
78-
OutputSpec{{"triggers"}, "EMC", "CELLSTRGR", 0, Lifetime::Timeframe},
79-
OutputSpec{{"cells"}, "EMC", "CELLS", 0, Lifetime::Timeframe},
78+
OutputSpec{{"triggers"}, "EMC", "CELLSTRGR", sspecOut, Lifetime::Timeframe},
79+
OutputSpec{{"cells"}, "EMC", "CELLS", sspecOut, Lifetime::Timeframe},
8080
OutputSpec{{"ctfrep"}, "EMC", "CTFDECREP", 0, Lifetime::Timeframe}};
8181

8282
std::vector<InputSpec> inputs;
83-
inputs.emplace_back("ctf", "EMC", "CTFDATA", sspec, Lifetime::Timeframe);
83+
inputs.emplace_back("ctf", "EMC", "CTFDATA", sspecInp, Lifetime::Timeframe);
8484
inputs.emplace_back("ctfdict", "EMC", "CTFDICT", 0, Lifetime::Condition, ccdbParamSpec("EMC/Calib/CTFDictionary"));
8585

8686
return DataProcessorSpec{
8787
"emcal-entropy-decoder",
8888
inputs,
8989
outputs,
90-
AlgorithmSpec{adaptFromTask<EntropyDecoderSpec>(verbosity)},
90+
AlgorithmSpec{adaptFromTask<EntropyDecoderSpec>(verbosity, sspecOut)},
9191
Options{{"ctf-dict", VariantType::String, "ccdb", {"CTF dictionary: empty or ccdb=CCDB, none=no external dictionary otherwise: local filename"}}}};
9292
}
9393

0 commit comments

Comments
 (0)