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 mThinTracks{
false};
250 bool mPropTracks{
false};
251 bool mPropMuons{
false};
252 bool mStoreAllMFTCov{
false};
253 float mTrackQCKeepGlobalTracks{
false};
254 float mTrackQCRetainOnlydEdx{
false};
255 float mTrackQCFraction{0.00};
257 float mTrackQCDCAxy{3.};
258 float mTrackQCPt{0.2};
259 int mTrackQCNCls{80};
260 float mSqrtS{13860.};
261 std::mt19937 mGenerator{};
264 float mMaxPropXiu{5.0f};
270 std::unordered_set<GIndex> mGIDUsedBySVtx;
271 std::unordered_set<GIndex> mGIDUsedByStr;
274 std::shared_ptr<o2::utils::TreeStreamRedirector> mStreamer;
278 bool mUseSigFiltMC =
false;
279 bool mEnableSV =
true;
280 bool mEnableFITextra =
false;
281 bool mEnableTRDextra =
false;
282 bool mFieldON =
false;
283 const float cSpeed = 0.029979246f;
291 TString mLPMProdTag{
""};
292 TString mAnchorPass{
""};
293 TString mAnchorProd{
""};
294 TString mRecoPass{
""};
295 std::string mAODParent{
""};
296 TString mUser{
"aliprod"};
298 bool mEMCselectLeading{
false};
299 uint64_t mEMCALTrgClassMask = 0;
300 size_t mCurrentTRDTrigID = 0;
303 std::unordered_map<GIndex, int> mGIDToTableID;
306 std::unordered_map<GIndex, int> mGIDToTableFwdID;
307 int mTableTrFwdID{0};
309 std::unordered_map<GIndex, int> mGIDToTableMFTID;
310 int mTableTrMFTID{0};
312 std::unordered_map<GIndex, int> mVtxToTableCollID;
315 std::unordered_map<GIndex, int> mV0ToTableID;
319 std::vector<int> mVertexStrLUT;
320 std::vector<std::pair<int, int>> mCollisionStrTrk;
321 std::vector<int> mStrTrkIndices;
324 std::vector<int> mIndexTableFwd;
327 std::vector<int> mIndexTableMFT;
330 BunchCrossings mBCLookup;
334 std::array<float, o2::zdc::NChannels> mZDCEnergyMap;
335 std::array<float, o2::zdc::NTDCChannels> mZDCTDCMap;
337 std::vector<uint16_t> mITSTPCTRDTriggers;
338 std::vector<uint16_t> mTPCTRDTriggers;
339 std::vector<uint16_t> mITSROFs;
340 std::vector<uint16_t> mMFTROFs;
341 std::vector<uint16_t> mMCHROFs;
342 double mITSROFrameHalfLengthNS = -1;
343 double mMFTROFrameHalfLengthNS = -1;
344 double mITSROFBiasNS = 0;
345 double mMFTROFBiasNS = 0;
346 double mNSigmaTimeTrack = -1;
347 double mTimeMarginTrackTime = -1;
348 double mTPCBinNS = -1;
354 std::vector<std::vector<std::unordered_map<int, int>>> mToStore;
358 std::vector<TString> mMetaDataKeys;
359 std::vector<TString> mMetaDataVals;
361 std::shared_ptr<DataRequest> mDataRequest;
362 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
366 static constexpr int TOFTimePrecPS = 16;
368 uint32_t mCollisionPosition = 0xFFFFFFF0;
369 uint32_t mCollisionPositionCov = 0xFFFFE000;
370 uint32_t mTrackX = 0xFFFFFFF0;
371 uint32_t mTrackAlpha = 0xFFFFFFF0;
372 uint32_t mTrackSnp = 0xFFFFFF00;
373 uint32_t mTrackTgl = 0xFFFFFF00;
374 uint32_t mTrack1Pt = 0xFFFFFC00;
375 uint32_t mTrackCovDiag = 0xFFFFFF00;
376 uint32_t mTrackChi2 = 0xFFFF0000;
377 uint32_t mTrackCovOffDiag = 0xFFFF0000;
378 uint32_t mTrackSignal = 0xFFFFFF00;
379 uint32_t mTrackTime = 0xFFFFFFFF;
380 uint32_t mTPCTime0 = 0xFFFFFFE0;
381 uint32_t mTrackTimeError = 0xFFFFFF00;
382 uint32_t mTrackPosEMCAL = 0xFFFFFF00;
383 uint32_t mTracklets = 0xFFFFFF00;
384 uint32_t mMcParticleW = 0xFFFFFFF0;
385 uint32_t mMcParticlePos = 0xFFFFFFF0;
386 uint32_t mMcParticleMom = 0xFFFFFFF0;
387 uint32_t mCaloAmp = 0xFFFFFF00;
388 uint32_t mCaloTime = 0xFFFFFF00;
389 uint32_t mCPVPos = 0xFFFFF800;
390 uint32_t mCPVAmpl = 0xFFFFFF00;
391 uint32_t mMuonTr1P = 0xFFFFFC00;
392 uint32_t mMuonTrThetaX = 0xFFFFFF00;
393 uint32_t mMuonTrThetaY = 0xFFFFFF00;
394 uint32_t mMuonTrZmu = 0xFFFFFFF0;
395 uint32_t mMuonTrBend = 0xFFFFFFF0;
396 uint32_t mMuonTrNonBend = 0xFFFFFFF0;
397 uint32_t mMuonTrCov = 0xFFFF0000;
398 uint32_t mMuonCl = 0xFFFFFF00;
399 uint32_t mMuonClErr = 0xFFFF0000;
400 uint32_t mV0Time = 0xFFFFF000;
401 uint32_t mV0ChannelTime = 0xFFFFFF00;
402 uint32_t mFDDTime = 0xFFFFF000;
403 uint32_t mFDDChannelTime = 0xFFFFFF00;
404 uint32_t mT0Time = 0xFFFFFF00;
405 uint32_t mT0ChannelTime = 0xFFFFFFF0;
406 uint32_t mV0Amplitude = 0xFFFFF000;
407 uint32_t mFDDAmplitude = 0xFFFFF000;
408 uint32_t mT0Amplitude = 0xFFFFF000;
410 bool mCTPConfigPerRun =
false;
412 struct TrackExtraInfo {
413 float tpcInnerParam = 0.f;
415 uint32_t itsClusterSizes = 0u;
418 int8_t tpcNClsFindableMinusFound = 0;
419 int8_t tpcNClsFindableMinusPID = 0;
420 int8_t tpcNClsFindableMinusCrossedRows = 0;
423 float itsChi2NCl = -999.f;
424 float tpcChi2NCl = -999.f;
425 float trdChi2 = -999.f;
426 float tofChi2 = -999.f;
427 float tpcSignal = -999.f;
428 float trdSignal = -999.f;
430 float tofExpMom = -999.f;
431 float trackEtaEMCAL = -999.f;
432 float trackPhiEMCAL = -999.f;
433 float trackTime = -999.f;
434 float trackTimeRes = -999.f;
436 int bcSlice[2] = {-1, -1};
437 bool isTPConly =
false;
455 int8_t dRefContY{std::numeric_limits<int8_t>::min()};
456 int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
457 int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
458 int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
459 int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
460 int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
461 int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
462 int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
463 int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
464 int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
465 int8_t dTofdX{std::numeric_limits<int8_t>::min()};
466 int8_t dTofdZ{std::numeric_limits<int8_t>::min()};
470 struct FwdTrackInfo {
482 float chi2matchmchmid = -1.0;
483 float chi2matchmchmft = -1.0;
484 float matchscoremchmft = -1.0;
485 int matchmfttrackid = -1;
486 int matchmchtrackid = -1;
487 uint16_t mchBitMap = 0;
489 uint32_t midBoards = 0;
490 float trackTime = -999.f;
491 float trackTimeRes = -999.f;
495 struct FwdTrackCovInfo {
506 int8_t rhoTglPhi = 0;
509 int8_t rho1PtPhi = 0;
510 int8_t rho1PtTgl = 0;
516 uint32_t labelID = -1;
517 uint16_t labelMask = 0;
527 std::vector<TPCCounters> mTPCCounters;
535 const std::vector<o2::InteractionTimeRecord>& mcRecords,
536 std::map<uint64_t, int>& bcsMap);
538 template <
typename TracksCursorType,
typename TracksCovCursorType>
539 void addToTracksTable(TracksCursorType& tracksCursor, TracksCovCursorType& tracksCovCursor,
542 template <
typename TracksExtraCursorType>
543 void addToTracksExtraTable(TracksExtraCursorType& tracksExtraCursor, TrackExtraInfo& extraInfoHolder);
545 template <
typename TracksQACursorType>
546 void addToTracksQATable(TracksQACursorType& tracksQACursor, TrackQA& trackQAInfoHolder);
548 template <
typename TRDsExtraCursorType>
551 template <
typename mftTracksCursorType,
typename mftTracksCovCursorType,
typename AmbigMFTTracksCursorType>
552 void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, mftTracksCovCursorType& mftTracksCovCursor, AmbigMFTTracksCursorType& ambigMFTTracksCursor,
554 std::uint64_t collisionBC,
const std::map<uint64_t, int>& bcsMap);
556 template <
typename fwdTracksCursorType,
typename fwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename mftTracksCovCursorType>
557 void addToFwdTracksTable(fwdTracksCursorType& fwdTracksCursor, fwdTracksCovCursorType& fwdTracksCovCursor, AmbigFwdTracksCursorType& ambigFwdTracksCursor, mftTracksCovCursorType& mftTracksCovCursor,
564 void extrapolateToCalorimeters(TrackExtraInfo& extraInfoHolder,
const o2::track::TrackPar& track);
570 template <
typename TracksCursorType,
typename TracksCovCursorType,
typename TracksExtraCursorType,
typename TracksQACursorType,
typename TRDsExtraCursorType,
typename AmbigTracksCursorType,
571 typename MFTTracksCursorType,
typename MFTTracksCovCursorType,
typename AmbigMFTTracksCursorType,
572 typename FwdTracksCursorType,
typename FwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename FwdTrkClsCursorType>
573 void fillTrackTablesPerCollision(
int collisionID,
574 std::uint64_t collisionBC,
576 const gsl::span<const GIndex>& GIndices,
578 TracksCursorType& tracksCursor,
579 TracksCovCursorType& tracksCovCursor,
580 TracksExtraCursorType& tracksExtraCursor,
581 TracksQACursorType& tracksQACursor,
582 TRDsExtraCursorType& trdsExtraCursor,
583 AmbigTracksCursorType& ambigTracksCursor,
584 MFTTracksCursorType& mftTracksCursor,
585 MFTTracksCovCursorType& mftTracksCovCursor,
586 AmbigMFTTracksCursorType& ambigMFTTracksCursor,
587 FwdTracksCursorType& fwdTracksCursor,
588 FwdTracksCovCursorType& fwdTracksCovCursor,
589 AmbigFwdTracksCursorType& ambigFwdTracksCursor,
590 FwdTrkClsCursorType& fwdTrkClsCursor,
591 const std::map<uint64_t, int>& bcsMap);
593 template <
typename FwdTrkClsCursorType>
598 template <
typename V0CursorType,
typename CascadeCursorType,
typename Decay3bodyCursorType>
601 template <
typename HMPCursorType>
605 template <
typename V0C,
typename CC,
typename D3BC>
617 HepMCUpdate mXSectionUpdate = HepMCUpdate::anyKey;
618 HepMCUpdate mPdfInfoUpdate = HepMCUpdate::anyKey;
619 HepMCUpdate mHeavyIonUpdate = HepMCUpdate::anyKey;
657 void updateMCHeader(MCCollisionCursor& collisionCursor,
658 XSectionCursor& xSectionCursor,
659 PdfInfoCursor& pdfInfoCursor,
660 HeavyIonCursor& heavyIonCursor,
661 const MCEventHeader& header,
669 MCParticlesCursor& mcParticlesCursor,
670 const gsl::span<const o2::dataformats::VtxTrackRef>& primVer2TRefs,
671 const gsl::span<const GIndex>& GIndices,
673 const std::vector<MCColInfo>& mcColToEvSrc);
675 template <
typename MCTrackLabelCursorType,
typename MCMFTTrackLabelCursorType,
typename MCFwdTrackLabelCursorType>
676 void fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTrackLabelCursor,
677 MCMFTTrackLabelCursorType& mcMFTTrackLabelCursor,
678 MCFwdTrackLabelCursorType& mcFwdTrackLabelCursor,
680 const gsl::span<const GIndex>& primVerGIs,
684 std::uint64_t fillBCSlice(
int (&slice)[2],
double tmin,
double tmax,
const std::map<uint64_t, int>& bcsMap)
const;
694 template <
typename TCaloHandler,
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
695 void addToCaloTable(TCaloHandler& caloHandler, TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
696 TMCCaloLabelCursor& mcCaloCellLabelCursor,
int eventID,
int bcID, int8_t caloType);
698 template <
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
699 void fillCaloTable(TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
700 TMCCaloLabelCursor& mcCaloCellLabelCursor,
const std::map<uint64_t, int>& bcsMap,
703 std::set<uint64_t> filterEMCALIncomplete(
const gsl::span<const o2::emcal::TriggerRecord> triggers);