Skip to content

Commit

Permalink
Write full native clusters
Browse files Browse the repository at this point in the history
* shared flag added to native clusters
* Charge info now via native clusters
  • Loading branch information
wiechula committed Jun 17, 2024
1 parent 585cf07 commit bcec784
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions Detectors/TPC/workflow/src/TPCRefitter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class TPCRefitterSpec final : public Task
float mSamplingFactor{0.1}; ///< sampling factor in case sampling is used for unbinned data
bool mUseR = false;
bool mEnableDCA = false;
int mWriteTrackClusters = false;
int mWriteTrackClusters = 0;
bool mDoSampling{false}; ///< perform sampling of unbinned data
bool mDoRefit{true}; ///< perform refit of TPC track
std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOutTPC; ///< per track streamer for TPC tracks
Expand Down Expand Up @@ -330,8 +330,8 @@ bool TPCRefitterSpec::processTPCTrack(int itr, o2::utils::TreeStreamRedirector*
static long counter = -1;

std::vector<short> clSector, clRow;
std::vector<uint8_t> flags;
std::vector<float> clX, clY, clZ, clXI, clYI, clZI, clQtot, clQmax; // *I are the uncorrected cluster positions
std::vector<float> clX, clY, clZ, clXI, clYI, clZI; // *I are the uncorrected cluster positions
std::vector<tpc::ClusterNative> clNative;
float dcar, dcaz, dcarRef, dcazRef;

auto tr = mTPCTracksArray[itr]; // create track copy
Expand Down Expand Up @@ -384,7 +384,7 @@ bool TPCRefitterSpec::processTPCTrack(int itr, o2::utils::TreeStreamRedirector*
return true;
};

auto prepClus = [this, &tr, &clSector, &clRow, &clX, &clY, &clZ, &clXI, &clYI, &clZI, &clQtot, &clQmax, &flags](float t) { // extract cluster info
auto prepClus = [this, &tr, &clSector, &clRow, &clX, &clY, &clZ, &clXI, &clYI, &clZI, &clNative](float t) { // extract cluster info
int count = tr.getNClusters();
const auto* corrMap = this->mTPCCorrMapsLoader.getCorrMap();
const o2::tpc::ClusterNative* cl = nullptr;
Expand All @@ -402,9 +402,8 @@ bool TPCRefitterSpec::processTPCTrack(int itr, o2::utils::TreeStreamRedirector*
// cl = &tr.getCluster(this->mTPCTrackClusIdx, ic, *this->mTPCClusterIdxStruct, sector, row);
clSector.emplace_back(sector);
clRow.emplace_back(row);
clQtot.emplace_back(cl->getQtot());
clQmax.emplace_back(cl->getQmax());
flags.emplace_back(clflags);
auto& clCopy = clNative.emplace_back(*cl);
clCopy.setFlags(clflags);
float x, y, z;
// ideal transformation without distortions
corrMap->TransformIdeal(sector, row, cl->getPad(), cl->getTime(), x, y, z, t); // nominal time of the track
Expand Down Expand Up @@ -472,13 +471,11 @@ bool TPCRefitterSpec::processTPCTrack(int itr, o2::utils::TreeStreamRedirector*
if (mWriteTrackClusters) {
(*streamer) << "tpc"
<< "clSector=" << clSector
<< "clRow=" << clRow
<< "flags=" << flags;
<< "clRow=" << clRow;

if ((mWriteTrackClusters & 0x1) == 0x1) {
(*streamer) << "tpc"
<< "clQtot=" << clQtot
<< "clQmax=" << clQmax;
<< "cl=" << clNative;
}

if ((mWriteTrackClusters & 0x2) == 0x2) {
Expand Down Expand Up @@ -583,7 +580,7 @@ DataProcessorSpec getTPCRefitterSpec(GTrackID::mask_t srcTracks, GTrackID::mask_
Options opts{
{"target-x", VariantType::Float, 83.f, {"Try to propagate to this radius"}},
{"dump-clusters", VariantType::Bool, false, {"dump all clusters"}},
{"write-track-clusters", VariantType::Int, 3, {"Bitmask write clusters associated to the track, charges (0x1), corrected (0x2) and uncorrected (0x4) positions"}},
{"write-track-clusters", VariantType::Int, 3, {"Bitmask write clusters associated to the track, full native cluster (0x1), corrected (0x2) and uncorrected (0x4) positions"}},
{"tf-start", VariantType::Int, 0, {"1st TF to process"}},
{"tf-end", VariantType::Int, 999999999, {"last TF to process"}},
{"use-gpu-fitter", VariantType::Bool, false, {"use GPU track model for refit instead of TrackParCov"}},
Expand Down

0 comments on commit bcec784

Please sign in to comment.