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: 8 additions & 6 deletions PWGLF/Tasks/QC/mcParticlePrediction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ using namespace o2::pwglf;
// Particles
static const std::vector<std::string> parameterNames{"Enable"};
static constexpr int nParameters = 1;
static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
bool enabledParticlesArray[PIDExtended::NIDsTot];

// Estimators
Expand Down Expand Up @@ -158,7 +158,7 @@ std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hvertexPosZ;
std::array<std::array<std::shared_ptr<TH2>, PIDExtended::NIDsTot>, Estimators::nEstimators> hpt;
std::array<std::array<std::shared_ptr<TH1>, PIDExtended::NIDsTot>, Estimators::nEstimators> hyield;

struct mcParticlePrediction {
struct McParticlePrediction {

// Histograms
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
Expand Down Expand Up @@ -195,6 +195,8 @@ struct mcParticlePrediction {
Configurable<bool> enableVsEta05Histograms{"enableVsEta05Histograms", true, "Enables the correlation between ETA05 and other estimators"};
Configurable<bool> enableVsEta08Histograms{"enableVsEta08Histograms", true, "Enables the correlation between ETA08 and other estimators"};
Configurable<bool> enableVsImpactParameterHistograms{"enableVsImpactParameterHistograms", true, "Enables the correlation between impact parameter and other estimators"};
Configurable<float> cfgEvtZvtxCut{"cfgEvtZvtxCut", 10.0f, "Evt sel: Max. z-Vertex (cm)"};
Configurable<float> chargetolerance{"chargetolerance", 1e-3, "Tolerance to consider a particle as charged based on its charge"};

Service<o2::framework::O2DatabasePDG> pdgDB;
o2::pwglf::ParticleCounter<o2::framework::O2DatabasePDG> mCounter;
Expand Down Expand Up @@ -456,7 +458,7 @@ struct mcParticlePrediction {
}

histos.fill(HIST("collisions/generated"), 1);
if (std::abs(mcCollision.posZ()) > 10.f) {
if (std::abs(mcCollision.posZ()) > cfgEvtZvtxCut) {
return;
}
histos.fill(HIST("collisions/generated"), 2);
Expand Down Expand Up @@ -500,7 +502,7 @@ struct mcParticlePrediction {

TParticlePDG* p = pdgDB->GetParticle(particle.pdgCode());
if (p) {
if (std::abs(p->Charge()) > 1e-3) {
if (std::abs(p->Charge()) > chargetolerance) {
histos.fill(HIST("particles/eta/charged"), particle.eta());
} else {
histos.fill(HIST("particles/eta/neutral"), particle.eta());
Expand Down Expand Up @@ -721,7 +723,7 @@ struct mcParticlePrediction {
hestimatorsRecoEvVsBCId[i]->Fill(foundBCid, nMultReco[i]);
}
}
PROCESS_SWITCH(mcParticlePrediction, processReco, "Process the reco info", true);
PROCESS_SWITCH(McParticlePrediction, processReco, "Process the reco info", true);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<mcParticlePrediction>(cfgc)}; }
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<McParticlePrediction>(cfgc)}; }
6 changes: 5 additions & 1 deletion PWGLF/Utils/mcParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ class PIDExtended
static constexpr ID KstarPM = PIDCounts + 40;
static constexpr ID Kshort = PIDCounts + 41;
static constexpr ID Xi1530 = PIDCounts + 42;
static constexpr ID NIDsTot = PIDCounts + 43;
static constexpr ID Lambda1520 = PIDCounts + 43;
static constexpr ID NIDsTot = PIDCounts + 44;

static constexpr const char* sNames[NIDsTot + 1] = {
o2::track::pid_constants::sNames[Electron], // Electron
Expand Down Expand Up @@ -199,6 +200,7 @@ class PIDExtended
"KstarPM", // KstarPM
"Kshort", // Kshort
"Xi1530", // Xi1530
"Lambda1520", // Lambda1520
nullptr};

static std::vector<std::string> arrayNames()
Expand Down Expand Up @@ -341,6 +343,8 @@ class PIDExtended
return Kshort;
case 3324:
return Xi1530;
case 3124:
return Lambda1520;
default:
LOG(debug) << "Cannot identify particle with PDG code " << particle.pdgCode();
break;
Expand Down
Loading