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{
""};
274 TString mUser{
"aliprod"};
276 bool mEMCselectLeading{
false};
277 uint64_t mEMCALTrgClassMask = 0;
280 std::unordered_map<GIndex, int> mGIDToTableID;
283 std::unordered_map<GIndex, int> mGIDToTableFwdID;
284 int mTableTrFwdID{0};
286 std::unordered_map<GIndex, int> mGIDToTableMFTID;
287 int mTableTrMFTID{0};
289 std::unordered_map<GIndex, int> mVtxToTableCollID;
292 std::unordered_map<GIndex, int> mV0ToTableID;
296 std::vector<int> mVertexStrLUT;
297 std::vector<std::pair<int, int>> mCollisionStrTrk;
298 std::vector<int> mStrTrkIndices;
301 std::vector<int> mIndexTableFwd;
304 std::vector<int> mIndexTableMFT;
307 BunchCrossings mBCLookup;
311 std::array<float, o2::zdc::NChannels> mZDCEnergyMap;
312 std::array<float, o2::zdc::NTDCChannels> mZDCTDCMap;
314 std::vector<uint16_t> mITSTPCTRDTriggers;
315 std::vector<uint16_t> mTPCTRDTriggers;
316 std::vector<uint16_t> mITSROFs;
317 std::vector<uint16_t> mMFTROFs;
318 std::vector<uint16_t> mMCHROFs;
319 double mITSROFrameHalfLengthNS = -1;
320 double mMFTROFrameHalfLengthNS = -1;
321 double mITSROFBiasNS = 0;
322 double mMFTROFBiasNS = 0;
323 double mNSigmaTimeTrack = -1;
324 double mTimeMarginTrackTime = -1;
325 double mTPCBinNS = -1;
331 std::vector<std::vector<std::unordered_map<int, int>>> mToStore;
335 std::vector<TString> mMetaDataKeys;
336 std::vector<TString> mMetaDataVals;
338 std::shared_ptr<DataRequest> mDataRequest;
339 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
343 static constexpr int TOFTimePrecPS = 16;
345 uint32_t mCollisionPosition = 0xFFFFFFF0;
346 uint32_t mCollisionPositionCov = 0xFFFFE000;
347 uint32_t mTrackX = 0xFFFFFFF0;
348 uint32_t mTrackAlpha = 0xFFFFFFF0;
349 uint32_t mTrackSnp = 0xFFFFFF00;
350 uint32_t mTrackTgl = 0xFFFFFF00;
351 uint32_t mTrack1Pt = 0xFFFFFC00;
352 uint32_t mTrackCovDiag = 0xFFFFFF00;
353 uint32_t mTrackChi2 = 0xFFFF0000;
354 uint32_t mTrackCovOffDiag = 0xFFFF0000;
355 uint32_t mTrackSignal = 0xFFFFFF00;
356 uint32_t mTrackTime = 0xFFFFFFFF;
357 uint32_t mTPCTime0 = 0xFFFFFFE0;
358 uint32_t mTrackTimeError = 0xFFFFFF00;
359 uint32_t mTrackPosEMCAL = 0xFFFFFF00;
360 uint32_t mTracklets = 0xFFFFFF00;
361 uint32_t mMcParticleW = 0xFFFFFFF0;
362 uint32_t mMcParticlePos = 0xFFFFFFF0;
363 uint32_t mMcParticleMom = 0xFFFFFFF0;
364 uint32_t mCaloAmp = 0xFFFFFF00;
365 uint32_t mCaloTime = 0xFFFFFF00;
366 uint32_t mCPVPos = 0xFFFFF800;
367 uint32_t mCPVAmpl = 0xFFFFFF00;
368 uint32_t mMuonTr1P = 0xFFFFFC00;
369 uint32_t mMuonTrThetaX = 0xFFFFFF00;
370 uint32_t mMuonTrThetaY = 0xFFFFFF00;
371 uint32_t mMuonTrZmu = 0xFFFFFFF0;
372 uint32_t mMuonTrBend = 0xFFFFFFF0;
373 uint32_t mMuonTrNonBend = 0xFFFFFFF0;
374 uint32_t mMuonTrCov = 0xFFFF0000;
375 uint32_t mMuonCl = 0xFFFFFF00;
376 uint32_t mMuonClErr = 0xFFFF0000;
377 uint32_t mV0Time = 0xFFFFF000;
378 uint32_t mV0ChannelTime = 0xFFFFFF00;
379 uint32_t mFDDTime = 0xFFFFF000;
380 uint32_t mFDDChannelTime = 0xFFFFFF00;
381 uint32_t mT0Time = 0xFFFFFF00;
382 uint32_t mT0ChannelTime = 0xFFFFFFF0;
383 uint32_t mV0Amplitude = 0xFFFFF000;
384 uint32_t mFDDAmplitude = 0xFFFFF000;
385 uint32_t mT0Amplitude = 0xFFFFF000;
387 bool mCTPConfigPerRun =
false;
389 struct TrackExtraInfo {
390 float tpcInnerParam = 0.f;
392 uint32_t itsClusterSizes = 0u;
395 int8_t tpcNClsFindableMinusFound = 0;
396 int8_t tpcNClsFindableMinusPID = 0;
397 int8_t tpcNClsFindableMinusCrossedRows = 0;
400 float itsChi2NCl = -999.f;
401 float tpcChi2NCl = -999.f;
402 float trdChi2 = -999.f;
403 float tofChi2 = -999.f;
404 float tpcSignal = -999.f;
405 float trdSignal = -999.f;
407 float tofExpMom = -999.f;
408 float trackEtaEMCAL = -999.f;
409 float trackPhiEMCAL = -999.f;
410 float trackTime = -999.f;
411 float trackTimeRes = -999.f;
413 int bcSlice[2] = {-1, -1};
414 bool isTPConly =
false;
432 int8_t dRefContY{std::numeric_limits<int8_t>::min()};
433 int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
434 int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
435 int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
436 int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
437 int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
438 int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
439 int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
440 int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
441 int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
442 int8_t dTofdX{std::numeric_limits<int8_t>::min()};
443 int8_t dTofdZ{std::numeric_limits<int8_t>::min()};
447 struct FwdTrackInfo {
459 float chi2matchmchmid = -1.0;
460 float chi2matchmchmft = -1.0;
461 float matchscoremchmft = -1.0;
462 int matchmfttrackid = -1;
463 int matchmchtrackid = -1;
464 uint16_t mchBitMap = 0;
466 uint32_t midBoards = 0;
467 float trackTime = -999.f;
468 float trackTimeRes = -999.f;
472 struct FwdTrackCovInfo {
483 int8_t rhoTglPhi = 0;
486 int8_t rho1PtPhi = 0;
487 int8_t rho1PtTgl = 0;
493 uint32_t labelID = -1;
494 uint16_t labelMask = 0;
504 std::vector<TPCCounters> mTPCCounters;
512 const std::vector<o2::InteractionTimeRecord>& mcRecords,
513 std::map<uint64_t, int>& bcsMap);
515 template <
typename TracksCursorType,
typename TracksCovCursorType>
516 void addToTracksTable(TracksCursorType& tracksCursor, TracksCovCursorType& tracksCovCursor,
519 template <
typename TracksExtraCursorType>
520 void addToTracksExtraTable(TracksExtraCursorType& tracksExtraCursor, TrackExtraInfo& extraInfoHolder);
522 template <
typename TracksQACursorType>
523 void addToTracksQATable(TracksQACursorType& tracksQACursor, TrackQA& trackQAInfoHolder);
525 template <
typename mftTracksCursorType,
typename AmbigMFTTracksCursorType>
526 void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, AmbigMFTTracksCursorType& ambigMFTTracksCursor,
528 std::uint64_t collisionBC,
const std::map<uint64_t, int>& bcsMap);
530 template <
typename fwdTracksCursorType,
typename fwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename mftTracksCovCursorType>
531 void addToFwdTracksTable(fwdTracksCursorType& fwdTracksCursor, fwdTracksCovCursorType& fwdTracksCovCursor, AmbigFwdTracksCursorType& ambigFwdTracksCursor, mftTracksCovCursorType& mftTracksCovCursor,
538 void extrapolateToCalorimeters(TrackExtraInfo& extraInfoHolder,
const o2::track::TrackPar& track);
544 template <
typename TracksCursorType,
typename TracksCovCursorType,
typename TracksExtraCursorType,
typename TracksQACursorType,
typename AmbigTracksCursorType,
545 typename MFTTracksCursorType,
typename MFTTracksCovCursorType,
typename AmbigMFTTracksCursorType,
546 typename FwdTracksCursorType,
typename FwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename FwdTrkClsCursorType>
547 void fillTrackTablesPerCollision(
int collisionID,
548 std::uint64_t collisionBC,
550 const gsl::span<const GIndex>& GIndices,
552 TracksCursorType& tracksCursor,
553 TracksCovCursorType& tracksCovCursor,
554 TracksExtraCursorType& tracksExtraCursor,
555 TracksQACursorType& tracksQACursor,
556 AmbigTracksCursorType& ambigTracksCursor,
557 MFTTracksCursorType& mftTracksCursor,
558 MFTTracksCovCursorType& mftTracksCovCursor,
559 AmbigMFTTracksCursorType& ambigMFTTracksCursor,
560 FwdTracksCursorType& fwdTracksCursor,
561 FwdTracksCovCursorType& fwdTracksCovCursor,
562 AmbigFwdTracksCursorType& ambigFwdTracksCursor,
563 FwdTrkClsCursorType& fwdTrkClsCursor,
564 const std::map<uint64_t, int>& bcsMap);
566 template <
typename FwdTrkClsCursorType>
571 template <
typename V0CursorType,
typename CascadeCursorType,
typename Decay3bodyCursorType>
574 template <
typename HMPCursorType>
578 template <
typename V0C,
typename CC,
typename D3BC>
590 HepMCUpdate mXSectionUpdate = HepMCUpdate::anyKey;
591 HepMCUpdate mPdfInfoUpdate = HepMCUpdate::anyKey;
592 HepMCUpdate mHeavyIonUpdate = HepMCUpdate::anyKey;
630 void updateMCHeader(MCCollisionCursor& collisionCursor,
631 XSectionCursor& xSectionCursor,
632 PdfInfoCursor& pdfInfoCursor,
633 HeavyIonCursor& heavyIonCursor,
634 const MCEventHeader& header,
642 MCParticlesCursor& mcParticlesCursor,
643 const gsl::span<const o2::dataformats::VtxTrackRef>& primVer2TRefs,
644 const gsl::span<const GIndex>& GIndices,
646 const std::vector<std::vector<int>>& mcColToEvSrc);
648 template <
typename MCTrackLabelCursorType,
typename MCMFTTrackLabelCursorType,
typename MCFwdTrackLabelCursorType>
649 void fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTrackLabelCursor,
650 MCMFTTrackLabelCursorType& mcMFTTrackLabelCursor,
651 MCFwdTrackLabelCursorType& mcFwdTrackLabelCursor,
653 const gsl::span<const GIndex>& primVerGIs,
657 std::uint64_t fillBCSlice(
int (&slice)[2],
double tmin,
double tmax,
const std::map<uint64_t, int>& bcsMap)
const;
667 template <
typename TCaloHandler,
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
668 void addToCaloTable(TCaloHandler& caloHandler, TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
669 TMCCaloLabelCursor& mcCaloCellLabelCursor,
int eventID,
int bcID, int8_t caloType);
671 template <
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
672 void fillCaloTable(TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
673 TMCCaloLabelCursor& mcCaloCellLabelCursor,
const std::map<uint64_t, int>& bcsMap,
676 std::set<uint64_t> filterEMCALIncomplete(
const gsl::span<const o2::emcal::TriggerRecord> triggers);