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 float mTrackQCKeepGlobalTracks{
false};
253 float mTrackQCRetainOnlydEdx{
false};
254 float mTrackQCFraction{0.00};
256 float mTrackQCDCAxy{3.};
257 float mTrackQCPt{0.2};
258 int mTrackQCNCls{80};
259 float mSqrtS{13860.};
260 std::mt19937 mGenerator{};
263 float mMaxPropXiu{5.0f};
269 std::unordered_set<GIndex> mGIDUsedBySVtx;
270 std::unordered_set<GIndex> mGIDUsedByStr;
273 std::shared_ptr<o2::utils::TreeStreamRedirector> mStreamer;
277 bool mUseSigFiltMC =
false;
278 bool mEnableSV =
true;
279 bool mEnableFITextra =
false;
280 bool mEnableTRDextra =
false;
281 bool mFieldON =
false;
282 const float cSpeed = 0.029979246f;
290 TString mLPMProdTag{
""};
291 TString mAnchorPass{
""};
292 TString mAnchorProd{
""};
293 TString mRecoPass{
""};
294 std::string mAODParent{
""};
295 TString mUser{
"aliprod"};
297 bool mEMCselectLeading{
false};
298 uint64_t mEMCALTrgClassMask = 0;
299 size_t mCurrentTRDTrigID = 0;
302 std::unordered_map<GIndex, int> mGIDToTableID;
305 std::unordered_map<GIndex, int> mGIDToTableFwdID;
306 int mTableTrFwdID{0};
308 std::unordered_map<GIndex, int> mGIDToTableMFTID;
309 int mTableTrMFTID{0};
311 std::unordered_map<GIndex, int> mVtxToTableCollID;
314 std::unordered_map<GIndex, int> mV0ToTableID;
318 std::vector<int> mVertexStrLUT;
319 std::vector<std::pair<int, int>> mCollisionStrTrk;
320 std::vector<int> mStrTrkIndices;
323 std::vector<int> mIndexTableFwd;
326 std::vector<int> mIndexTableMFT;
329 BunchCrossings mBCLookup;
333 std::array<float, o2::zdc::NChannels> mZDCEnergyMap;
334 std::array<float, o2::zdc::NTDCChannels> mZDCTDCMap;
336 std::vector<uint16_t> mITSTPCTRDTriggers;
337 std::vector<uint16_t> mTPCTRDTriggers;
338 std::vector<uint16_t> mITSROFs;
339 std::vector<uint16_t> mMFTROFs;
340 std::vector<uint16_t> mMCHROFs;
341 double mITSROFrameHalfLengthNS = -1;
342 double mMFTROFrameHalfLengthNS = -1;
343 double mITSROFBiasNS = 0;
344 double mMFTROFBiasNS = 0;
345 double mNSigmaTimeTrack = -1;
346 double mTimeMarginTrackTime = -1;
347 double mTPCBinNS = -1;
353 std::vector<std::vector<std::unordered_map<int, int>>> mToStore;
357 std::vector<TString> mMetaDataKeys;
358 std::vector<TString> mMetaDataVals;
360 std::shared_ptr<DataRequest> mDataRequest;
361 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
365 static constexpr int TOFTimePrecPS = 16;
367 uint32_t mCollisionPosition = 0xFFFFFFF0;
368 uint32_t mCollisionPositionCov = 0xFFFFE000;
369 uint32_t mTrackX = 0xFFFFFFF0;
370 uint32_t mTrackAlpha = 0xFFFFFFF0;
371 uint32_t mTrackSnp = 0xFFFFFF00;
372 uint32_t mTrackTgl = 0xFFFFFF00;
373 uint32_t mTrack1Pt = 0xFFFFFC00;
374 uint32_t mTrackCovDiag = 0xFFFFFF00;
375 uint32_t mTrackChi2 = 0xFFFF0000;
376 uint32_t mTrackCovOffDiag = 0xFFFF0000;
377 uint32_t mTrackSignal = 0xFFFFFF00;
378 uint32_t mTrackTime = 0xFFFFFFFF;
379 uint32_t mTPCTime0 = 0xFFFFFFE0;
380 uint32_t mTrackTimeError = 0xFFFFFF00;
381 uint32_t mTrackPosEMCAL = 0xFFFFFF00;
382 uint32_t mTracklets = 0xFFFFFF00;
383 uint32_t mMcParticleW = 0xFFFFFFF0;
384 uint32_t mMcParticlePos = 0xFFFFFFF0;
385 uint32_t mMcParticleMom = 0xFFFFFFF0;
386 uint32_t mCaloAmp = 0xFFFFFF00;
387 uint32_t mCaloTime = 0xFFFFFF00;
388 uint32_t mCPVPos = 0xFFFFF800;
389 uint32_t mCPVAmpl = 0xFFFFFF00;
390 uint32_t mMuonTr1P = 0xFFFFFC00;
391 uint32_t mMuonTrThetaX = 0xFFFFFF00;
392 uint32_t mMuonTrThetaY = 0xFFFFFF00;
393 uint32_t mMuonTrZmu = 0xFFFFFFF0;
394 uint32_t mMuonTrBend = 0xFFFFFFF0;
395 uint32_t mMuonTrNonBend = 0xFFFFFFF0;
396 uint32_t mMuonTrCov = 0xFFFF0000;
397 uint32_t mMuonCl = 0xFFFFFF00;
398 uint32_t mMuonClErr = 0xFFFF0000;
399 uint32_t mV0Time = 0xFFFFF000;
400 uint32_t mV0ChannelTime = 0xFFFFFF00;
401 uint32_t mFDDTime = 0xFFFFF000;
402 uint32_t mFDDChannelTime = 0xFFFFFF00;
403 uint32_t mT0Time = 0xFFFFFF00;
404 uint32_t mT0ChannelTime = 0xFFFFFFF0;
405 uint32_t mV0Amplitude = 0xFFFFF000;
406 uint32_t mFDDAmplitude = 0xFFFFF000;
407 uint32_t mT0Amplitude = 0xFFFFF000;
409 bool mCTPConfigPerRun =
false;
411 struct TrackExtraInfo {
412 float tpcInnerParam = 0.f;
414 uint32_t itsClusterSizes = 0u;
417 int8_t tpcNClsFindableMinusFound = 0;
418 int8_t tpcNClsFindableMinusPID = 0;
419 int8_t tpcNClsFindableMinusCrossedRows = 0;
422 float itsChi2NCl = -999.f;
423 float tpcChi2NCl = -999.f;
424 float trdChi2 = -999.f;
425 float tofChi2 = -999.f;
426 float tpcSignal = -999.f;
427 float trdSignal = -999.f;
429 float tofExpMom = -999.f;
430 float trackEtaEMCAL = -999.f;
431 float trackPhiEMCAL = -999.f;
432 float trackTime = -999.f;
433 float trackTimeRes = -999.f;
435 int bcSlice[2] = {-1, -1};
436 bool isTPConly =
false;
454 int8_t dRefContY{std::numeric_limits<int8_t>::min()};
455 int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
456 int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
457 int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
458 int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
459 int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
460 int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
461 int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
462 int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
463 int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
464 int8_t dTofdX{std::numeric_limits<int8_t>::min()};
465 int8_t dTofdZ{std::numeric_limits<int8_t>::min()};
469 struct FwdTrackInfo {
481 float chi2matchmchmid = -1.0;
482 float chi2matchmchmft = -1.0;
483 float matchscoremchmft = -1.0;
484 int matchmfttrackid = -1;
485 int matchmchtrackid = -1;
486 uint16_t mchBitMap = 0;
488 uint32_t midBoards = 0;
489 float trackTime = -999.f;
490 float trackTimeRes = -999.f;
494 struct FwdTrackCovInfo {
505 int8_t rhoTglPhi = 0;
508 int8_t rho1PtPhi = 0;
509 int8_t rho1PtTgl = 0;
515 uint32_t labelID = -1;
516 uint16_t labelMask = 0;
526 std::vector<TPCCounters> mTPCCounters;
534 const std::vector<o2::InteractionTimeRecord>& mcRecords,
535 std::map<uint64_t, int>& bcsMap);
537 template <
typename TracksCursorType,
typename TracksCovCursorType>
538 void addToTracksTable(TracksCursorType& tracksCursor, TracksCovCursorType& tracksCovCursor,
541 template <
typename TracksExtraCursorType>
542 void addToTracksExtraTable(TracksExtraCursorType& tracksExtraCursor, TrackExtraInfo& extraInfoHolder);
544 template <
typename TracksQACursorType>
545 void addToTracksQATable(TracksQACursorType& tracksQACursor, TrackQA& trackQAInfoHolder);
547 template <
typename TRDsExtraCursorType>
550 template <
typename mftTracksCursorType,
typename AmbigMFTTracksCursorType>
551 void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, AmbigMFTTracksCursorType& ambigMFTTracksCursor,
553 std::uint64_t collisionBC,
const std::map<uint64_t, int>& bcsMap);
555 template <
typename fwdTracksCursorType,
typename fwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename mftTracksCovCursorType>
556 void addToFwdTracksTable(fwdTracksCursorType& fwdTracksCursor, fwdTracksCovCursorType& fwdTracksCovCursor, AmbigFwdTracksCursorType& ambigFwdTracksCursor, mftTracksCovCursorType& mftTracksCovCursor,
563 void extrapolateToCalorimeters(TrackExtraInfo& extraInfoHolder,
const o2::track::TrackPar& track);
569 template <
typename TracksCursorType,
typename TracksCovCursorType,
typename TracksExtraCursorType,
typename TracksQACursorType,
typename TRDsExtraCursorType,
typename AmbigTracksCursorType,
570 typename MFTTracksCursorType,
typename MFTTracksCovCursorType,
typename AmbigMFTTracksCursorType,
571 typename FwdTracksCursorType,
typename FwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename FwdTrkClsCursorType>
572 void fillTrackTablesPerCollision(
int collisionID,
573 std::uint64_t collisionBC,
575 const gsl::span<const GIndex>& GIndices,
577 TracksCursorType& tracksCursor,
578 TracksCovCursorType& tracksCovCursor,
579 TracksExtraCursorType& tracksExtraCursor,
580 TracksQACursorType& tracksQACursor,
581 TRDsExtraCursorType& trdsExtraCursor,
582 AmbigTracksCursorType& ambigTracksCursor,
583 MFTTracksCursorType& mftTracksCursor,
584 MFTTracksCovCursorType& mftTracksCovCursor,
585 AmbigMFTTracksCursorType& ambigMFTTracksCursor,
586 FwdTracksCursorType& fwdTracksCursor,
587 FwdTracksCovCursorType& fwdTracksCovCursor,
588 AmbigFwdTracksCursorType& ambigFwdTracksCursor,
589 FwdTrkClsCursorType& fwdTrkClsCursor,
590 const std::map<uint64_t, int>& bcsMap);
592 template <
typename FwdTrkClsCursorType>
597 template <
typename V0CursorType,
typename CascadeCursorType,
typename Decay3bodyCursorType>
600 template <
typename HMPCursorType>
604 template <
typename V0C,
typename CC,
typename D3BC>
616 HepMCUpdate mXSectionUpdate = HepMCUpdate::anyKey;
617 HepMCUpdate mPdfInfoUpdate = HepMCUpdate::anyKey;
618 HepMCUpdate mHeavyIonUpdate = HepMCUpdate::anyKey;
656 void updateMCHeader(MCCollisionCursor& collisionCursor,
657 XSectionCursor& xSectionCursor,
658 PdfInfoCursor& pdfInfoCursor,
659 HeavyIonCursor& heavyIonCursor,
660 const MCEventHeader& header,
668 MCParticlesCursor& mcParticlesCursor,
669 const gsl::span<const o2::dataformats::VtxTrackRef>& primVer2TRefs,
670 const gsl::span<const GIndex>& GIndices,
672 const std::vector<MCColInfo>& mcColToEvSrc);
674 template <
typename MCTrackLabelCursorType,
typename MCMFTTrackLabelCursorType,
typename MCFwdTrackLabelCursorType>
675 void fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTrackLabelCursor,
676 MCMFTTrackLabelCursorType& mcMFTTrackLabelCursor,
677 MCFwdTrackLabelCursorType& mcFwdTrackLabelCursor,
679 const gsl::span<const GIndex>& primVerGIs,
683 std::uint64_t fillBCSlice(
int (&slice)[2],
double tmin,
double tmax,
const std::map<uint64_t, int>& bcsMap)
const;
693 template <
typename TCaloHandler,
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
694 void addToCaloTable(TCaloHandler& caloHandler, TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
695 TMCCaloLabelCursor& mcCaloCellLabelCursor,
int eventID,
int bcID, int8_t caloType);
697 template <
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
698 void fillCaloTable(TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
699 TMCCaloLabelCursor& mcCaloCellLabelCursor,
const std::map<uint64_t, int>& bcsMap,
702 std::set<uint64_t> filterEMCALIncomplete(
const gsl::span<const o2::emcal::TriggerRecord> triggers);