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
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ class StrangeTrack;
class TrackCosmics;
struct TrackCosmicsExtended;
struct CosmicsTFInfo;
struct TFIDInfo;
class GlobalFwdTrack;
class MatchInfoFwd;
class TrackMCHMID;
Expand Down Expand Up @@ -330,7 +329,6 @@ struct RecoContainer {
COSM_TRACKS_MC,
COSMEXT_TRACKS, // extended cosmics (with clusters), no MC
COSMEXT_TFINFO, // per-TF info of the extended cosmics
COSMEXT_TFID, // TFIDInfo of the extended cosmics
NCOSMSLOTS };

// slots to register ITS/MFT clusters data (per layer, or all layers together in the slot 0)
Expand Down Expand Up @@ -378,7 +376,7 @@ struct RecoContainer {
std::unique_ptr<const std::vector<o2::MCCompLabel>> mcMIDTracks;
o2::ctp::LumiInfo mCTPLumi;

std::shared_ptr<const void> cosmExtHolder[3]; // owners of the extended cosmics, TF info and TFID objects deserialized from the messages
std::shared_ptr<const void> cosmExtHolder[2]; // owners of the extended cosmics and TF info objects deserialized from the messages
gsl::span<const unsigned char> clusterShMapTPC; ///< externally set TPC clusters sharing map
gsl::span<const unsigned int> occupancyMapTPC; ///< externally set TPC clusters occupancy map

Expand Down Expand Up @@ -764,11 +762,10 @@ struct RecoContainer {
auto getCosmicTracks() const { return cosmPool.getSpan<o2::dataformats::TrackCosmics>(COSM_TRACKS); }
auto getCosmicTrackMCLabels() const { return cosmPool.getSpan<o2::MCCompLabel>(COSM_TRACKS_MC); }

// Extended cosmic tracks (with clusters); the user must include DataFormatsGlobalTracking/TrackCosmicsExtended.h and CommonDataFormat/TFIDInfo.h
// Extended cosmic tracks (with clusters); the user must include DataFormatsGlobalTracking/TrackCosmicsExtended.h
const o2::dataformats::TrackCosmicsExtended& getCosmicExtTrack(int i) const { return cosmPool.get_as<o2::dataformats::TrackCosmicsExtended>(COSMEXT_TRACKS, i); }
auto getCosmicExtTracks() const { return cosmPool.getSpan<o2::dataformats::TrackCosmicsExtended>(COSMEXT_TRACKS); }
const o2::dataformats::CosmicsTFInfo& getCosmicExtTFInfo() const { return cosmPool.get_as<o2::dataformats::CosmicsTFInfo>(COSMEXT_TFINFO, 0); }
const o2::dataformats::TFIDInfo& getCosmicExtTFID() const { return cosmPool.get_as<o2::dataformats::TFIDInfo>(COSMEXT_TFID, 0); }

// IRFrames where ITS was reconstructed and tracks were seen (e.g. sync.w-flow mult. selection)
auto getIRFramesITS() const { return getSpan<o2::dataformats::IRFrame>(GTrackID::ITS, VARIA); }
Expand Down
6 changes: 0 additions & 6 deletions DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "ReconstructionDataFormats/VtxTrackRef.h"
#include "ReconstructionDataFormats/TrackCosmics.h"
#include "DataFormatsGlobalTracking/TrackCosmicsExtended.h"
#include "CommonDataFormat/TFIDInfo.h"
#include "ReconstructionDataFormats/TrackMCHMID.h"
#include "DataFormatsITSMFT/TrkClusRef.h"
#include "DataFormatsITSMFT/TopologyDictionary.h"
Expand Down Expand Up @@ -435,7 +434,6 @@ void DataRequest::requestCosmicExtTracks(bool mc)
{
addInput({"cosmicsExt", "GLO", "COSMFULL", 0, Lifetime::Timeframe});
addInput({"cosmicsExtTF", "GLO", "COSMFULLTF", 0, Lifetime::Timeframe});
addInput({"cosmicsExtTFID", "GLO", "COSMFULLTFID", 0, Lifetime::Timeframe});
if (mc) {
LOG(error) << "Extended cosmics do not support MC truth";
}
Expand Down Expand Up @@ -925,18 +923,14 @@ void RecoContainer::addPVerticesTMP(ProcessingContext& pc, bool mc)
void RecoContainer::addCosmicExtTracks(ProcessingContext& pc, bool mc)
{
using o2::dataformats::CosmicsTFInfo;
using o2::dataformats::TFIDInfo;
using o2::dataformats::TrackCosmicsExtended;
// the messages are ROOT-serialized, keep the deserialized objects alive until the next TF
std::shared_ptr<const std::vector<TrackCosmicsExtended>> cosm = pc.inputs().get<std::vector<TrackCosmicsExtended>*>("cosmicsExt");
std::shared_ptr<const CosmicsTFInfo> tfInfo = pc.inputs().get<CosmicsTFInfo*>("cosmicsExtTF");
std::shared_ptr<const TFIDInfo> tfID = pc.inputs().get<TFIDInfo*>("cosmicsExtTFID");
cosmPool.registerContainer(*cosm, COSMEXT_TRACKS);
cosmPool.registerContainer(gsl::span<const CosmicsTFInfo>(tfInfo.get(), 1), COSMEXT_TFINFO);
cosmPool.registerContainer(gsl::span<const TFIDInfo>(tfID.get(), 1), COSMEXT_TFID);
cosmExtHolder[0] = std::move(cosm);
cosmExtHolder[1] = std::move(tfInfo);
cosmExtHolder[2] = std::move(tfID);
if (mc) {
LOG(error) << "Extended cosmics do not support MC truth";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class TrackCosmicsExtendedReader : public Task

private:
void connectTree(const std::string& filename);
bool mIncludeTFIDInfo = false;
std::unique_ptr<TFile> mFile;
std::unique_ptr<TTree> mTree;
std::string mFileName = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace globaltracking
{
void TrackCosmicsExtendedReader::init(InitContext& ic)
{
mIncludeTFIDInfo = ic.options().get<bool>("push-tfid-info");
mFileName = o2::utils::Str::concat_string(o2::utils::Str::rectifyDirectory(ic.options().get<std::string>("input-dir")),
ic.options().get<std::string>("cosmics-full-infile"));
connectTree(mFileName);
Expand All @@ -50,8 +51,9 @@ void TrackCosmicsExtendedReader::run(ProcessingContext& pc)

pc.outputs().snapshot(Output{"GLO", "COSMFULL", 0}, mCosmics);
pc.outputs().snapshot(Output{"GLO", "COSMFULLTF", 0}, mTFInfo);
pc.outputs().snapshot(Output{"GLO", "COSMFULLTFID", 0}, mTFID);

if (mIncludeTFIDInfo) {
pc.outputs().snapshot(Output{"GLO", "COSMFULLTFID", 0}, mTFID);
}
if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
Expand All @@ -71,7 +73,9 @@ void TrackCosmicsExtendedReader::connectTree(const std::string& filename)
}
mTree->SetBranchAddress("cosmics", &mCosmicsPtr);
mTree->SetBranchAddress("tfInfo", &mTFInfoPtr);
mTree->SetBranchAddress("tfID", &mTFIDPtr);
if (mIncludeTFIDInfo) {
mTree->SetBranchAddress("tfID", &mTFIDPtr);
}
LOG(info) << "Loaded tree from " << filename << " with " << mTree->GetEntries() << " entries";
}

Expand All @@ -89,6 +93,7 @@ DataProcessorSpec getTrackCosmicsExtendedReaderSpec()
AlgorithmSpec{adaptFromTask<TrackCosmicsExtendedReader>()},
Options{
{"cosmics-full-infile", VariantType::String, "o2_cosmics_full.root", {"Name of the input file"}},
{"push-tfid-info", VariantType::Bool, false, {"Include tfID branch (identical to o2_tfidinfo.root content pushed by DPL)"}},
{"input-dir", VariantType::String, "none", {"Input directory"}}}};
}

Expand Down
Loading