Skip to content
Open
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 @@ -13,6 +13,7 @@

#include <vector>

#include "CommonUtils/ConfigurableParam.h"
#include "Framework/ConfigParamSpec.h"
#include "MFTWorkflow/CATrackerSpec.h"

Expand All @@ -23,12 +24,15 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
workflowOptions.push_back(ConfigParamSpec{"disable-mc", VariantType::Bool, false, {"disable MC labels"}});
workflowOptions.push_back(ConfigParamSpec{"use-geom", VariantType::Bool, false, {"use geometry from the global geometry manager"}});
workflowOptions.push_back(ConfigParamSpec{"use-irframes", VariantType::Bool, false, {"consume ITS IR frames"}});
workflowOptions.push_back(ConfigParamSpec{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings (e.g. MFTAlpideParam.roFrameLengthInBC=594)"}});
}

#include "Framework/runDataProcessing.h"

WorkflowSpec defineDataProcessing(ConfigContext const& config)
{
o2::conf::ConfigurableParam::updateFromString(config.options().get<std::string>("configKeyValues"));

const bool useMC = !config.options().get<bool>("disable-mc");
const bool useGeom = config.options().get<bool>("use-geom");
const bool useIRFrames = config.options().get<bool>("use-irframes");
Expand Down
1 change: 1 addition & 0 deletions Detectors/ITSMFT/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# or submit itself to any jurisdiction.

add_subdirectory(base)
add_subdirectory(tracking)
add_subdirectory(simulation)
add_subdirectory(reconstruction)
add_subdirectory(workflow)
Expand Down
41 changes: 41 additions & 0 deletions Detectors/ITSMFT/common/tracking/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
# This software is distributed under the terms of the GNU General Public
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

o2_add_library(ITSMFTTracking
TARGETVARNAME targetName
SOURCES src/IOUtils.cxx
src/TrackingConfigParam.cxx
src/Configuration.cxx
src/TimeFrame.cxx
PUBLIC_LINK_LIBRARIES
O2::ITStracking
O2::GPUCommon
O2::CommonConstants
O2::DetectorsCommonDataFormats
O2::DataFormatsITSMFT
O2::ITSMFTBase
O2::CommonUtils
O2::DetectorsBase
O2::MathUtils
Microsoft.GSL::GSL
O2::SimulationDataFormat
O2::ReconstructionDataFormats
PRIVATE_LINK_LIBRARIES
O2::Framework
O2::ITSBase
O2::MFTBase
O2::DataFormatsITS)

# Only dictionary params (see ITSMFTTrackingLinkDef.h). TimeFrame and other
# headers pull ITStracking internals not exposed to rootcling include paths.
o2_target_root_dictionary(ITSMFTTracking
HEADERS include/ITSMFTTracking/TrackingConfigParam.h
LINKDEF src/ITSMFTTrackingLinkDef.h)
172 changes: 172 additions & 0 deletions Detectors/ITSMFT/common/tracking/include/ITSMFTTracking/Cell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
///
/// \file Cell.h
/// \brief CA cell/track seed types with hole-layer support (ITS PR #15390)
///

#ifndef ALICEO2_ITSMFT_TRACKING_INCLUDE_CACELL_H_
#define ALICEO2_ITSMFT_TRACKING_INCLUDE_CACELL_H_

#include <array>
#include <cstdint>

#include "ITStracking/Constants.h"
#include "ITSMFTTracking/LayerMask.h"
#include "DataFormatsITS/TimeEstBC.h"
#include "ReconstructionDataFormats/Track.h"
#include "GPUCommonDef.h"

namespace o2::itsmft::tracking
{

struct CellNeighbour {
int cellTopology{-1};
int cell{-1};
int nextCellTopology{-1};
int nextCell{-1};
int level{-1};
};

template <int NClusters>
class SeedBase : public o2::track::TrackParCovF
{
public:
GPUhd() LayerMask getHitLayerMask() const { return LayerMask{static_cast<uint16_t>(getUserField())}; }
GPUhd() void setHitLayerMask(LayerMask mask) { setUserField(mask.value()); }
GPUhd() int getInnerLayer() const { return getHitLayerMask().first(); }
GPUhd() int getFirstTrackletIndex() const { return mTracklets[0]; };
GPUhd() void setFirstTrackletIndex(int trkl) { mTracklets[0] = trkl; };
GPUhd() int getSecondTrackletIndex() const { return mTracklets[1]; };
GPUhd() void setSecondTrackletIndex(int trkl) { mTracklets[1] = trkl; };
GPUhd() float getChi2() const { return mChi2; };
GPUhd() void setChi2(float chi2) { mChi2 = chi2; };
GPUhd() int getLevel() const { return mLevel; };
GPUhd() void setLevel(int level) { mLevel = level; };
GPUhd() int* getLevelPtr() { return &mLevel; }
GPUhd() auto& getTimeStamp() noexcept { return mTime; }
GPUhd() const auto& getTimeStamp() const noexcept { return mTime; }

protected:
GPUhdDefault() SeedBase() = default;
GPUhdDefault() SeedBase(const SeedBase&) = default;
GPUhdDefault() ~SeedBase() = default;
GPUhdDefault() SeedBase(SeedBase&&) = default;
GPUhdDefault() SeedBase& operator=(const SeedBase&) = default;
GPUhdDefault() SeedBase& operator=(SeedBase&&) = default;
GPUhd() SeedBase(const o2::track::TrackParCovF& tpc, float chi2, int level, const o2::its::TimeEstBC& time)
: o2::track::TrackParCovF(tpc), mChi2(chi2), mLevel(level), mTime(time)
{
}
GPUhd() auto& clustersRaw() { return mClusters; }
GPUhd() const auto& clustersRaw() const { return mClusters; }

private:
float mChi2{o2::its::constants::UnsetValue};
int mLevel{o2::its::constants::UnusedIndex};
std::array<int, 2> mTracklets = o2::its::constants::helpers::initArray<int, 2, o2::its::constants::UnusedIndex>();
std::array<int, NClusters> mClusters = o2::its::constants::helpers::initArray<int, NClusters, o2::its::constants::UnusedIndex>();
o2::its::TimeEstBC mTime;
};

class CellSeed final : public SeedBase<o2::its::constants::ClustersPerCell>
{
using Base = SeedBase<o2::its::constants::ClustersPerCell>;

public:
GPUhdDefault() CellSeed() = default;
GPUhd() CellSeed(int innerL, int cl0, int cl1, int cl2, int trkl0, int trkl1, const o2::track::TrackParCovF& tpc, float chi2, const o2::its::TimeEstBC& time)
: CellSeed(LayerMask(innerL, innerL + 1, innerL + 2), cl0, cl1, cl2, trkl0, trkl1, tpc, chi2, time)
{
}
GPUhd() CellSeed(LayerMask hitLayerMask, int cl0, int cl1, int cl2, int trkl0, int trkl1, const o2::track::TrackParCovF& tpc, float chi2, const o2::its::TimeEstBC& time)
: Base(tpc, chi2, 1, time)
{
setHitLayerMask(hitLayerMask);
auto& clusters = this->clustersRaw();
clusters[0] = cl0;
clusters[1] = cl1;
clusters[2] = cl2;
setFirstTrackletIndex(trkl0);
setSecondTrackletIndex(trkl1);
}
GPUhdDefault() CellSeed(const CellSeed&) = default;
GPUhdDefault() ~CellSeed() = default;
GPUhdDefault() CellSeed(CellSeed&&) = default;
GPUhdDefault() CellSeed& operator=(const CellSeed&) = default;
GPUhdDefault() CellSeed& operator=(CellSeed&&) = default;

GPUhd() int getFirstClusterIndex() const { return this->clustersRaw()[0]; };
GPUhd() int getSecondClusterIndex() const { return this->clustersRaw()[1]; };
GPUhd() int getThirdClusterIndex() const { return this->clustersRaw()[2]; };
GPUhd() auto& getClusters() { return this->clustersRaw(); }
GPUhd() const auto& getClusters() const { return this->clustersRaw(); }
GPUhd() int getCluster(int layer) const
{
const int slot = getHitLayerMask().slot(layer);
return (slot >= 0 && slot < o2::its::constants::ClustersPerCell) ? this->clustersRaw()[slot] : o2::its::constants::UnusedIndex;
}
};

template <int NLayers>
class TrackSeed final : public SeedBase<NLayers>
{
using Base = SeedBase<NLayers>;

public:
GPUhdDefault() TrackSeed() = default;
GPUhd() TrackSeed(const CellSeed& cs)
: Base(static_cast<const o2::track::TrackParCovF&>(cs), cs.getChi2(), cs.getLevel(), cs.getTimeStamp())
{
this->setHitLayerMask(cs.getHitLayerMask());
this->setFirstTrackletIndex(cs.getFirstTrackletIndex());
this->setSecondTrackletIndex(cs.getSecondTrackletIndex());
auto& clusters = this->clustersRaw();
int slot = 0;
const auto hitMask = cs.getHitLayerMask();
for (int layer = 0; layer < NLayers; ++layer) {
if (hitMask.has(layer)) {
clusters[layer] = cs.getClusters()[slot++];
}
}
}
GPUhdDefault() TrackSeed(const TrackSeed&) = default;
GPUhdDefault() ~TrackSeed() = default;
GPUhdDefault() TrackSeed(TrackSeed&&) = default;
GPUhdDefault() TrackSeed& operator=(const TrackSeed&) = default;
GPUhdDefault() TrackSeed& operator=(TrackSeed&&) = default;

GPUhd() int getFirstClusterIndex() const { return getClusterBySlot(0); }
GPUhd() int getSecondClusterIndex() const { return getClusterBySlot(1); }
GPUhd() int getThirdClusterIndex() const { return getClusterBySlot(2); }
GPUhd() auto& getClusters() { return this->clustersRaw(); }
GPUhd() const auto& getClusters() const { return this->clustersRaw(); }
GPUhd() int getCluster(int layer) const { return this->clustersRaw()[layer]; }

private:
GPUhd() int getClusterBySlot(int requestedSlot) const
{
int slot = 0;
const auto hitMask = this->getHitLayerMask();
for (int layer = 0; layer < NLayers; ++layer) {
if (hitMask.has(layer)) {
if (slot++ == requestedSlot) {
return this->clustersRaw()[layer];
}
}
}
return o2::its::constants::UnusedIndex;
}
};

} // namespace o2::itsmft::tracking

#endif /* ALICEO2_ITSMFT_TRACKING_INCLUDE_CACELL_H_ */
Loading
Loading