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{};
249 float mMaxPropXiu{5.0f};
251 std::unordered_set<GIndex> mGIDUsedBySVtx;
252 std::unordered_set<GIndex> mGIDUsedByStr;
255 std::shared_ptr<o2::utils::TreeStreamRedirector> mStreamer;
259 bool mUseSigFiltMC =
false;
260 bool mEnableSV =
true;
261 bool mEnableFITextra =
false;
262 bool mFieldON =
false;
263 const float cSpeed = 0.029979246f;
266 int64_t mTFNumber{-1};
271 TString mLPMProdTag{
""};
272 TString mAnchorPass{
""};
273 TString mAnchorProd{
""};
274 TString mRecoPass{
""};
275 TString mUser{
"aliprod"};
277 bool mEMCselectLeading{
false};
278 uint64_t mEMCALTrgClassMask = 0;
281 std::unordered_map<GIndex, int> mGIDToTableID;
284 std::unordered_map<GIndex, int> mGIDToTableFwdID;
285 int mTableTrFwdID{0};
287 std::unordered_map<GIndex, int> mGIDToTableMFTID;
288 int mTableTrMFTID{0};
290 std::unordered_map<GIndex, int> mVtxToTableCollID;
293 std::unordered_map<GIndex, int> mV0ToTableID;
297 std::vector<int> mVertexStrLUT;
298 std::vector<std::pair<int, int>> mCollisionStrTrk;
299 std::vector<int> mStrTrkIndices;
302 std::vector<int> mIndexTableFwd;
305 std::vector<int> mIndexTableMFT;
308 BunchCrossings mBCLookup;
312 std::array<float, o2::zdc::NChannels> mZDCEnergyMap;
313 std::array<float, o2::zdc::NTDCChannels> mZDCTDCMap;
315 std::vector<uint16_t> mITSTPCTRDTriggers;
316 std::vector<uint16_t> mTPCTRDTriggers;
317 std::vector<uint16_t> mITSROFs;
318 std::vector<uint16_t> mMFTROFs;
319 std::vector<uint16_t> mMCHROFs;
320 double mITSROFrameHalfLengthNS = -1;
321 double mMFTROFrameHalfLengthNS = -1;
322 double mITSROFBiasNS = 0;
323 double mMFTROFBiasNS = 0;
324 double mNSigmaTimeTrack = -1;
325 double mTimeMarginTrackTime = -1;
326 double mTPCBinNS = -1;
332 std::vector<std::vector<std::unordered_map<int, int>>> mToStore;
336 std::vector<TString> mMetaDataKeys;
337 std::vector<TString> mMetaDataVals;
339 std::shared_ptr<DataRequest> mDataRequest;
340 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
344 static constexpr int TOFTimePrecPS = 16;
346 uint32_t mCollisionPosition = 0xFFFFFFF0;
347 uint32_t mCollisionPositionCov = 0xFFFFE000;
348 uint32_t mTrackX = 0xFFFFFFF0;
349 uint32_t mTrackAlpha = 0xFFFFFFF0;
350 uint32_t mTrackSnp = 0xFFFFFF00;
351 uint32_t mTrackTgl = 0xFFFFFF00;
352 uint32_t mTrack1Pt = 0xFFFFFC00;
353 uint32_t mTrackCovDiag = 0xFFFFFF00;
354 uint32_t mTrackChi2 = 0xFFFF0000;
355 uint32_t mTrackCovOffDiag = 0xFFFF0000;
356 uint32_t mTrackSignal = 0xFFFFFF00;
357 uint32_t mTrackTime = 0xFFFFFFFF;
358 uint32_t mTPCTime0 = 0xFFFFFFE0;
359 uint32_t mTrackTimeError = 0xFFFFFF00;
360 uint32_t mTrackPosEMCAL = 0xFFFFFF00;
361 uint32_t mTracklets = 0xFFFFFF00;
362 uint32_t mMcParticleW = 0xFFFFFFF0;
363 uint32_t mMcParticlePos = 0xFFFFFFF0;
364 uint32_t mMcParticleMom = 0xFFFFFFF0;
365 uint32_t mCaloAmp = 0xFFFFFF00;
366 uint32_t mCaloTime = 0xFFFFFF00;
367 uint32_t mCPVPos = 0xFFFFF800;
368 uint32_t mCPVAmpl = 0xFFFFFF00;
369 uint32_t mMuonTr1P = 0xFFFFFC00;
370 uint32_t mMuonTrThetaX = 0xFFFFFF00;
371 uint32_t mMuonTrThetaY = 0xFFFFFF00;
372 uint32_t mMuonTrZmu = 0xFFFFFFF0;
373 uint32_t mMuonTrBend = 0xFFFFFFF0;
374 uint32_t mMuonTrNonBend = 0xFFFFFFF0;
375 uint32_t mMuonTrCov = 0xFFFF0000;
376 uint32_t mMuonCl = 0xFFFFFF00;
377 uint32_t mMuonClErr = 0xFFFF0000;
378 uint32_t mV0Time = 0xFFFFF000;
379 uint32_t mV0ChannelTime = 0xFFFFFF00;
380 uint32_t mFDDTime = 0xFFFFF000;
381 uint32_t mFDDChannelTime = 0xFFFFFF00;
382 uint32_t mT0Time = 0xFFFFFF00;
383 uint32_t mT0ChannelTime = 0xFFFFFFF0;
384 uint32_t mV0Amplitude = 0xFFFFF000;
385 uint32_t mFDDAmplitude = 0xFFFFF000;
386 uint32_t mT0Amplitude = 0xFFFFF000;
388 bool mCTPConfigPerRun =
false;
390 struct TrackExtraInfo {
391 float tpcInnerParam = 0.f;
393 uint32_t itsClusterSizes = 0u;
396 int8_t tpcNClsFindableMinusFound = 0;
397 int8_t tpcNClsFindableMinusPID = 0;
398 int8_t tpcNClsFindableMinusCrossedRows = 0;
401 float itsChi2NCl = -999.f;
402 float tpcChi2NCl = -999.f;
403 float trdChi2 = -999.f;
404 float tofChi2 = -999.f;
405 float tpcSignal = -999.f;
406 float trdSignal = -999.f;
408 float tofExpMom = -999.f;
409 float trackEtaEMCAL = -999.f;
410 float trackPhiEMCAL = -999.f;
411 float trackTime = -999.f;
412 float trackTimeRes = -999.f;
414 int bcSlice[2] = {-1, -1};
415 bool isTPConly =
false;
433 int8_t dRefContY{std::numeric_limits<int8_t>::min()};
434 int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
435 int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
436 int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
437 int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
438 int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
439 int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
440 int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
441 int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
442 int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
443 int8_t dTofdX{std::numeric_limits<int8_t>::min()};
444 int8_t dTofdZ{std::numeric_limits<int8_t>::min()};
448 struct FwdTrackInfo {
460 float chi2matchmchmid = -1.0;
461 float chi2matchmchmft = -1.0;
462 float matchscoremchmft = -1.0;
463 int matchmfttrackid = -1;
464 int matchmchtrackid = -1;
465 uint16_t mchBitMap = 0;
467 uint32_t midBoards = 0;
468 float trackTime = -999.f;
469 float trackTimeRes = -999.f;
473 struct FwdTrackCovInfo {
484 int8_t rhoTglPhi = 0;
487 int8_t rho1PtPhi = 0;
488 int8_t rho1PtTgl = 0;
494 uint32_t labelID = -1;
495 uint16_t labelMask = 0;
505 std::vector<TPCCounters> mTPCCounters;
513 const std::vector<o2::InteractionTimeRecord>& mcRecords,
514 std::map<uint64_t, int>& bcsMap);
516 template <
typename TracksCursorType,
typename TracksCovCursorType>
517 void addToTracksTable(TracksCursorType& tracksCursor, TracksCovCursorType& tracksCovCursor,
520 template <
typename TracksExtraCursorType>
521 void addToTracksExtraTable(TracksExtraCursorType& tracksExtraCursor, TrackExtraInfo& extraInfoHolder);
523 template <
typename TracksQACursorType>
524 void addToTracksQATable(TracksQACursorType& tracksQACursor, TrackQA& trackQAInfoHolder);
526 template <
typename mftTracksCursorType,
typename AmbigMFTTracksCursorType>
527 void addToMFTTracksTable(mftTracksCursorType& mftTracksCursor, AmbigMFTTracksCursorType& ambigMFTTracksCursor,
529 std::uint64_t collisionBC,
const std::map<uint64_t, int>& bcsMap);
531 template <
typename fwdTracksCursorType,
typename fwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename mftTracksCovCursorType>
532 void addToFwdTracksTable(fwdTracksCursorType& fwdTracksCursor, fwdTracksCovCursorType& fwdTracksCovCursor, AmbigFwdTracksCursorType& ambigFwdTracksCursor, mftTracksCovCursorType& mftTracksCovCursor,
539 void extrapolateToCalorimeters(TrackExtraInfo& extraInfoHolder,
const o2::track::TrackPar& track);
545 template <
typename TracksCursorType,
typename TracksCovCursorType,
typename TracksExtraCursorType,
typename TracksQACursorType,
typename AmbigTracksCursorType,
546 typename MFTTracksCursorType,
typename MFTTracksCovCursorType,
typename AmbigMFTTracksCursorType,
547 typename FwdTracksCursorType,
typename FwdTracksCovCursorType,
typename AmbigFwdTracksCursorType,
typename FwdTrkClsCursorType>
548 void fillTrackTablesPerCollision(
int collisionID,
549 std::uint64_t collisionBC,
551 const gsl::span<const GIndex>& GIndices,
553 TracksCursorType& tracksCursor,
554 TracksCovCursorType& tracksCovCursor,
555 TracksExtraCursorType& tracksExtraCursor,
556 TracksQACursorType& tracksQACursor,
557 AmbigTracksCursorType& ambigTracksCursor,
558 MFTTracksCursorType& mftTracksCursor,
559 MFTTracksCovCursorType& mftTracksCovCursor,
560 AmbigMFTTracksCursorType& ambigMFTTracksCursor,
561 FwdTracksCursorType& fwdTracksCursor,
562 FwdTracksCovCursorType& fwdTracksCovCursor,
563 AmbigFwdTracksCursorType& ambigFwdTracksCursor,
564 FwdTrkClsCursorType& fwdTrkClsCursor,
565 const std::map<uint64_t, int>& bcsMap);
567 template <
typename FwdTrkClsCursorType>
572 template <
typename V0CursorType,
typename CascadeCursorType,
typename Decay3bodyCursorType>
575 template <
typename HMPCursorType>
579 template <
typename V0C,
typename CC,
typename D3BC>
591 HepMCUpdate mXSectionUpdate = HepMCUpdate::anyKey;
592 HepMCUpdate mPdfInfoUpdate = HepMCUpdate::anyKey;
593 HepMCUpdate mHeavyIonUpdate = HepMCUpdate::anyKey;
631 void updateMCHeader(MCCollisionCursor& collisionCursor,
632 XSectionCursor& xSectionCursor,
633 PdfInfoCursor& pdfInfoCursor,
634 HeavyIonCursor& heavyIonCursor,
635 const MCEventHeader& header,
643 MCParticlesCursor& mcParticlesCursor,
644 const gsl::span<const o2::dataformats::VtxTrackRef>& primVer2TRefs,
645 const gsl::span<const GIndex>& GIndices,
647 const std::vector<std::vector<int>>& mcColToEvSrc);
649 template <
typename MCTrackLabelCursorType,
typename MCMFTTrackLabelCursorType,
typename MCFwdTrackLabelCursorType>
650 void fillMCTrackLabelsTable(MCTrackLabelCursorType& mcTrackLabelCursor,
651 MCMFTTrackLabelCursorType& mcMFTTrackLabelCursor,
652 MCFwdTrackLabelCursorType& mcFwdTrackLabelCursor,
654 const gsl::span<const GIndex>& primVerGIs,
658 std::uint64_t fillBCSlice(
int (&slice)[2],
double tmin,
double tmax,
const std::map<uint64_t, int>& bcsMap)
const;
668 template <
typename TCaloHandler,
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
669 void addToCaloTable(TCaloHandler& caloHandler, TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
670 TMCCaloLabelCursor& mcCaloCellLabelCursor,
int eventID,
int bcID, int8_t caloType);
672 template <
typename TCaloCursor,
typename TCaloTRGCursor,
typename TMCCaloLabelCursor>
673 void fillCaloTable(TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
674 TMCCaloLabelCursor& mcCaloCellLabelCursor,
const std::map<uint64_t, int>& bcsMap,
677 std::set<uint64_t> filterEMCALIncomplete(
const gsl::span<const o2::emcal::TriggerRecord> triggers);