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>
3940
4041using namespace o2 ::framework;
4142using GID = o2::dataformats::GlobalTrackID;
43+ using GIndex = o2::dataformats::VtxTrackIndex;
4244using DataRequest = o2::globaltracking::DataRequest;
4345
4446namespace o2 ::aodproducer
@@ -145,17 +147,16 @@ typedef boost::unordered_map<Triplet_t, int, TripletHash, TripletEqualTo> Triple
145147class 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