Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ALICE3/DataModel/collisionAlice3.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ DECLARE_SOA_TABLE(CollisionsAlice3, "AOD", "COLLALICE3",

using CollisionAlice3 = CollisionsAlice3::iterator;

namespace mcmult_alice3
{
DECLARE_SOA_COLUMN(MultMC, multMC, int); //! Total MCTruth multiplicity
DECLARE_SOA_COLUMN(MultMC25, multMC25, int); //! MCTruth multiplicity in |eta| < 2.5
DECLARE_SOA_COLUMN(MultMC125, multMC125, int); //! MCTruth multiplicity in |eta| < 1.25
DECLARE_SOA_COLUMN(MultMC09, multMC09, int); //! MCTruth multiplicity in |eta| < 0.9
} // namespace mcmult_alice3
DECLARE_SOA_TABLE(MultsMCAlice3, "AOD", "MULTMCALICE3",
mcmult_alice3::MultMC,
mcmult_alice3::MultMC25,
mcmult_alice3::MultMC125,
mcmult_alice3::MultMC09);

using MultMCAlice3 = MultsMCAlice3::iterator;
} // namespace o2::aod

#endif // ALICE3_DATAMODEL_COLLISIONALICE3_H_
4 changes: 3 additions & 1 deletion ALICE3/DataModel/tracksAlice3.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ DECLARE_SOA_COLUMN(NSiliconHits, nSiliconHits, int); //! number of silico
DECLARE_SOA_COLUMN(NTPCHits, nTPCHits, int); //! number of tpc hits
DECLARE_SOA_COLUMN(PdgCode, pdgCode, int); //! PDG code of the linked truth MC particle
DECLARE_SOA_COLUMN(TrackType, trackType, int); //! Type of the track
DECLARE_SOA_COLUMN(IsPVContributor, isPVContributor, bool); //! Has track contributed to the PV fit?
} // namespace track_alice3
DECLARE_SOA_TABLE(TracksAlice3, "AOD", "TRACKSALICE3",
track_alice3::IsReconstructed);
Expand All @@ -43,7 +44,8 @@ using TrackAlice3Pdg = TracksAlice3Pdg::iterator;
DECLARE_SOA_TABLE(TracksExtraA3, "AOD", "TracksExtraA3",
track_alice3::NSiliconHits,
track_alice3::NTPCHits,
track_alice3::TrackType);
track_alice3::TrackType,
track_alice3::IsPVContributor);
using TrackExtraA3 = TracksExtraA3::iterator;

namespace mcparticle_alice3
Expand Down
5 changes: 5 additions & 0 deletions ALICE3/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Use kebab-case for names of workflows and match the name of the workflow file.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
Expand All @@ -11,12 +11,12 @@

add_subdirectory(OTF)

o2physics_add_dpl_workflow(alice3-trackselection

Check failure on line 14 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-trackselection does not match its file name alice3-trackselection.cxx. (Matches alice3Trackselection.cxx.)
SOURCES alice3-trackselection.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-trackextension

Check failure on line 19 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-trackextension does not match its file name alice3-trackextension.cxx. (Matches alice3Trackextension.cxx.)
SOURCES alice3-trackextension.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats
COMPONENT_NAME Analysis)
Expand All @@ -26,12 +26,17 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-multiplicity
SOURCES alice3Multiplicity.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-decaypreselector

Check failure on line 34 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-decaypreselector does not match its file name alice3-decaypreselector.cxx. (Matches alice3Decaypreselector.cxx.)
SOURCES alice3-decaypreselector.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-decayfinder

Check failure on line 39 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-decayfinder does not match its file name alice3-decayfinder.cxx. (Matches alice3Decayfinder.cxx.)
SOURCES alice3-decayfinder.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)
Expand All @@ -41,7 +46,7 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-correlatorddbar

Check failure on line 49 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-correlatorddbar does not match its file name alice3-correlatorDDbar.cxx. (Matches alice3Correlatorddbar.cxx.)
SOURCES alice3-correlatorDDbar.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)
Expand All @@ -66,12 +71,12 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2Physics::AnalysisCCDB O2Physics::PWGDQCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-dileptonsmearing

Check failure on line 74 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-dileptonsmearing does not match its file name alice3-dileptonsmearing.cxx. (Matches alice3Dileptonsmearing.cxx.)
SOURCES alice3-dileptonsmearing.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2Physics::AnalysisCCDB O2Physics::PWGEMDileptonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3strangenessfinder

Check failure on line 79 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3strangenessfinder does not match its file name alice3strangenessFinder.cxx. (Matches alice3strangenessfinder.cxx.)
SOURCES alice3strangenessFinder.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::ALICE3Core
COMPONENT_NAME Analysis)
Expand Down
69 changes: 45 additions & 24 deletions ALICE3/TableProducer/OTF/onTheFlyTracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
#include <TGeoGlobalMagField.h>
#include <TH1.h>
#include <TH2.h>
#include <TLorentzVector.h>

Check failure on line 80 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TMCProcess.h>
#include <TMath.h>
#include <TPDGCode.h>
Expand Down Expand Up @@ -275,6 +275,7 @@
const float time = 0,
const float timeError = 1,
bool decayDauInput = false,
bool isPVContributorInput = false,
bool weakDecayDauInput = false,
int isUsedInCascadingInput = 0,
int nSiliconHitsInput = 0,
Expand All @@ -283,19 +284,21 @@
mcLabel{label},
timeEst{time, timeError},
isDecayDau(decayDauInput),
isPVContributor(isPVContributorInput),
isWeakDecayDau(weakDecayDauInput),
isUsedInCascading(isUsedInCascadingInput),
nSiliconHits(nSiliconHitsInput),
nTPCHits(nTPCHitsInput),
trackType(trackTypeInput) {}
const TimeEst& getTimeMUS() const { return timeEst; }
int64_t mcLabel = -1; ///< MC label of the track
TimeEst timeEst{}; ///< time estimate in ns
bool isDecayDau = false; ///< is a decay daughter
bool isWeakDecayDau = false; ///< is a weak decay daughter
int isUsedInCascading = 0; ///< 0: not at all, 1: is a cascade, 2: is a bachelor, 3: is a pion, 4: is a proton
int nSiliconHits = 0; ///< number of silicon hits
int nTPCHits = 0; ///< number of TPC hits
int64_t mcLabel = -1; ///< MC label of the track
TimeEst timeEst{}; ///< time estimate in ns
bool isDecayDau = false; ///< is a decay daughter
bool isPVContributor = false; ///< track is PV contributor
bool isWeakDecayDau = false; ///< is a weak decay daughter
int isUsedInCascading = 0; ///< 0: not at all, 1: is a cascade, 2: is a bachelor, 3: is a pion, 4: is a proton
int nSiliconHits = 0; ///< number of silicon hits
int nTPCHits = 0; ///< number of TPC hits
TrackType trackType;
};

Expand Down Expand Up @@ -798,7 +801,7 @@
/// \param xiDecayVertex the address of the xi decay vertex
/// \param laDecayVertex the address of the la decay vertex
template <typename McParticleType>
void decayCascade(const McParticleType& particle, o2::track::TrackParCov track, std::vector<TLorentzVector>& decayDaughters, std::vector<double>& xiDecayVertex, std::vector<double>& laDecayVertex)

Check failure on line 804 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
{
const double uXi = rand.Uniform(0, 1);
const double ctauXi = 4.91; // cm
Expand Down Expand Up @@ -1004,13 +1007,13 @@
thisCascade.cascadeTrackId = trackTableOffset + 4;

float trackTime = (eventCollisionTimeNS + gRandom->Gaus(0., timeResolutionNs)) * nsToMus;
tracksCascadeProngs.push_back(TrackAlice3{xiDaughterTrackParCovsPerfect[0], mcParticle.globalIndex(), trackTime, timeResolutionUs, true, true, 1, -1, -1, TrackType::kGenCascDaug});
tracksCascadeProngs.push_back(TrackAlice3{xiDaughterTrackParCovsPerfect[0], mcParticle.globalIndex(), trackTime, timeResolutionUs, true, false, true, 1, -1, -1, TrackType::kGenCascDaug});
trackTime = (eventCollisionTimeNS + gRandom->Gaus(0., timeResolutionNs)) * nsToMus;
tracksCascadeProngs.push_back(TrackAlice3{xiDaughterTrackParCovsPerfect[1], mcParticle.globalIndex(), trackTime, timeResolutionUs, true, true, 2, -1, -1, TrackType::kGenCascDaug});
tracksCascadeProngs.push_back(TrackAlice3{xiDaughterTrackParCovsPerfect[1], mcParticle.globalIndex(), trackTime, timeResolutionUs, true, false, true, 2, -1, -1, TrackType::kGenCascDaug});
trackTime = (eventCollisionTimeNS + gRandom->Gaus(0., timeResolutionNs)) * nsToMus;
tracksCascadeProngs.push_back(TrackAlice3{xiDaughterTrackParCovsPerfect[2], mcParticle.globalIndex(), trackTime, timeResolutionUs, true, true, 3, -1, -1, TrackType::kGenCascDaug});
tracksCascadeProngs.push_back(TrackAlice3{xiDaughterTrackParCovsPerfect[2], mcParticle.globalIndex(), trackTime, timeResolutionUs, true, false, true, 3, -1, -1, TrackType::kGenCascDaug});
trackTime = (eventCollisionTimeNS + gRandom->Gaus(0., timeResolutionNs)) * nsToMus;
tracksCascadeProngs.push_back(TrackAlice3{perfectCascadeTrack, mcParticle.globalIndex(), trackTime, timeResolutionUs, true, true, 3, -1, -1, TrackType::kGenCascDaug});
tracksCascadeProngs.push_back(TrackAlice3{perfectCascadeTrack, mcParticle.globalIndex(), trackTime, timeResolutionUs, true, false, true, 3, -1, -1, TrackType::kGenCascDaug});

for (int i = 0; i < kCascProngs; i++) {
isReco[i] = false;
Expand Down Expand Up @@ -1061,7 +1064,7 @@
trackTime = (eventCollisionTimeNS + gRandom->Gaus(0., timeResolutionNs)) * nsToMus;
// TODO: add flag for whether it's a ghost track or not, currently assuming all are reconstructed tracks if they pass the fast tracker requirements
TrackType trackType = isReco[i] ? TrackType::kRecoCascDaug : TrackType::kGenCascDaug;
tracksCascadeProngs[i] = TrackAlice3{xiDaughterTrackParCovsTracked[i], mcParticle.globalIndex(), trackTime, timeResolutionUs, true, true, i + 2, nSiliconHitsCascadeProngs[i], nTPCHitsCascadeProngs[i], trackType};
tracksCascadeProngs[i] = TrackAlice3{xiDaughterTrackParCovsTracked[i], mcParticle.globalIndex(), trackTime, timeResolutionUs, true, false, true, i + 2, nSiliconHitsCascadeProngs[i], nTPCHitsCascadeProngs[i], trackType};
}

bool tryKinkReco = false;
Expand Down Expand Up @@ -1272,7 +1275,7 @@
return; // We didn't find enough hits for strangeness tracking
}
}
tracksCascadeProngs[kCascProngs] = TrackAlice3{cascadeTrack, mcParticle.globalIndex(), trackTime, timeResolutionUs, false, false, 1, thisCascade.foundClusters, TrackType::kGenCascDaug};
tracksCascadeProngs[kCascProngs] = TrackAlice3{cascadeTrack, mcParticle.globalIndex(), trackTime, timeResolutionUs, false, false, false, 1, thisCascade.foundClusters, TrackType::kGenCascDaug};
fillCascadeTable = true;
}
}
Expand Down Expand Up @@ -1342,7 +1345,10 @@
std::array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassLambda});
newCascadeTrack.setPID(pdgCodeToPID(PDG_t::kXiMinus)); // FIXME: not OK for omegas
float trackTime = (eventCollisionTimeNS + gRandom->Gaus(0., timeResolutionNs)) * nsToMus;
tracksCascadeProngs[kCascProngs + 1] = TrackAlice3{newCascadeTrack, mcParticle.globalIndex(), trackTime, timeResolutionUs, false, false, 1, thisCascade.foundClusters, 0, TrackType::kRecoCascDaug};
if (reconstructedCascade) {
tracksCascadeProngs[kCascProngs + 1] = TrackAlice3{newCascadeTrack, mcParticle.globalIndex(), trackTime, timeResolutionUs, false, false, false, 1, thisCascade.foundClusters, TrackType::kRecoCascDaug};
}
tracksCascadeProngs[kCascProngs + 1] = TrackAlice3{newCascadeTrack, mcParticle.globalIndex(), trackTime, timeResolutionUs, false, false, false, 1, thisCascade.foundClusters, 0, TrackType::kRecoCascDaug};
fillCascadeTable = true;
} // end fitter OK
} // end cascade found
Expand Down Expand Up @@ -1490,9 +1496,12 @@

// Store not reconstructed daughters, will update them in case reconstruction is successful
float trackTime = (eventCollisionTimeNS + gRandom->Gaus(0., timeResolutionNs)) * nsToMus;
tracksV0Daugs.push_back(TrackAlice3{v0DaughterTrackParCovsPerfect[0], mcParticle.globalIndex(), 0.f, timeResolutionUs, true, true, 1, 0, 0, TrackType::kGhostV0Daug});
tracksV0Daugs.push_back(TrackAlice3{v0DaughterTrackParCovsPerfect[0], mcParticle.globalIndex(), 0.f, timeResolutionUs, true, false, true, 1, TrackType::kGhostV0Daug});
trackTime = (eventCollisionTimeNS + gRandom->Gaus(0., timeResolutionNs)) * nsToMus;
tracksV0Daugs.push_back(TrackAlice3{v0DaughterTrackParCovsPerfect[1], mcParticle.globalIndex(), 0.f, timeResolutionUs, true, false, true, 1, TrackType::kGhostV0Daug});
tracksV0Daugs.push_back(TrackAlice3{v0DaughterTrackParCovsPerfect[0], mcParticle.globalIndex(), 0.f, timeResolutionUs, true, false, true, 1, 0, 0, TrackType::kGhostV0Daug});
trackTime = (eventCollisionTimeNS + gRandom->Gaus(0., timeResolutionNs)) * nsToMus;
tracksV0Daugs.push_back(TrackAlice3{v0DaughterTrackParCovsPerfect[1], mcParticle.globalIndex(), 0.f, timeResolutionUs, true, true, 1, 0, 0, TrackType::kGhostV0Daug});
tracksV0Daugs.push_back(TrackAlice3{v0DaughterTrackParCovsPerfect[1], mcParticle.globalIndex(), 0.f, timeResolutionUs, true, false, true, 1, 0, 0, TrackType::kGhostV0Daug});

bool fillV0Table{false};
for (int i = 0; i < kv0Prongs; i++) {
Expand Down Expand Up @@ -1529,7 +1538,7 @@
trackTime = (eventCollisionTimeNS + gRandom->Gaus(0., timeResolutionNs)) * nsToMus;
// TODO: flag to separate ghost and reco tracks
TrackType trackType = isV0Reco[i] ? TrackType::kRecoV0Daug : TrackType::kGhostV0Daug;
tracksV0Daugs[i] = TrackAlice3{v0DaughterTrackParCovsTracked[i], mcParticle.globalIndex(), trackTime, timeResolutionUs, true, true, i + 2, trackType};
tracksV0Daugs[i] = TrackAlice3{v0DaughterTrackParCovsTracked[i], mcParticle.globalIndex(), trackTime, timeResolutionUs, true, false, true, i + 2, trackType};
}
if (v0DecaySettings.doV0QA) {
if (isV0Reco[0] && isV0Reco[1]) {
Expand Down Expand Up @@ -1680,8 +1689,8 @@
/// \param prmTrks the vector of tracks to be used for vertex reconstruction
/// \param primaryVertex the output variable where the computed primary vertex will be stored
/// \param icfg index of the current configuration, used for histogram filling
template <typename McCollisionType, typename TrackType>
void computeVertex(McCollisionType& mcCollision, const std::vector<TrackType>& prmTrks, o2::vertexing::PVertex& primaryVertex, const int icfg)
template <typename McCollisionType, typename TrackT>
void computeVertex(McCollisionType& mcCollision, std::vector<TrackT>& prmTrks, o2::vertexing::PVertex& primaryVertex, const int icfg)
{

if (!enablePrimaryVertexing) {
Expand Down Expand Up @@ -1733,7 +1742,18 @@
largestVertex = iv;
}
}

primaryVertex = vertices[largestVertex];

const auto& contributorRef = v2tRefs[largestVertex];
const int first = contributorRef.getFirstEntry();
const int end = first + contributorRef.getEntries();

for (int i = first; i < end; ++i) {
const auto trackIndex = vertexTrackIDs[i].getIndex();
prmTrks[trackIndex].isPVContributor = true;
}

if (doExtraQA) {
histos.fill(HIST("h2dVerticesVsContributors"), primaryVertex.getNContributors(), n_vertices);
}
Expand Down Expand Up @@ -1784,7 +1804,7 @@
trackParCov.getSigmaTgl2(), trackParCov.getSigma1PtY(), trackParCov.getSigma1PtZ(), trackParCov.getSigma1PtSnp(), trackParCov.getSigma1PtTgl(),
trackParCov.getSigma1Pt2());
tableMcTrackLabels(trackParCov.mcLabel, 0);
tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits, trackParCov.trackType);
tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits, trackParCov.trackType, trackParCov.isPVContributor);

// populate extra tables if required to do so
if (populateTracksExtra) {
Expand Down Expand Up @@ -1977,10 +1997,11 @@
// Time associated to the mcParticle: collision time + smearing
float trackTime = (eventCollisionTimeNS + gRandom->Gaus(0., timeResolutionNs)) * nsToMus;
TrackType trackType = reconstructed ? TrackType::kRecoPrimary : TrackType::kGhostPrimary;
bool isPVContributor = trackType == TrackType::kRecoPrimary;
if (reconstructed) {
recoPrimaries.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), trackTime, timeResolutionUs, isDecayDaughter, false, 0, nTrkHits, trackType});
recoPrimaries.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), trackTime, timeResolutionUs, isDecayDaughter, isPVContributor, false, 0, nTrkHits, trackType});
} else {
ghostPrimaries.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), trackTime, timeResolutionUs, isDecayDaughter, false, 0, nTrkHits, trackType});
ghostPrimaries.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), trackTime, timeResolutionUs, isDecayDaughter, isPVContributor, false, 0, nTrkHits, trackType});
}
}

Expand Down Expand Up @@ -2202,10 +2223,10 @@
}

if (reconstructed) {
tracksAlice3.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), time, timeResolutionUs, isSecondary, false, 0, nTrkHits, kRecoPrimary});
tracksAlice3.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), time, timeResolutionUs, isSecondary, true, false, 0, nTrkHits, kRecoPrimary});
getHist<TH1>(histPath + "hPtReconstructedPr")->Fill(trackParCov.getPt());
} else {
ghostTracksAlice3.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), time, timeResolutionUs, isSecondary, false, 0, nTrkHits, kGhostPrimary});
ghostTracksAlice3.push_back(TrackAlice3{trackParCov, mcParticle.globalIndex(), time, timeResolutionUs, isSecondary, false, false, false, 0, nTrkHits, kGhostPrimary});
}
}

Expand Down
Loading
Loading