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 mTrackQCDCAxy{3.};
243 float mTrackQCPt{0.2};
244 int mTrackQCNCls{80};
245 float mSqrtS{13860.};
246 std::mt19937 mGenerator{};
251 std::unordered_set<GIndex> mGIDUsedBySVtx;
252 std::unordered_set<GIndex> mGIDUsedByStr;
255 std::shared_ptr<o2::utils::TreeStreamRedirector> mStreamer;
259 bool mEnableSV =
true;
260 bool mEnableFITextra =
false;
261 bool mFieldON =
false;
262 const float cSpeed = 0.029979246f;
265 int64_t mTFNumber{-1};
270 TString mLPMProdTag{
""};
271 TString mAnchorPass{
""};
272 TString mAnchorProd{
""};
273 TString mRecoPass{
""};
275 bool mEMCselectLeading{
false};
276 uint64_t mEMCALTrgClassMask = 0;
279 std::unordered_map<GIndex, int> mGIDToTableID;
282 std::unordered_map<GIndex, int> mGIDToTableFwdID;
283 int mTableTrFwdID{0};
285 std::unordered_map<GIndex, int> mGIDToTableMFTID;
286 int mTableTrMFTID{0};
288 std::unordered_map<GIndex, int> mVtxToTableCollID;
291 std::unordered_map<GIndex, int> mV0ToTableID;
295 std::vector<int> mVertexStrLUT;
296 std::vector<std::pair<int, int>> mCollisionStrTrk;
297 std::vector<int> mStrTrkIndices;
300 std::vector<int> mIndexTableFwd;
303 std::vector<int> mIndexTableMFT;
306 BunchCrossings mBCLookup;
310 std::array<float, o2::zdc::NChannels> mZDCEnergyMap;
311 std::array<float, o2::zdc::NTDCChannels> mZDCTDCMap;
313 std::vector<uint16_t> mITSTPCTRDTriggers;
314 std::vector<uint16_t> mTPCTRDTriggers;
315 std::vector<uint16_t> mITSROFs;
316 std::vector<uint16_t> mMFTROFs;
317 std::vector<uint16_t> mMCHROFs;
318 double mITSROFrameHalfLengthNS = -1;
319 double mMFTROFrameHalfLengthNS = -1;
320 double mITSROFBiasNS = 0;
321 double mMFTROFBiasNS = 0;
322 double mNSigmaTimeTrack = -1;
323 double mTimeMarginTrackTime = -1;
324 double mTPCBinNS = -1;
330 std::vector<std::vector<std::unordered_map<int, int>>> mToStore;
334 std::vector<TString> mMetaDataKeys;
335 std::vector<TString> mMetaDataVals;
337 std::shared_ptr<DataRequest> mDataRequest;
338 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
342 static constexpr int TOFTimePrecPS = 16;
344 uint32_t mCollisionPosition = 0xFFFFFFF0;
345 uint32_t mCollisionPositionCov = 0xFFFFE000;
346 uint32_t mTrackX = 0xFFFFFFF0;
347 uint32_t mTrackAlpha = 0xFFFFFFF0;
348 uint32_t mTrackSnp = 0xFFFFFF00;
349 uint32_t mTrackTgl = 0xFFFFFF00;
350 uint32_t mTrack1Pt = 0xFFFFFC00;
351 uint32_t mTrackCovDiag = 0xFFFFFF00;
352 uint32_t mTrackChi2 = 0xFFFF0000;
353 uint32_t mTrackCovOffDiag = 0xFFFF0000;
354 uint32_t mTrackSignal = 0xFFFFFF00;
355 uint32_t mTrackTime = 0xFFFFFFFF;
356 uint32_t mTPCTime0 = 0xFFFFFFE0;
357 uint32_t mTrackTimeError = 0xFFFFFF00;
358 uint32_t mTrackPosEMCAL = 0xFFFFFF00;
359 uint32_t mTracklets = 0xFFFFFF00;
360 uint32_t mMcParticleW = 0xFFFFFFF0;
361 uint32_t mMcParticlePos = 0xFFFFFFF0;
362 uint32_t mMcParticleMom = 0xFFFFFFF0;
363 uint32_t mCaloAmp = 0xFFFFFF00;
364 uint32_t mCaloTime = 0xFFFFFF00;
365 uint32_t mCPVPos = 0xFFFFF800;
366 uint32_t mCPVAmpl = 0xFFFFFF00;
367 uint32_t mMuonTr1P = 0xFFFFFC00;
368 uint32_t mMuonTrThetaX = 0xFFFFFF00;
369 uint32_t mMuonTrThetaY = 0xFFFFFF00;
370 uint32_t mMuonTrZmu = 0xFFFFFFF0;
371 uint32_t mMuonTrBend = 0xFFFFFFF0;
372 uint32_t mMuonTrNonBend = 0xFFFFFFF0;
373 uint32_t mMuonTrCov = 0xFFFF0000;
374 uint32_t mMuonCl = 0xFFFFFF00;
375 uint32_t mMuonClErr = 0xFFFF0000;
376 uint32_t mV0Time = 0xFFFFF000;
377 uint32_t mV0ChannelTime = 0xFFFFFF00;
378 uint32_t mFDDTime = 0xFFFFF000;
379 uint32_t mFDDChannelTime = 0xFFFFFF00;
380 uint32_t mT0Time = 0xFFFFFF00;
381 uint32_t mT0ChannelTime = 0xFFFFFFF0;
382 uint32_t mV0Amplitude = 0xFFFFF000;
383 uint32_t mFDDAmplitude = 0xFFFFF000;
384 uint32_t mT0Amplitude = 0xFFFFF000;
386 bool mCTPConfigPerRun =
false;
388 struct TrackExtraInfo {
389 float tpcInnerParam = 0.f;
391 uint32_t itsClusterSizes = 0u;
394 int8_t tpcNClsFindableMinusFound = 0;
395 int8_t tpcNClsFindableMinusPID = 0;
396 int8_t tpcNClsFindableMinusCrossedRows = 0;
399 float itsChi2NCl = -999.f;
400 float tpcChi2NCl = -999.f;
401 float trdChi2 = -999.f;
402 float tofChi2 = -999.f;
403 float tpcSignal = -999.f;
404 float trdSignal = -999.f;
406 float tofExpMom = -999.f;
407 float trackEtaEMCAL = -999.f;
408 float trackPhiEMCAL = -999.f;
409 float trackTime = -999.f;
410 float trackTimeRes = -999.f;
412 int bcSlice[2] = {-1, -1};
413 bool isTPConly =
false;
431 int8_t dRefContY{std::numeric_limits<int8_t>::min()};
432 int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
433 int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
434 int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
435 int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
436 int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
437 int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
438 int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
439 int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
440 int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
441 int8_t dTofdX{std::numeric_limits<int8_t>::min()};
442 int8_t dTofdZ{std::numeric_limits<int8_t>::min()};
446 struct FwdTrackInfo {
458 float chi2matchmchmid = -1.0;
459 float chi2matchmchmft = -1.0;
460 float matchscoremchmft = -1.0;
461 int matchmfttrackid = -1;
462 int matchmchtrackid = -1;
463 uint16_t mchBitMap = 0;
465 uint32_t midBoards = 0;
466 float trackTime = -999.f;
467 float trackTimeRes = -999.f;
471 struct FwdTrackCovInfo {
482 int8_t rhoTglPhi = 0;
485 int8_t rho1PtPhi = 0;
486 int8_t rho1PtTgl = 0;
492 uint32_t labelID = -1;
493 uint16_t labelMask = 0;
503 std::vector<TPCCounters> mTPCCounters;
511 const std::vector<o2::InteractionTimeRecord>& mcRecords,
512 std::map<uint64_t, int>& bcsMap);
514 template <
typename TracksCursorType,
typename TracksCovCursorType>
515 void addToTracksTable(TracksCursorType& tracksCursor, TracksCovCursorType& tracksCovCursor,
518 template <
typename TracksExtraCursorType>
519 void addToTracksExtraTable(TracksExtraCursorType& tracksExtraCursor, TrackExtraInfo& extraInfoHolder);
521 template <
typename TracksQACursorType>
522 void addToTracksQATable(TracksQACursorType& tracksQACursor, TrackQA& trackQAInfoHolder);
524 template <
typename mftTracksCursorType,
typename AmbigMFTTracksCursorType>
525 void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, AmbigMFTTracksCursorType& ambigMFTTracksCursor,
527 std::uint64_t collisionBC,
const std::map<uint64_t, int>& bcsMap);
529 template <
typename fwdTracksCursorType,
typename fwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename mftTracksCovCursorType>
530 void addToFwdTracksTable(fwdTracksCursorType& fwdTracksCursor, fwdTracksCovCursorType& fwdTracksCovCursor, AmbigFwdTracksCursorType& ambigFwdTracksCursor, mftTracksCovCursorType& mftTracksCovCursor,
537 void extrapolateToCalorimeters(TrackExtraInfo& extraInfoHolder,
const o2::track::TrackPar& track);
543 template <
typename TracksCursorType,
typename TracksCovCursorType,
typename TracksExtraCursorType,
typename TracksQACursorType,
typename AmbigTracksCursorType,
544 typename MFTTracksCursorType,
typename MFTTracksCovCursorType,
typename AmbigMFTTracksCursorType,
545 typename FwdTracksCursorType,
typename FwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename FwdTrkClsCursorType>
546 void fillTrackTablesPerCollision(
int collisionID,
547 std::uint64_t collisionBC,
549 const gsl::span<const GIndex>& GIndices,
551 TracksCursorType& tracksCursor,
552 TracksCovCursorType& tracksCovCursor,
553 TracksExtraCursorType& tracksExtraCursor,
554 TracksQACursorType& tracksQACursor,
555 AmbigTracksCursorType& ambigTracksCursor,
556 MFTTracksCursorType& mftTracksCursor,
557 MFTTracksCovCursorType& mftTracksCovCursor,
558 AmbigMFTTracksCursorType& ambigMFTTracksCursor,
559 FwdTracksCursorType& fwdTracksCursor,
560 FwdTracksCovCursorType& fwdTracksCovCursor,
561 AmbigFwdTracksCursorType& ambigFwdTracksCursor,
562 FwdTrkClsCursorType& fwdTrkClsCursor,
563 const std::map<uint64_t, int>& bcsMap);
565 template <
typename FwdTrkClsCursorType>
570 template <
typename V0CursorType,
typename CascadeCursorType,
typename Decay3bodyCursorType>
573 template <
typename HMPCursorType>
577 template <
typename V0C,
typename CC,
typename D3BC>
589 HepMCUpdate mXSectionUpdate = HepMCUpdate::anyKey;
590 HepMCUpdate mPdfInfoUpdate = HepMCUpdate::anyKey;
591 HepMCUpdate mHeavyIonUpdate = HepMCUpdate::anyKey;
629 void updateMCHeader(MCCollisionCursor& collisionCursor,
630 XSectionCursor& xSectionCursor,
631 PdfInfoCursor& pdfInfoCursor,
632 HeavyIonCursor& heavyIonCursor,
633 const MCEventHeader& header,
641 MCParticlesCursor& mcParticlesCursor,
642 const gsl::span<const o2::dataformats::VtxTrackRef>& primVer2TRefs,
643 const gsl::span<const GIndex>& GIndices,
645 const std::vector<std::vector<int>>& mcColToEvSrc);
647 template <
typename MCTrackLabelCursorType,
typename MCMFTTrackLabelCursorType,
typename MCFwdTrackLabelCursorType>
648 void fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTrackLabelCursor,
649 MCMFTTrackLabelCursorType& mcMFTTrackLabelCursor,
650 MCFwdTrackLabelCursorType& mcFwdTrackLabelCursor,
652 const gsl::span<const GIndex>& primVerGIs,
656 std::uint64_t fillBCSlice(
int (&slice)[2],
double tmin,
double tmax,
const std::map<uint64_t, int>& bcsMap)
const;
666 template <
typename TCaloHandler,
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
667 void addToCaloTable(TCaloHandler& caloHandler, TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
668 TMCCaloLabelCursor& mcCaloCellLabelCursor,
int eventID,
int bcID, int8_t caloType);
670 template <
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
671 void fillCaloTable(TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
672 TMCCaloLabelCursor& mcCaloCellLabelCursor,
const std::map<uint64_t, int>& bcsMap,
675 std::set<uint64_t> filterEMCALIncomplete(
const gsl::span<const o2::emcal::TriggerRecord> triggers);