Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "ReconstructionDataFormats/TrackMCHMID.h"
#include "DataFormatsITSMFT/TrkClusRef.h"
#include "DataFormatsITSMFT/TopologyDictionary.h"
#include "ITSMFTBase/DPLAlpideParam.h"
#include "DataFormatsITSMFT/DPLAlpideParam.h"
// FIXME: ideally, the data formats definition should be independent of the framework
// collectData is using the input of ProcessingContext to extract the first valid
// header and the TF orbit from it
Expand Down
4 changes: 4 additions & 0 deletions DataFormats/Detectors/ITSMFT/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ o2_add_library(DataFormatsITSMFT
src/TopologyDictionary.cxx
src/TimeDeadMap.cxx
src/CTF.cxx
src/DPLAlpideParam.cxx
PUBLIC_LINK_LIBRARIES O2::ITSMFTBase
O2::DetectorsCommonDataFormats
O2::ReconstructionDataFormats
O2::CommonUtils
Microsoft.GSL::GSL)

o2_target_root_dictionary(DataFormatsITSMFT
HEADERS include/DataFormatsITSMFT/ROFRecord.h
include/DataFormatsITSMFT/Digit.h
include/DataFormatsITSMFT/DPLAlpideParam.h
include/DataFormatsITSMFT/GBTCalibData.h
include/DataFormatsITSMFT/NoiseMap.h
include/DataFormatsITSMFT/TimeDeadMap.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ struct CTFHeader : public o2::ctf::CTFDictHeader {
uint32_t nPatternBytes = 0; /// number of bytes for explict patterns
uint32_t firstOrbit = 0; /// 1st orbit of TF
uint16_t firstBC = 0; /// 1st BC of TF
ClassDefNV(CTFHeader, 2);
uint8_t maxStreams = 1; /// Number of streams per TF (== NLayers for staggered ITS/MFT readout, 1 for non-staggered one)
uint8_t streamID = 0; /// ID of the stream (0:maxStreams-1)
ClassDefNV(CTFHeader, 3);
};

/// Compressed but not yet entropy-encoded clusters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef ALICEO2_ITSMFTDPLBASEPARAM_H_
#define ALICEO2_ITSMFTDPLBASEPARAM_H_
#ifndef ALICEO2_ITSMFTALPIDEPARAM_H_
#define ALICEO2_ITSMFTALPIDEPARAM_H_

#include "DetectorsCommonDataFormats/DetID.h"
#include "CommonUtils/ConfigurableParam.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include "ITSMFTBase/DPLAlpideParam.h"
#include "DataFormatsITSMFT/DPLAlpideParam.h"

namespace o2
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class o2::itsmft::DPLAlpideParam < o2::detectors::DetID::ITS> + ;
#pragma link C++ class o2::itsmft::DPLAlpideParam < o2::detectors::DetID::MFT> + ;
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::itsmft::DPLAlpideParam < o2::detectors::DetID::ITS>> + ;
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::itsmft::DPLAlpideParam < o2::detectors::DetID::MFT>> + ;

#pragma link C++ class o2::itsmft::Digit + ;
#pragma link C++ class o2::itsmft::NoiseMap + ;
#pragma link C++ class o2::itsmft::TimeDeadMap + ;
Expand Down
2 changes: 1 addition & 1 deletion Detectors/AOD/src/AODProducerWorkflowSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#include "GlobalTracking/MatchGlobalFwd.h"
#include "MCHTracking/TrackExtrap.h"
#include "MCHTracking/TrackParam.h"
#include "ITSMFTBase/DPLAlpideParam.h"
#include "DataFormatsITSMFT/DPLAlpideParam.h"
#include "DetectorsVertexing/PVertexerParams.h"
#include "ReconstructionDataFormats/GlobalFwdTrack.h"
#include "ReconstructionDataFormats/GlobalTrackID.h"
Expand Down
2 changes: 1 addition & 1 deletion Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#include "DataFormatsTPC/ClusterNative.h"
#include "DataFormatsTPC/WorkflowHelper.h"
#include "ITSBase/GeometryTGeo.h"
#include "ITSMFTBase/DPLAlpideParam.h"
#include "DataFormatsITSMFT/DPLAlpideParam.h"
*/

using namespace o2::framework;
Expand Down
4 changes: 2 additions & 2 deletions Detectors/CTF/test/test_ctf_io_itsmft.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ BOOST_DATA_TEST_CASE(CompressedClustersTest, boost_data::make(ANSVersions), ansV
sw.Start();
std::vector<o2::ctf::BufferType> vec;
{
CTFCoder coder(o2::ctf::CTFCoderBase::OpType::Encoder, o2::detectors::DetID::ITS);
CTFCoder<o2::detectors::DetID::ITS> coder(o2::ctf::CTFCoderBase::OpType::Encoder);
coder.setANSVersion(ansVersion);
coder.encode(vec, rofRecVec, cclusVec, pattVec, pattIdConverter, 0); // compress
}
Expand Down Expand Up @@ -120,7 +120,7 @@ BOOST_DATA_TEST_CASE(CompressedClustersTest, boost_data::make(ANSVersions), ansV
sw.Start();
const auto ctfImage = o2::itsmft::CTF::getImage(vec.data());
{
CTFCoder coder(o2::ctf::CTFCoderBase::OpType::Decoder, o2::detectors::DetID::ITS);
CTFCoder<o2::detectors::DetID::ITS> coder(o2::ctf::CTFCoderBase::OpType::Decoder);
coder.decode(ctfImage, rofRecVecD, cclusVecD, pattVecD, nullptr, clPattLookup); // decompress
}
sw.Stop();
Expand Down
77 changes: 60 additions & 17 deletions Detectors/CTF/workflow/src/CTFReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "CommonUtils/NameConf.h"
#include "DetectorsCommonDataFormats/CTFHeader.h"
#include "Headers/STFHeader.h"
#include "DataFormatsITSMFT/DPLAlpideParam.h"
#include "DataFormatsITSMFT/CTF.h"
#include "DataFormatsTPC/CTF.h"
#include "DataFormatsTRD/CTF.h"
Expand Down Expand Up @@ -188,6 +189,50 @@ void CTFReaderSpec::init(InitContext& ic)
}
}

///_______________________________________
template <>
void CTFReaderSpec::processDetector<o2::itsmft::CTF>(DetID det, const CTFHeader& ctfHeader, ProcessingContext& pc) const
{
if (mInput.detMask[det]) {
std::string lbl = det.getName();
int nLayers = 1;
if (det == DetID::ITS) {
const auto& par = o2::itsmft::DPLAlpideParam<DetID::ITS>::Instance();
nLayers = par.supportsStaggering() ? par.getNLayers() : 1;
} else if (det == DetID::MFT) {
const auto& par = o2::itsmft::DPLAlpideParam<DetID::MFT>::Instance();
nLayers = par.supportsStaggering() ? par.getNLayers() : 1;
} else {
LOGP(fatal, "This specialization is define only for ITS and MFT detectors, {} provided", det.getName());
}
for (int iLayer = 0; iLayer < nLayers; iLayer++) {
auto& bufVec = pc.outputs().make<std::vector<o2::ctf::BufferType>>({lbl, mInput.subspec * 100 + iLayer}, ctfHeader.detectors[det] ? sizeof(o2::itsmft::CTF) : 0);
if (ctfHeader.detectors[det]) {
auto brName = nLayers == 1 ? lbl : fmt::format("{}_{}", lbl, iLayer);
o2::itsmft::CTF::readFromTree(bufVec, *(mCTFTree.get()), brName, mCurrTreeEntry);
} else if (!mInput.allowMissingDetectors) {
throw std::runtime_error(fmt::format("Requested detector {} is missing in the CTF", lbl));
}
}
}
}

///_______________________________________
template <typename C>
void CTFReaderSpec::processDetector(DetID det, const CTFHeader& ctfHeader, ProcessingContext& pc) const
{
if (mInput.detMask[det]) {
const auto lbl = det.getName();
auto& bufVec = pc.outputs().make<std::vector<o2::ctf::BufferType>>({lbl, mInput.subspec}, ctfHeader.detectors[det] ? sizeof(C) : 0);
if (ctfHeader.detectors[det]) {
C::readFromTree(bufVec, *(mCTFTree.get()), lbl, mCurrTreeEntry);
} else if (!mInput.allowMissingDetectors) {
throw std::runtime_error(fmt::format("Requested detector {} is missing in the CTF", lbl));
}
// setMessageHeader(pc, ctfHeader, lbl);
}
}

void CTFReaderSpec::runTimeRangesToIRFrameSelector(const o2::framework::TimingInfo& timingInfo)
{
// convert entries in the runTimeRanges to IRFrameSelector, if needed, convert time to orbit
Expand Down Expand Up @@ -562,22 +607,6 @@ void CTFReaderSpec::setMessageHeader(ProcessingContext& pc, const CTFHeader& ctf
dph->creation = ctfHeader.creationTime;
}

///_______________________________________
template <typename C>
void CTFReaderSpec::processDetector(DetID det, const CTFHeader& ctfHeader, ProcessingContext& pc) const
{
if (mInput.detMask[det]) {
const auto lbl = det.getName();
auto& bufVec = pc.outputs().make<std::vector<o2::ctf::BufferType>>({lbl, mInput.subspec}, ctfHeader.detectors[det] ? sizeof(C) : 0);
if (ctfHeader.detectors[det]) {
C::readFromTree(bufVec, *(mCTFTree.get()), lbl, mCurrTreeEntry);
} else if (!mInput.allowMissingDetectors) {
throw std::runtime_error(fmt::format("Requested detector {} is missing in the CTF", lbl));
}
// setMessageHeader(pc, ctfHeader, lbl);
}
}

///_______________________________________
void CTFReaderSpec::tryToFixCTFHeader(CTFHeader& ctfHeader) const
{
Expand Down Expand Up @@ -636,7 +665,21 @@ DataProcessorSpec getCTFReaderSpec(const CTFReaderInp& inp)
for (auto id = DetID::First; id <= DetID::Last; id++) {
if (inp.detMask[id]) {
DetID det(id);
outputs.emplace_back(OutputLabel{det.getName()}, det.getDataOrigin(), "CTFDATA", inp.subspec, Lifetime::Timeframe);
if (det == DetID::ITS) {
const auto& par = o2::itsmft::DPLAlpideParam<DetID::ITS>::Instance();
uint32_t nLayers = par.supportsStaggering() ? par.getNLayers() : 1;
for (uint32_t iLayer = 0; iLayer < nLayers; iLayer++) {
outputs.emplace_back(OutputLabel{det.getName()}, det.getDataOrigin(), "CTFDATA", inp.subspec * 100 + iLayer, Lifetime::Timeframe);
}
} else if (det == DetID::MFT) {
const auto& par = o2::itsmft::DPLAlpideParam<DetID::MFT>::Instance();
uint32_t nLayers = par.supportsStaggering() ? par.getNLayers() : 1;
for (uint32_t iLayer = 0; iLayer < nLayers; iLayer++) {
outputs.emplace_back(OutputLabel{det.getName()}, det.getDataOrigin(), "CTFDATA", inp.subspec * 100 + iLayer, Lifetime::Timeframe);
}
} else {
outputs.emplace_back(OutputLabel{det.getName()}, det.getDataOrigin(), "CTFDATA", inp.subspec, Lifetime::Timeframe);
}
}
}
if (!inp.fileIRFrames.empty() || !inp.fileRunTimeSpans.empty()) {
Expand Down
Loading
Loading