|
35 | 35 | #include "CommonUtils/NameConf.h" |
36 | 36 | #include "DetectorsCommonDataFormats/CTFHeader.h" |
37 | 37 | #include "Headers/STFHeader.h" |
| 38 | +#include "DataFormatsITSMFT/DPLAlpideParam.h" |
38 | 39 | #include "DataFormatsITSMFT/CTF.h" |
39 | 40 | #include "DataFormatsTPC/CTF.h" |
40 | 41 | #include "DataFormatsTRD/CTF.h" |
@@ -562,6 +563,34 @@ void CTFReaderSpec::setMessageHeader(ProcessingContext& pc, const CTFHeader& ctf |
562 | 563 | dph->creation = ctfHeader.creationTime; |
563 | 564 | } |
564 | 565 |
|
| 566 | +///_______________________________________ |
| 567 | +template <> |
| 568 | +void CTFReaderSpec::processDetector<o2::itsmft::CTF>(DetID det, const CTFHeader& ctfHeader, ProcessingContext& pc) const |
| 569 | +{ |
| 570 | + if (mInput.detMask[det]) { |
| 571 | + std::string lbl = det.getName(); |
| 572 | + int nLayers = 1; |
| 573 | + if (det == DetID::ITS) { |
| 574 | + const auto& par = DPLAlpideParam<DetID::ITS>::Instance(); |
| 575 | + nLayers = par.supportsStaggering() ? par.getNLayers() : 1; |
| 576 | + } else if (det == DetID::MFT) { |
| 577 | + const auto& par = DPLAlpideParam<DetID::MFT>::Instance(); |
| 578 | + nLayers = par.supportsStaggering() ? par.getNLayers() : 1; |
| 579 | + } else { |
| 580 | + LOGP(fatal, "This specialization is define only for ITS and MFT detectors, {} provided", det.getName()); |
| 581 | + } |
| 582 | + for (int iLayer = 0; iLayer < nLayers; iLayer++) { |
| 583 | + auto& bufVec = pc.outputs().make<std::vector<o2::ctf::BufferType>>({lbl, mInput.subspec * 100 + iLayer}, ctfHeader.detectors[det] ? sizeof(o2::itsmft::CTF) : 0); |
| 584 | + if (ctfHeader.detectors[det]) { |
| 585 | + auto brName = nLayers == 1 ? lbl : fmt::format("{}_{}", lbl, iLayer); |
| 586 | + C::readFromTree(bufVec, *(mCTFTree.get()), brName, mCurrTreeEntry); |
| 587 | + } else if (!mInput.allowMissingDetectors) { |
| 588 | + throw std::runtime_error(fmt::format("Requested detector {} is missing in the CTF", lbl)); |
| 589 | + } |
| 590 | + } |
| 591 | + } |
| 592 | +} |
| 593 | + |
565 | 594 | ///_______________________________________ |
566 | 595 | template <typename C> |
567 | 596 | void CTFReaderSpec::processDetector(DetID det, const CTFHeader& ctfHeader, ProcessingContext& pc) const |
@@ -636,7 +665,21 @@ DataProcessorSpec getCTFReaderSpec(const CTFReaderInp& inp) |
636 | 665 | for (auto id = DetID::First; id <= DetID::Last; id++) { |
637 | 666 | if (inp.detMask[id]) { |
638 | 667 | DetID det(id); |
639 | | - outputs.emplace_back(OutputLabel{det.getName()}, det.getDataOrigin(), "CTFDATA", inp.subspec, Lifetime::Timeframe); |
| 668 | + if (det == DetID::ITS) { |
| 669 | + const auto& par = DPLAlpideParam<DetID::ITS>::Instance(); |
| 670 | + int nLayers = par.supportsStaggering() ? par.getNLayers() : 1; |
| 671 | + for (int iLayer = 0; iLayer < nLayers; iLayer++) { |
| 672 | + outputs.emplace_back(OutputLabel{det.getName()}, det.getDataOrigin(), "CTFDATA", inp.subspec * 100 + iLayer, Lifetime::Timeframe); |
| 673 | + } |
| 674 | + } else if (det == DetID::MFT) { |
| 675 | + const auto& par = DPLAlpideParam<DetID::MFT>::Instance(); |
| 676 | + int nLayers = par.supportsStaggering() ? par.getNLayers() : 1; |
| 677 | + for (int iLayer = 0; iLayer < nLayers; iLayer++) { |
| 678 | + outputs.emplace_back(OutputLabel{det.getName()}, det.getDataOrigin(), "CTFDATA", inp.subspec * 100 + iLayer, Lifetime::Timeframe); |
| 679 | + } |
| 680 | + } else { |
| 681 | + outputs.emplace_back(OutputLabel{det.getName()}, det.getDataOrigin(), "CTFDATA", inp.subspec, Lifetime::Timeframe); |
| 682 | + } |
640 | 683 | } |
641 | 684 | } |
642 | 685 | if (!inp.fileIRFrames.empty() || !inp.fileRunTimeSpans.empty()) { |
|
0 commit comments