Skip to content
Merged
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
19 changes: 17 additions & 2 deletions PWGCF/FemtoWorld/Core/FemtoWorldContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "Math/Vector4D.h"
#include "TMath.h"
#include "TDatabasePDG.h"
#include "TLorentzVector.h"

#include "CommonConstants/MathConstants.h"
using namespace o2::constants::math;
Expand Down Expand Up @@ -66,8 +67,10 @@ class FemtoWorldContainer
/// \param mTBins mT binning for the histograms
/// \param etaBins mT binning for the histograms
/// \param phiBins mT binning for the histograms
/// \param mInvBins mT binning for the histograms

template <typename T1, typename T2>
void init(HistogramRegistry* registry, T1& kstarBins, T1& multBins, T1& kTBins, T1& mTBins, T2& phiBins, T2& etaBins)
void init(HistogramRegistry* registry, T1& kstarBins, T1& multBins, T1& kTBins, T1& mTBins, T2& phiBins, T2& etaBins, T2& mInvBins)
{
mHistogramRegistry = registry;
std::string femtoObs;
Expand All @@ -85,6 +88,7 @@ class FemtoWorldContainer

framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh};
framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0};
framework::AxisSpec mInvAxis = {mInvBins, 0.0, 10.0};

std::string folderName = static_cast<std::string>(mFolderSuffix[mEventType]);
mHistogramRegistry->add((folderName + "relPairDist").c_str(), ("Name; " + femtoObs + "; Entries").c_str(), kTH1F, {femtoObsAxis});
Expand All @@ -98,6 +102,7 @@ class FemtoWorldContainer
mHistogramRegistry->add((folderName + "MultPtPart2").c_str(), "; #it{p} _{T} Particle 2 (GeV/#it{c}); Multiplicity", kTH2F, {{375, 0., 7.5}, multAxis});
mHistogramRegistry->add((folderName + "PtPart1PtPart2").c_str(), "; #it{p} _{T} Particle 1 (GeV/#it{c}); #it{p} _{T} Particle 2 (GeV/#it{c})", kTH2F, {{375, 0., 7.5}, {375, 0., 7.5}});
mHistogramRegistry->add((folderName + "relPairDetaDphi").c_str(), "; #Delta#varphi (rad); #Delta#eta", kTH2D, {phiAxis, etaAxis});
mHistogramRegistry->add((folderName + "relPairInvariantMass").c_str(), ";M_{#pi^{+}#pi^{-}} (GeV/#it{c}^{2});", kTH1D, {mInvAxis});
}

/// Set the PDG codes of the two particles involved
Expand Down Expand Up @@ -125,14 +130,24 @@ class FemtoWorldContainer
const float mT = FemtoWorldMath::getmT(part1, mMassOne, part2, mMassTwo);

double delta_eta = part1.eta() - part2.eta();

double delta_phi = part1.phi() - part2.phi();

while (delta_phi < mPhiLow) {
delta_phi += TwoPI;
}
while (delta_phi > mPhiHigh) {
delta_phi -= TwoPI;
}
TLorentzVector part1Vec;
part1Vec.SetPtEtaPhiM(part1.pt(), part1.eta(), part1.phi(), mMassOne);
TLorentzVector part2Vec;
part2Vec.SetPtEtaPhiM(part2.pt(), part2.eta(), part2.phi(), mMassTwo);

TLorentzVector sumVec(part1Vec);
sumVec += part2Vec;
if (mHistogramRegistry) {
mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST("relPairInvariantMass"), sumVec.M());
}

if (mHistogramRegistry) {
mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST("relPairDist"), femtoObs);
Expand Down
2 changes: 2 additions & 0 deletions PWGCF/FemtoWorld/Core/FemtoWorldParticleHisto.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class FemtoWorldParticleHisto
mHistogramRegistry->add((folderName + "/hPt").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, {{240, 0, 6}});
mHistogramRegistry->add((folderName + "/hEta").c_str(), "; #eta; Entries", kTH1F, {{200, -1.5, 1.5}});
mHistogramRegistry->add((folderName + "/hPhi").c_str(), "; #phi; Entries", kTH1F, {{200, 0, 2. * M_PI}});
mHistogramRegistry->add((folderName + "/dEdxTPCVsMomentum").c_str(), "; #it{p} (GeV/#it{c}); dE/dx (keV/cm)", kTH2F, {{100, 0., 5.}, {250, 0., 500.}});

/// Particle-type specific histograms
if constexpr (mParticleType == o2::aod::femtodreamparticle::ParticleType::kTrack) {
Expand Down Expand Up @@ -76,6 +77,7 @@ class FemtoWorldParticleHisto
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST("/hPt"), part.pt());
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST("/hEta"), part.eta());
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST("/hPhi"), part.phi());
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST("/dEdxTPCVsMomentum"), part.p(), part.tpcSignal());

/// Particle-type specific histograms
if constexpr (mParticleType == o2::aod::femtodreamparticle::ParticleType::kTrack) {
Expand Down
31 changes: 19 additions & 12 deletions PWGCF/FemtoWorld/Tasks/femtoWorldPairTaskTrackTrack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ static const std::vector<float> kNsigma = {3.5f, 3.f, 2.5f};

} // namespace

namespace o2::aod
{
using FemtoWorldParticles = soa::Join<aod::FemtoDreamParticles,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better to put this in a header under DataModel/ directory?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fixed tomorrow

aod::FemtoDreamDebugParticles>;
using FemtoWorldParticle = FemtoWorldParticles::iterator;
} // namespace o2::aod

struct femtoWorldPairTaskTrackTrack {

/// Particle selection part
Expand All @@ -59,26 +66,25 @@ struct femtoWorldPairTaskTrackTrack {
Configurable<int> cfgNspecies{"ccfgNspecies", 4, "Number of particle spieces with PID info"};

/// Particle 1
Configurable<int> ConfPDGCodePartOne{"ConfPDGCodePartOne", 2212, "Particle 1 - PDG code"};
Configurable<uint32_t> ConfCutPartOne{"ConfCutPartOne", 84035877, "Particle 1 - Selection bit from cutCulator"};
Configurable<int> ConfPDGCodePartOne{"ConfPDGCodePartOne", 211, "Particle 1 - PDG code"};
Configurable<uint32_t> ConfCutPartOne{"ConfCutPartOne", 84035878, "Particle 1 - Selection bit from cutCulator"};
Configurable<std::vector<int>> ConfPIDPartOne{"ConfPIDPartOne", std::vector<int>{2}, "Particle 1 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector<std::pair<int, int>>int>>

/// Partition for particle 1
Partition<aod::FemtoDreamParticles> partsOne = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) && ((aod::femtodreamparticle::cut & ConfCutPartOne) == ConfCutPartOne);

Partition<o2::aod::FemtoWorldParticles> partsOne = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) && ((aod::femtodreamparticle::cut & ConfCutPartOne) == ConfCutPartOne);
/// Histogramming for particle 1
FemtoWorldParticleHisto<aod::femtodreamparticle::ParticleType::kTrack, 1> trackHistoPartOne;

/// Particle 2
Configurable<bool> ConfIsSame{"ConfIsSame", false, "Pairs of the same particle"};
Configurable<int> ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 2212, "Particle 2 - PDG code"};
Configurable<int> ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 211, "Particle 2 - PDG code"};
Configurable<uint32_t> ConfCutPartTwo{"ConfCutPartTwo", 84035877, "Particle 2 - Selection bit"};
Configurable<std::vector<int>> ConfPIDPartTwo{"ConfPIDPartTwo", std::vector<int>{2}, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector<std::pair<int, int>>

/// Partition for particle 2
Partition<aod::FemtoDreamParticles> partsTwo = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) &&
// (aod::femtodreamparticle::pt < cfgCutTable->get("PartTwo", "MaxPt")) &&
((aod::femtodreamparticle::cut & ConfCutPartTwo) == ConfCutPartTwo);
Partition<o2::aod::FemtoWorldParticles> partsTwo = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) &&
// (aod::femtodreamparticle::pt < cfgCutTable->get("PartTwo", "MaxPt")) &&
((aod::femtodreamparticle::cut & ConfCutPartTwo) == ConfCutPartTwo);

/// Histogramming for particle 2
FemtoWorldParticleHisto<aod::femtodreamparticle::ParticleType::kTrack, 2> trackHistoPartTwo;
Expand All @@ -101,6 +107,7 @@ struct femtoWorldPairTaskTrackTrack {
Configurable<bool> ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"};
Configurable<int> ConfPhiBins{"ConfPhiBins", 15, "Number of phi bins in deta dphi"};
Configurable<int> ConfEtaBins{"ConfEtaBins", 15, "Number of eta bins in deta dphi"};
Configurable<int> ConfMInvBins{"ConfMInvBins", 1000, "Number of bins in mInv distribution"};

FemtoWorldContainer<femtoWorldContainer::EventType::same, femtoWorldContainer::Observable::kstar> sameEventCont;

Expand All @@ -121,9 +128,9 @@ struct femtoWorldPairTaskTrackTrack {
trackHistoPartTwo.init(&qaRegistry);
}

sameEventCont.init(&resultRegistry, CfgkstarBins, CfgMultBins, CfgkTBins, CfgmTBins, ConfPhiBins, ConfEtaBins);
sameEventCont.init(&resultRegistry, CfgkstarBins, CfgMultBins, CfgkTBins, CfgmTBins, ConfPhiBins, ConfEtaBins, ConfMInvBins);
sameEventCont.setPDGCodes(ConfPDGCodePartOne, ConfPDGCodePartTwo);
mixedEventCont.init(&resultRegistry, CfgkstarBins, CfgMultBins, CfgkTBins, CfgmTBins, ConfPhiBins, ConfEtaBins);
mixedEventCont.init(&resultRegistry, CfgkstarBins, CfgMultBins, CfgkTBins, CfgmTBins, ConfPhiBins, ConfEtaBins, ConfMInvBins);
mixedEventCont.setPDGCodes(ConfPDGCodePartOne, ConfPDGCodePartTwo);
pairCleaner.init(&qaRegistry);
if (ConfIsCPR) {
Expand All @@ -145,7 +152,7 @@ struct femtoWorldPairTaskTrackTrack {
/// This function processes the same event and takes care of all the histogramming
/// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ...
void processSameEvent(o2::aod::FemtoDreamCollision& col,
o2::aod::FemtoDreamParticles& parts)
o2::aod::FemtoWorldParticles& parts)
{
const auto& tmstamp = col.timestamp();
const auto& magFieldTesla = getMagneticFieldTesla(tmstamp, ccdb);
Expand Down Expand Up @@ -205,7 +212,7 @@ struct femtoWorldPairTaskTrackTrack {
/// This function processes the mixed event
/// \todo the trivial loops over the collisions and tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ...
void processMixedEvent(o2::aod::FemtoDreamCollisions& cols,
o2::aod::FemtoDreamParticles& parts)
o2::aod::FemtoWorldParticles& parts)
{

ColumnBinningPolicy<aod::collision::PosZ, aod::femtodreamcollision::MultV0M> colBinning{{CfgVtxBins, CfgMultBins}, true};
Expand Down