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 @@ -15,6 +15,7 @@
#include "GlobalTrackingWorkflowHelpers/InputHelper.h"
#include "GlobalTrackingWorkflowHelpers/NoInpDummyOutSpec.h"
#include "DetectorsRaw/HBFUtilsInitializer.h"
#include "DataFormatsITSMFT/DPLAlpideParamInitializer.h"
#include "ITS3Align/AlignmentSpec.h"

using namespace o2::framework;
Expand All @@ -38,6 +39,7 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
{"disable-root-input", VariantType::Bool, false, {"disable root-files input reader"}},
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
o2::raw::HBFUtilsInitializer::addConfigOption(options);
o2::itsmft::DPLAlpideParamInitializer::addITSConfigOption(options);
std::swap(workflowOptions, options);
}
#include "Framework/runDataProcessing.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// | *|
#define _ALLOW_DIAGONAL_ALPIDE_CLUSTERS_

#include <algorithm>
#include <utility>
#include <vector>
#include <cstring>
Expand Down Expand Up @@ -94,18 +95,10 @@ class Clusterer
}
void adjust(uint16_t row, uint16_t col)
{
if (row < rowMin) {
rowMin = row;
}
if (row > rowMax) {
rowMax = row;
}
if (col < colMin) {
colMin = col;
}
if (col > colMax) {
colMax = col;
}
rowMin = std::min(row, rowMin);
rowMax = std::max(row, rowMax);
colMin = std::min(col, colMin);
colMax = std::max(col, colMax);
}
};

Expand All @@ -121,6 +114,10 @@ class Clusterer
};

struct ClustererThread {
struct PreCluster {
int head = 0; // index of precluster head in the pixels
int index = 0;
};
Clusterer* parent = nullptr; // parent clusterer
int id = -1;
// buffers for entries in preClusterIndices in 2 columns, to avoid boundary checks, we reserve
Expand All @@ -133,12 +130,11 @@ class Clusterer
// pixels[].first is the index of the next pixel of the same precluster in the pixels
// pixels[].second is the index of the referred pixel in the ChipPixelData (element of mChips)
std::vector<std::pair<int, uint32_t>> pixels;
std::vector<int> preClusterHeads; // index of precluster head in the pixels
std::vector<int> preClusterIndices;
uint16_t currCol = 0xffff; ///< Column being processed
bool noLeftCol = true; ///< flag that there is no column on the left to check
std::array<Label, MaxLabels> labelsBuff; //! temporary buffer for building cluster labels
std::vector<PixelData> pixArrBuff; //! temporary buffer for pattern calc.
std::vector<PreCluster> preClusters; //! preclusters info
//
/// temporary storage for the thread output
CompClusCont compClusters;
Expand All @@ -152,10 +148,11 @@ class Clusterer
///< swap current and previous column buffers
void swapColumnBuffers() { std::swap(prev, curr); }

///< add cluster at row (entry ip in the ChipPixeData) to the precluster with given index
///< add cluster at row (entry ip in the ChipPixeData) to the precluster with given index
void expandPreCluster(uint32_t ip, uint16_t row, int preClusIndex)
{
auto& firstIndex = preClusterHeads[preClusterIndices[preClusIndex]];
auto& firstIndex = preClusters[preClusters[preClusIndex].index].head;
pixels.emplace_back(firstIndex, ip);
firstIndex = pixels.size() - 1;
curr[row] = preClusIndex;
Expand All @@ -164,11 +161,10 @@ class Clusterer
///< add new precluster at given row of current column for the fired pixel with index ip in the ChipPixelData
void addNewPrecluster(uint32_t ip, uint16_t row)
{
preClusterHeads.push_back(pixels.size());
int lastIndex = preClusters.size();
preClusters.emplace_back(pixels.size(), lastIndex);
// new head does not point yet (-1) on other pixels, store just the entry of the pixel in the ChipPixelData
pixels.emplace_back(-1, ip);
int lastIndex = preClusterIndices.size();
preClusterIndices.push_back(lastIndex);
curr[row] = lastIndex; // store index of the new precluster in the current column buffer
}

Expand Down Expand Up @@ -212,19 +208,25 @@ class Clusterer
bool isContinuousReadOut() const { return mContinuousReadout; }
void setContinuousReadOut(bool v) { mContinuousReadout = v; }

bool isDropHugeClusters() const { return mDropHugeClusters; }
void setDropHugeClusters(bool v) { mDropHugeClusters = v; }

int getMaxBCSeparationToMask() const { return mMaxBCSeparationToMask; }
void setMaxBCSeparationToMask(int n) { mMaxBCSeparationToMask = n; }

int getMaxRowColDiffToMask() const { return mMaxRowColDiffToMask; }
void setMaxRowColDiffToMask(int v) { mMaxRowColDiffToMask = v; }

int getMaxROFDepthToSquash() const { return mSquashingDepth; }
int getMaxROFDepthToSquash(int layer = -1) const { return (layer < 0) ? mSquashingDepth : mSquashingLayerDepth[layer]; }
void setMaxROFDepthToSquash(int v) { mSquashingDepth = v; }
void addMaxROFDepthToSquash(int v) { mSquashingLayerDepth.push_back(v); }

int getMaxBCSeparationToSquash() const { return mMaxBCSeparationToSquash; }
int getMaxBCSeparationToSquash(int layer = -1) const { return (layer < 0) ? mMaxBCSeparationToSquash : mMaxBCSeparationToSquashLayer[layer]; }
void setMaxBCSeparationToSquash(int n) { mMaxBCSeparationToSquash = n; }
void addMaxBCSeparationToSquash(int n) { mMaxBCSeparationToSquashLayer.push_back(n); }

void print() const;
void print(bool showsTiming) const;
void reset();
void clear();

///< load the dictionary of cluster topologies
Expand All @@ -249,6 +251,7 @@ class Clusterer

// clusterization options
bool mContinuousReadout = true; ///< flag continuous readout
bool mDropHugeClusters = false; ///< don't include clusters that would be split in more than one

///< mask continuosly fired pixels in frames separated by less than this amount of BCs (fired from hit in prev. ROF)
int mMaxBCSeparationToMask = static_cast<int>(6000. / o2::constants::lhc::LHCBunchSpacingNS + 10);
Expand All @@ -258,6 +261,8 @@ class Clusterer
///< Squashing options
int mSquashingDepth = 0; ///< squashing is applied to next N rofs
int mMaxBCSeparationToSquash = 6000. / o2::constants::lhc::LHCBunchSpacingNS + 10;
std::vector<int> mSquashingLayerDepth;
std::vector<int> mMaxBCSeparationToSquashLayer;

std::vector<std::unique_ptr<ClustererThread>> mThreads; // buffers for threads
std::vector<ChipPixelData> mChips; // currently processed ROF's chips data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ int loadROFrameDataITS3(its::TimeFrame<7>* tf,
gsl::span<const itsmft::CompClusterExt> clusters,
gsl::span<const unsigned char>::iterator& pattIt,
const o2::its3::TopologyDictionary* dict,
int layer,
const dataformats::MCTruthContainer<MCCompLabel>* mcLabels = nullptr);
} // namespace its3::ioutils
} // namespace o2
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ class ITS3TrackingInterface final : public its::ITSTrackingInterface
using its::ITSTrackingInterface::ITSTrackingInterface;

void setClusterDictionary(const o2::its3::TopologyDictionary* d) { mDict = d; }
void updateTimeDependentParams(framework::ProcessingContext& pc) final;
void finaliseCCDB(framework::ConcreteDataMatcher& matcher, void* obj) final;

protected:
void overrideParameters(std::vector<o2::its::TrackingParameters>& t, std::vector<o2::its::VertexingParameters>& v) final;
void requestTopologyDictionary(framework::ProcessingContext& pc) final;
void loadROF(gsl::span<const itsmft::ROFRecord>& trackROFspan,
gsl::span<const itsmft::CompClusterExt> clusters,
gsl::span<const unsigned char>::iterator& pattIt,
Expand Down
Loading