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 std::string mAODParent{
""};
287 TString mUser{
"aliprod"};
289 bool mEMCselectLeading{
false};
290 uint64_t mEMCALTrgClassMask = 0;
291 size_t mCurrentTRDTrigID = 0;
294 std::unordered_map<GIndex, int> mGIDToTableID;
297 std::unordered_map<GIndex, int> mGIDToTableFwdID;
298 int mTableTrFwdID{0};
300 std::unordered_map<GIndex, int> mGIDToTableMFTID;
301 int mTableTrMFTID{0};
303 std::unordered_map<GIndex, int> mVtxToTableCollID;
306 std::unordered_map<GIndex, int> mV0ToTableID;
310 std::vector<int> mVertexStrLUT;
311 std::vector<std::pair<int, int>> mCollisionStrTrk;
312 std::vector<int> mStrTrkIndices;
315 std::vector<int> mIndexTableFwd;
318 std::vector<int> mIndexTableMFT;
321 BunchCrossings mBCLookup;
325 std::array<float, o2::zdc::NChannels> mZDCEnergyMap;
326 std::array<float, o2::zdc::NTDCChannels> mZDCTDCMap;
328 std::vector<uint16_t> mITSTPCTRDTriggers;
329 std::vector<uint16_t> mTPCTRDTriggers;
330 std::vector<uint16_t> mITSROFs;
331 std::vector<uint16_t> mMFTROFs;
332 std::vector<uint16_t> mMCHROFs;
333 double mITSROFrameHalfLengthNS = -1;
334 double mMFTROFrameHalfLengthNS = -1;
335 double mITSROFBiasNS = 0;
336 double mMFTROFBiasNS = 0;
337 double mNSigmaTimeTrack = -1;
338 double mTimeMarginTrackTime = -1;
339 double mTPCBinNS = -1;
345 std::vector<std::vector<std::unordered_map<int, int>>> mToStore;
349 std::vector<TString> mMetaDataKeys;
350 std::vector<TString> mMetaDataVals;
352 std::shared_ptr<DataRequest> mDataRequest;
353 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
357 static constexpr int TOFTimePrecPS = 16;
359 uint32_t mCollisionPosition = 0xFFFFFFF0;
360 uint32_t mCollisionPositionCov = 0xFFFFE000;
361 uint32_t mTrackX = 0xFFFFFFF0;
362 uint32_t mTrackAlpha = 0xFFFFFFF0;
363 uint32_t mTrackSnp = 0xFFFFFF00;
364 uint32_t mTrackTgl = 0xFFFFFF00;
365 uint32_t mTrack1Pt = 0xFFFFFC00;
366 uint32_t mTrackCovDiag = 0xFFFFFF00;
367 uint32_t mTrackChi2 = 0xFFFF0000;
368 uint32_t mTrackCovOffDiag = 0xFFFF0000;
369 uint32_t mTrackSignal = 0xFFFFFF00;
370 uint32_t mTrackTime = 0xFFFFFFFF;
371 uint32_t mTPCTime0 = 0xFFFFFFE0;
372 uint32_t mTrackTimeError = 0xFFFFFF00;
373 uint32_t mTrackPosEMCAL = 0xFFFFFF00;
374 uint32_t mTracklets = 0xFFFFFF00;
375 uint32_t mMcParticleW = 0xFFFFFFF0;
376 uint32_t mMcParticlePos = 0xFFFFFFF0;
377 uint32_t mMcParticleMom = 0xFFFFFFF0;
378 uint32_t mCaloAmp = 0xFFFFFF00;
379 uint32_t mCaloTime = 0xFFFFFF00;
380 uint32_t mCPVPos = 0xFFFFF800;
381 uint32_t mCPVAmpl = 0xFFFFFF00;
382 uint32_t mMuonTr1P = 0xFFFFFC00;
383 uint32_t mMuonTrThetaX = 0xFFFFFF00;
384 uint32_t mMuonTrThetaY = 0xFFFFFF00;
385 uint32_t mMuonTrZmu = 0xFFFFFFF0;
386 uint32_t mMuonTrBend = 0xFFFFFFF0;
387 uint32_t mMuonTrNonBend = 0xFFFFFFF0;
388 uint32_t mMuonTrCov = 0xFFFF0000;
389 uint32_t mMuonCl = 0xFFFFFF00;
390 uint32_t mMuonClErr = 0xFFFF0000;
391 uint32_t mV0Time = 0xFFFFF000;
392 uint32_t mV0ChannelTime = 0xFFFFFF00;
393 uint32_t mFDDTime = 0xFFFFF000;
394 uint32_t mFDDChannelTime = 0xFFFFFF00;
395 uint32_t mT0Time = 0xFFFFFF00;
396 uint32_t mT0ChannelTime = 0xFFFFFFF0;
397 uint32_t mV0Amplitude = 0xFFFFF000;
398 uint32_t mFDDAmplitude = 0xFFFFF000;
399 uint32_t mT0Amplitude = 0xFFFFF000;
401 bool mCTPConfigPerRun =
false;
403 struct TrackExtraInfo {
404 float tpcInnerParam = 0.f;
406 uint32_t itsClusterSizes = 0u;
409 int8_t tpcNClsFindableMinusFound = 0;
410 int8_t tpcNClsFindableMinusPID = 0;
411 int8_t tpcNClsFindableMinusCrossedRows = 0;
414 float itsChi2NCl = -999.f;
415 float tpcChi2NCl = -999.f;
416 float trdChi2 = -999.f;
417 float tofChi2 = -999.f;
418 float tpcSignal = -999.f;
419 float trdSignal = -999.f;
421 float tofExpMom = -999.f;
422 float trackEtaEMCAL = -999.f;
423 float trackPhiEMCAL = -999.f;
424 float trackTime = -999.f;
425 float trackTimeRes = -999.f;
427 int bcSlice[2] = {-1, -1};
428 bool isTPConly =
false;
446 int8_t dRefContY{std::numeric_limits<int8_t>::min()};
447 int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
448 int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
449 int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
450 int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
451 int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
452 int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
453 int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
454 int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
455 int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
456 int8_t dTofdX{std::numeric_limits<int8_t>::min()};
457 int8_t dTofdZ{std::numeric_limits<int8_t>::min()};
461 struct FwdTrackInfo {
473 float chi2matchmchmid = -1.0;
474 float chi2matchmchmft = -1.0;
475 float matchscoremchmft = -1.0;
476 int matchmfttrackid = -1;
477 int matchmchtrackid = -1;
478 uint16_t mchBitMap = 0;
480 uint32_t midBoards = 0;
481 float trackTime = -999.f;
482 float trackTimeRes = -999.f;
486 struct FwdTrackCovInfo {
497 int8_t rhoTglPhi = 0;
500 int8_t rho1PtPhi = 0;
501 int8_t rho1PtTgl = 0;
507 uint32_t labelID = -1;
508 uint16_t labelMask = 0;
518 std::vector<TPCCounters> mTPCCounters;
526 const std::vector<o2::InteractionTimeRecord>& mcRecords,
527 std::map<uint64_t, int>& bcsMap);
529 template <
typename TracksCursorType,
typename TracksCovCursorType>
530 void addToTracksTable(TracksCursorType& tracksCursor, TracksCovCursorType& tracksCovCursor,
533 template <
typename TracksExtraCursorType>
534 void addToTracksExtraTable(TracksExtraCursorType& tracksExtraCursor, TrackExtraInfo& extraInfoHolder);
536 template <
typename TracksQACursorType>
537 void addToTracksQATable(TracksQACursorType& tracksQACursor, TrackQA& trackQAInfoHolder);
539 template <
typename TRDsExtraCursorType>
542 template <
typename mftTracksCursorType,
typename AmbigMFTTracksCursorType>
543 void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, AmbigMFTTracksCursorType& ambigMFTTracksCursor,
545 std::uint64_t collisionBC,
const std::map<uint64_t, int>& bcsMap);
547 template <
typename fwdTracksCursorType,
typename fwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename mftTracksCovCursorType>
548 void addToFwdTracksTable(fwdTracksCursorType& fwdTracksCursor, fwdTracksCovCursorType& fwdTracksCovCursor, AmbigFwdTracksCursorType& ambigFwdTracksCursor, mftTracksCovCursorType& mftTracksCovCursor,
555 void extrapolateToCalorimeters(TrackExtraInfo& extraInfoHolder,
const o2::track::TrackPar& track);
561 template <
typename TracksCursorType,
typename TracksCovCursorType,
typename TracksExtraCursorType,
typename TracksQACursorType,
typename TRDsExtraCursorType,
typename AmbigTracksCursorType,
562 typename MFTTracksCursorType,
typename MFTTracksCovCursorType,
typename AmbigMFTTracksCursorType,
563 typename FwdTracksCursorType,
typename FwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename FwdTrkClsCursorType>
564 void fillTrackTablesPerCollision(
int collisionID,
565 std::uint64_t collisionBC,
567 const gsl::span<const GIndex>& GIndices,
569 TracksCursorType& tracksCursor,
570 TracksCovCursorType& tracksCovCursor,
571 TracksExtraCursorType& tracksExtraCursor,
572 TracksQACursorType& tracksQACursor,
573 TRDsExtraCursorType& trdsExtraCursor,
574 AmbigTracksCursorType& ambigTracksCursor,
575 MFTTracksCursorType& mftTracksCursor,
576 MFTTracksCovCursorType& mftTracksCovCursor,
577 AmbigMFTTracksCursorType& ambigMFTTracksCursor,
578 FwdTracksCursorType& fwdTracksCursor,
579 FwdTracksCovCursorType& fwdTracksCovCursor,
580 AmbigFwdTracksCursorType& ambigFwdTracksCursor,
581 FwdTrkClsCursorType& fwdTrkClsCursor,
582 const std::map<uint64_t, int>& bcsMap);
584 template <
typename FwdTrkClsCursorType>
589 template <
typename V0CursorType,
typename CascadeCursorType,
typename Decay3bodyCursorType>
592 template <
typename HMPCursorType>
596 template <
typename V0C,
typename CC,
typename D3BC>
608 HepMCUpdate mXSectionUpdate = HepMCUpdate::anyKey;
609 HepMCUpdate mPdfInfoUpdate = HepMCUpdate::anyKey;
610 HepMCUpdate mHeavyIonUpdate = HepMCUpdate::anyKey;
648 void updateMCHeader(MCCollisionCursor& collisionCursor,
649 XSectionCursor& xSectionCursor,
650 PdfInfoCursor& pdfInfoCursor,
651 HeavyIonCursor& heavyIonCursor,
652 const MCEventHeader& header,
660 MCParticlesCursor& mcParticlesCursor,
661 const gsl::span<const o2::dataformats::VtxTrackRef>& primVer2TRefs,
662 const gsl::span<const GIndex>& GIndices,
664 const std::vector<std::vector<int>>& mcColToEvSrc);
666 template <
typename MCTrackLabelCursorType,
typename MCMFTTrackLabelCursorType,
typename MCFwdTrackLabelCursorType>
667 void fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTrackLabelCursor,
668 MCMFTTrackLabelCursorType& mcMFTTrackLabelCursor,
669 MCFwdTrackLabelCursorType& mcFwdTrackLabelCursor,
671 const gsl::span<const GIndex>& primVerGIs,
675 std::uint64_t fillBCSlice(
int (&slice)[2],
double tmin,
double tmax,
const std::map<uint64_t, int>& bcsMap)
const;
685 template <
typename TCaloHandler,
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
686 void addToCaloTable(TCaloHandler& caloHandler, TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
687 TMCCaloLabelCursor& mcCaloCellLabelCursor,
int eventID,
int bcID, int8_t caloType);
689 template <
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
690 void fillCaloTable(TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
691 TMCCaloLabelCursor& mcCaloCellLabelCursor,
const std::map<uint64_t, int>& bcsMap,
694 std::set<uint64_t> filterEMCALIncomplete(
const gsl::span<const o2::emcal::TriggerRecord> triggers);