Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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 @@ -94,9 +94,10 @@ class TrackITS : public o2::track::TrackParCov
o2::track::TrackParCov& getParamOut() { return mParamOut; }
const o2::track::TrackParCov& getParamOut() const { return mParamOut; }

void setPattern(uint16_t p) { mPattern = p; }
void setPattern(uint32_t p) { mPattern = p; }
int getPattern() const { return mPattern; }
bool hasHitOnLayer(int i) { return mPattern & (0x1 << i); }
bool isFakeOnLayer(int i) { return !(mPattern & (0x1 << (16 + i))); }

void setNextROFbit(bool toggle = true) { setUserField((getUserField() & ~kNextROF) | (-toggle & kNextROF)); }
bool hasHitInNextROF() const { return getUserField() & kNextROF; }
Expand All @@ -105,17 +106,17 @@ class TrackITS : public o2::track::TrackParCov
o2::track::TrackParCov mParamOut; ///< parameter at largest radius
ClusRefs mClusRef; ///< references on clusters
float mChi2 = 0.; ///< Chi2 for this track
uint16_t mPattern = 0; ///< layers pattern
uint32_t mPattern = 0; ///< layers pattern

ClassDefNV(TrackITS, 4);
ClassDefNV(TrackITS, 5);
};

class TrackITSExt : public TrackITS
{
///< heavy version of TrackITS, with clusters embedded
public:
static constexpr int MaxClusters = 16; /// Prepare for overlaps and new detector configurations
using TrackITS::TrackITS; // inherit base constructors
using TrackITS::TrackITS; // inherit base constructors

GPUd() TrackITSExt(o2::track::TrackParCov&& parCov, short ncl, float chi2,
o2::track::TrackParCov&& outer, std::array<int, MaxClusters> cls)
Expand All @@ -124,6 +125,13 @@ class TrackITSExt : public TrackITS
setNumberOfClusters(ncl);
}

GPUd() TrackITSExt(o2::track::TrackParCov& parCov, short ncl, float chi2, std::uint32_t rof,
o2::track::TrackParCov& outer, std::array<int, MaxClusters> cls)
: TrackITS(parCov, chi2, outer), mIndex{cls}
{
setNumberOfClusters(ncl);
}

void setClusterIndex(int l, int i)
{
int ncl = getNumberOfClusters();
Expand All @@ -137,10 +145,18 @@ class TrackITSExt : public TrackITS
{
if (newCluster) {
getClusterRefs().setEntries(getNumberOfClusters() + 1);
uint32_t pattern = getPattern();
pattern |= 0x1 << layer;
setPattern(pattern);
}
mIndex[layer] = idx;
}

std::array<int, MaxClusters>& getClusterIndexes()
{
return mIndex;
}

private:
std::array<int, MaxClusters> mIndex = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; ///< Indices of associated clusters
ClassDefNV(TrackITSExt, 2);
Expand Down
2 changes: 0 additions & 2 deletions 2 Detectors/ITSMFT/ITS/tracking/include/ITStracking/IOUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,12 @@ constexpr float DefClusErrorCol = o2::itsmft::SegmentationAlpide::PitchCol * 0.5
constexpr float DefClusError2Row = DefClusErrorRow * DefClusErrorRow;
constexpr float DefClusError2Col = DefClusErrorCol * DefClusErrorCol;

std::vector<ROframe> loadEventData(const std::string&);
void loadEventData(ROframe& events, gsl::span<const itsmft::CompClusterExt> clusters,
gsl::span<const unsigned char>::iterator& pattIt, const itsmft::TopologyDictionary& dict,
const dataformats::MCTruthContainer<MCCompLabel>* clsLabels = nullptr);
int loadROFrameData(const o2::itsmft::ROFRecord& rof, ROframe& events, gsl::span<const itsmft::CompClusterExt> clusters,
gsl::span<const unsigned char>::iterator& pattIt, const itsmft::TopologyDictionary& dict,
const dataformats::MCTruthContainer<MCCompLabel>* mClsLabels = nullptr);
// void generateSimpleData(ROframe& event, const int phiDivs, const int zDivs);

void convertCompactClusters(gsl::span<const itsmft::CompClusterExt> clusters,
gsl::span<const unsigned char>::iterator& pattIt,
Expand Down
51 changes: 34 additions & 17 deletions 51 Detectors/ITSMFT/ITS/tracking/include/ITStracking/ROframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,29 @@ class ROframe final
const auto& getTrackingFrameInfo() const { return mTrackingFrameInfo; }

const TrackingFrameInfo& getClusterTrackingFrameInfo(int layerId, const Cluster& cl) const;
const MCCompLabel& getClusterLabels(int layerId, const Cluster& cl) const;
const MCCompLabel& getClusterLabels(int layerId, const int clId) const;
const MCCompLabel& getClusterFirstLabel(int layerId, const Cluster& cl) const;
const MCCompLabel& getClusterFirstLabel(int layerId, const int clId) const;
gsl::span<o2::MCCompLabel> getClusterLabels(int layerId, const int clId) const;
gsl::span<o2::MCCompLabel> getClusterLabels(int layerId, const Cluster& cl) const;
int getClusterExternalIndex(int layerId, const int clId) const;
std::vector<int> getTracksId(const int layerId, const std::vector<Cluster>& cl);

template <typename... T>
void addClusterToLayer(int layer, T&&... args);
template <typename... T>
void addTrackingFrameInfoToLayer(int layer, T&&... args);
void addClusterLabelToLayer(int layer, const MCCompLabel label);
void setMClabelsContainer(const dataformats::MCTruthContainer<MCCompLabel>* ptr);
void addClusterExternalIndexToLayer(int layer, const int idx);
bool hasMCinformation() const;

void clear();

private:
const int mROframeId;
o2::dataformats::MCTruthContainer<MCCompLabel>* mMClabels = nullptr;
std::vector<float3> mPrimaryVertices;
std::vector<std::vector<Cluster>> mClusters;
std::vector<std::vector<TrackingFrameInfo>> mTrackingFrameInfo;
std::vector<std::vector<MCCompLabel>> mClusterLabels;
std::vector<std::vector<int>> mClusterExternalIndices;
};

Expand All @@ -103,14 +105,24 @@ inline const TrackingFrameInfo& ROframe::getClusterTrackingFrameInfo(int layerId
return mTrackingFrameInfo[layerId][cl.clusterId];
}

inline const MCCompLabel& ROframe::getClusterLabels(int layerId, const Cluster& cl) const
inline const MCCompLabel& ROframe::getClusterFirstLabel(int layerId, const Cluster& cl) const
{
return mClusterLabels[layerId][cl.clusterId];
return getClusterFirstLabel(layerId, cl.clusterId);
}

inline const MCCompLabel& ROframe::getClusterLabels(int layerId, const int clId) const
inline const MCCompLabel& ROframe::getClusterFirstLabel(int layerId, const int clId) const
{
return mClusterLabels[layerId][clId];
return *(mMClabels->getLabels(getClusterExternalIndex(layerId, clId)).begin());
}

inline gsl::span<o2::MCCompLabel> ROframe::getClusterLabels(int layerId, const int clId) const
{
return mMClabels->getLabels(getClusterExternalIndex(layerId, clId));
}

inline gsl::span<o2::MCCompLabel> ROframe::getClusterLabels(int layerId, const Cluster& cl) const
{
return getClusterLabels(layerId, cl.clusterId);
}

inline int ROframe::getClusterExternalIndex(int layerId, const int clId) const
Expand All @@ -122,7 +134,7 @@ inline std::vector<int> ROframe::getTracksId(const int layerId, const std::vecto
{
std::vector<int> tracksId;
for (auto& cluster : cl) {
tracksId.push_back(getClusterLabels(layerId, cluster).isNoise() ? -1 : getClusterLabels(layerId, cluster).getTrackID());
tracksId.push_back(getClusterFirstLabel(layerId, cluster).isNoise() ? -1 : getClusterFirstLabel(layerId, cluster).getTrackID());
}
return tracksId;
}
Expand All @@ -139,7 +151,10 @@ void ROframe::addTrackingFrameInfoToLayer(int layer, T&&... values)
mTrackingFrameInfo[layer].emplace_back(std::forward<T>(values)...);
}

inline void ROframe::addClusterLabelToLayer(int layer, const MCCompLabel label) { mClusterLabels[layer].emplace_back(label); }
inline void ROframe::setMClabelsContainer(const dataformats::MCTruthContainer<MCCompLabel>* ptr)
{
mMClabels = const_cast<dataformats::MCTruthContainer<MCCompLabel>*>(ptr);
}

inline void ROframe::addClusterExternalIndexToLayer(int layer, const int idx)
{
Expand All @@ -151,20 +166,22 @@ inline void ROframe::clear()
for (unsigned int iL = 0; iL < mClusters.size(); ++iL) {
mClusters[iL].clear();
mTrackingFrameInfo[iL].clear();
mClusterLabels[iL].clear();
// mClusterLabels[iL].clear();
mClusterExternalIndices[iL].clear();
}
mPrimaryVertices.clear();
mMClabels = nullptr;
}

inline bool ROframe::hasMCinformation() const
{
for (const auto& vect : mClusterLabels) {
if (!vect.empty()) {
return true;
}
}
return false;
// for (const auto& vect : mClusterLabels) {
// if (!vect.empty()) {
// return true;
// }
// }
// return false;
return mMClabels;
}

} // namespace its
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct FakeTrackInfo {
if (extIndex == -1) {
continue;
}
o2::MCCompLabel mcLabel = event.getClusterLabels(iCluster, extIndex);
o2::MCCompLabel mcLabel = *(event.getClusterLabels(iCluster, extIndex).begin());
bool found = false;

for (size_t iOcc{0}; iOcc < occurrences.size(); ++iOcc) {
Expand Down Expand Up @@ -96,7 +96,7 @@ struct FakeTrackInfo {
if (extIndex == -1) {
continue;
}
o2::MCCompLabel lbl = event.getClusterLabels(iCluster, extIndex);
o2::MCCompLabel lbl = *(event.getClusterLabels(iCluster, extIndex).begin());
if (lbl == mainLabel && occurrences[0].second > 1 && !lbl.isNoise()) { // if we have MaxClusters fake clusters -> occurrences[0].second = 1
clusStatuses[iCluster] = 1;
} else {
Expand Down
26 changes: 9 additions & 17 deletions 26 Detectors/ITSMFT/ITS/tracking/include/ITStracking/TimeFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ class TimeFrame final
const std::vector<TrackingFrameInfo>& getTrackingFrameInfoOnLayer(int layerId) const;

const TrackingFrameInfo& getClusterTrackingFrameInfo(int layerId, const Cluster& cl) const;
const MCCompLabel& getClusterLabels(int layerId, const Cluster& cl) const;
const MCCompLabel& getClusterLabels(int layerId, const int clId) const;
const gsl::span<const MCCompLabel> getClusterLabels(int layerId, const Cluster& cl) const;
const gsl::span<const MCCompLabel> getClusterLabels(int layerId, const int clId) const;
int getClusterExternalIndex(int layerId, const int clId) const;

std::vector<MCCompLabel>& getTrackletsLabel(int layer) { return mTrackletLabels[layer]; }
Expand Down Expand Up @@ -135,7 +135,6 @@ class TimeFrame final
void addClusterToLayer(int layer, T&&... args);
template <typename... T>
void addTrackingFrameInfoToLayer(int layer, T&&... args);
void addClusterLabelToLayer(int layer, const MCCompLabel label);
void addClusterExternalIndexToLayer(int layer, const int idx);

int mNrof = 0;
Expand All @@ -150,7 +149,7 @@ class TimeFrame final
std::vector<std::vector<Cluster>> mUnsortedClusters;
std::vector<std::vector<bool>> mUsedClusters;
std::vector<std::vector<TrackingFrameInfo>> mTrackingFrameInfo;
std::vector<std::vector<MCCompLabel>> mClusterLabels;
const dataformats::MCTruthContainer<MCCompLabel>* mClusterLabels = nullptr;
std::vector<std::vector<MCCompLabel>> mTrackletLabels;
std::vector<std::vector<MCCompLabel>> mCellLabels;
std::vector<std::vector<int>> mClusterExternalIndices;
Expand Down Expand Up @@ -239,14 +238,14 @@ inline const TrackingFrameInfo& TimeFrame::getClusterTrackingFrameInfo(int layer
return mTrackingFrameInfo[layerId][cl.clusterId];
}

inline const MCCompLabel& TimeFrame::getClusterLabels(int layerId, const Cluster& cl) const
inline const gsl::span<const MCCompLabel> TimeFrame::getClusterLabels(int layerId, const Cluster& cl) const
{
return mClusterLabels[layerId][cl.clusterId];
return getClusterLabels(layerId, cl.clusterId);
}

inline const MCCompLabel& TimeFrame::getClusterLabels(int layerId, const int clId) const
inline const gsl::span<const MCCompLabel> TimeFrame::getClusterLabels(int layerId, int clId) const
{
return mClusterLabels[layerId][clId];
return mClusterLabels->getLabels(mClusterExternalIndices[layerId][clId]);
}

inline int TimeFrame::getClusterExternalIndex(int layerId, const int clId) const
Expand All @@ -271,8 +270,6 @@ void TimeFrame::addTrackingFrameInfoToLayer(int layer, T&&... values)
mTrackingFrameInfo[layer].emplace_back(std::forward<T>(values)...);
}

inline void TimeFrame::addClusterLabelToLayer(int layer, const MCCompLabel label) { mClusterLabels[layer].emplace_back(label); }

inline void TimeFrame::addClusterExternalIndexToLayer(int layer, const int idx)
{
mClusterExternalIndices[layer].push_back(idx);
Expand All @@ -283,20 +280,15 @@ inline void TimeFrame::clear()
for (unsigned int iL = 0; iL < mClusters.size(); ++iL) {
mClusters[iL].clear();
mTrackingFrameInfo[iL].clear();
mClusterLabels[iL].clear();
mClusterLabels = nullptr;
mClusterExternalIndices[iL].clear();
}
mPrimaryVertices.clear();
}

inline bool TimeFrame::hasMCinformation() const
{
for (const auto& vect : mClusterLabels) {
if (!vect.empty()) {
return true;
}
}
return false;
return mClusterLabels;
}

inline bool TimeFrame::isClusterUsed(int layer, int clusterId) const
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.