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
63 changes: 47 additions & 16 deletions PWGLF/TableProducer/Common/kinkBuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
std::shared_ptr<TH2> h2ClsMapPtDaug;
std::shared_ptr<TH2> h2DeDxDaugSel;
std::shared_ptr<TH2> h2KinkAnglePt;
std::shared_ptr<TH2> h2SigmaMinusMassPt;
std::shared_ptr<TH2> h2MothMassPt;
} // namespace

struct kinkCandidate {
Expand Down Expand Up @@ -89,9 +89,13 @@

struct kinkBuilder {

enum PartType { kSigmaMinus = 0,
kHyperhelium4sigma };

Produces<aod::KinkCands> outputDataTable;
Service<o2::ccdb::BasicCCDBManager> ccdb;

Configurable<int> hypoMoth{"hypoMoth", kSigmaMinus, "Mother particle hypothesis"};
// Selection criteria
Configurable<float> maxDCAMothToPV{"maxDCAMothToPV", 0.1, "Max DCA of the mother to the PV"};
Configurable<float> minDCADaugToPV{"minDCADaugToPV", 0., "Min DCA of the daughter to the PV"};
Expand All @@ -107,7 +111,7 @@
o2::base::MatLayerCylSet* lut = nullptr;

// constants
float radToDeg = 180. / M_PI;
float radToDeg = o2::constants::math::Rad2Deg;
svPoolCreator svCreator;

// bethe bloch parameters
Expand Down Expand Up @@ -141,8 +145,25 @@
float mBz;
std::array<float, 6> mBBparamsDaug;

// mother and daughter tracks' properties (absolute charge and mass)
int charge = 1;
float mothMass = o2::constants::physics::MassSigmaMinus;
float chargedDauMass = o2::constants::physics::MassPiMinus;
float neutDauMass = o2::constants::physics::MassNeutron;

void init(InitContext const&)
{
if (hypoMoth == kSigmaMinus) {
charge = 1;
mothMass = o2::constants::physics::MassSigmaMinus;
chargedDauMass = o2::constants::physics::MassPiMinus;
neutDauMass = o2::constants::physics::MassNeutron;
} else if (hypoMoth == kHyperhelium4sigma) {
charge = 2;
mothMass = o2::constants::physics::MassHyperHelium4;
chargedDauMass = o2::constants::physics::MassAlpha;
neutDauMass = o2::constants::physics::MassPi0;
}

// dummy values, 1 for mother, 0 for daughter
svCreator.setPDGs(1, 0);
Expand Down Expand Up @@ -174,13 +195,19 @@
const AxisSpec itsClusterMapAxis(128, 0, 127, "ITS cluster map");
const AxisSpec rigidityAxis{rigidityBins, "#it{p}^{TPC}/#it{z}"};
const AxisSpec ptAxis{rigidityBins, "#it{p}_{T} (GeV/#it{c})"};
const AxisSpec sigmaMassAxis{100, 1.1, 1.4, "m (GeV/#it{c}^{2})"};
const AxisSpec kinkAngleAxis{100, 0, 180, "#theta_{kink} (deg)"};
const AxisSpec dedxAxis{dedxBins, "d#it{E}/d#it{x}"};

AxisSpec massAxis(100, 1.1, 1.4, "m (GeV/#it{c}^{2})");
if (hypoMoth == kSigmaMinus) {
massAxis = AxisSpec{100, 1.1, 1.4, "m (GeV/#it{c}^{2})"};
} else if (hypoMoth == kHyperhelium4sigma) {
massAxis = AxisSpec{100, 3.85, 4.25, "m (GeV/#it{c}^{2})"};
}

h2DeDxDaugSel = qaRegistry.add<TH2>("h2DeDxDaugSel", ";p_{TPC}/z (GeV/#it{c}); dE/dx", HistType::kTH2F, {rigidityAxis, dedxAxis});
h2KinkAnglePt = qaRegistry.add<TH2>("h2KinkAnglePt", "; p_{T} (GeV/#it{c}); #theta_{kink} (deg)", HistType::kTH2F, {ptAxis, kinkAngleAxis});
h2SigmaMinusMassPt = qaRegistry.add<TH2>("h2SigmaMinusMassPt", "; p_{T} (GeV/#it{c}); m (GeV/#it{c}^{2})", HistType::kTH2F, {ptAxis, sigmaMassAxis});
h2MothMassPt = qaRegistry.add<TH2>("h2MothMassPt", "; p_{T} (GeV/#it{c}); m (GeV/#it{c}^{2})", HistType::kTH2F, {ptAxis, massAxis});
h2ClsMapPtMoth = qaRegistry.add<TH2>("h2ClsMapPtMoth", "; p_{T} (GeV/#it{c}); ITS cluster map", HistType::kTH2F, {ptAxis, itsClusterMapAxis});
h2ClsMapPtDaug = qaRegistry.add<TH2>("h2ClsMapPtDaug", "; p_{T} (GeV/#it{c}); ITS cluster map", HistType::kTH2F, {ptAxis, itsClusterMapAxis});
}
Expand All @@ -188,8 +215,8 @@
template <typename T>
bool selectMothTrack(const T& candidate)
{
if (candidate.has_collision() && candidate.hasITS() && !candidate.hasTPC() && !candidate.hasTOF() && candidate.itsNCls() < 6 &&

Check failure on line 218 in PWGLF/TableProducer/Common/kinkBuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
candidate.itsNClsInnerBarrel() == 3 && candidate.itsChi2NCl() < 36 && candidate.pt() > minPtMoth) {

Check failure on line 219 in PWGLF/TableProducer/Common/kinkBuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return true;
}
return false;
Expand All @@ -207,8 +234,8 @@
}

bool isGoodTPCCand = false;
if (candidate.itsNClsInnerBarrel() == 0 && candidate.itsNCls() < 4 &&

Check failure on line 237 in PWGLF/TableProducer/Common/kinkBuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
candidate.tpcNClsCrossedRows() > 0.8 * candidate.tpcNClsFindable() && candidate.tpcNClsFound() > nTPCClusMinDaug) {

Check failure on line 238 in PWGLF/TableProducer/Common/kinkBuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
isGoodTPCCand = true;
}

Expand All @@ -225,7 +252,7 @@
svCreator.clearPools();
svCreator.fillBC2Coll(collisions, bcs);

for (auto& track : tracks) {
for (const auto& track : tracks) {
if (std::abs(track.eta()) > etaMax)
continue;

Expand All @@ -240,7 +267,7 @@
}
auto& kinkPool = svCreator.getSVCandPool(collisions, !unlikeSignBkg);

for (auto& svCand : kinkPool) {
for (const auto& svCand : kinkPool) {
kinkCandidate kinkCand;

auto trackMoth = tracks.rawIteratorAt(svCand.tr0Idx);
Expand Down Expand Up @@ -311,13 +338,13 @@

// get last layer hitted by the mother and the first layer hitted by the daughter
int lastLayerMoth = 0, firstLayerDaug = 0;
for (int i = 0; i < 7; i++) {

Check failure on line 341 in PWGLF/TableProducer/Common/kinkBuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (trackMoth.itsClusterMap() & (1 << i)) {
lastLayerMoth = i;
}
}

for (int i = 0; i < 7; i++) {

Check failure on line 347 in PWGLF/TableProducer/Common/kinkBuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (trackDaug.itsClusterMap() & (1 << i)) {
firstLayerDaug = i;
break;
Expand All @@ -332,31 +359,35 @@
continue;
}

for (int i = 0; i < 3; i++) {

Check failure on line 362 in PWGLF/TableProducer/Common/kinkBuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
kinkCand.decVtx[i] -= kinkCand.primVtx[i];
}

propMothTrack.getPxPyPzGlo(kinkCand.momMoth);
propDaugTrack.getPxPyPzGlo(kinkCand.momDaug);
float pMoth = propMothTrack.getP();
float pDaug = propDaugTrack.getP();
for (int i = 0; i < 3; i++) {

Check failure on line 368 in PWGLF/TableProducer/Common/kinkBuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
kinkCand.momMoth[i] *= charge;
kinkCand.momDaug[i] *= charge;
}
float pMoth = propMothTrack.getP() * charge;
float pDaug = propDaugTrack.getP() * charge;
float spKink = kinkCand.momMoth[0] * kinkCand.momDaug[0] + kinkCand.momMoth[1] * kinkCand.momDaug[1] + kinkCand.momMoth[2] * kinkCand.momDaug[2];
kinkCand.kinkAngle = std::acos(spKink / (pMoth * pDaug));

std::array<float, 3> neutDauMom{0.f, 0.f, 0.f};
for (int i = 0; i < 3; i++) {

Check failure on line 378 in PWGLF/TableProducer/Common/kinkBuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
neutDauMom[i] = kinkCand.momMoth[i] - kinkCand.momDaug[i];
}

float piMinusE = std::sqrt(neutDauMom[0] * neutDauMom[0] + neutDauMom[1] * neutDauMom[1] + neutDauMom[2] * neutDauMom[2] + 0.13957 * 0.13957);
float neutronE = std::sqrt(pDaug * pDaug + 0.93957 * 0.93957);
float invMass = std::sqrt((piMinusE + neutronE) * (piMinusE + neutronE) - (pMoth * pMoth));
float chargedDauE = std::sqrt(pDaug * pDaug + chargedDauMass * chargedDauMass);
float neutE = std::sqrt(neutDauMom[0] * neutDauMom[0] + neutDauMom[1] * neutDauMom[1] + neutDauMom[2] * neutDauMom[2] + neutDauMass * neutDauMass);
float invMass = std::sqrt((chargedDauE + neutE) * (chargedDauE + neutE) - (pMoth * pMoth));

h2DeDxDaugSel->Fill(trackDaug.tpcInnerParam() * trackDaug.sign(), trackDaug.tpcSignal());
h2KinkAnglePt->Fill(trackMoth.pt() * trackMoth.sign(), kinkCand.kinkAngle * radToDeg);
h2SigmaMinusMassPt->Fill(trackMoth.pt() * trackMoth.sign(), invMass);
h2ClsMapPtMoth->Fill(trackMoth.pt() * trackMoth.sign(), trackMoth.itsClusterMap());
h2ClsMapPtDaug->Fill(trackDaug.pt() * trackDaug.sign(), trackDaug.itsClusterMap());
h2KinkAnglePt->Fill(trackMoth.pt() * charge * trackMoth.sign(), kinkCand.kinkAngle * radToDeg);
h2MothMassPt->Fill(trackMoth.pt() * charge * trackMoth.sign(), invMass);
h2ClsMapPtMoth->Fill(trackMoth.pt() * charge * trackMoth.sign(), trackMoth.itsClusterMap());
h2ClsMapPtDaug->Fill(trackDaug.pt() * charge * trackDaug.sign(), trackDaug.itsClusterMap());

kinkCand.collisionID = collision.globalIndex();
kinkCand.mothTrackID = trackMoth.globalIndex();
Expand All @@ -381,7 +412,7 @@
o2::parameters::GRPMagField* grpmag = 0x0;
if (grpo) {
o2::base::Propagator::initFieldFromGRP(grpo);
if (inputBz < -990) {

Check failure on line 415 in PWGLF/TableProducer/Common/kinkBuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
// Fetch magnetic field from ccdb for current collision
mBz = grpo->getNominalL3Field();
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << mBz << " kZG";
Expand Down Expand Up @@ -423,7 +454,7 @@
// sort kinkCandidates by collisionID to allow joining with collision table
std::sort(kinkCandidates.begin(), kinkCandidates.end(), [](const kinkCandidate& a, const kinkCandidate& b) { return a.collisionID < b.collisionID; });

for (auto& kinkCand : kinkCandidates) {
for (const auto& kinkCand : kinkCandidates) {
outputDataTable(kinkCand.collisionID, kinkCand.mothTrackID, kinkCand.daugTrackID,
kinkCand.decVtx[0], kinkCand.decVtx[1], kinkCand.decVtx[2],
kinkCand.mothSign, kinkCand.momMoth[0], kinkCand.momMoth[1], kinkCand.momMoth[2],
Expand Down
139 changes: 95 additions & 44 deletions PWGLF/Tasks/Nuspex/hyperhelium4sigmaAnalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/PIDResponse.h"
#include "CommonConstants/PhysicsConstants.h"
#include "PWGLF/DataModel/LFKinkDecayTables.h"

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
using std::array;

using CollisionsFull = soa::Join<aod::Collisions, aod::EvSel>;
using FullTracksExtIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullPr, aod::pidTPCFullAl, aod::pidTPCFullTr, aod::pidTPCFullPi>;
using MCLabeledTracksIU = soa::Join<FullTracksExtIU, aod::McTrackLabels>;

Expand Down Expand Up @@ -97,17 +99,52 @@ Channel getDecayChannelH4S(TMCParticle const& particle)
return kNDecayChannel;
}
//--------------------------------------------------------------
struct Hyperhelium4sigmaAnalysis {
// Histograms are defined with HistogramRegistry
HistogramRegistry registry{"registry", {}};

// Configurable for event selection
Configurable<float> cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"};
Configurable<float> cutNSigmaAl{"cutNSigmaAl", 5, "NSigmaTPCAlpha"};

void init(InitContext const&)
{
// Axes
const AxisSpec vertexZAxis{100, -15., 15., "vrtx_{Z} [cm]"};
const AxisSpec ptAxis{50, -10, 10, "#it{p}_{T} (GeV/#it{c})"};
const AxisSpec nSigmaAxis{120, -6.f, 6.f, "n#sigma_{#alpha}"};
const AxisSpec massAxis{100, 3.85, 4.25, "m (GeV/#it{c}^{2})"};

registry.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}});

registry.add("h2MassHyperhelium4sigmaPt", "h2MassHyperhelium4sigmaPt", {HistType::kTH2F, {ptAxis, massAxis}});
registry.add("h2NSigmaAlPt", "h2NSigmaAlPt", {HistType::kTH2F, {ptAxis, nSigmaAxis}});
}

void process(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision,
aod::KinkCands const& KinkCands, FullTracksExtIU const&)
{
if (std::abs(collision.posZ()) > cutzvertex || !collision.sel8()) {
return;
}
registry.fill(HIST("hVertexZRec"), collision.posZ());
for (const auto& kinkCand : KinkCands) {
auto dauTrack = kinkCand.trackDaug_as<FullTracksExtIU>();
if (std::abs(dauTrack.tpcNSigmaAl()) > cutNSigmaAl) {
continue;
}
float invMass = RecoDecay::m(std::array{std::array{kinkCand.pxDaug(), kinkCand.pyDaug(), kinkCand.pzDaug()}, std::array{kinkCand.pxDaugNeut(), kinkCand.pyDaugNeut(), kinkCand.pzDaugNeut()}}, std::array{o2::constants::physics::MassAlpha, o2::constants::physics::MassPi0});
registry.fill(HIST("h2MassHyperhelium4sigmaPt"), kinkCand.mothSign() * kinkCand.ptMoth(), invMass);
registry.fill(HIST("h2NSigmaAlPt"), kinkCand.mothSign() * kinkCand.ptDaug(), dauTrack.tpcNSigmaAl());
}
}
};

//--------------------------------------------------------------
// check the performance of mcparticle
struct Hyperhelium4sigmaAnalysis {
struct Hyperhelium4sigmaQa {
// Basic checks
HistogramRegistry registry{
"registry",
{
{"hCollCounter", "hCollCounter", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}},
{"hMcCollCounter", "hMcCollCounter", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}},
},
};
HistogramRegistry registry{"registry", {}};

ConfigurableAxis ptBins{"ptBins", {200, 0.f, 10.f}, "Binning for #it{p}_{T} (GeV/#it{c})"};
ConfigurableAxis ctBins{"ctBins", {100, 0.f, 25.f}, "Binning for c#it{t} (cm)"};
Expand All @@ -117,40 +154,45 @@ struct Hyperhelium4sigmaAnalysis {

void init(InitContext&)
{
const AxisSpec ptAxis{ptBins, "#it{p}_{T} (GeV/#it{c})"};
const AxisSpec ctAxis{ctBins, "c#it{t} (cm)"};
const AxisSpec rigidityAxis{rigidityBins, "p/z (GeV/#it{c})"};
const AxisSpec nsigmaAxis{nsigmaBins, "TPC n#sigma"};
const AxisSpec invMassAxis{invMassBins, "Inv Mass (GeV/#it{c}^{2})"};

registry.get<TH1>(HIST("hCollCounter"))->GetXaxis()->SetBinLabel(1, "Reconstructed Collisions");
registry.get<TH1>(HIST("hCollCounter"))->GetXaxis()->SetBinLabel(2, "Selected");
registry.get<TH1>(HIST("hMcCollCounter"))->GetXaxis()->SetBinLabel(1, "MC Collisions");
registry.get<TH1>(HIST("hMcCollCounter"))->GetXaxis()->SetBinLabel(2, "Reconstructed");

auto hGenHyperHelium4SigmaCounter = registry.add<TH1>("hGenHyperHelium4SigmaCounter", "", HistType::kTH1F, {{10, 0.f, 10.f}});
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(1, "H4S All");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(2, "Matter");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(3, "AntiMatter");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(4, "#alpha + #pi^{0}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(5, "#bar{#alpha} + #pi^{0}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(6, "t + p + #pi^{0}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(7, "#bar{t} + #bar{p} + #pi^{0}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(8, "t + n + #pi^{+}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(9, "#bar{t} + #bar{n} + #pi^{+}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(10, "Unexpected");

auto hEvtSelectedHyperHelium4SigmaCounter = registry.add<TH1>("hEvtSelectedHyperHelium4SigmaCounter", "", HistType::kTH1F, {{2, 0.f, 2.f}});
registry.get<TH1>(HIST("hEvtSelectedHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(1, "Generated");
registry.get<TH1>(HIST("hEvtSelectedHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(2, "Survived");

registry.add<TH1>("hGenHyperHelium4SigmaPt", "", HistType::kTH1F, {ptAxis});
registry.add<TH1>("hGenHyperHelium4SigmaCt", "", HistType::kTH1F, {ctAxis});
registry.add<TH1>("hMcRecoInvMass", "", HistType::kTH1F, {invMassAxis});

registry.add<TH2>("hDauHelium4TPCNSigma", "", HistType::kTH2F, {rigidityAxis, nsigmaAxis});
registry.add<TH2>("hDauTritonTPCNSigma", "", HistType::kTH2F, {rigidityAxis, nsigmaAxis});
registry.add<TH2>("hDauProtonTPCNSigma", "", HistType::kTH2F, {rigidityAxis, nsigmaAxis});
if (doprocessMC == true) {
const AxisSpec ptAxis{ptBins, "#it{p}_{T} (GeV/#it{c})"};
const AxisSpec ctAxis{ctBins, "c#it{t} (cm)"};
const AxisSpec rigidityAxis{rigidityBins, "p/z (GeV/#it{c})"};
const AxisSpec nsigmaAxis{nsigmaBins, "TPC n#sigma"};
const AxisSpec invMassAxis{invMassBins, "Inv Mass (GeV/#it{c}^{2})"};

auto hCollCounter = registry.add<TH1>("hCollCounter", "hCollCounter", HistType::kTH1F, {{2, 0.0f, 2.0f}});
registry.get<TH1>(HIST("hCollCounter"))->GetXaxis()->SetBinLabel(1, "Reconstructed Collisions");
registry.get<TH1>(HIST("hCollCounter"))->GetXaxis()->SetBinLabel(2, "Selected");
auto hMcCollCounter = registry.add<TH1>("hMcCollCounter", "hMcCollCounter", HistType::kTH1F, {{2, 0.0f, 2.0f}});
registry.get<TH1>(HIST("hMcCollCounter"))->GetXaxis()->SetBinLabel(1, "MC Collisions");
registry.get<TH1>(HIST("hMcCollCounter"))->GetXaxis()->SetBinLabel(2, "Reconstructed");

auto hGenHyperHelium4SigmaCounter = registry.add<TH1>("hGenHyperHelium4SigmaCounter", "", HistType::kTH1F, {{10, 0.f, 10.f}});
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(1, "H4S All");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(2, "Matter");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(3, "AntiMatter");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(4, "#alpha + #pi^{0}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(5, "#bar{#alpha} + #pi^{0}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(6, "t + p + #pi^{0}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(7, "#bar{t} + #bar{p} + #pi^{0}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(8, "t + n + #pi^{+}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(9, "#bar{t} + #bar{n} + #pi^{+}");
registry.get<TH1>(HIST("hGenHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(10, "Unexpected");

auto hEvtSelectedHyperHelium4SigmaCounter = registry.add<TH1>("hEvtSelectedHyperHelium4SigmaCounter", "", HistType::kTH1F, {{2, 0.f, 2.f}});
registry.get<TH1>(HIST("hEvtSelectedHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(1, "Generated");
registry.get<TH1>(HIST("hEvtSelectedHyperHelium4SigmaCounter"))->GetXaxis()->SetBinLabel(2, "Survived");

registry.add<TH1>("hGenHyperHelium4SigmaP", "", HistType::kTH1F, {ptAxis});
registry.add<TH1>("hGenHyperHelium4SigmaPt", "", HistType::kTH1F, {ptAxis});
registry.add<TH1>("hGenHyperHelium4SigmaCt", "", HistType::kTH1F, {ctAxis});
registry.add<TH1>("hMcRecoInvMass", "", HistType::kTH1F, {invMassAxis});

registry.add<TH2>("hDauHelium4TPCNSigma", "", HistType::kTH2F, {rigidityAxis, nsigmaAxis});
registry.add<TH2>("hDauTritonTPCNSigma", "", HistType::kTH2F, {rigidityAxis, nsigmaAxis});
registry.add<TH2>("hDauProtonTPCNSigma", "", HistType::kTH2F, {rigidityAxis, nsigmaAxis});
}
}

// Configurable<bool> eventSel8Cut{"eventSel8Cut", true, "flag to enable event sel8 selection"};
Expand Down Expand Up @@ -183,7 +225,13 @@ struct Hyperhelium4sigmaAnalysis {
}
}

void process(aod::McCollisions const& mcCollisions, aod::McParticles const& particlesMC, o2::soa::Join<o2::aod::Collisions, o2::aod::McCollisionLabels, o2::aod::EvSels> const& collisions, MCLabeledTracksIU const& tracks)
void processData(o2::aod::Collisions const&)
{
// dummy process function;
}
PROCESS_SWITCH(Hyperhelium4sigmaQa, processData, "process data", true);

void processMC(aod::McCollisions const& mcCollisions, aod::McParticles const& particlesMC, o2::soa::Join<o2::aod::Collisions, o2::aod::McCollisionLabels, o2::aod::EvSels> const& collisions, MCLabeledTracksIU const& tracks)
{
setTrackIDForMC(particlesMC, tracks);
std::vector<int64_t> selectedEvents(collisions.size());
Expand Down Expand Up @@ -296,6 +344,7 @@ struct Hyperhelium4sigmaAnalysis {
}
}

registry.fill(HIST("hGenHyperHelium4SigmaP"), mcparticle.p());
registry.fill(HIST("hGenHyperHelium4SigmaPt"), mcparticle.pt());
double ct = RecoDecay::sqrtSumOfSquares(svPos[0] - mcparticle.vx(), svPos[1] - mcparticle.vy(), svPos[2] - mcparticle.vz()) * o2::constants::physics::MassHyperHelium4Sigma / mcparticle.p();
registry.fill(HIST("hGenHyperHelium4SigmaCt"), ct);
Expand Down Expand Up @@ -328,11 +377,13 @@ struct Hyperhelium4sigmaAnalysis {
}
}
}
PROCESS_SWITCH(Hyperhelium4sigmaQa, processMC, "do QA for MC prodcutions", false);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<Hyperhelium4sigmaAnalysis>(cfgc),
adaptAnalysisTask<Hyperhelium4sigmaQa>(cfgc),
};
}
Loading