230 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,
bool enableTRDextra =
false) : mUseMC(useMC), mEnableSV(enableSV), mEnableFITextra(enableFITextra), mEnableTRDextra(enableTRDextra), mInputSources(
src), mDataRequest(dataRequest), mGGCCDBRequest(gr) {}
239 uint64_t relativeTime_to_LocalBC(
double relativeTimeStampInNS)
const
244 uint64_t relativeTime_to_GlobalBC(
double relativeTimeStampInNS)
const
246 return std::uint64_t(mStartIR.
toLong()) + relativeTime_to_LocalBC(relativeTimeStampInNS);
249 bool collectConfigFiles(std::vector<TString>& keys, std::vector<TString>&
values,
int indent = -1);
251 bool mThinTracks{
false};
252 bool mPropTracks{
false};
253 bool mPropMuons{
false};
254 bool mStoreAllMFTCov{
false};
255 float mTrackQCKeepGlobalTracks{
false};
256 float mTrackQCRetainOnlydEdx{
false};
257 float mTrackQCFraction{0.00};
259 float mTrackQCDCAxy{3.};
260 float mTrackQCPt{0.2};
261 int mTrackQCNCls{80};
262 float mSqrtS{13860.};
263 std::mt19937 mGenerator{};
266 float mMaxPropXiu{5.0f};
272 std::unordered_set<GIndex> mGIDUsedBySVtx;
273 std::unordered_set<GIndex> mGIDUsedByStr;
276 std::shared_ptr<o2::utils::TreeStreamRedirector> mStreamer;
280 bool mUseSigFiltMC =
false;
281 bool mEnableSV =
true;
282 bool mEnableFITextra =
false;
283 bool mEnableTRDextra =
false;
284 bool mFieldON =
false;
285 bool mCollectConfigFiles =
false;
286 const float cSpeed = 0.029979246f;
294 TString mLPMProdTag{
""};
295 TString mAnchorPass{
""};
296 TString mAnchorProd{
""};
297 TString mRecoPass{
""};
298 std::string mAODParent{
""};
299 TString mUser{
"aliprod"};
301 bool mEMCselectLeading{
false};
302 uint64_t mEMCALTrgClassMask = 0;
303 size_t mCurrentTRDTrigID = 0;
306 std::unordered_map<GIndex, int> mGIDToTableID;
309 std::unordered_map<GIndex, int> mGIDToTableFwdID;
310 int mTableTrFwdID{0};
312 std::unordered_map<GIndex, int> mGIDToTableMFTID;
313 int mTableTrMFTID{0};
315 std::unordered_map<GIndex, int> mVtxToTableCollID;
318 std::unordered_map<GIndex, int> mV0ToTableID;
322 std::vector<int> mVertexStrLUT;
323 std::vector<std::pair<int, int>> mCollisionStrTrk;
324 std::vector<int> mStrTrkIndices;
327 std::vector<int> mIndexTableFwd;
330 std::vector<int> mIndexTableMFT;
333 BunchCrossings mBCLookup;
337 std::array<float, o2::zdc::NChannels> mZDCEnergyMap;
338 std::array<float, o2::zdc::NTDCChannels> mZDCTDCMap;
340 std::vector<uint16_t> mITSTPCTRDTriggers;
341 std::vector<uint16_t> mTPCTRDTriggers;
342 std::vector<uint16_t> mITSROFs;
343 std::vector<uint16_t> mMFTROFs;
344 std::vector<uint16_t> mMCHROFs;
345 double mITSROFrameHalfLengthNS = -1;
346 double mMFTROFrameHalfLengthNS = -1;
347 double mITSROFBiasNS = 0;
348 double mMFTROFBiasNS = 0;
349 double mNSigmaTimeTrack = -1;
350 double mTimeMarginTrackTime = -1;
351 double mTPCBinNS = -1;
357 std::vector<std::vector<std::unordered_map<int, int>>> mToStore;
361 std::vector<TString> mMetaDataKeys;
362 std::vector<TString> mMetaDataVals;
364 std::shared_ptr<DataRequest> mDataRequest;
365 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
369 static constexpr int TOFTimePrecPS = 16;
371 uint32_t mCollisionPosition = 0xFFFFFFF0;
372 uint32_t mCollisionPositionCov = 0xFFFFE000;
373 uint32_t mTrackX = 0xFFFFFFF0;
374 uint32_t mTrackAlpha = 0xFFFFFFF0;
375 uint32_t mTrackSnp = 0xFFFFFF00;
376 uint32_t mTrackTgl = 0xFFFFFF00;
377 uint32_t mTrack1Pt = 0xFFFFFC00;
378 uint32_t mTrackCovDiag = 0xFFFFFF00;
379 uint32_t mTrackChi2 = 0xFFFF0000;
380 uint32_t mTrackCovOffDiag = 0xFFFF0000;
381 uint32_t mTrackSignal = 0xFFFFFF00;
382 uint32_t mTrackTime = 0xFFFFFFFF;
383 uint32_t mTPCTime0 = 0xFFFFFFE0;
384 uint32_t mTrackTimeError = 0xFFFFFF00;
385 uint32_t mTrackPosEMCAL = 0xFFFFFF00;
386 uint32_t mTracklets = 0xFFFFFF00;
387 uint32_t mMcParticleW = 0xFFFFFFF0;
388 uint32_t mMcParticlePos = 0xFFFFFFF0;
389 uint32_t mMcParticleMom = 0xFFFFFFF0;
390 uint32_t mCaloAmp = 0xFFFFFF00;
391 uint32_t mCaloTime = 0xFFFFFF00;
392 uint32_t mCPVPos = 0xFFFFF800;
393 uint32_t mCPVAmpl = 0xFFFFFF00;
394 uint32_t mMuonTr1P = 0xFFFFFC00;
395 uint32_t mMuonTrThetaX = 0xFFFFFF00;
396 uint32_t mMuonTrThetaY = 0xFFFFFF00;
397 uint32_t mMuonTrZmu = 0xFFFFFFF0;
398 uint32_t mMuonTrBend = 0xFFFFFFF0;
399 uint32_t mMuonTrNonBend = 0xFFFFFFF0;
400 uint32_t mMuonTrCov = 0xFFFF0000;
401 uint32_t mMuonCl = 0xFFFFFF00;
402 uint32_t mMuonClErr = 0xFFFF0000;
403 uint32_t mV0Time = 0xFFFFF000;
404 uint32_t mV0ChannelTime = 0xFFFFFF00;
405 uint32_t mFDDTime = 0xFFFFF000;
406 uint32_t mFDDChannelTime = 0xFFFFFF00;
407 uint32_t mT0Time = 0xFFFFFF00;
408 uint32_t mT0ChannelTime = 0xFFFFFFF0;
409 uint32_t mV0Amplitude = 0xFFFFF000;
410 uint32_t mFDDAmplitude = 0xFFFFF000;
411 uint32_t mT0Amplitude = 0xFFFFF000;
413 bool mCTPConfigPerRun =
false;
415 struct TrackExtraInfo {
416 float tpcInnerParam = 0.f;
418 uint32_t itsClusterSizes = 0u;
421 int8_t tpcNClsFindableMinusFound = 0;
422 int8_t tpcNClsFindableMinusPID = 0;
423 int8_t tpcNClsFindableMinusCrossedRows = 0;
426 float itsChi2NCl = -999.f;
427 float tpcChi2NCl = -999.f;
428 float trdChi2 = -999.f;
429 float tofChi2 = -999.f;
430 float tpcSignal = -999.f;
431 float trdSignal = -999.f;
433 float tofExpMom = -999.f;
434 float trackEtaEMCAL = -999.f;
435 float trackPhiEMCAL = -999.f;
436 float trackTime = -999.f;
437 float trackTimeRes = -999.f;
439 int bcSlice[2] = {-1, -1};
440 bool isTPConly =
false;
458 int8_t dRefContY{std::numeric_limits<int8_t>::min()};
459 int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
460 int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
461 int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
462 int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
463 int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
464 int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
465 int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
466 int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
467 int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
468 int8_t dTofdX{std::numeric_limits<int8_t>::min()};
469 int8_t dTofdZ{std::numeric_limits<int8_t>::min()};
473 struct FwdTrackInfo {
485 float chi2matchmchmid = -1.0;
486 float chi2matchmchmft = -1.0;
487 float matchscoremchmft = -1.0;
488 int matchmfttrackid = -1;
489 int matchmchtrackid = -1;
490 uint16_t mchBitMap = 0;
492 uint32_t midBoards = 0;
493 float trackTime = -999.f;
494 float trackTimeRes = -999.f;
498 struct FwdTrackCovInfo {
509 int8_t rhoTglPhi = 0;
512 int8_t rho1PtPhi = 0;
513 int8_t rho1PtTgl = 0;
519 uint32_t labelID = -1;
520 uint16_t labelMask = 0;
530 std::vector<TPCCounters> mTPCCounters;
538 const std::vector<o2::InteractionTimeRecord>& mcRecords,
539 std::map<uint64_t, int>& bcsMap);
541 template <
typename TracksCursorType,
typename TracksCovCursorType>
542 void addToTracksTable(TracksCursorType& tracksCursor, TracksCovCursorType& tracksCovCursor,
545 template <
typename TracksExtraCursorType>
546 void addToTracksExtraTable(TracksExtraCursorType& tracksExtraCursor, TrackExtraInfo& extraInfoHolder);
548 template <
typename TracksQACursorType>
549 void addToTracksQATable(TracksQACursorType& tracksQACursor, TrackQA& trackQAInfoHolder);
551 template <
typename TRDsExtraCursorType>
554 template <
typename mftTracksCursorType,
typename mftTracksCovCursorType,
typename AmbigMFTTracksCursorType>
555 void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, mftTracksCovCursorType& mftTracksCovCursor, AmbigMFTTracksCursorType& ambigMFTTracksCursor,
557 std::uint64_t collisionBC,
const std::map<uint64_t, int>& bcsMap);
559 template <
typename fwdTracksCursorType,
typename fwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename mftTracksCovCursorType>
560 void addToFwdTracksTable(fwdTracksCursorType& fwdTracksCursor, fwdTracksCovCursorType& fwdTracksCovCursor, AmbigFwdTracksCursorType& ambigFwdTracksCursor, mftTracksCovCursorType& mftTracksCovCursor,
567 void extrapolateToCalorimeters(TrackExtraInfo& extraInfoHolder,
const o2::track::TrackPar& track);
573 template <
typename TracksCursorType,
typename TracksCovCursorType,
typename TracksExtraCursorType,
typename TracksQACursorType,
typename TRDsExtraCursorType,
typename AmbigTracksCursorType,
574 typename MFTTracksCursorType,
typename MFTTracksCovCursorType,
typename AmbigMFTTracksCursorType,
575 typename FwdTracksCursorType,
typename FwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename FwdTrkClsCursorType>
576 void fillTrackTablesPerCollision(
int collisionID,
577 std::uint64_t collisionBC,
579 const gsl::span<const GIndex>& GIndices,
581 TracksCursorType& tracksCursor,
582 TracksCovCursorType& tracksCovCursor,
583 TracksExtraCursorType& tracksExtraCursor,
584 TracksQACursorType& tracksQACursor,
585 TRDsExtraCursorType& trdsExtraCursor,
586 AmbigTracksCursorType& ambigTracksCursor,
587 MFTTracksCursorType& mftTracksCursor,
588 MFTTracksCovCursorType& mftTracksCovCursor,
589 AmbigMFTTracksCursorType& ambigMFTTracksCursor,
590 FwdTracksCursorType& fwdTracksCursor,
591 FwdTracksCovCursorType& fwdTracksCovCursor,
592 AmbigFwdTracksCursorType& ambigFwdTracksCursor,
593 FwdTrkClsCursorType& fwdTrkClsCursor,
594 const std::map<uint64_t, int>& bcsMap);
596 template <
typename FwdTrkClsCursorType>
601 template <
typename V0CursorType,
typename CascadeCursorType,
typename Decay3bodyCursorType>
604 template <
typename HMPCursorType>
608 template <
typename V0C,
typename CC,
typename D3BC>
620 HepMCUpdate mXSectionUpdate = HepMCUpdate::anyKey;
621 HepMCUpdate mPdfInfoUpdate = HepMCUpdate::anyKey;
622 HepMCUpdate mHeavyIonUpdate = HepMCUpdate::anyKey;
660 void updateMCHeader(MCCollisionCursor& collisionCursor,
661 XSectionCursor& xSectionCursor,
662 PdfInfoCursor& pdfInfoCursor,
663 HeavyIonCursor& heavyIonCursor,
664 const MCEventHeader& header,
672 MCParticlesCursor& mcParticlesCursor,
673 const gsl::span<const o2::dataformats::VtxTrackRef>& primVer2TRefs,
674 const gsl::span<const GIndex>& GIndices,
676 const std::vector<MCColInfo>& mcColToEvSrc);
678 template <
typename MCTrackLabelCursorType,
typename MCMFTTrackLabelCursorType,
typename MCFwdTrackLabelCursorType>
679 void fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTrackLabelCursor,
680 MCMFTTrackLabelCursorType& mcMFTTrackLabelCursor,
681 MCFwdTrackLabelCursorType& mcFwdTrackLabelCursor,
683 const gsl::span<const GIndex>& primVerGIs,
687 std::uint64_t fillBCSlice(
int (&slice)[2],
double tmin,
double tmax,
const std::map<uint64_t, int>& bcsMap)
const;
697 template <
typename TCaloHandler,
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
698 void addToCaloTable(TCaloHandler& caloHandler, TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
699 TMCCaloLabelCursor& mcCaloCellLabelCursor,
int eventID,
int bcID, int8_t caloType);
701 template <
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
702 void fillCaloTable(TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
703 TMCCaloLabelCursor& mcCaloCellLabelCursor,
const std::map<uint64_t, int>& bcsMap,
706 std::set<uint64_t> filterEMCALIncomplete(
const gsl::span<const o2::emcal::TriggerRecord> triggers);