222 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) {}
231 uint64_t relativeTime_to_LocalBC(
double relativeTimeStampInNS)
const
236 uint64_t relativeTime_to_GlobalBC(
double relativeTimeStampInNS)
const
238 return std::uint64_t(mStartIR.
toLong()) + relativeTime_to_LocalBC(relativeTimeStampInNS);
241 bool mThinTracks{
false};
242 bool mPropTracks{
false};
243 bool mPropMuons{
false};
244 float mTrackQCKeepGlobalTracks{
false};
245 float mTrackQCRetainOnlydEdx{
false};
246 float mTrackQCFraction{0.00};
248 float mTrackQCDCAxy{3.};
249 float mTrackQCPt{0.2};
250 int mTrackQCNCls{80};
251 float mSqrtS{13860.};
252 std::mt19937 mGenerator{};
255 float mMaxPropXiu{5.0f};
261 std::unordered_set<GIndex> mGIDUsedBySVtx;
262 std::unordered_set<GIndex> mGIDUsedByStr;
265 std::shared_ptr<o2::utils::TreeStreamRedirector> mStreamer;
269 bool mUseSigFiltMC =
false;
270 bool mEnableSV =
true;
271 bool mEnableFITextra =
false;
272 bool mEnableTRDextra =
false;
273 bool mFieldON =
false;
274 const float cSpeed = 0.029979246f;
282 TString mLPMProdTag{
""};
283 TString mAnchorPass{
""};
284 TString mAnchorProd{
""};
285 TString mRecoPass{
""};
286 TString mUser{
"aliprod"};
288 bool mEMCselectLeading{
false};
289 uint64_t mEMCALTrgClassMask = 0;
290 size_t mCurrentTRDTrigID = 0;
293 std::unordered_map<GIndex, int> mGIDToTableID;
296 std::unordered_map<GIndex, int> mGIDToTableFwdID;
297 int mTableTrFwdID{0};
299 std::unordered_map<GIndex, int> mGIDToTableMFTID;
300 int mTableTrMFTID{0};
302 std::unordered_map<GIndex, int> mVtxToTableCollID;
305 std::unordered_map<GIndex, int> mV0ToTableID;
309 std::vector<int> mVertexStrLUT;
310 std::vector<std::pair<int, int>> mCollisionStrTrk;
311 std::vector<int> mStrTrkIndices;
314 std::vector<int> mIndexTableFwd;
317 std::vector<int> mIndexTableMFT;
320 BunchCrossings mBCLookup;
324 std::array<float, o2::zdc::NChannels> mZDCEnergyMap;
325 std::array<float, o2::zdc::NTDCChannels> mZDCTDCMap;
327 std::vector<uint16_t> mITSTPCTRDTriggers;
328 std::vector<uint16_t> mTPCTRDTriggers;
329 std::vector<uint16_t> mITSROFs;
330 std::vector<uint16_t> mMFTROFs;
331 std::vector<uint16_t> mMCHROFs;
332 double mITSROFrameHalfLengthNS = -1;
333 double mMFTROFrameHalfLengthNS = -1;
334 double mITSROFBiasNS = 0;
335 double mMFTROFBiasNS = 0;
336 double mNSigmaTimeTrack = -1;
337 double mTimeMarginTrackTime = -1;
338 double mTPCBinNS = -1;
344 std::vector<std::vector<std::unordered_map<int, int>>> mToStore;
348 std::vector<TString> mMetaDataKeys;
349 std::vector<TString> mMetaDataVals;
351 std::shared_ptr<DataRequest> mDataRequest;
352 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
356 static constexpr int TOFTimePrecPS = 16;
358 uint32_t mCollisionPosition = 0xFFFFFFF0;
359 uint32_t mCollisionPositionCov = 0xFFFFE000;
360 uint32_t mTrackX = 0xFFFFFFF0;
361 uint32_t mTrackAlpha = 0xFFFFFFF0;
362 uint32_t mTrackSnp = 0xFFFFFF00;
363 uint32_t mTrackTgl = 0xFFFFFF00;
364 uint32_t mTrack1Pt = 0xFFFFFC00;
365 uint32_t mTrackCovDiag = 0xFFFFFF00;
366 uint32_t mTrackChi2 = 0xFFFF0000;
367 uint32_t mTrackCovOffDiag = 0xFFFF0000;
368 uint32_t mTrackSignal = 0xFFFFFF00;
369 uint32_t mTrackTime = 0xFFFFFFFF;
370 uint32_t mTPCTime0 = 0xFFFFFFE0;
371 uint32_t mTrackTimeError = 0xFFFFFF00;
372 uint32_t mTrackPosEMCAL = 0xFFFFFF00;
373 uint32_t mTracklets = 0xFFFFFF00;
374 uint32_t mMcParticleW = 0xFFFFFFF0;
375 uint32_t mMcParticlePos = 0xFFFFFFF0;
376 uint32_t mMcParticleMom = 0xFFFFFFF0;
377 uint32_t mCaloAmp = 0xFFFFFF00;
378 uint32_t mCaloTime = 0xFFFFFF00;
379 uint32_t mCPVPos = 0xFFFFF800;
380 uint32_t mCPVAmpl = 0xFFFFFF00;
381 uint32_t mMuonTr1P = 0xFFFFFC00;
382 uint32_t mMuonTrThetaX = 0xFFFFFF00;
383 uint32_t mMuonTrThetaY = 0xFFFFFF00;
384 uint32_t mMuonTrZmu = 0xFFFFFFF0;
385 uint32_t mMuonTrBend = 0xFFFFFFF0;
386 uint32_t mMuonTrNonBend = 0xFFFFFFF0;
387 uint32_t mMuonTrCov = 0xFFFF0000;
388 uint32_t mMuonCl = 0xFFFFFF00;
389 uint32_t mMuonClErr = 0xFFFF0000;
390 uint32_t mV0Time = 0xFFFFF000;
391 uint32_t mV0ChannelTime = 0xFFFFFF00;
392 uint32_t mFDDTime = 0xFFFFF000;
393 uint32_t mFDDChannelTime = 0xFFFFFF00;
394 uint32_t mT0Time = 0xFFFFFF00;
395 uint32_t mT0ChannelTime = 0xFFFFFFF0;
396 uint32_t mV0Amplitude = 0xFFFFF000;
397 uint32_t mFDDAmplitude = 0xFFFFF000;
398 uint32_t mT0Amplitude = 0xFFFFF000;
400 bool mCTPConfigPerRun =
false;
402 struct TrackExtraInfo {
403 float tpcInnerParam = 0.f;
405 uint32_t itsClusterSizes = 0u;
408 int8_t tpcNClsFindableMinusFound = 0;
409 int8_t tpcNClsFindableMinusPID = 0;
410 int8_t tpcNClsFindableMinusCrossedRows = 0;
413 float itsChi2NCl = -999.f;
414 float tpcChi2NCl = -999.f;
415 float trdChi2 = -999.f;
416 float tofChi2 = -999.f;
417 float tpcSignal = -999.f;
418 float trdSignal = -999.f;
420 float tofExpMom = -999.f;
421 float trackEtaEMCAL = -999.f;
422 float trackPhiEMCAL = -999.f;
423 float trackTime = -999.f;
424 float trackTimeRes = -999.f;
426 int bcSlice[2] = {-1, -1};
427 bool isTPConly =
false;
445 int8_t dRefContY{std::numeric_limits<int8_t>::min()};
446 int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
447 int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
448 int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
449 int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
450 int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
451 int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
452 int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
453 int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
454 int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
455 int8_t dTofdX{std::numeric_limits<int8_t>::min()};
456 int8_t dTofdZ{std::numeric_limits<int8_t>::min()};
460 struct FwdTrackInfo {
472 float chi2matchmchmid = -1.0;
473 float chi2matchmchmft = -1.0;
474 float matchscoremchmft = -1.0;
475 int matchmfttrackid = -1;
476 int matchmchtrackid = -1;
477 uint16_t mchBitMap = 0;
479 uint32_t midBoards = 0;
480 float trackTime = -999.f;
481 float trackTimeRes = -999.f;
485 struct FwdTrackCovInfo {
496 int8_t rhoTglPhi = 0;
499 int8_t rho1PtPhi = 0;
500 int8_t rho1PtTgl = 0;
506 uint32_t labelID = -1;
507 uint16_t labelMask = 0;
517 std::vector<TPCCounters> mTPCCounters;
525 const std::vector<o2::InteractionTimeRecord>& mcRecords,
526 std::map<uint64_t, int>& bcsMap);
528 template <
typename TracksCursorType,
typename TracksCovCursorType>
529 void addToTracksTable(TracksCursorType& tracksCursor, TracksCovCursorType& tracksCovCursor,
532 template <
typename TracksExtraCursorType>
533 void addToTracksExtraTable(TracksExtraCursorType& tracksExtraCursor, TrackExtraInfo& extraInfoHolder);
535 template <
typename TracksQACursorType>
536 void addToTracksQATable(TracksQACursorType& tracksQACursor, TrackQA& trackQAInfoHolder);
538 template <
typename TRDsExtraCursorType>
541 template <
typename mftTracksCursorType,
typename AmbigMFTTracksCursorType>
542 void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, AmbigMFTTracksCursorType& ambigMFTTracksCursor,
544 std::uint64_t collisionBC,
const std::map<uint64_t, int>& bcsMap);
546 template <
typename fwdTracksCursorType,
typename fwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename mftTracksCovCursorType>
547 void addToFwdTracksTable(fwdTracksCursorType& fwdTracksCursor, fwdTracksCovCursorType& fwdTracksCovCursor, AmbigFwdTracksCursorType& ambigFwdTracksCursor, mftTracksCovCursorType& mftTracksCovCursor,
554 void extrapolateToCalorimeters(TrackExtraInfo& extraInfoHolder,
const o2::track::TrackPar& track);
560 template <
typename TracksCursorType,
typename TracksCovCursorType,
typename TracksExtraCursorType,
typename TracksQACursorType,
typename TRDsExtraCursorType,
typename AmbigTracksCursorType,
561 typename MFTTracksCursorType,
typename MFTTracksCovCursorType,
typename AmbigMFTTracksCursorType,
562 typename FwdTracksCursorType,
typename FwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename FwdTrkClsCursorType>
563 void fillTrackTablesPerCollision(
int collisionID,
564 std::uint64_t collisionBC,
566 const gsl::span<const GIndex>& GIndices,
568 TracksCursorType& tracksCursor,
569 TracksCovCursorType& tracksCovCursor,
570 TracksExtraCursorType& tracksExtraCursor,
571 TracksQACursorType& tracksQACursor,
572 TRDsExtraCursorType& trdsExtraCursor,
573 AmbigTracksCursorType& ambigTracksCursor,
574 MFTTracksCursorType& mftTracksCursor,
575 MFTTracksCovCursorType& mftTracksCovCursor,
576 AmbigMFTTracksCursorType& ambigMFTTracksCursor,
577 FwdTracksCursorType& fwdTracksCursor,
578 FwdTracksCovCursorType& fwdTracksCovCursor,
579 AmbigFwdTracksCursorType& ambigFwdTracksCursor,
580 FwdTrkClsCursorType& fwdTrkClsCursor,
581 const std::map<uint64_t, int>& bcsMap);
583 template <
typename FwdTrkClsCursorType>
588 template <
typename V0CursorType,
typename CascadeCursorType,
typename Decay3bodyCursorType>
591 template <
typename HMPCursorType>
595 template <
typename V0C,
typename CC,
typename D3BC>
607 HepMCUpdate mXSectionUpdate = HepMCUpdate::anyKey;
608 HepMCUpdate mPdfInfoUpdate = HepMCUpdate::anyKey;
609 HepMCUpdate mHeavyIonUpdate = HepMCUpdate::anyKey;
647 void updateMCHeader(MCCollisionCursor& collisionCursor,
648 XSectionCursor& xSectionCursor,
649 PdfInfoCursor& pdfInfoCursor,
650 HeavyIonCursor& heavyIonCursor,
651 const MCEventHeader& header,
659 MCParticlesCursor& mcParticlesCursor,
660 const gsl::span<const o2::dataformats::VtxTrackRef>& primVer2TRefs,
661 const gsl::span<const GIndex>& GIndices,
663 const std::vector<std::vector<int>>& mcColToEvSrc);
665 template <
typename MCTrackLabelCursorType,
typename MCMFTTrackLabelCursorType,
typename MCFwdTrackLabelCursorType>
666 void fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTrackLabelCursor,
667 MCMFTTrackLabelCursorType& mcMFTTrackLabelCursor,
668 MCFwdTrackLabelCursorType& mcFwdTrackLabelCursor,
670 const gsl::span<const GIndex>& primVerGIs,
674 std::uint64_t fillBCSlice(
int (&slice)[2],
double tmin,
double tmax,
const std::map<uint64_t, int>& bcsMap)
const;
684 template <
typename TCaloHandler,
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
685 void addToCaloTable(TCaloHandler& caloHandler, TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
686 TMCCaloLabelCursor& mcCaloCellLabelCursor,
int eventID,
int bcID, int8_t caloType);
688 template <
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
689 void fillCaloTable(TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
690 TMCCaloLabelCursor& mcCaloCellLabelCursor,
const std::map<uint64_t, int>& bcsMap,
693 std::set<uint64_t> filterEMCALIncomplete(
const gsl::span<const o2::emcal::TriggerRecord> triggers);