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 @@ -29,7 +29,7 @@ class MatchInfoTOF
using evIdx = o2::dataformats::EvIndex<int, int>;

public:
MatchInfoTOF(evIdx evIdxTOFCl, float chi2, o2::track::TrackLTIntegral trkIntLT, evGIdx evIdxTrack, float dt = 0, float z = 0) : mEvIdxTOFCl(evIdxTOFCl), mChi2(chi2), mIntLT(trkIntLT), mEvIdxTrack(evIdxTrack), mDeltaT(dt), mZatTOF(z){};
MatchInfoTOF(evIdx evIdxTOFCl, double time, float chi2, o2::track::TrackLTIntegral trkIntLT, evGIdx evIdxTrack, float dt = 0, float z = 0) : mEvIdxTOFCl(evIdxTOFCl), mSignal(time), mChi2(chi2), mIntLT(trkIntLT), mEvIdxTrack(evIdxTrack), mDeltaT(dt), mZatTOF(z){};
MatchInfoTOF() = default;
void setEvIdxTOFCl(evIdx index) { mEvIdxTOFCl = index; }
void setEvIdxTrack(evGIdx index) { mEvIdxTrack = index; }
Expand All @@ -51,6 +51,8 @@ class MatchInfoTOF
float getDeltaT() const { return mDeltaT; }
void setZatTOF(float val) { mZatTOF = val; }
float getZatTOF() const { return mZatTOF; }
void setSignal(double time) { mSignal = time; }
double getSignal() const { return mSignal; }

private:
float mChi2; // chi2 of the pair track-TOFcluster
Expand All @@ -59,8 +61,9 @@ class MatchInfoTOF
evGIdx mEvIdxTrack; ///< EvIdx for track (first: ev index; second: track global index)
float mZatTOF = 0.0; ///< Z position at TOF
float mDeltaT = 0.0; ///< tTOF - TPC (microsec)
double mSignal = 0.0; ///< TOF time in ps

ClassDefNV(MatchInfoTOF, 2);
ClassDefNV(MatchInfoTOF, 3);
};
} // namespace dataformats
} // namespace o2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MatchInfoTOFReco : public MatchInfoTOF
ITSTPCTRD,
SIZEALL };

MatchInfoTOFReco(evIdx evIdxTOFCl, float chi2, o2::track::TrackLTIntegral trkIntLT, evGIdx evIdxTrack, TrackType trkType, float dt = 0, float z = 0) : MatchInfoTOF(evIdxTOFCl, chi2, trkIntLT, evIdxTrack, dt, z), mTrackType(trkType){};
MatchInfoTOFReco(evIdx evIdxTOFCl, double time, float chi2, o2::track::TrackLTIntegral trkIntLT, evGIdx evIdxTrack, TrackType trkType, float dt = 0, float z = 0) : MatchInfoTOF(evIdxTOFCl, time, chi2, trkIntLT, evIdxTrack, dt, z), mTrackType(trkType){};

MatchInfoTOFReco() = default;

Expand All @@ -45,7 +45,7 @@ class MatchInfoTOFReco : public MatchInfoTOF

private:
TrackType mTrackType; ///< track type (TPC, ITSTPC, TPCTRD, ITSTPCTRD)
ClassDefNV(MatchInfoTOFReco, 1);
ClassDefNV(MatchInfoTOFReco, 2);
};
} // namespace dataformats
} // namespace o2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "DataFormatsITS/TrackITS.h"
#include "DataFormatsMFT/TrackMFT.h"
#include "DataFormatsTPC/TrackTPC.h"
#include "DataFormatsTRD/TrackTRD.h"
#include "ReconstructionDataFormats/TrackTPCITS.h"

#include <string>
Expand All @@ -39,6 +40,7 @@

using namespace o2::framework;
using GID = o2::dataformats::GlobalTrackID;
using GIndex = o2::dataformats::VtxTrackIndex;
using DataRequest = o2::globaltracking::DataRequest;

namespace o2::aodproducer
Expand Down Expand Up @@ -145,17 +147,16 @@ typedef boost::unordered_map<Triplet_t, int, TripletHash, TripletEqualTo> Triple
class AODProducerWorkflowDPL : public Task
{
public:
AODProducerWorkflowDPL(std::shared_ptr<DataRequest> dataRequest, bool fillSVertices) : mDataRequest(dataRequest), mFillSVertices(fillSVertices) {}
AODProducerWorkflowDPL(GID::mask_t src, std::shared_ptr<DataRequest> dataRequest, bool fillSVertices) : mInputSources(src), mDataRequest(dataRequest), mFillSVertices(fillSVertices) {}
~AODProducerWorkflowDPL() override = default;
void init(InitContext& ic) final;
void run(ProcessingContext& pc) final;
void endOfStream(framework::EndOfStreamContext& ec) final;

private:
int mFillTracksITS{1};
int mFillTracksMFT{1};
int mFillTracksTPC{0};
int mFillTracksITSTPC{1};
const float cSpeed = 0.029979246f; // speed of light in TOF units

GID::mask_t mInputSources;
int64_t mTFNumber{-1};
int mTruncate{1};
int mRecoOnly{0};
Expand Down Expand Up @@ -198,6 +199,7 @@ class AODProducerWorkflowDPL : public Task
uint32_t mFDDAmplitude = 0xFFFFF000; // 11 bits
uint32_t mT0Amplitude = 0xFFFFF000; // 11 bits

// helper struct for extra info in fillTrackTablesPerCollision()
struct TrackExtraInfo {
float tpcInnerParam = 0.f;
uint32_t flags = 0;
Expand All @@ -220,6 +222,15 @@ class AODProducerWorkflowDPL : public Task
float trackPhiEMCAL = -999.f;
};

// helper struct for mc track labels
struct MCLabels {
uint32_t labelID = std::numeric_limits<uint32_t>::max();
uint32_t labelITS = std::numeric_limits<uint32_t>::max();
uint32_t labelTPC = std::numeric_limits<uint32_t>::max();
uint16_t labelMask = 0;
uint8_t mftLabelMask = 0;
};

void collectBCs(gsl::span<const o2::ft0::RecPoints>& ft0RecPoints,
gsl::span<const o2::dataformats::PrimaryVertex>& primVertices,
const std::vector<o2::InteractionTimeRecord>& mcRecords,
Expand All @@ -237,12 +248,37 @@ class AODProducerWorkflowDPL : public Task
template <typename mftTracksCursorType>
void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, const o2::mft::TrackMFT& track, int collisionID);

// helper for track tables
// fills tables collision by collision
// interaction time is for TOF information
template <typename TracksCursorType, typename TracksCovCursorType, typename TracksExtraCursorType, typename mftTracksCursorType>
void fillTrackTablesPerCollision(int collisionID,
double interactionTime,
const o2::dataformats::VtxTrackRef& trackRef,
gsl::span<const GIndex>& GIndices,
o2::globaltracking::RecoContainer& data,
TracksCursorType& tracksCursor,
TracksCovCursorType& tracksCovCursor,
TracksExtraCursorType& tracksExtraCursor,
mftTracksCursorType& mftTracksCursor);

template <typename MCParticlesCursorType>
void fillMCParticlesTable(o2::steer::MCKinematicsReader& mcReader, const MCParticlesCursorType& mcParticlesCursor,
gsl::span<const o2::MCCompLabel>& mcTruthITS, std::vector<bool>& isStoredITS,
gsl::span<const o2::MCCompLabel>& mcTruthMFT, std::vector<bool>& isStoredMFT,
gsl::span<const o2::MCCompLabel>& mcTruthTPC, std::vector<bool>& isStoredTPC,
TripletsMap_t& toStore, std::vector<std::pair<int, int>> const& mccolidtoeventsource);
gsl::span<const o2::MCCompLabel>& mcTruthITS,
gsl::span<const o2::MCCompLabel>& mcTruthMFT,
gsl::span<const o2::MCCompLabel>& mcTruthTPC,
TripletsMap_t& toStore,
std::vector<std::pair<int, int>> const& mccolidtoeventsource);

// helper for tpc clusters
void countTPCClusters(const o2::tpc::TrackTPC& track,
const gsl::span<const o2::tpc::TPCClRefElem>& tpcClusRefs,
const gsl::span<const unsigned char>& tpcClusShMap,
const o2::tpc::ClusterNativeAccess& tpcClusAcc,
uint8_t& shared, uint8_t& found, uint8_t& crossed);

// helper for trd pattern
uint8_t getTRDPattern(const o2::trd::TrackTRD& track);
};

/// create a processor spec
Expand Down
Loading