|
19 | 19 | #include "CommonConstants/LHCConstants.h" |
20 | 20 | #include "CommonDataFormat/TimeStamp.h" |
21 | 21 | #include "ReconstructionDataFormats/PrimaryVertex.h" |
| 22 | +#include "ReconstructionDataFormats/V0.h" |
22 | 23 | #include "SimulationDataFormat/TrackReference.h" |
23 | 24 | #include <array> |
24 | 25 | #include <vector> |
@@ -320,5 +321,77 @@ struct MCVertex { |
320 | 321 | ClassDefNV(MCVertex, 2); |
321 | 322 | }; |
322 | 323 |
|
| 324 | +/// State of one prong of a MC decay with respect to the SVertexer seeds pool. |
| 325 | +/// A prong which was reconstructed but never made it into the pool can never form a V0, |
| 326 | +/// whatever the pair cuts do, so this has to be checked before interpreting SVCheck::rejV0. |
| 327 | +struct SVProngInfo { |
| 328 | + o2::dataformats::VtxTrackIndex gid; // reco track used as this prong, unset if not reconstructed |
| 329 | + int32_t poolEntry = -1; // entry in the SVertexer seeds pool, -1 if not seeded |
| 330 | + int8_t poolSide = -1; // SVertexer::POS / SVertexer::NEG |
| 331 | + int32_t vBrMin = -1; // vertex bracket of the seed |
| 332 | + int32_t vBrMax = -1; |
| 333 | + float minR = -1.f; // lowest radial point of the seed, used by the causality cut |
| 334 | + uint8_t seedRej = 0; // SVertexer::SeedRej, why the track never entered the pool |
| 335 | + int8_t nITSclu = -1; |
| 336 | + bool hasTPC = false; |
| 337 | + |
| 338 | + bool isReconstructed() const { return gid.isSourceSet(); } |
| 339 | + bool isSeeded() const { return poolEntry >= 0; } |
| 340 | + |
| 341 | + ClassDefNV(SVProngInfo, 1); |
| 342 | +}; |
| 343 | + |
| 344 | +/// Why a MC decay was or was not reconstructed as a V0 by the SVertexer. |
| 345 | +/// stage says how far the decay got, and only if it reached CutRejected is rejV0 meaningful. |
| 346 | +struct SVCheck { |
| 347 | + enum Stage : int8_t { |
| 348 | + NotChecked = -1, // SV checking disabled or decay not eligible |
| 349 | + NoProngs, // at least one prong has no reconstructed track at all |
| 350 | + NotSeeded, // a prong was reconstructed but rejected before the seeds pool, see prong seedRej |
| 351 | + SameCharge, // prongs did not end up as one positive and one negative seed |
| 352 | + NoBracketOverlap, // seeds share no primary vertex, so the pair is never even tried |
| 353 | + CutRejected, // the pair was tried and rejected, see rejV0 |
| 354 | + Found // the pair passes the SVertexer selection |
| 355 | + }; |
| 356 | + std::array<SVProngInfo, 2> prongs{}; |
| 357 | + int foundSVID = -1; // reconstructed V0 matched to this decay by MC labels, -1 if none |
| 358 | + int8_t stage = NotChecked; // Stage |
| 359 | + uint8_t rejV0 = 0; // SVertexer::V0Rej, only if stage == CutRejected |
| 360 | + bool pairInReco = false; // the reconstruction built a V0 out of exactly the two prongs replayed |
| 361 | + bool replayConsistent = true; // false if the replay verdict differs from pairInReco |
| 362 | + |
| 363 | + bool isReconstructed() const { return foundSVID >= 0; } |
| 364 | + |
| 365 | + bool isFound() const { return stage == Found; } |
| 366 | + bool bothProngsReconstructed() const { return prongs[0].isReconstructed() && prongs[1].isReconstructed(); } |
| 367 | + bool bothProngsSeeded() const { return prongs[0].isSeeded() && prongs[1].isSeeded(); } |
| 368 | + |
| 369 | + ClassDefNV(SVCheck, 1); |
| 370 | +}; |
| 371 | + |
| 372 | +/// A reconstructed V0 together with the MC origin of its prongs, to study the composition of |
| 373 | +/// the sample: which V0s are real decays and which are combinatorial. |
| 374 | +struct RecSVInfo { |
| 375 | + enum Kind : int8_t { |
| 376 | + Unknown = -1, // MC information unavailable for at least one prong |
| 377 | + TrueDecay, // both prongs are daughters of the same MC mother |
| 378 | + DifferentMothers, // prongs come from unrelated MC particles, i.e. combinatorial |
| 379 | + FakeProng // at least one prong track has a fake MC label |
| 380 | + }; |
| 381 | + o2::dataformats::V0 v0; |
| 382 | + o2::dataformats::V0Index v0ID{}; |
| 383 | + std::array<o2::MCCompLabel, 2> prongLbl{}; |
| 384 | + std::array<int, 2> prongPDG{0, 0}; |
| 385 | + int mcMotherPDG = 0; // PDG of the common mother, 0 if there is none |
| 386 | + int mcMotherEntry = -1; // entry in the decays pool of mcMotherDecID, -1 if not checked |
| 387 | + int8_t mcMotherDecID = -1; // which decay type the pool of mcMotherEntry refers to |
| 388 | + int8_t kind = Unknown; // Kind |
| 389 | + |
| 390 | + bool isTrueDecay() const { return kind == TrueDecay; } |
| 391 | + bool isCheckedDecay() const { return mcMotherEntry >= 0; } |
| 392 | + |
| 393 | + ClassDefNV(RecSVInfo, 1); |
| 394 | +}; |
| 395 | + |
323 | 396 | } // namespace o2::trackstudy |
324 | 397 | #endif |
0 commit comments