Skip to content

Commit

Permalink
Changes to strangeness derived data builder for MC
Browse files Browse the repository at this point in the history
  • Loading branch information
ddobrigk committed Jan 11, 2024
1 parent 656fa13 commit a98fa66
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions PWGLF/TableProducer/strangederivedbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ using namespace o2::framework::expressions;
using std::array;

using TracksWithExtra = soa::Join<aod::TracksIU, aod::TracksExtra, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTPCFullHe>;
using TracksCompleteIUMC = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TracksDCA, aod::McTrackLabels>;
using FullTracksExtIUTOF = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TOFEvTime, aod::TOFSignal>;

// simple checkers
Expand Down Expand Up @@ -117,6 +118,8 @@ struct strangederivedbuilder {
"Fill generated particle histograms for each species. 0: no, 1: yes"};

ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"};
ConfigurableAxis axisCentrality{"axisCentrality", {100, 0.0f, 100.0f}, "Centrality"};
ConfigurableAxis axisNVertices{"axisNVertices", {10, -0.5f, 9.5f}, "N(vertices)"};

Configurable<bool> fillEmptyCollisions{"fillEmptyCollisions", false, "fill collision entries without candidates"};

Expand All @@ -141,8 +144,12 @@ struct strangederivedbuilder {
});

// Creation of histograms: MC generated
for (Int_t i = 0; i < nSpecies; i++)
for (Int_t i = 0; i < nSpecies; i++){
histos.add(Form("hGen%s", particleNames[i].data()), Form("hGen%s", particleNames[i].data()), kTH1D, {axisPt});
histos.add(Form("h2dGen%s", particleNames[i].data()), Form("h2dGen%s", particleNames[i].data()), kTH2D, {axisCentrality, axisPt});
}

histos.add("h2dNVerticesVsCentrality", "h2dNVerticesVsCentrality", kTH2D, {axisCentrality, axisNVertices});
}

void processCollisionsV0sOnly(soa::Join<aod::Collisions, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As> const& collisions, aod::V0Datas const& V0s, aod::BCsWithTimestamps const&)
Expand Down Expand Up @@ -409,9 +416,8 @@ struct strangederivedbuilder {
}
}

void processSimulation(aod::McParticles const& mcParticles)
void processPureSimulation(aod::McParticles const& mcParticles)
{
// check if collision successfully reconstructed
for (auto& mcp : mcParticles) {
if (TMath::Abs(mcp.y()) < 0.5) {
static_for<0, nSpecies - 1>([&](auto i) {
Expand All @@ -424,6 +430,33 @@ struct strangederivedbuilder {
}
}

void processReconstructedSimulation(aod::McCollision const& mcCollision, soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As>> const& collisions, TracksCompleteIUMC const& tracks, aod::McParticles const& mcParticles){
// this process function also checks if a given collision was reconstructed and checks explicitly for splitting, etc

// identify best-of collision
int biggestNContribs = -1;
float bestCentrality = 100.5;
for (auto& collision : collisions) {
if (biggestNContribs < collision.numContrib()) {
biggestNContribs = collision.numContrib();
bestCentrality = collision.centFT0C();
}
}
histos.fill(HIST("h2dNVerticesVsCentrality"), bestCentrality, collisions.size());

for (auto& mcp : mcParticles) {
if (TMath::Abs(mcp.y()) < 0.5) {
static_for<0, nSpecies - 1>([&](auto i) {
constexpr int index = i.value;
if (mcp.pdgCode() == particlePDGCodes[index] && bitcheck(enabledBits, index)) {
histos.fill(HIST("h2dGen") + HIST(particleNamesConstExpr[index]), bestCentrality, mcp.pt());
}
});
}
}

}

void processProduceV0TOFs(aod::Collision const& collision, aod::V0Datas const& V0s, FullTracksExtIUTOF const&)
{
for (auto const& v0 : V0s) {
Expand Down Expand Up @@ -453,7 +486,8 @@ struct strangederivedbuilder {
PROCESS_SWITCH(strangederivedbuilder, processStrangeMothers, "Produce tables with mother info for V0s + casc", true);
PROCESS_SWITCH(strangederivedbuilder, processCascadeInterlinkTracked, "Produce tables interconnecting cascades", false);
PROCESS_SWITCH(strangederivedbuilder, processCascadeInterlinkKF, "Produce tables interconnecting cascades", false);
PROCESS_SWITCH(strangederivedbuilder, processSimulation, "Produce simulated information", true);
PROCESS_SWITCH(strangederivedbuilder, processPureSimulation, "Produce pure simulated information", true);
PROCESS_SWITCH(strangederivedbuilder, processReconstructedSimulation, "Produce pure simulated information", true);
PROCESS_SWITCH(strangederivedbuilder, processProduceV0TOFs, "Produce V0TOFs table", true);
PROCESS_SWITCH(strangederivedbuilder, processProduceCascTOFs, "Produce CascTOFs table", true);
};
Expand Down

0 comments on commit a98fa66

Please sign in to comment.