218 AODProducerWorkflowDPL(
GID::mask_t src, std::shared_ptr<DataRequest> dataRequest, std::shared_ptr<o2::base::GRPGeomRequest> gr,
bool enableSV,
bool useMC =
true,
bool enableFITextra =
false) : mUseMC(useMC), mEnableSV(enableSV), mEnableFITextra(enableFITextra), mInputSources(
src), mDataRequest(dataRequest), mGGCCDBRequest(gr) {}
227 uint64_t relativeTime_to_LocalBC(
double relativeTimeStampInNS)
const
232 uint64_t relativeTime_to_GlobalBC(
double relativeTimeStampInNS)
const
234 return std::uint64_t(mStartIR.
toLong()) + relativeTime_to_LocalBC(relativeTimeStampInNS);
237 bool mThinTracks{
false};
238 bool mPropTracks{
false};
239 bool mPropMuons{
false};
240 float mTrackQCFraction{0.00};
241 int64_t mTrackQCNTrCut{4};
242 float mSqrtS{13860.};
243 std::mt19937 mGenerator{};
248 std::unordered_set<GIndex> mGIDUsedBySVtx;
249 std::unordered_set<GIndex> mGIDUsedByStr;
252 std::shared_ptr<o2::utils::TreeStreamRedirector> mStreamer;
256 bool mEnableSV =
true;
257 bool mEnableFITextra =
false;
258 bool mFieldON =
false;
259 const float cSpeed = 0.029979246f;
262 int64_t mTFNumber{-1};
267 TString mLPMProdTag{
""};
268 TString mAnchorPass{
""};
269 TString mAnchorProd{
""};
270 TString mRecoPass{
""};
272 bool mEMCselectLeading{
false};
273 uint64_t mEMCALTrgClassMask = 0;
276 std::unordered_map<GIndex, int> mGIDToTableID;
279 std::unordered_map<GIndex, int> mGIDToTableFwdID;
280 int mTableTrFwdID{0};
282 std::unordered_map<GIndex, int> mGIDToTableMFTID;
283 int mTableTrMFTID{0};
285 std::unordered_map<GIndex, int> mVtxToTableCollID;
288 std::unordered_map<GIndex, int> mV0ToTableID;
292 std::vector<int> mVertexStrLUT;
293 std::vector<std::pair<int, int>> mCollisionStrTrk;
294 std::vector<int> mStrTrkIndices;
297 std::vector<int> mIndexTableFwd;
300 std::vector<int> mIndexTableMFT;
303 BunchCrossings mBCLookup;
307 std::array<float, o2::zdc::NChannels> mZDCEnergyMap;
308 std::array<float, o2::zdc::NTDCChannels> mZDCTDCMap;
310 std::vector<uint16_t> mITSTPCTRDTriggers;
311 std::vector<uint16_t> mTPCTRDTriggers;
312 std::vector<uint16_t> mITSROFs;
313 std::vector<uint16_t> mMFTROFs;
314 std::vector<uint16_t> mMCHROFs;
315 double mITSROFrameHalfLengthNS = -1;
316 double mMFTROFrameHalfLengthNS = -1;
317 double mITSROFBiasNS = 0;
318 double mMFTROFBiasNS = 0;
319 double mNSigmaTimeTrack = -1;
320 double mTimeMarginTrackTime = -1;
321 double mTPCBinNS = -1;
327 std::vector<std::vector<std::unordered_map<int, int>>> mToStore;
331 std::vector<TString> mMetaDataKeys;
332 std::vector<TString> mMetaDataVals;
334 std::shared_ptr<DataRequest> mDataRequest;
335 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
339 static constexpr int TOFTimePrecPS = 16;
341 uint32_t mCollisionPosition = 0xFFFFFFF0;
342 uint32_t mCollisionPositionCov = 0xFFFFE000;
343 uint32_t mTrackX = 0xFFFFFFF0;
344 uint32_t mTrackAlpha = 0xFFFFFFF0;
345 uint32_t mTrackSnp = 0xFFFFFF00;
346 uint32_t mTrackTgl = 0xFFFFFF00;
347 uint32_t mTrack1Pt = 0xFFFFFC00;
348 uint32_t mTrackCovDiag = 0xFFFFFF00;
349 uint32_t mTrackChi2 = 0xFFFF0000;
350 uint32_t mTrackCovOffDiag = 0xFFFF0000;
351 uint32_t mTrackSignal = 0xFFFFFF00;
352 uint32_t mTrackTime = 0xFFFFFFFF;
353 uint32_t mTPCTime0 = 0xFFFFFFE0;
354 uint32_t mTrackTimeError = 0xFFFFFF00;
355 uint32_t mTrackPosEMCAL = 0xFFFFFF00;
356 uint32_t mTracklets = 0xFFFFFF00;
357 uint32_t mMcParticleW = 0xFFFFFFF0;
358 uint32_t mMcParticlePos = 0xFFFFFFF0;
359 uint32_t mMcParticleMom = 0xFFFFFFF0;
360 uint32_t mCaloAmp = 0xFFFFFF00;
361 uint32_t mCaloTime = 0xFFFFFF00;
362 uint32_t mCPVPos = 0xFFFFF800;
363 uint32_t mCPVAmpl = 0xFFFFFF00;
364 uint32_t mMuonTr1P = 0xFFFFFC00;
365 uint32_t mMuonTrThetaX = 0xFFFFFF00;
366 uint32_t mMuonTrThetaY = 0xFFFFFF00;
367 uint32_t mMuonTrZmu = 0xFFFFFFF0;
368 uint32_t mMuonTrBend = 0xFFFFFFF0;
369 uint32_t mMuonTrNonBend = 0xFFFFFFF0;
370 uint32_t mMuonTrCov = 0xFFFF0000;
371 uint32_t mMuonCl = 0xFFFFFF00;
372 uint32_t mMuonClErr = 0xFFFF0000;
373 uint32_t mV0Time = 0xFFFFF000;
374 uint32_t mV0ChannelTime = 0xFFFFFF00;
375 uint32_t mFDDTime = 0xFFFFF000;
376 uint32_t mFDDChannelTime = 0xFFFFFF00;
377 uint32_t mT0Time = 0xFFFFFF00;
378 uint32_t mT0ChannelTime = 0xFFFFFFF0;
379 uint32_t mV0Amplitude = 0xFFFFF000;
380 uint32_t mFDDAmplitude = 0xFFFFF000;
381 uint32_t mT0Amplitude = 0xFFFFF000;
383 bool mCTPConfigPerRun =
false;
385 struct TrackExtraInfo {
386 float tpcInnerParam = 0.f;
388 uint32_t itsClusterSizes = 0u;
391 int8_t tpcNClsFindableMinusFound = 0;
392 int8_t tpcNClsFindableMinusPID = 0;
393 int8_t tpcNClsFindableMinusCrossedRows = 0;
396 float itsChi2NCl = -999.f;
397 float tpcChi2NCl = -999.f;
398 float trdChi2 = -999.f;
399 float tofChi2 = -999.f;
400 float tpcSignal = -999.f;
401 float trdSignal = -999.f;
403 float tofExpMom = -999.f;
404 float trackEtaEMCAL = -999.f;
405 float trackPhiEMCAL = -999.f;
406 float trackTime = -999.f;
407 float trackTimeRes = -999.f;
409 int bcSlice[2] = {-1, -1};
410 bool isTPConly =
false;
427 int8_t dRefContY{std::numeric_limits<int8_t>::min()};
428 int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
429 int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
430 int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
431 int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
432 int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
433 int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
434 int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
435 int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
436 int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
437 int8_t dTofdX{std::numeric_limits<int8_t>::min()};
438 int8_t dTofdZ{std::numeric_limits<int8_t>::min()};
442 struct FwdTrackInfo {
454 float chi2matchmchmid = -1.0;
455 float chi2matchmchmft = -1.0;
456 float matchscoremchmft = -1.0;
457 int matchmfttrackid = -1;
458 int matchmchtrackid = -1;
459 uint16_t mchBitMap = 0;
461 uint32_t midBoards = 0;
462 float trackTime = -999.f;
463 float trackTimeRes = -999.f;
467 struct FwdTrackCovInfo {
478 int8_t rhoTglPhi = 0;
481 int8_t rho1PtPhi = 0;
482 int8_t rho1PtTgl = 0;
488 uint32_t labelID = -1;
489 uint16_t labelMask = 0;
499 std::vector<TPCCounters> mTPCCounters;
507 const std::vector<o2::InteractionTimeRecord>& mcRecords,
508 std::map<uint64_t, int>& bcsMap);
510 template <
typename TracksCursorType,
typename TracksCovCursorType>
511 void addToTracksTable(TracksCursorType& tracksCursor, TracksCovCursorType& tracksCovCursor,
514 template <
typename TracksExtraCursorType>
515 void addToTracksExtraTable(TracksExtraCursorType& tracksExtraCursor, TrackExtraInfo& extraInfoHolder);
517 template <
typename TracksQACursorType>
518 void addToTracksQATable(TracksQACursorType& tracksQACursor, TrackQA& trackQAInfoHolder);
520 template <
typename mftTracksCursorType,
typename AmbigMFTTracksCursorType>
521 void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, AmbigMFTTracksCursorType& ambigMFTTracksCursor,
523 std::uint64_t collisionBC,
const std::map<uint64_t, int>& bcsMap);
525 template <
typename fwdTracksCursorType,
typename fwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename mftTracksCovCursorType>
526 void addToFwdTracksTable(fwdTracksCursorType& fwdTracksCursor, fwdTracksCovCursorType& fwdTracksCovCursor, AmbigFwdTracksCursorType& ambigFwdTracksCursor, mftTracksCovCursorType& mftTracksCovCursor,
533 void extrapolateToCalorimeters(TrackExtraInfo& extraInfoHolder,
const o2::track::TrackPar& track);
539 template <
typename TracksCursorType,
typename TracksCovCursorType,
typename TracksExtraCursorType,
typename TracksQACursorType,
typename AmbigTracksCursorType,
540 typename MFTTracksCursorType,
typename MFTTracksCovCursorType,
typename AmbigMFTTracksCursorType,
541 typename FwdTracksCursorType,
typename FwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename FwdTrkClsCursorType>
542 void fillTrackTablesPerCollision(
int collisionID,
543 std::uint64_t collisionBC,
545 const gsl::span<const GIndex>& GIndices,
547 TracksCursorType& tracksCursor,
548 TracksCovCursorType& tracksCovCursor,
549 TracksExtraCursorType& tracksExtraCursor,
550 TracksQACursorType& tracksQACursor,
551 AmbigTracksCursorType& ambigTracksCursor,
552 MFTTracksCursorType& mftTracksCursor,
553 MFTTracksCovCursorType& mftTracksCovCursor,
554 AmbigMFTTracksCursorType& ambigMFTTracksCursor,
555 FwdTracksCursorType& fwdTracksCursor,
556 FwdTracksCovCursorType& fwdTracksCovCursor,
557 AmbigFwdTracksCursorType& ambigFwdTracksCursor,
558 FwdTrkClsCursorType& fwdTrkClsCursor,
559 const std::map<uint64_t, int>& bcsMap);
561 template <
typename FwdTrkClsCursorType>
566 template <
typename V0CursorType,
typename CascadeCursorType,
typename Decay3bodyCursorType>
569 template <
typename HMPCursorType>
573 template <
typename V0C,
typename CC,
typename D3BC>
585 HepMCUpdate mXSectionUpdate = HepMCUpdate::anyKey;
586 HepMCUpdate mPdfInfoUpdate = HepMCUpdate::anyKey;
587 HepMCUpdate mHeavyIonUpdate = HepMCUpdate::anyKey;
625 void updateMCHeader(MCCollisionCursor& collisionCursor,
626 XSectionCursor& xSectionCursor,
627 PdfInfoCursor& pdfInfoCursor,
628 HeavyIonCursor& heavyIonCursor,
629 const MCEventHeader& header,
637 MCParticlesCursor& mcParticlesCursor,
638 const gsl::span<const o2::dataformats::VtxTrackRef>& primVer2TRefs,
639 const gsl::span<const GIndex>& GIndices,
641 const std::vector<std::vector<int>>& mcColToEvSrc);
643 template <
typename MCTrackLabelCursorType,
typename MCMFTTrackLabelCursorType,
typename MCFwdTrackLabelCursorType>
644 void fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTrackLabelCursor,
645 MCMFTTrackLabelCursorType& mcMFTTrackLabelCursor,
646 MCFwdTrackLabelCursorType& mcFwdTrackLabelCursor,
648 const gsl::span<const GIndex>& primVerGIs,
652 std::uint64_t fillBCSlice(
int (&slice)[2],
double tmin,
double tmax,
const std::map<uint64_t, int>& bcsMap)
const;
662 template <
typename TCaloHandler,
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
663 void addToCaloTable(TCaloHandler& caloHandler, TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
664 TMCCaloLabelCursor& mcCaloCellLabelCursor,
int eventID,
int bcID, int8_t caloType);
666 template <
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
667 void fillCaloTable(TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
668 TMCCaloLabelCursor& mcCaloCellLabelCursor,
const std::map<uint64_t, int>& bcsMap,
671 std::set<uint64_t> filterEMCALIncomplete(
const gsl::span<const o2::emcal::TriggerRecord> triggers);