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 mTrackQCKeepGlobalTracks{
false};
241 float mTrackQCRetainOnlydEdx{
false};
242 float mTrackQCFraction{0.00};
244 float mTrackQCDCAxy{3.};
245 float mTrackQCPt{0.2};
246 int mTrackQCNCls{80};
247 float mSqrtS{13860.};
248 std::mt19937 mGenerator{};
251 float mMaxPropXiu{5.0f};
253 std::unordered_set<GIndex> mGIDUsedBySVtx;
254 std::unordered_set<GIndex> mGIDUsedByStr;
257 std::shared_ptr<o2::utils::TreeStreamRedirector> mStreamer;
261 bool mUseSigFiltMC =
false;
262 bool mEnableSV =
true;
263 bool mEnableFITextra =
false;
264 bool mFieldON =
false;
265 const float cSpeed = 0.029979246f;
273 TString mLPMProdTag{
""};
274 TString mAnchorPass{
""};
275 TString mAnchorProd{
""};
276 TString mRecoPass{
""};
277 TString mUser{
"aliprod"};
279 bool mEMCselectLeading{
false};
280 uint64_t mEMCALTrgClassMask = 0;
283 std::unordered_map<GIndex, int> mGIDToTableID;
286 std::unordered_map<GIndex, int> mGIDToTableFwdID;
287 int mTableTrFwdID{0};
289 std::unordered_map<GIndex, int> mGIDToTableMFTID;
290 int mTableTrMFTID{0};
292 std::unordered_map<GIndex, int> mVtxToTableCollID;
295 std::unordered_map<GIndex, int> mV0ToTableID;
299 std::vector<int> mVertexStrLUT;
300 std::vector<std::pair<int, int>> mCollisionStrTrk;
301 std::vector<int> mStrTrkIndices;
304 std::vector<int> mIndexTableFwd;
307 std::vector<int> mIndexTableMFT;
310 BunchCrossings mBCLookup;
314 std::array<float, o2::zdc::NChannels> mZDCEnergyMap;
315 std::array<float, o2::zdc::NTDCChannels> mZDCTDCMap;
317 std::vector<uint16_t> mITSTPCTRDTriggers;
318 std::vector<uint16_t> mTPCTRDTriggers;
319 std::vector<uint16_t> mITSROFs;
320 std::vector<uint16_t> mMFTROFs;
321 std::vector<uint16_t> mMCHROFs;
322 double mITSROFrameHalfLengthNS = -1;
323 double mMFTROFrameHalfLengthNS = -1;
324 double mITSROFBiasNS = 0;
325 double mMFTROFBiasNS = 0;
326 double mNSigmaTimeTrack = -1;
327 double mTimeMarginTrackTime = -1;
328 double mTPCBinNS = -1;
334 std::vector<std::vector<std::unordered_map<int, int>>> mToStore;
338 std::vector<TString> mMetaDataKeys;
339 std::vector<TString> mMetaDataVals;
341 std::shared_ptr<DataRequest> mDataRequest;
342 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
346 static constexpr int TOFTimePrecPS = 16;
348 uint32_t mCollisionPosition = 0xFFFFFFF0;
349 uint32_t mCollisionPositionCov = 0xFFFFE000;
350 uint32_t mTrackX = 0xFFFFFFF0;
351 uint32_t mTrackAlpha = 0xFFFFFFF0;
352 uint32_t mTrackSnp = 0xFFFFFF00;
353 uint32_t mTrackTgl = 0xFFFFFF00;
354 uint32_t mTrack1Pt = 0xFFFFFC00;
355 uint32_t mTrackCovDiag = 0xFFFFFF00;
356 uint32_t mTrackChi2 = 0xFFFF0000;
357 uint32_t mTrackCovOffDiag = 0xFFFF0000;
358 uint32_t mTrackSignal = 0xFFFFFF00;
359 uint32_t mTrackTime = 0xFFFFFFFF;
360 uint32_t mTPCTime0 = 0xFFFFFFE0;
361 uint32_t mTrackTimeError = 0xFFFFFF00;
362 uint32_t mTrackPosEMCAL = 0xFFFFFF00;
363 uint32_t mTracklets = 0xFFFFFF00;
364 uint32_t mMcParticleW = 0xFFFFFFF0;
365 uint32_t mMcParticlePos = 0xFFFFFFF0;
366 uint32_t mMcParticleMom = 0xFFFFFFF0;
367 uint32_t mCaloAmp = 0xFFFFFF00;
368 uint32_t mCaloTime = 0xFFFFFF00;
369 uint32_t mCPVPos = 0xFFFFF800;
370 uint32_t mCPVAmpl = 0xFFFFFF00;
371 uint32_t mMuonTr1P = 0xFFFFFC00;
372 uint32_t mMuonTrThetaX = 0xFFFFFF00;
373 uint32_t mMuonTrThetaY = 0xFFFFFF00;
374 uint32_t mMuonTrZmu = 0xFFFFFFF0;
375 uint32_t mMuonTrBend = 0xFFFFFFF0;
376 uint32_t mMuonTrNonBend = 0xFFFFFFF0;
377 uint32_t mMuonTrCov = 0xFFFF0000;
378 uint32_t mMuonCl = 0xFFFFFF00;
379 uint32_t mMuonClErr = 0xFFFF0000;
380 uint32_t mV0Time = 0xFFFFF000;
381 uint32_t mV0ChannelTime = 0xFFFFFF00;
382 uint32_t mFDDTime = 0xFFFFF000;
383 uint32_t mFDDChannelTime = 0xFFFFFF00;
384 uint32_t mT0Time = 0xFFFFFF00;
385 uint32_t mT0ChannelTime = 0xFFFFFFF0;
386 uint32_t mV0Amplitude = 0xFFFFF000;
387 uint32_t mFDDAmplitude = 0xFFFFF000;
388 uint32_t mT0Amplitude = 0xFFFFF000;
390 bool mCTPConfigPerRun =
false;
392 struct TrackExtraInfo {
393 float tpcInnerParam = 0.f;
395 uint32_t itsClusterSizes = 0u;
398 int8_t tpcNClsFindableMinusFound = 0;
399 int8_t tpcNClsFindableMinusPID = 0;
400 int8_t tpcNClsFindableMinusCrossedRows = 0;
403 float itsChi2NCl = -999.f;
404 float tpcChi2NCl = -999.f;
405 float trdChi2 = -999.f;
406 float tofChi2 = -999.f;
407 float tpcSignal = -999.f;
408 float trdSignal = -999.f;
410 float tofExpMom = -999.f;
411 float trackEtaEMCAL = -999.f;
412 float trackPhiEMCAL = -999.f;
413 float trackTime = -999.f;
414 float trackTimeRes = -999.f;
416 int bcSlice[2] = {-1, -1};
417 bool isTPConly =
false;
435 int8_t dRefContY{std::numeric_limits<int8_t>::min()};
436 int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
437 int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
438 int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
439 int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
440 int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
441 int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
442 int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
443 int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
444 int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
445 int8_t dTofdX{std::numeric_limits<int8_t>::min()};
446 int8_t dTofdZ{std::numeric_limits<int8_t>::min()};
450 struct FwdTrackInfo {
462 float chi2matchmchmid = -1.0;
463 float chi2matchmchmft = -1.0;
464 float matchscoremchmft = -1.0;
465 int matchmfttrackid = -1;
466 int matchmchtrackid = -1;
467 uint16_t mchBitMap = 0;
469 uint32_t midBoards = 0;
470 float trackTime = -999.f;
471 float trackTimeRes = -999.f;
475 struct FwdTrackCovInfo {
486 int8_t rhoTglPhi = 0;
489 int8_t rho1PtPhi = 0;
490 int8_t rho1PtTgl = 0;
496 uint32_t labelID = -1;
497 uint16_t labelMask = 0;
507 std::vector<TPCCounters> mTPCCounters;
515 const std::vector<o2::InteractionTimeRecord>& mcRecords,
516 std::map<uint64_t, int>& bcsMap);
518 template <
typename TracksCursorType,
typename TracksCovCursorType>
519 void addToTracksTable(TracksCursorType& tracksCursor, TracksCovCursorType& tracksCovCursor,
522 template <
typename TracksExtraCursorType>
523 void addToTracksExtraTable(TracksExtraCursorType& tracksExtraCursor, TrackExtraInfo& extraInfoHolder);
525 template <
typename TracksQACursorType>
526 void addToTracksQATable(TracksQACursorType& tracksQACursor, TrackQA& trackQAInfoHolder);
528 template <
typename mftTracksCursorType,
typename AmbigMFTTracksCursorType>
529 void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, AmbigMFTTracksCursorType& ambigMFTTracksCursor,
531 std::uint64_t collisionBC,
const std::map<uint64_t, int>& bcsMap);
533 template <
typename fwdTracksCursorType,
typename fwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename mftTracksCovCursorType>
534 void addToFwdTracksTable(fwdTracksCursorType& fwdTracksCursor, fwdTracksCovCursorType& fwdTracksCovCursor, AmbigFwdTracksCursorType& ambigFwdTracksCursor, mftTracksCovCursorType& mftTracksCovCursor,
541 void extrapolateToCalorimeters(TrackExtraInfo& extraInfoHolder,
const o2::track::TrackPar& track);
547 template <
typename TracksCursorType,
typename TracksCovCursorType,
typename TracksExtraCursorType,
typename TracksQACursorType,
typename AmbigTracksCursorType,
548 typename MFTTracksCursorType,
typename MFTTracksCovCursorType,
typename AmbigMFTTracksCursorType,
549 typename FwdTracksCursorType,
typename FwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename FwdTrkClsCursorType>
550 void fillTrackTablesPerCollision(
int collisionID,
551 std::uint64_t collisionBC,
553 const gsl::span<const GIndex>& GIndices,
555 TracksCursorType& tracksCursor,
556 TracksCovCursorType& tracksCovCursor,
557 TracksExtraCursorType& tracksExtraCursor,
558 TracksQACursorType& tracksQACursor,
559 AmbigTracksCursorType& ambigTracksCursor,
560 MFTTracksCursorType& mftTracksCursor,
561 MFTTracksCovCursorType& mftTracksCovCursor,
562 AmbigMFTTracksCursorType& ambigMFTTracksCursor,
563 FwdTracksCursorType& fwdTracksCursor,
564 FwdTracksCovCursorType& fwdTracksCovCursor,
565 AmbigFwdTracksCursorType& ambigFwdTracksCursor,
566 FwdTrkClsCursorType& fwdTrkClsCursor,
567 const std::map<uint64_t, int>& bcsMap);
569 template <
typename FwdTrkClsCursorType>
574 template <
typename V0CursorType,
typename CascadeCursorType,
typename Decay3bodyCursorType>
577 template <
typename HMPCursorType>
581 template <
typename V0C,
typename CC,
typename D3BC>
593 HepMCUpdate mXSectionUpdate = HepMCUpdate::anyKey;
594 HepMCUpdate mPdfInfoUpdate = HepMCUpdate::anyKey;
595 HepMCUpdate mHeavyIonUpdate = HepMCUpdate::anyKey;
633 void updateMCHeader(MCCollisionCursor& collisionCursor,
634 XSectionCursor& xSectionCursor,
635 PdfInfoCursor& pdfInfoCursor,
636 HeavyIonCursor& heavyIonCursor,
637 const MCEventHeader& header,
645 MCParticlesCursor& mcParticlesCursor,
646 const gsl::span<const o2::dataformats::VtxTrackRef>& primVer2TRefs,
647 const gsl::span<const GIndex>& GIndices,
649 const std::vector<std::vector<int>>& mcColToEvSrc);
651 template <
typename MCTrackLabelCursorType,
typename MCMFTTrackLabelCursorType,
typename MCFwdTrackLabelCursorType>
652 void fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTrackLabelCursor,
653 MCMFTTrackLabelCursorType& mcMFTTrackLabelCursor,
654 MCFwdTrackLabelCursorType& mcFwdTrackLabelCursor,
656 const gsl::span<const GIndex>& primVerGIs,
660 std::uint64_t fillBCSlice(
int (&slice)[2],
double tmin,
double tmax,
const std::map<uint64_t, int>& bcsMap)
const;
670 template <
typename TCaloHandler,
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
671 void addToCaloTable(TCaloHandler& caloHandler, TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
672 TMCCaloLabelCursor& mcCaloCellLabelCursor,
int eventID,
int bcID, int8_t caloType);
674 template <
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
675 void fillCaloTable(TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
676 TMCCaloLabelCursor& mcCaloCellLabelCursor,
const std::map<uint64_t, int>& bcsMap,
679 std::set<uint64_t> filterEMCALIncomplete(
const gsl::span<const o2::emcal::TriggerRecord> triggers);