Skip to content

Commit 2fc1634

Browse files
authored
Add more information to TrackExtra table (#6596)
* Add TPC information (tpcNClsFindableMinusFound) * add TOFsignal in TOF matched info * Fix tofExpMom calculation * Get expSig via getTOF()
1 parent 246d14f commit 2fc1634

File tree

6 files changed

+242
-298
lines changed

6 files changed

+242
-298
lines changed

DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class MatchInfoTOF
2929
using evIdx = o2::dataformats::EvIndex<int, int>;
3030

3131
public:
32-
MatchInfoTOF(evIdx evIdxTOFCl, float chi2, o2::track::TrackLTIntegral trkIntLT, evGIdx evIdxTrack, float dt = 0, float z = 0) : mEvIdxTOFCl(evIdxTOFCl), mChi2(chi2), mIntLT(trkIntLT), mEvIdxTrack(evIdxTrack), mDeltaT(dt), mZatTOF(z){};
32+
MatchInfoTOF(evIdx evIdxTOFCl, double time, float chi2, o2::track::TrackLTIntegral trkIntLT, evGIdx evIdxTrack, float dt = 0, float z = 0) : mEvIdxTOFCl(evIdxTOFCl), mSignal(time), mChi2(chi2), mIntLT(trkIntLT), mEvIdxTrack(evIdxTrack), mDeltaT(dt), mZatTOF(z){};
3333
MatchInfoTOF() = default;
3434
void setEvIdxTOFCl(evIdx index) { mEvIdxTOFCl = index; }
3535
void setEvIdxTrack(evGIdx index) { mEvIdxTrack = index; }
@@ -51,6 +51,8 @@ class MatchInfoTOF
5151
float getDeltaT() const { return mDeltaT; }
5252
void setZatTOF(float val) { mZatTOF = val; }
5353
float getZatTOF() const { return mZatTOF; }
54+
void setSignal(double time) { mSignal = time; }
55+
double getSignal() const { return mSignal; }
5456

5557
private:
5658
float mChi2; // chi2 of the pair track-TOFcluster
@@ -59,8 +61,9 @@ class MatchInfoTOF
5961
evGIdx mEvIdxTrack; ///< EvIdx for track (first: ev index; second: track global index)
6062
float mZatTOF = 0.0; ///< Z position at TOF
6163
float mDeltaT = 0.0; ///< tTOF - TPC (microsec)
64+
double mSignal = 0.0; ///< TOF time in ps
6265

63-
ClassDefNV(MatchInfoTOF, 2);
66+
ClassDefNV(MatchInfoTOF, 3);
6467
};
6568
} // namespace dataformats
6669
} // namespace o2

DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOFReco.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class MatchInfoTOFReco : public MatchInfoTOF
3636
ITSTPCTRD,
3737
SIZEALL };
3838

39-
MatchInfoTOFReco(evIdx evIdxTOFCl, float chi2, o2::track::TrackLTIntegral trkIntLT, evGIdx evIdxTrack, TrackType trkType, float dt = 0, float z = 0) : MatchInfoTOF(evIdxTOFCl, chi2, trkIntLT, evIdxTrack, dt, z), mTrackType(trkType){};
39+
MatchInfoTOFReco(evIdx evIdxTOFCl, double time, float chi2, o2::track::TrackLTIntegral trkIntLT, evGIdx evIdxTrack, TrackType trkType, float dt = 0, float z = 0) : MatchInfoTOF(evIdxTOFCl, time, chi2, trkIntLT, evIdxTrack, dt, z), mTrackType(trkType){};
4040

4141
MatchInfoTOFReco() = default;
4242

@@ -45,7 +45,7 @@ class MatchInfoTOFReco : public MatchInfoTOF
4545

4646
private:
4747
TrackType mTrackType; ///< track type (TPC, ITSTPC, TPCTRD, ITSTPCTRD)
48-
ClassDefNV(MatchInfoTOFReco, 1);
48+
ClassDefNV(MatchInfoTOFReco, 2);
4949
};
5050
} // namespace dataformats
5151
} // namespace o2

Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "DataFormatsITS/TrackITS.h"
3030
#include "DataFormatsMFT/TrackMFT.h"
3131
#include "DataFormatsTPC/TrackTPC.h"
32+
#include "DataFormatsTRD/TrackTRD.h"
3233
#include "ReconstructionDataFormats/TrackTPCITS.h"
3334

3435
#include <string>
@@ -39,6 +40,7 @@
3940

4041
using namespace o2::framework;
4142
using GID = o2::dataformats::GlobalTrackID;
43+
using GIndex = o2::dataformats::VtxTrackIndex;
4244
using DataRequest = o2::globaltracking::DataRequest;
4345

4446
namespace o2::aodproducer
@@ -145,17 +147,16 @@ typedef boost::unordered_map<Triplet_t, int, TripletHash, TripletEqualTo> Triple
145147
class AODProducerWorkflowDPL : public Task
146148
{
147149
public:
148-
AODProducerWorkflowDPL(std::shared_ptr<DataRequest> dataRequest, bool fillSVertices) : mDataRequest(dataRequest), mFillSVertices(fillSVertices) {}
150+
AODProducerWorkflowDPL(GID::mask_t src, std::shared_ptr<DataRequest> dataRequest, bool fillSVertices) : mInputSources(src), mDataRequest(dataRequest), mFillSVertices(fillSVertices) {}
149151
~AODProducerWorkflowDPL() override = default;
150152
void init(InitContext& ic) final;
151153
void run(ProcessingContext& pc) final;
152154
void endOfStream(framework::EndOfStreamContext& ec) final;
153155

154156
private:
155-
int mFillTracksITS{1};
156-
int mFillTracksMFT{1};
157-
int mFillTracksTPC{0};
158-
int mFillTracksITSTPC{1};
157+
const float cSpeed = 0.029979246f; // speed of light in TOF units
158+
159+
GID::mask_t mInputSources;
159160
int64_t mTFNumber{-1};
160161
int mTruncate{1};
161162
int mRecoOnly{0};
@@ -198,6 +199,7 @@ class AODProducerWorkflowDPL : public Task
198199
uint32_t mFDDAmplitude = 0xFFFFF000; // 11 bits
199200
uint32_t mT0Amplitude = 0xFFFFF000; // 11 bits
200201

202+
// helper struct for extra info in fillTrackTablesPerCollision()
201203
struct TrackExtraInfo {
202204
float tpcInnerParam = 0.f;
203205
uint32_t flags = 0;
@@ -220,6 +222,15 @@ class AODProducerWorkflowDPL : public Task
220222
float trackPhiEMCAL = -999.f;
221223
};
222224

225+
// helper struct for mc track labels
226+
struct MCLabels {
227+
uint32_t labelID = std::numeric_limits<uint32_t>::max();
228+
uint32_t labelITS = std::numeric_limits<uint32_t>::max();
229+
uint32_t labelTPC = std::numeric_limits<uint32_t>::max();
230+
uint16_t labelMask = 0;
231+
uint8_t mftLabelMask = 0;
232+
};
233+
223234
void collectBCs(gsl::span<const o2::ft0::RecPoints>& ft0RecPoints,
224235
gsl::span<const o2::dataformats::PrimaryVertex>& primVertices,
225236
const std::vector<o2::InteractionTimeRecord>& mcRecords,
@@ -237,12 +248,37 @@ class AODProducerWorkflowDPL : public Task
237248
template <typename mftTracksCursorType>
238249
void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, const o2::mft::TrackMFT& track, int collisionID);
239250

251+
// helper for track tables
252+
// fills tables collision by collision
253+
// interaction time is for TOF information
254+
template <typename TracksCursorType, typename TracksCovCursorType, typename TracksExtraCursorType, typename mftTracksCursorType>
255+
void fillTrackTablesPerCollision(int collisionID,
256+
double interactionTime,
257+
const o2::dataformats::VtxTrackRef& trackRef,
258+
gsl::span<const GIndex>& GIndices,
259+
o2::globaltracking::RecoContainer& data,
260+
TracksCursorType& tracksCursor,
261+
TracksCovCursorType& tracksCovCursor,
262+
TracksExtraCursorType& tracksExtraCursor,
263+
mftTracksCursorType& mftTracksCursor);
264+
240265
template <typename MCParticlesCursorType>
241266
void fillMCParticlesTable(o2::steer::MCKinematicsReader& mcReader, const MCParticlesCursorType& mcParticlesCursor,
242-
gsl::span<const o2::MCCompLabel>& mcTruthITS, std::vector<bool>& isStoredITS,
243-
gsl::span<const o2::MCCompLabel>& mcTruthMFT, std::vector<bool>& isStoredMFT,
244-
gsl::span<const o2::MCCompLabel>& mcTruthTPC, std::vector<bool>& isStoredTPC,
245-
TripletsMap_t& toStore, std::vector<std::pair<int, int>> const& mccolidtoeventsource);
267+
gsl::span<const o2::MCCompLabel>& mcTruthITS,
268+
gsl::span<const o2::MCCompLabel>& mcTruthMFT,
269+
gsl::span<const o2::MCCompLabel>& mcTruthTPC,
270+
TripletsMap_t& toStore,
271+
std::vector<std::pair<int, int>> const& mccolidtoeventsource);
272+
273+
// helper for tpc clusters
274+
void countTPCClusters(const o2::tpc::TrackTPC& track,
275+
const gsl::span<const o2::tpc::TPCClRefElem>& tpcClusRefs,
276+
const gsl::span<const unsigned char>& tpcClusShMap,
277+
const o2::tpc::ClusterNativeAccess& tpcClusAcc,
278+
uint8_t& shared, uint8_t& found, uint8_t& crossed);
279+
280+
// helper for trd pattern
281+
uint8_t getTRDPattern(const o2::trd::TrackTRD& track);
246282
};
247283

248284
/// create a processor spec

0 commit comments

Comments
 (0)