Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "Framework/RunningWorkflowInfo.h"
#include "Framework/StepTHn.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "TDatabasePDG.h"

Check failure on line 25 in PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.

#include "PWGCF/DataModel/FemtoDerived.h"
#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h"
Expand All @@ -49,6 +49,10 @@
float mMassOne = -999, mMassTwo = -999, mMassThree = -999;
int collisions = 0;

// Require bitmask selection for candidates
Configurable<bool> ConfRequireBitmask{"ConfRequireBitmask", false, "Require bitmask selection for candidates"};

// Number of candidates required
Configurable<int> ConfNumberOfTracks{"ConfNumberOfTracks", 3, "Number of tracks"};
Configurable<int> ConfNumberOfV0{"ConfNumberOfV0", 0, "Number of V0"};
Configurable<int> ConfNumberOfCascades{"ConfNumberOfCascades", 0, "Number of Cascades"};
Expand All @@ -57,6 +61,8 @@
Configurable<float> ConfPIDthrMom{"ConfPIDthrMom", 1.f, "Momentum threshold from which TPC and TOF are required for PID"};
Configurable<o2::aod::femtodreamparticle::cutContainerType> ConfTPCPIDBit{"ConfTPCPIDBit", 16, "PID TPC bit from cutCulator "};
Configurable<o2::aod::femtodreamparticle::cutContainerType> ConfTPCTOFPIDBit{"ConfTPCTOFPIDBit", 8, "PID TPCTOF bit from cutCulator"};
Configurable<o2::aod::femtodreamparticle::cutContainerType> ConfCutPart{"ConfCutPart", 0, "Track - Selection bit from cutCulator for part"};
Configurable<o2::aod::femtodreamparticle::cutContainerType> ConfCutPartAntiPart{"ConfCutPartAntiPart", 0, "Track - Selection bit from cutCulator for antipart"};

/// Partition for selected particles
Partition<aod::FDParticles> SelectedParts = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) &&
Expand All @@ -67,6 +73,12 @@
Configurable<float> Conf_maxInvMass_V0{"Conf_maxInvMass_V0", 1.15, "Maximum invariant mass of V0 (particle)"};
Configurable<float> Conf_minInvMassAnti_V0{"Conf_minInvMassAnti_V0", 1.08, "Minimum invariant mass of V0 (antiparticle)"};
Configurable<float> Conf_maxInvMassAnti_V0{"Conf_maxInvMassAnti_V0", 1.15, "Maximum invariant mass of V0 (antiparticle)"};
Configurable<o2::aod::femtodreamparticle::cutContainerType> ConfCutV0_SameForAntipart{"ConfCutV0_SameForAntipart", 0, "V0 - Selection bit from cutCulator for part/antipart"};
Configurable<o2::aod::femtodreamparticle::cutContainerType> Conf_ChildPos_CutV0{"Conf_ChildPos_CutV0", 149, "Selection bit for positive child of V0"};
Configurable<o2::aod::femtodreamparticle::cutContainerType> Conf_ChildPos_TPCBitV0{"Conf_ChildPos_TPCBitV0", 2, "PID TPC bit for positive child of V0"};
Configurable<o2::aod::femtodreamparticle::cutContainerType> Conf_ChildNeg_CutV0{"Conf_ChildNeg_CutV0", 149, "Selection bit for negative child of V0"};
Configurable<o2::aod::femtodreamparticle::cutContainerType> Conf_ChildNeg_TPCBitV0{"Conf_ChildNeg_TPCBitV0", 2, "PID TPC bit for negative child of V0"};

/// Cascade selection
Configurable<float> Conf_minInvMass_Cascade{"Conf_minInvMass_Cascade", 1.2, "Minimum invariant mass of Cascade (particle)"};
Configurable<float> Conf_maxInvMass_Cascade{"Conf_maxInvMass_Cascade", 1.5, "Maximum invariant mass of Cascade (particle)"};
Expand Down Expand Up @@ -95,8 +107,12 @@
void init(InitContext&)
{
EventRegistry.add("hStatistiscs", ";bin;Entries", kTH1F, {{3, 0, 3}});
// get bit for the collision mask
// Never run V0s and Cascades together as this will DOUBLE the track number and induce self correlations
if ((doprocessCollisionsWithNTracksAndNCascades && doprocessCollisionsWithNTracksAndNV0)) {
LOG(fatal) << "Never run V0s and Cascades together as this will DOUBLE the track number and induce self correlations!";
}
}

/// This function stores accepted collisions in derived data
/// @tparam PartitionType
/// @tparam PartType
Expand All @@ -110,22 +126,52 @@
/// check tracks
int tracksCount = 0;
int antitracksCount = 0;
for (auto& part : groupSelectedTracks) {

Check failure on line 129 in PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (part.cut() & 1) {
antitracksCount++;
if (!ConfRequireBitmask || ncheckbit(part.cut(), ConfCutPartAntiPart)) {
antitracksCount++;
}
} else {
tracksCount++;
if (!ConfRequireBitmask || ncheckbit(part.cut(), ConfCutPart)) {
tracksCount++;
}
}
}

/// check V0s
int V0Count = 0;
int antiV0Count = 0;
for (auto& V0 : groupSelectedV0s) {

Check failure on line 144 in PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if ((V0.mLambda() > Conf_minInvMass_V0) && (V0.mLambda() < Conf_maxInvMass_V0)) {
V0Count++;
if (ConfRequireBitmask) {
if (ncheckbit(V0.cut(), ConfCutV0_SameForAntipart)) {
const auto& posChild = parts.iteratorAt(V0.index() - 2);
const auto& negChild = parts.iteratorAt(V0.index() - 1);
if (((posChild.cut() & Conf_ChildPos_CutV0) == Conf_ChildPos_CutV0 &&
(posChild.pidcut() & Conf_ChildPos_TPCBitV0) == Conf_ChildPos_TPCBitV0 &&
(negChild.cut() & Conf_ChildNeg_CutV0) == Conf_ChildNeg_CutV0 &&
(negChild.pidcut() & Conf_ChildNeg_TPCBitV0) == Conf_ChildNeg_TPCBitV0)) {
V0Count++;
}
}
} else {
V0Count++;
}
} else if ((V0.mAntiLambda() > Conf_minInvMassAnti_V0) && (V0.mAntiLambda() < Conf_maxInvMassAnti_V0)) {
antiV0Count++;
if (ConfRequireBitmask) {
if (ncheckbit(V0.cut(), ConfCutV0_SameForAntipart)) {
const auto& posChild = parts.iteratorAt(V0.index() - 2);
const auto& negChild = parts.iteratorAt(V0.index() - 1);
if (((posChild.cut() & Conf_ChildPos_CutV0) == Conf_ChildPos_CutV0 &&
(posChild.pidcut() & Conf_ChildNeg_TPCBitV0) == Conf_ChildNeg_TPCBitV0 && // exchanged values because checking antiparticle daughters and pid of particles exchange
(negChild.cut() & Conf_ChildNeg_CutV0) == Conf_ChildNeg_CutV0 &&
(negChild.pidcut() & Conf_ChildPos_TPCBitV0) == Conf_ChildPos_TPCBitV0)) { // exchanged values because checking antiparticle daughters and pid of particles exchange
antiV0Count++;
}
}
} else {
antiV0Count++;
}
}
}

Expand All @@ -134,7 +180,7 @@
if ((V0Count >= ConfNumberOfV0 && tracksCount >= ConfNumberOfTracks) || (antiV0Count >= ConfNumberOfV0 && antitracksCount >= ConfNumberOfTracks)) {
EventRegistry.fill(HIST("hStatistiscs"), 1);
outputCollision(col.posZ(), col.multV0M(), col.multNtr(), col.sphericity(), col.magField());
for (auto& femtoParticle : parts) {

Check failure on line 183 in PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (aod::femtodreamparticle::ParticleType::kTrack == femtoParticle.partType()) {
std::vector<int> childIDs = {0, 0};
outputParts(outputCollision.lastIndex(),
Expand Down Expand Up @@ -198,7 +244,7 @@
/// \param col subscribe to the collision table (Data)
/// \param parts subscribe to the femtoDreamParticleTable
void processCollisionsWithNTracksAndNV0(o2::aod::FDCollision& col,
o2::aod::FDParticles& parts)

Check failure on line 247 in PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Argument o2::aod::FDParticles& parts is not const&.

Check failure on line 247 in PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Argument o2::aod::FDCollision& col is not const&.
{
EventRegistry.fill(HIST("hStatistiscs"), 0);
auto thegroupSelectedParts = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
Expand All @@ -222,7 +268,7 @@
/// check tracks
int tracksCount = 0;
int antitracksCount = 0;
for (auto& part : groupSelectedTracks) {

Check failure on line 271 in PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (part.cut() & 1) {
antitracksCount++;
} else {
Expand All @@ -233,7 +279,7 @@
/// check Cascades
int CascadeCount = 0;
int antiCascadeCount = 0;
for (auto& casc : groupSelectedCascades) {

Check failure on line 282 in PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if ((casc.cut() & kSignPlusMask) == kSignPlusMask) {
CascadeCount++;
} else {
Expand All @@ -247,7 +293,7 @@
EventRegistry.fill(HIST("hStatistiscs"), 1);
outputCollision(col.posZ(), col.multV0M(), col.multNtr(), col.sphericity(), col.magField());

for (auto& femtoParticle : parts) {

Check failure on line 296 in PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (aod::femtodreamparticle::ParticleType::kTrack == femtoParticle.partType()) {
std::vector<int> childIDs = {0, 0};
outputParts(outputCollision.lastIndex(),
Expand Down Expand Up @@ -331,7 +377,7 @@
/// \param col subscribe to the collision table (Data)
/// \param parts subscribe to the femtoDreamParticleTable
void processCollisionsWithNTracksAndNCascades(o2::aod::FDCollision& col,
o2::aod::FDParticles& parts)

Check failure on line 380 in PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Argument o2::aod::FDCollision& col is not const&.
{
EventRegistry.fill(HIST("hStatistiscs"), 0);
auto thegroupSelectedParts = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
Expand Down
Loading