From bce795577f8a020a1776154d615fee92d3d6666c Mon Sep 17 00:00:00 2001 From: miranov25 Date: Tue, 17 Dec 2024 00:23:47 +0100 Subject: [PATCH 1/5] O2-4592 - adding tof LTIntegral to time series --- Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx b/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx index 280fd965c4185..06200acfc833c 100644 --- a/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx +++ b/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx @@ -206,11 +206,14 @@ class TPCTimeSeries : public Task indicesITSTPC[tracksITSTPC[i].getRefTPC().getIndex()] = {i, idxVtx}; } - std::vector> idxTPCTrackToTOFCluster; // store for each tpc track index the index to the TOF cluster + std::vector> idxTPCTrackToTOFCluster; // store for each tpc track index the index to the TOF cluster // get matches to TOF in case skimmed data is produced if (mUnbinnedWriter) { - idxTPCTrackToTOFCluster = std::vector>(tracksTPC.size(), {-1, -999, -999}); + // getLTIntegralOut(), ///< L,TOF integral calculated during the propagation + // getSignal() mSignal = 0.0; ///< TOF time in ps + o2::track::TrackLTIntegral defLT; + idxTPCTrackToTOFCluster = std::vector>(tracksTPC.size(), {-1, -999, -999,defLT,0}); const std::vector> tofMatches{recoData.getTPCTOFMatches(), recoData.getTPCTRDTOFMatches(), recoData.getITSTPCTOFMatches(), recoData.getITSTPCTRDTOFMatches()}; // loop over ITS-TPC-TRD-TOF and ITS-TPC-TOF tracks an store for each ITS-TPC track the TOF track index @@ -218,7 +221,9 @@ class TPCTimeSeries : public Task for (const auto& tpctofmatch : tofMatch) { auto refTPC = recoData.getTPCContributorGID(tpctofmatch.getTrackRef()); if (refTPC.isIndexSet()) { - idxTPCTrackToTOFCluster[refTPC] = {tpctofmatch.getIdxTOFCl(), tpctofmatch.getDXatTOF(), tpctofmatch.getDZatTOF()}; + o2::track::TrackLTIntegral ltIntegral=tpctofmatch.getLTIntegralOut(); + float signal=tpctofmatch.getSignal(); + idxTPCTrackToTOFCluster[refTPC] = {tpctofmatch.getIdxTOFCl(), tpctofmatch.getDXatTOF(), tpctofmatch.getDZatTOF(),ltIntegral,signal}; } } } @@ -1049,7 +1054,7 @@ class TPCTimeSeries : public Task return isGoodTrack; } - void fillDCA(const gsl::span tracksTPC, const gsl::span tracksITSTPC, const gsl::span vertices, const int iTrk, const int iThread, const std::unordered_map>& indicesITSTPC, const gsl::span tracksITS, const std::vector>& idxTPCTrackToTOFCluster, const gsl::span tofClusters) + void fillDCA(const gsl::span tracksTPC, const gsl::span tracksITSTPC, const gsl::span vertices, const int iTrk, const int iThread, const std::unordered_map>& indicesITSTPC, const gsl::span tracksITS, const std::vector>& idxTPCTrackToTOFCluster, const gsl::span tofClusters) { const auto& trackFull = tracksTPC[iTrk]; const bool isGoodTrack = checkTrack(trackFull); @@ -1432,6 +1437,8 @@ class TPCTimeSeries : public Task << "tpcZDeltaAtTOF=" << tpcZDeltaAtTOF << "mDXatTOF=" << std::get<1>(idxTPCTrackToTOFCluster[iTrk]) << "mDZatTOF=" << std::get<2>(idxTPCTrackToTOFCluster[iTrk]) + << "mTOFLength=" << std::get<3>(idxTPCTrackToTOFCluster[iTrk]) + << "mTOFSignal=" << std::get<4>(idxTPCTrackToTOFCluster[iTrk]) // TPC delta param << "deltaTPCParamInOutTgl=" << deltaTPCParamInOutTgl << "deltaTPCParamInOutQPt=" << deltaTPCParamInOutQPt From 8eed4c086ac9539bb272e09933c8ac59db2f8914 Mon Sep 17 00:00:00 2001 From: miranov25 Date: Tue, 17 Dec 2024 01:02:26 +0100 Subject: [PATCH 2/5] O2-4592 - adding deltaT and vertex and TPC times --- Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx b/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx index 06200acfc833c..77c92fe879816 100644 --- a/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx +++ b/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx @@ -206,14 +206,14 @@ class TPCTimeSeries : public Task indicesITSTPC[tracksITSTPC[i].getRefTPC().getIndex()] = {i, idxVtx}; } - std::vector> idxTPCTrackToTOFCluster; // store for each tpc track index the index to the TOF cluster + std::vector> idxTPCTrackToTOFCluster; // store for each tpc track index the index to the TOF cluster // get matches to TOF in case skimmed data is produced if (mUnbinnedWriter) { // getLTIntegralOut(), ///< L,TOF integral calculated during the propagation // getSignal() mSignal = 0.0; ///< TOF time in ps o2::track::TrackLTIntegral defLT; - idxTPCTrackToTOFCluster = std::vector>(tracksTPC.size(), {-1, -999, -999,defLT,0}); + idxTPCTrackToTOFCluster = std::vector>(tracksTPC.size(), {-1, -999, -999,defLT,0,0}); const std::vector> tofMatches{recoData.getTPCTOFMatches(), recoData.getTPCTRDTOFMatches(), recoData.getITSTPCTOFMatches(), recoData.getITSTPCTRDTOFMatches()}; // loop over ITS-TPC-TRD-TOF and ITS-TPC-TOF tracks an store for each ITS-TPC track the TOF track index @@ -223,7 +223,8 @@ class TPCTimeSeries : public Task if (refTPC.isIndexSet()) { o2::track::TrackLTIntegral ltIntegral=tpctofmatch.getLTIntegralOut(); float signal=tpctofmatch.getSignal(); - idxTPCTrackToTOFCluster[refTPC] = {tpctofmatch.getIdxTOFCl(), tpctofmatch.getDXatTOF(), tpctofmatch.getDZatTOF(),ltIntegral,signal}; + float deltaT=tpctofmatch.getDeltaT(); + idxTPCTrackToTOFCluster[refTPC] = {tpctofmatch.getIdxTOFCl(), tpctofmatch.getDXatTOF(), tpctofmatch.getDZatTOF(),ltIntegral,signal,deltaT}; } } } @@ -1054,7 +1055,7 @@ class TPCTimeSeries : public Task return isGoodTrack; } - void fillDCA(const gsl::span tracksTPC, const gsl::span tracksITSTPC, const gsl::span vertices, const int iTrk, const int iThread, const std::unordered_map>& indicesITSTPC, const gsl::span tracksITS, const std::vector>& idxTPCTrackToTOFCluster, const gsl::span tofClusters) + void fillDCA(const gsl::span tracksTPC, const gsl::span tracksITSTPC, const gsl::span vertices, const int iTrk, const int iThread, const std::unordered_map>& indicesITSTPC, const gsl::span tracksITS, const std::vector>& idxTPCTrackToTOFCluster, const gsl::span tofClusters) { const auto& trackFull = tracksTPC[iTrk]; const bool isGoodTrack = checkTrack(trackFull); @@ -1359,7 +1360,8 @@ class TPCTimeSeries : public Task } } } - + float vertexTime=vertex.getTimeStamp().getTimeStamp(); + float trackTime0=trackFull.getTime0(); *mStreamer[iThread] << "treeTimeSeries" // DCAs << "triggerMask=" << triggerMask @@ -1439,6 +1441,9 @@ class TPCTimeSeries : public Task << "mDZatTOF=" << std::get<2>(idxTPCTrackToTOFCluster[iTrk]) << "mTOFLength=" << std::get<3>(idxTPCTrackToTOFCluster[iTrk]) << "mTOFSignal=" << std::get<4>(idxTPCTrackToTOFCluster[iTrk]) + << "mDeltaTTOFTPC=" << std::get<5>(idxTPCTrackToTOFCluster[iTrk]) /// delta T- TPC TOF + << "vertexTime" << vertexTime /// time stamp assigned to the vertex + << "trackTime0" << trackTime0 /// time stamp assigned to the track // TPC delta param << "deltaTPCParamInOutTgl=" << deltaTPCParamInOutTgl << "deltaTPCParamInOutQPt=" << deltaTPCParamInOutQPt From bc4dfc9b76e3ff8a69f7474237a80e4db7b728a2 Mon Sep 17 00:00:00 2001 From: miranov25 Date: Tue, 17 Dec 2024 01:29:19 +0100 Subject: [PATCH 3/5] O2-4592 - adding deltaT and vertex and TPC times in double precision --- Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx b/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx index 77c92fe879816..d17a11f50b829 100644 --- a/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx +++ b/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx @@ -206,14 +206,14 @@ class TPCTimeSeries : public Task indicesITSTPC[tracksITSTPC[i].getRefTPC().getIndex()] = {i, idxVtx}; } - std::vector> idxTPCTrackToTOFCluster; // store for each tpc track index the index to the TOF cluster + std::vector> idxTPCTrackToTOFCluster; // store for each tpc track index the index to the TOF cluster // get matches to TOF in case skimmed data is produced if (mUnbinnedWriter) { // getLTIntegralOut(), ///< L,TOF integral calculated during the propagation // getSignal() mSignal = 0.0; ///< TOF time in ps o2::track::TrackLTIntegral defLT; - idxTPCTrackToTOFCluster = std::vector>(tracksTPC.size(), {-1, -999, -999,defLT,0,0}); + idxTPCTrackToTOFCluster = std::vector>(tracksTPC.size(), {-1, -999, -999,defLT,0,0}); const std::vector> tofMatches{recoData.getTPCTOFMatches(), recoData.getTPCTRDTOFMatches(), recoData.getITSTPCTOFMatches(), recoData.getITSTPCTRDTOFMatches()}; // loop over ITS-TPC-TRD-TOF and ITS-TPC-TOF tracks an store for each ITS-TPC track the TOF track index @@ -222,7 +222,7 @@ class TPCTimeSeries : public Task auto refTPC = recoData.getTPCContributorGID(tpctofmatch.getTrackRef()); if (refTPC.isIndexSet()) { o2::track::TrackLTIntegral ltIntegral=tpctofmatch.getLTIntegralOut(); - float signal=tpctofmatch.getSignal(); + double signal=tpctofmatch.getSignal(); float deltaT=tpctofmatch.getDeltaT(); idxTPCTrackToTOFCluster[refTPC] = {tpctofmatch.getIdxTOFCl(), tpctofmatch.getDXatTOF(), tpctofmatch.getDZatTOF(),ltIntegral,signal,deltaT}; } @@ -1055,7 +1055,7 @@ class TPCTimeSeries : public Task return isGoodTrack; } - void fillDCA(const gsl::span tracksTPC, const gsl::span tracksITSTPC, const gsl::span vertices, const int iTrk, const int iThread, const std::unordered_map>& indicesITSTPC, const gsl::span tracksITS, const std::vector>& idxTPCTrackToTOFCluster, const gsl::span tofClusters) + void fillDCA(const gsl::span tracksTPC, const gsl::span tracksITSTPC, const gsl::span vertices, const int iTrk, const int iThread, const std::unordered_map>& indicesITSTPC, const gsl::span tracksITS, const std::vector>& idxTPCTrackToTOFCluster, const gsl::span tofClusters) { const auto& trackFull = tracksTPC[iTrk]; const bool isGoodTrack = checkTrack(trackFull); @@ -1360,8 +1360,8 @@ class TPCTimeSeries : public Task } } } - float vertexTime=vertex.getTimeStamp().getTimeStamp(); - float trackTime0=trackFull.getTime0(); + double vertexTime=vertex.getTimeStamp().getTimeStamp(); + double trackTime0=trackFull.getTime0(); *mStreamer[iThread] << "treeTimeSeries" // DCAs << "triggerMask=" << triggerMask @@ -1442,8 +1442,8 @@ class TPCTimeSeries : public Task << "mTOFLength=" << std::get<3>(idxTPCTrackToTOFCluster[iTrk]) << "mTOFSignal=" << std::get<4>(idxTPCTrackToTOFCluster[iTrk]) << "mDeltaTTOFTPC=" << std::get<5>(idxTPCTrackToTOFCluster[iTrk]) /// delta T- TPC TOF - << "vertexTime" << vertexTime /// time stamp assigned to the vertex - << "trackTime0" << trackTime0 /// time stamp assigned to the track + << "vertexTime=" << vertexTime /// time stamp assigned to the vertex + << "trackTime0=" << trackTime0 /// time stamp assigned to the track // TPC delta param << "deltaTPCParamInOutTgl=" << deltaTPCParamInOutTgl << "deltaTPCParamInOutQPt=" << deltaTPCParamInOutQPt From 1bc973078d976e7888d913ca13bbb22d05d9a74f Mon Sep 17 00:00:00 2001 From: miranov25 Date: Tue, 17 Dec 2024 01:51:06 +0100 Subject: [PATCH 4/5] O2-4592 - aply clang-format --- .../TPC/workflow/src/TPCTimeSeriesSpec.cxx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx b/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx index d17a11f50b829..4bdfd5209d038 100644 --- a/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx +++ b/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx @@ -61,7 +61,7 @@ class TPCTimeSeries : public Task { public: /// \constructor - TPCTimeSeries(std::shared_ptr req, const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, const bool tpcOnly, std::shared_ptr dr) : mCCDBRequest(req), mDisableWriter(disableWriter), mMatType(matType), mUnbinnedWriter(enableUnbinnedWriter), mTPCOnly(tpcOnly), mDataRequest(dr){}; + TPCTimeSeries(std::shared_ptr req, const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, const bool tpcOnly, std::shared_ptr dr) : mCCDBRequest(req), mDisableWriter(disableWriter), mMatType(matType), mUnbinnedWriter(enableUnbinnedWriter), mTPCOnly(tpcOnly), mDataRequest(dr) {}; void init(framework::InitContext& ic) final { @@ -206,14 +206,14 @@ class TPCTimeSeries : public Task indicesITSTPC[tracksITSTPC[i].getRefTPC().getIndex()] = {i, idxVtx}; } - std::vector> idxTPCTrackToTOFCluster; // store for each tpc track index the index to the TOF cluster + std::vector> idxTPCTrackToTOFCluster; // store for each tpc track index the index to the TOF cluster // get matches to TOF in case skimmed data is produced if (mUnbinnedWriter) { // getLTIntegralOut(), ///< L,TOF integral calculated during the propagation // getSignal() mSignal = 0.0; ///< TOF time in ps o2::track::TrackLTIntegral defLT; - idxTPCTrackToTOFCluster = std::vector>(tracksTPC.size(), {-1, -999, -999,defLT,0,0}); + idxTPCTrackToTOFCluster = std::vector>(tracksTPC.size(), {-1, -999, -999, defLT, 0, 0}); const std::vector> tofMatches{recoData.getTPCTOFMatches(), recoData.getTPCTRDTOFMatches(), recoData.getITSTPCTOFMatches(), recoData.getITSTPCTRDTOFMatches()}; // loop over ITS-TPC-TRD-TOF and ITS-TPC-TOF tracks an store for each ITS-TPC track the TOF track index @@ -221,10 +221,10 @@ class TPCTimeSeries : public Task for (const auto& tpctofmatch : tofMatch) { auto refTPC = recoData.getTPCContributorGID(tpctofmatch.getTrackRef()); if (refTPC.isIndexSet()) { - o2::track::TrackLTIntegral ltIntegral=tpctofmatch.getLTIntegralOut(); - double signal=tpctofmatch.getSignal(); - float deltaT=tpctofmatch.getDeltaT(); - idxTPCTrackToTOFCluster[refTPC] = {tpctofmatch.getIdxTOFCl(), tpctofmatch.getDXatTOF(), tpctofmatch.getDZatTOF(),ltIntegral,signal,deltaT}; + o2::track::TrackLTIntegral ltIntegral = tpctofmatch.getLTIntegralOut(); + double signal = tpctofmatch.getSignal(); + float deltaT = tpctofmatch.getDeltaT(); + idxTPCTrackToTOFCluster[refTPC] = {tpctofmatch.getIdxTOFCl(), tpctofmatch.getDXatTOF(), tpctofmatch.getDZatTOF(), ltIntegral, signal, deltaT}; } } } @@ -1055,7 +1055,7 @@ class TPCTimeSeries : public Task return isGoodTrack; } - void fillDCA(const gsl::span tracksTPC, const gsl::span tracksITSTPC, const gsl::span vertices, const int iTrk, const int iThread, const std::unordered_map>& indicesITSTPC, const gsl::span tracksITS, const std::vector>& idxTPCTrackToTOFCluster, const gsl::span tofClusters) + void fillDCA(const gsl::span tracksTPC, const gsl::span tracksITSTPC, const gsl::span vertices, const int iTrk, const int iThread, const std::unordered_map>& indicesITSTPC, const gsl::span tracksITS, const std::vector>& idxTPCTrackToTOFCluster, const gsl::span tofClusters) { const auto& trackFull = tracksTPC[iTrk]; const bool isGoodTrack = checkTrack(trackFull); @@ -1360,8 +1360,8 @@ class TPCTimeSeries : public Task } } } - double vertexTime=vertex.getTimeStamp().getTimeStamp(); - double trackTime0=trackFull.getTime0(); + double vertexTime = vertex.getTimeStamp().getTimeStamp(); + double trackTime0 = trackFull.getTime0(); *mStreamer[iThread] << "treeTimeSeries" // DCAs << "triggerMask=" << triggerMask @@ -1441,9 +1441,9 @@ class TPCTimeSeries : public Task << "mDZatTOF=" << std::get<2>(idxTPCTrackToTOFCluster[iTrk]) << "mTOFLength=" << std::get<3>(idxTPCTrackToTOFCluster[iTrk]) << "mTOFSignal=" << std::get<4>(idxTPCTrackToTOFCluster[iTrk]) - << "mDeltaTTOFTPC=" << std::get<5>(idxTPCTrackToTOFCluster[iTrk]) /// delta T- TPC TOF - << "vertexTime=" << vertexTime /// time stamp assigned to the vertex - << "trackTime0=" << trackTime0 /// time stamp assigned to the track + << "mDeltaTTOFTPC=" << std::get<5>(idxTPCTrackToTOFCluster[iTrk]) /// delta T- TPC TOF + << "vertexTime=" << vertexTime /// time stamp assigned to the vertex + << "trackTime0=" << trackTime0 /// time stamp assigned to the track // TPC delta param << "deltaTPCParamInOutTgl=" << deltaTPCParamInOutTgl << "deltaTPCParamInOutQPt=" << deltaTPCParamInOutQPt From 525f33493422aea0c8c5bf1c29d8eb48480ed390 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 17 Dec 2024 00:53:02 +0000 Subject: [PATCH 5/5] Please consider the following formatting changes --- Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx b/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx index 4bdfd5209d038..8ea10e24262c8 100644 --- a/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx +++ b/Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx @@ -61,7 +61,7 @@ class TPCTimeSeries : public Task { public: /// \constructor - TPCTimeSeries(std::shared_ptr req, const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, const bool tpcOnly, std::shared_ptr dr) : mCCDBRequest(req), mDisableWriter(disableWriter), mMatType(matType), mUnbinnedWriter(enableUnbinnedWriter), mTPCOnly(tpcOnly), mDataRequest(dr) {}; + TPCTimeSeries(std::shared_ptr req, const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, const bool tpcOnly, std::shared_ptr dr) : mCCDBRequest(req), mDisableWriter(disableWriter), mMatType(matType), mUnbinnedWriter(enableUnbinnedWriter), mTPCOnly(tpcOnly), mDataRequest(dr){}; void init(framework::InitContext& ic) final {