Skip to content
Merged
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
183 changes: 95 additions & 88 deletions PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
BinningType binningPolicy{{axisVertex, axisCentrality}, true};
SliceCache cache;
SameKindPair<CollisionsFull, TrackCandidates, BinningType> mPair{binningPolicy, settingNoMixedEvents, -1, &cache};
//Pair<CollisionsFull, TrackCandidates, o2::aod::DataHypCandsWColl, BinningType> hyperPair{binningPolicy, settingNoMixedEvents, -1, &cache};
// Pair<CollisionsFull, TrackCandidates, o2::aod::DataHypCandsWColl, BinningType> hyperPair{binningPolicy, settingNoMixedEvents, -1, &cache};

std::array<float, 6> mBBparamsDe;

Expand Down Expand Up @@ -273,12 +273,11 @@
false,
true};


int numOfCentBins = 40;
int numOfVertexZBins = 30;
float Vz_low = -10.0f;

Check failure on line 278 in PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
float Vz_high = 10.0f;
float Vz_step = (Vz_high - Vz_low) / numOfVertexZBins;
float Vz_step = (Vz_high - Vz_low) / numOfVertexZBins;

struct EventRef {
int64_t collisionId;
Expand All @@ -300,17 +299,21 @@
isInitialized = true;
}

int where_pool(float vz, float v0Centr) const
int where_pool(float vz, float v0Centr) const
{
float CentBinWidth = 100.0 / numOfCentBins; // = 2.5

int iy = static_cast<int>(std::floor(v0Centr / CentBinWidth));
if (iy < 0) iy = 0;
if (iy >= numOfCentBins) iy = numOfCentBins - 1;
if (iy < 0)
iy = 0;
if (iy >= numOfCentBins)
iy = numOfCentBins - 1;

int ix = static_cast<int>(std::floor((vz - Vz_low) / Vz_step));
if (ix < 0) ix = 0;
if (ix >= numOfVertexZBins) ix = numOfVertexZBins - 1;
if (ix < 0)
ix = 0;
if (ix >= numOfVertexZBins)
ix = numOfVertexZBins - 1;

int bin = ix + numOfVertexZBins * iy;
return bin;
Expand Down Expand Up @@ -557,16 +560,16 @@

bool selectionPIDHyper(const aod::DataHypCandsWColl::iterator& V0Hyper)
{
mQaRegistry.fill(HIST("hHe3P_preselected"), V0Hyper.tpcMomHe());
float averClusSizeHe = averageClusterSizeCosl(V0Hyper.itsClusterSizesHe(), V0Hyper.etaHe3());
if (averClusSizeHe <= 4) {
mQaRegistry.fill(HIST("hHe3P_preselected"), V0Hyper.tpcMomHe());
float averClusSizeHe = averageClusterSizeCosl(V0Hyper.itsClusterSizesHe(), V0Hyper.etaHe3());
if (averClusSizeHe <= 4) {

Check failure on line 565 in PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.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 false;
}
if (V0Hyper.tpcChi2He() <= 0.5) {
if (V0Hyper.tpcChi2He() <= 0.5) {

Check failure on line 568 in PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.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 false;
}
mQaRegistry.fill(HIST("hHe3P"), V0Hyper.tpcMomHe());
mQaRegistry.fill(HIST("hHe3TPCnsigma"), V0Hyper.nSigmaHe());
mQaRegistry.fill(HIST("hHe3P"), V0Hyper.tpcMomHe());
mQaRegistry.fill(HIST("hHe3TPCnsigma"), V0Hyper.nSigmaHe());

return true;
}
Expand Down Expand Up @@ -689,22 +692,22 @@
bool fillCandidateInfoHyper(const aod::DataHypCandsWColl::iterator& V0Hyper, const Ttrack& trackPi, PiNucandidate& piHypercand, bool isMixedEvent)
{
piHypercand.collisionID = V0Hyper.collisionId();
//get hypertriton information
//constexpr double mHe3 = o2::constants::physics::MassHelium3;
//constexpr double mPi = o2::constants::physics::MassPiPlus;
// --- He3
// get hypertriton information
// constexpr double mHe3 = o2::constants::physics::MassHelium3;
// constexpr double mPi = o2::constants::physics::MassPiPlus;
// --- He3
float pxHe3 = V0Hyper.ptHe3() * std::cos(V0Hyper.phiHe3());
float pyHe3 = V0Hyper.ptHe3() * std::sin(V0Hyper.phiHe3());
float pzHe3 = V0Hyper.ptHe3() * std::sinh(V0Hyper.etaHe3());
//float pHe3 = V0Hyper.ptHe3() * std::cosh(V0Hyper.etaHe3());
//float enHe3 = std::sqrt(pHe3 * pHe3 + mHe3 * mHe3);
// --- pi
// float pHe3 = V0Hyper.ptHe3() * std::cosh(V0Hyper.etaHe3());
// float enHe3 = std::sqrt(pHe3 * pHe3 + mHe3 * mHe3);
// --- pi
float pxPi = V0Hyper.ptPi() * std::cos(V0Hyper.phiPi());
float pyPi = V0Hyper.ptPi() * std::sin(V0Hyper.phiPi());
float pzPi = V0Hyper.ptPi() * std::sinh(V0Hyper.etaPi());
//float pPi = V0Hyper.ptPi() * std::cosh(V0Hyper.etaPi());
//float enPi = std::sqrt(pPi * pPi + mPi * mPi);
// --- hypertriton
// float pPi = V0Hyper.ptPi() * std::cosh(V0Hyper.etaPi());
// float enPi = std::sqrt(pPi * pPi + mPi * mPi);
// --- hypertriton
float px = pxHe3 + pxPi;
float py = pyHe3 + pyPi;
float pz = pzHe3 + pzPi;
Expand All @@ -722,12 +725,12 @@
}

piHypercand.signPi = trackPi.sign();
if(V0Hyper.isMatter()){
if (V0Hyper.isMatter()) {
piHypercand.signNu = 1;
}else{
} else {
piHypercand.signNu = -1;
}

piHypercand.dcaxyPi = trackPi.dcaXY();
piHypercand.dcazPi = trackPi.dcaZ();
piHypercand.tpcSignalPi = trackPi.tpcSignal();
Expand Down Expand Up @@ -804,30 +807,30 @@
void pairTracksSameEventHyper(const Ttrack& piTracks, const Thypers& V0Hypers)
{
for (const auto& V0Hyper : V0Hypers) {
if (!selectionPIDHyper(V0Hyper)) {
if (!selectionPIDHyper(V0Hyper)) {
continue;
}
for (const auto& piTrack : piTracks) {

mQaRegistry.fill(HIST("hTrackSel"), Selections::kNoCuts);

if (!selectTrack(piTrack)) {
continue;
}
for (const auto& piTrack : piTracks) {

mQaRegistry.fill(HIST("hTrackSel"), Selections::kNoCuts);

if (!selectTrack(piTrack)) {
continue;
}
mQaRegistry.fill(HIST("hTrackSel"), Selections::kTrackCuts);

if (!selectionPIDPion(piTrack)) {
continue;
}
mQaRegistry.fill(HIST("hTrackSel"), Selections::kPID);

SVCand pair;
pair.tr0Idx = piTrack.globalIndex();
pair.tr1Idx = V0Hyper.globalIndex();
const int collIdx = V0Hyper.collisionId();
CollBracket collBracket{collIdx, collIdx};
pair.collBracket = collBracket;
mTrackHypPairs.push_back(pair);
mQaRegistry.fill(HIST("hTrackSel"), Selections::kTrackCuts);

if (!selectionPIDPion(piTrack)) {
continue;
}
mQaRegistry.fill(HIST("hTrackSel"), Selections::kPID);

SVCand pair;
pair.tr0Idx = piTrack.globalIndex();
pair.tr1Idx = V0Hyper.globalIndex();
const int collIdx = V0Hyper.collisionId();
CollBracket collBracket{collIdx, collIdx};
pair.collBracket = collBracket;
mTrackHypPairs.push_back(pair);
}
}
}
Expand Down Expand Up @@ -964,7 +967,7 @@
mQaRegistry.fill(HIST("hNuPitInvMass"), piNucand.invMass);
mQaRegistry.fill(HIST("hdcaxyNu"), piNucand.dcaxyNu);
mQaRegistry.fill(HIST("hdcazNu"), piNucand.dcazNu);
mQaRegistry.fill(HIST("hdcazNu_min"), (abs(piNucand.dcazNu) - settingCutDeDCAzMin));

Check failure on line 970 in PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
mQaRegistry.fill(HIST("hNClsNuITS"), piNucand.nClsItsNu);
mQaRegistry.fill(HIST("hNClsPiITS"), piNucand.nClsItsPi);
mQaRegistry.fill(HIST("hisBkgEM"), piNucand.isBkgEM);
Expand All @@ -975,7 +978,7 @@
double m_BBparamsProton[6] = {-54.42066571222577, 0.2857381250239097, 1.247140602468868, 0.6297483918147729, 2.985438833884555, 0.09};

float TPCinnerParam = InnerParamTPCHad;
float expTPCSignal = o2::tpc::BetheBlochAleph((TPCinnerParam / 0.9382721), m_BBparamsProton[0], m_BBparamsProton[1], m_BBparamsProton[2], m_BBparamsProton[3], m_BBparamsProton[4]);

Check failure on line 981 in PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
double resoTPC{expTPCSignal * m_BBparamsProton[5]};
return ((SignalTPCHad - expTPCSignal) / resoTPC);
}
Expand All @@ -986,7 +989,7 @@
const float kp0 = 1.22204e-02;
const float kp1 = 7.48467e-01;

double fSigmaTOFMassHad = (kp0 * TMath::Exp(kp1 * TMath::Abs(ptHad))) * fExpTOFMassHad;

Check failure on line 992 in PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
double fNSigmaTOFHad = (MassTOFHad - fExpTOFMassHad) / fSigmaTOFMassHad;
return fNSigmaTOFHad;
}
Expand Down Expand Up @@ -1020,12 +1023,12 @@
{
double PrTPCnsigma = computePrTPCnsig(piNucand.momPiTPC, piNucand.tpcSignalPi);
double PrTOFnsigma = tofNSigmaCalculation(piNucand.massTOFPi, piNucand.recoPtPi());
if (abs(PrTPCnsigma) < settingCutNsigTPCPrMin)

Check failure on line 1026 in PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return;
if (abs(PrTOFnsigma) < settingCutNsigTOFPrMin)

Check failure on line 1028 in PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return;
float DeDCAxyMin = 0.015 + 0.0305 / TMath::Power(piNucand.recoPtNu(), 1.1);

Check failure on line 1030 in PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (abs(piNucand.dcaxyNu) > DeDCAxyMin || abs(piNucand.dcazNu) > settingCutDeDCAzMin || abs(piNucand.dcaxyPi) > settingCutPiDCAxyMin || abs(piNucand.dcazPi) > settingCutPiDCAzMin)

Check failure on line 1031 in PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return;
fillHistograms(piNucand);

Expand Down Expand Up @@ -1079,7 +1082,7 @@

auto v0hyper = V0Hypers.rawIteratorAt(trackPair.tr1Idx);
auto piTrack = piTracks.rawIteratorAt(trackPair.tr0Idx);
//auto collBracket = trackPair.collBracket;
// auto collBracket = trackPair.collBracket;

PiNucandidate piNucand;
if (!fillCandidateInfoHyper(v0hyper, piTrack, piNucand, isMixedEvent)) {
Expand Down Expand Up @@ -1138,7 +1141,7 @@
{
mGoodCollisions.clear();
mGoodCollisions.resize(collisions.size(), false);
//LOG(info) << "Number of hyperCandidates read = " << V0Hypers.size();
// LOG(info) << "Number of hyperCandidates read = " << V0Hypers.size();

for (const auto& collision : collisions) {

Expand All @@ -1151,7 +1154,7 @@
mGoodCollisions[collision.globalIndex()] = true;
const uint64_t collIdx = collision.globalIndex();
auto trackTableThisCollision = pitracks.sliceBy(mPerCol, collIdx);
auto hypdTableThisCollision = V0Hypers.sliceBy(hypPerCol, collIdx);
auto hypdTableThisCollision = V0Hypers.sliceBy(hypPerCol, collIdx);
trackTableThisCollision.bindExternalIndices(&pitracks);
hypdTableThisCollision.bindExternalIndices(&V0Hypers);

Expand All @@ -1161,7 +1164,7 @@
continue;
}

fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/ false);
fillPairsHyper(collisions, pitracks, V0Hypers, /*isMixedEvent*/ false);
}
}
PROCESS_SWITCH(PiNucleiFemto, processSameEventHyper, "Process Same event", false);
Expand Down Expand Up @@ -1204,54 +1207,58 @@
pairHyperEventMixing(tracks1, V0Hypers2);
}

fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/ /*false);
}
PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyper, "Process Mixed event", false);*/
fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/
/*false);
}
PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyper, "Process Mixed event", false);*/

void processMixedEventHyperPool(const CollisionsFull& collisions, o2::aod::DataHypCandsWColl const& V0Hypers, const TrackCandidates& pitracks)
{
LOG(info) << "Processing mixed event for hypertriton";

mTrackHypPairs.clear();
if (!isInitialized) {
initializePools();
LOG(info) << "Initialized event pool with size = " << All_Event_pool.size();
initializePools();
LOG(info) << "Initialized event pool with size = " << All_Event_pool.size();
}
for (auto const& collision : collisions) {
int poolIndexPi = where_pool(collision.posZ(), collision.centFT0C());
auto& pool = All_Event_pool[poolIndexPi];
for (auto const& collision : collisions) {
int poolIndexPi = where_pool(collision.posZ(), collision.centFT0C());
auto& pool = All_Event_pool[poolIndexPi];

if (poolIndexPi < 0 || poolIndexPi >= All_Event_pool.size()) {
continue;
}
if (poolIndexPi < 0 || poolIndexPi >= All_Event_pool.size()) {
continue;
}

for (auto const& storedEvent : pool.events) {
auto c1 = collisions.iteratorAt(storedEvent.collisionId);
const auto& c2 = collision;
if (!c1.sel8() || !c2.sel8()) continue;

std::vector<TrackCandidates::iterator> tracks1;
for (auto const& t : pitracks) {
if (t.collisionId() == c1.globalIndex()) {
tracks1.push_back(t);
}
}

std::vector<o2::aod::DataHypCandsWColl::iterator> hypers2;
for (auto const& h : V0Hypers) {
if (h.collisionId() != c2.globalIndex()) continue;
int poolIndexHyp = where_pool(h.zPrimVtx(), h.centralityFT0C());
if (poolIndexHyp != poolIndexPi) continue;
hypers2.push_back(h);
}
pairHyperEventMixing(tracks1, hypers2);
for (auto const& storedEvent : pool.events) {
auto c1 = collisions.iteratorAt(storedEvent.collisionId);
const auto& c2 = collision;
if (!c1.sel8() || !c2.sel8())
continue;

std::vector<TrackCandidates::iterator> tracks1;
for (auto const& t : pitracks) {
if (t.collisionId() == c1.globalIndex()) {
tracks1.push_back(t);
}
fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/ true);
}

if (static_cast<int>(pool.events.size()) >= settingNoMixedEvents) {
pool.events.pop_front();
std::vector<o2::aod::DataHypCandsWColl::iterator> hypers2;
for (auto const& h : V0Hypers) {
if (h.collisionId() != c2.globalIndex())
continue;
int poolIndexHyp = where_pool(h.zPrimVtx(), h.centralityFT0C());
if (poolIndexHyp != poolIndexPi)
continue;
hypers2.push_back(h);
}
pool.events.push_back({collision.globalIndex()});
pairHyperEventMixing(tracks1, hypers2);
}
fillPairsHyper(collisions, pitracks, V0Hypers, /*isMixedEvent*/ true);

if (static_cast<int>(pool.events.size()) >= settingNoMixedEvents) {
pool.events.pop_front();
}
pool.events.push_back({collision.globalIndex()});
}
}
PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyperPool, "Process Mixed event", false);
Expand Down
Loading