Skip to content

Commit 6de2e04

Browse files
committed
added configurable enablepuredcahist for enabling pure DCA histogram based on nsigmaTPCKa cut
1 parent 7b6e3e9 commit 6de2e04

File tree

1 file changed

+132
-122
lines changed

1 file changed

+132
-122
lines changed

PWGLF/Tasks/Nuspex/spectraTOF.cxx

Lines changed: 132 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ struct tofSpectra {
9797
} trkselOptions;
9898

9999
Configurable<bool> enableDcaGoodEvents{"enableDcaGoodEvents", true, "Enables the MC plots with the correct match between data and MC"};
100+
Configurable<bool> enablepuredcahist{"enablepuredcahist", false, "Enables the pure DCA histograms"};
100101
Configurable<bool> enableTrackCutHistograms{"enableTrackCutHistograms", true, "Enables track cut histograms, before and after the cut"};
101102
Configurable<bool> enableDeltaHistograms{"enableDeltaHistograms", true, "Enables the delta TPC and TOF histograms"};
102103
Configurable<bool> enableTPCTOFHistograms{"enableTPCTOFHistograms", true, "Enables TPC TOF histograms"};
@@ -760,7 +761,7 @@ struct tofSpectra {
760761
hDcaXYWrongCollisionPrm[i] = histos.add<TH2>("dcaxywrongcollprm" + cpName, pTCharge[i], kTH2D, {ptAxis, dcaXyAxis});
761762
hDcaXYWrongCollisionStr[i] = histos.add<TH2>("dcaxywrongcollstr" + cpName, pTCharge[i], kTH2D, {ptAxis, dcaXyAxis});
762763
hDcaXYWrongCollisionMat[i] = histos.add<TH2>("dcaxywrongcollmat" + cpName, pTCharge[i], kTH2D, {ptAxis, dcaXyAxis});
763-
764+
764765
histos.add(hdcaxyprm[i].data(), pTCharge[i], kTH2D, {ptAxis, dcaXyAxis});
765766
histos.add(hdcazprm[i].data(), pTCharge[i], kTH2D, {ptAxis, dcaZAxis});
766767
histos.add(hdcaxystr[i].data(), pTCharge[i], kTH2D, {ptAxis, dcaXyAxis});
@@ -1017,7 +1018,6 @@ struct tofSpectra {
10171018
}
10181019
}
10191020
}
1020-
10211021
if constexpr (fillFullInfo) {
10221022
if (enableDeltaHistograms) {
10231023
const auto& deltaTOF = o2::aod::pidutils::tofExpSignalDiff<id>(track);
@@ -1036,7 +1036,6 @@ struct tofSpectra {
10361036
}
10371037
}
10381038
}
1039-
10401039
// Filling DCA info with the TPC+TOF PID
10411040
bool isDCAPureSample = (std::sqrt(nsigmaTOF * nsigmaTOF + nsigmaTPC * nsigmaTPC) < 2.f);
10421041
if (track.pt() <= 0.4) {
@@ -1060,23 +1059,24 @@ struct tofSpectra {
10601059
}
10611060
}
10621061
}
1063-
} else {
1064-
if (track.sign() > 0) {
1065-
histos.fill(HIST(hdcaxy[id]), track.pt(), track.dcaXY());
1066-
histos.fill(HIST(hdcaz[id]), track.pt(), track.dcaZ());
1067-
if (isInPtRangeForPhi) {
1068-
if (enableDCAxyphiHistograms) {
1069-
histos.fill(HIST(hdcaxyphi[id]), track.phi(), track.dcaXY());
1070-
}
1071-
}
1072-
} else {
1073-
histos.fill(HIST(hdcaxy[id + Np]), track.pt(), track.dcaXY());
1074-
histos.fill(HIST(hdcaz[id + Np]), track.pt(), track.dcaZ());
1075-
if (isInPtRangeForPhi) {
1076-
if (enableDCAxyphiHistograms) {
1077-
histos.fill(HIST(hdcaxyphi[id + Np]), track.phi(), track.dcaXY());
1078-
}
1079-
}
1062+
}
1063+
}
1064+
const bool isInPtRangeForPhi = track.pt() < 1.1f && track.pt() > 0.9f;
1065+
if (track.sign() > 0) {
1066+
histos.fill(HIST(hdcaxy[id]), track.pt(), track.dcaXY());
1067+
histos.fill(HIST(hdcaz[id]), track.pt(), track.dcaZ());
1068+
if (isInPtRangeForPhi) {
1069+
if (enableDCAxyphiHistograms) {
1070+
histos.fill(HIST(hdcaxyphi[id]), track.phi(), track.dcaXY());
1071+
}
1072+
}
1073+
}
1074+
else {
1075+
histos.fill(HIST(hdcaxy[id + Np]), track.pt(), track.dcaXY());
1076+
histos.fill(HIST(hdcaz[id + Np]), track.pt(), track.dcaZ());
1077+
if (isInPtRangeForPhi) {
1078+
if (enableDCAxyphiHistograms) {
1079+
histos.fill(HIST(hdcaxyphi[id + Np]), track.phi(), track.dcaXY());
10801080
}
10811081
}
10821082
}
@@ -1889,7 +1889,7 @@ struct tofSpectra {
18891889
}
18901890

18911891
const auto& mcCollision = collision.mcCollision_as<GenMCCollisions>();
1892-
const float multiplicity = getMultiplicityMC(mcCollision);
1892+
const float multiplicity = getMultiplicity(collision);
18931893
const int occupancy = collision.trackOccupancyInTimeRange();
18941894
//************************************RD**************************************************
18951895
const float impParam = mcCollision.impactParameter();
@@ -1912,124 +1912,134 @@ struct tofSpectra {
19121912

19131913
const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track);
19141914
const bool isKaonTOF = std::abs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma;
1915-
1916-
// Filling DCA info with the TPC+TOF PID
1917-
bool isDCAPureSample = (std::sqrt(nsigmaTOFKa * nsigmaTOFKa + nsigmaTPCKa * nsigmaTPCKa) < 2.f);
1918-
if (track.pt() <= 0.4) {
1919-
isDCAPureSample = (nsigmaTPCKa < 1.f);
1920-
}
1921-
1922-
if (isDCAPureSample) {
1923-
if (enableDCAvsmotherHistograms) {
1924-
hDcaXYMC[i]->Fill(track.pt(), track.dcaXY());
1925-
hDcaZMC[i]->Fill(track.pt(), track.dcaZ());
1915+
if (enablepuredcahist){
1916+
// Filling DCA info with the TPC+TOF PID
1917+
bool isDCAPureSample = (std::sqrt(nsigmaTOFKa * nsigmaTOFKa + nsigmaTPCKa * nsigmaTPCKa) < 2.f);
1918+
if (track.pt() <= 0.4) {
1919+
isDCAPureSample = (nsigmaTPCKa < 1.f);
19261920
}
1921+
if (isDCAPureSample) {
1922+
if (enableDCAvsmotherHistograms) {
1923+
hDcaXYMC[i]->Fill(track.pt(), track.dcaXY());
1924+
hDcaZMC[i]->Fill(track.pt(), track.dcaZ());
1925+
}
19271926

1928-
if (!mcParticle.isPhysicalPrimary()) { // Secondaries (weak decays and material)
1929-
if (mcParticle.getProcess() == 4) { // Particles from decay
1930-
if (enableDCAxyzHistograms) {
1931-
hDcaXYZStr[i]->Fill(track.pt(), track.dcaXY(), track.dcaZ());
1932-
} else {
1933-
histos.fill(HIST(hdcaxystr[i]), track.pt(), track.dcaXY());
1934-
histos.fill(HIST(hdcazstr[i]), track.pt(), track.dcaZ());
1935-
}
1927+
if (!mcParticle.isPhysicalPrimary()) { // Secondaries (weak decays and material)
1928+
if (mcParticle.getProcess() == 4) { // Particles from decay
1929+
if (enableDCAxyzHistograms) {
1930+
hDcaXYZStr[i]->Fill(track.pt(), track.dcaXY(), track.dcaZ());
1931+
} else {
1932+
histos.fill(HIST(hdcaxystr[i]), track.pt(), track.dcaXY());
1933+
histos.fill(HIST(hdcazstr[i]), track.pt(), track.dcaZ());
1934+
}
19361935

1937-
if (mcParticle.has_mothers()) {
1938-
for (const auto& mother : mcParticle.template mothers_as<aod::McParticles>()) {
1939-
auto daughter0 = mother.template daughters_as<aod::McParticles>().begin();
1940-
double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()};
1941-
double vertexMoth[3] = {mother.vx(), mother.vy(), mother.vz()};
1942-
auto decayLength = RecoDecay::distance(vertexMoth, vertexDau);
1943-
hDecayLengthStr[i]->Fill(track.pt(), decayLength);
1936+
if (mcParticle.has_mothers()) {
1937+
for (const auto& mother : mcParticle.template mothers_as<aod::McParticles>()) {
1938+
auto daughter0 = mother.template daughters_as<aod::McParticles>().begin();
1939+
double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()};
1940+
double vertexMoth[3] = {mother.vx(), mother.vy(), mother.vz()};
1941+
auto decayLength = RecoDecay::distance(vertexMoth, vertexDau);
1942+
hDecayLengthStr[i]->Fill(track.pt(), decayLength);
1943+
}
1944+
}
1945+
} else { // Particles from the material
1946+
if (enableDCAxyzHistograms) {
1947+
hDcaXYZMat[i]->Fill(track.pt(), track.dcaXY(), track.dcaZ());
1948+
} else {
1949+
histos.fill(HIST(hdcaxymat[i]), track.pt(), track.dcaXY());
1950+
histos.fill(HIST(hdcazmat[i]), track.pt(), track.dcaZ());
19441951
}
19451952
}
1946-
} else { // Particles from the material
1953+
} else { // Primaries
19471954
if (enableDCAxyzHistograms) {
1948-
hDcaXYZMat[i]->Fill(track.pt(), track.dcaXY(), track.dcaZ());
1955+
hDcaXYZPrm[i]->Fill(track.pt(), track.dcaXY(), track.dcaZ());
1956+
if (enableDcaGoodEvents.value && collision.has_mcCollision()) {
1957+
histos.fill(HIST(hdcaxyprmgoodevs[i]), track.pt(), track.dcaXY(), track.dcaZ());
1958+
}
19491959
} else {
1950-
histos.fill(HIST(hdcaxymat[i]), track.pt(), track.dcaXY());
1951-
histos.fill(HIST(hdcazmat[i]), track.pt(), track.dcaZ());
1960+
// DCAxy for all primaries
1961+
histos.fill(HIST(hdcaxyprm[i]), track.pt(), track.dcaXY());
1962+
histos.fill(HIST(hdcazprm[i]), track.pt(), track.dcaZ());
19521963
}
1953-
}
1954-
} else { // Primaries
1955-
if (enableDCAxyzHistograms) {
1956-
hDcaXYZPrm[i]->Fill(track.pt(), track.dcaXY(), track.dcaZ());
19571964
if (enableDcaGoodEvents.value && collision.has_mcCollision()) {
1958-
histos.fill(HIST(hdcaxyprmgoodevs[i]), track.pt(), track.dcaXY(), track.dcaZ());
1965+
histos.fill(HIST(hdcaxyprmgoodevs[i]), track.pt(), track.dcaXY());
1966+
histos.fill(HIST(hdcazprmgoodevs[i]), track.pt(), track.dcaZ());
19591967
}
1960-
} else {
1961-
// DCAxy for all primaries
1962-
histos.fill(HIST(hdcaxyprm[i]), track.pt(), track.dcaXY());
1963-
histos.fill(HIST(hdcazprm[i]), track.pt(), track.dcaZ());
1964-
}
1965-
if (enableDcaGoodEvents.value && collision.has_mcCollision()) {
1966-
histos.fill(HIST(hdcaxyprmgoodevs[i]), track.pt(), track.dcaXY());
1967-
histos.fill(HIST(hdcazprmgoodevs[i]), track.pt(), track.dcaZ());
1968-
}
19691968

1970-
if (enableDCAvsmotherHistograms) {
1971-
bool IsD0Mother = false;
1972-
bool IsCharmMother = false;
1973-
bool IsBeautyMother = false;
1974-
bool IsNotHFMother = false;
1975-
if (mcParticle.has_mothers()) {
1976-
const int charmOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, false);
1977-
for (const auto& mother : mcParticle.template mothers_as<aod::McParticles>()) {
1978-
const int motherPdgCode = std::abs(mother.pdgCode());
1979-
if (motherPdgCode == 421) {
1980-
IsD0Mother = true;
1981-
}
1982-
if (charmOrigin == RecoDecay::OriginType::NonPrompt) {
1983-
IsBeautyMother = true;
1984-
}
1985-
if (charmOrigin == RecoDecay::OriginType::Prompt) {
1986-
IsCharmMother = true;
1987-
}
1988-
if (charmOrigin == RecoDecay::OriginType::None) {
1989-
IsNotHFMother = true;
1969+
if (enableDCAvsmotherHistograms) {
1970+
bool IsD0Mother = false;
1971+
bool IsCharmMother = false;
1972+
bool IsBeautyMother = false;
1973+
bool IsNotHFMother = false;
1974+
if (mcParticle.has_mothers()) {
1975+
const int charmOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, false);
1976+
for (const auto& mother : mcParticle.template mothers_as<aod::McParticles>()) {
1977+
const int motherPdgCode = std::abs(mother.pdgCode());
1978+
if (motherPdgCode == 421) {
1979+
IsD0Mother = true;
1980+
}
1981+
if (charmOrigin == RecoDecay::OriginType::NonPrompt) {
1982+
IsBeautyMother = true;
1983+
}
1984+
if (charmOrigin == RecoDecay::OriginType::Prompt) {
1985+
IsCharmMother = true;
1986+
}
1987+
if (charmOrigin == RecoDecay::OriginType::None) {
1988+
IsNotHFMother = true;
1989+
}
19901990
}
19911991
}
1992-
}
1993-
if (IsD0Mother) {
1994-
hDcaXYMCD0[i]->Fill(track.pt(), track.dcaXY());
1995-
hDcaZMCD0[i]->Fill(track.pt(), track.dcaZ());
1996-
}
1997-
if (IsCharmMother) {
1998-
hDcaXYMCCharm[i]->Fill(track.pt(), track.dcaXY());
1999-
hdcaZMCCharm[i]->Fill(track.pt(), track.dcaZ());
2000-
}
2001-
if (IsBeautyMother) {
2002-
hDcaXYMCBeauty[i]->Fill(track.pt(), track.dcaXY());
2003-
hDcaZMCBeauty[i]->Fill(track.pt(), track.dcaZ());
2004-
}
2005-
if (IsNotHFMother) {
2006-
hDcaXYMCNotHF[i]->Fill(track.pt(), track.dcaXY());
2007-
hDcaZMCNotHF[i]->Fill(track.pt(), track.dcaZ());
2008-
}
2009-
2010-
if (mcParticle.has_mothers()) {
2011-
for (const auto& mother : mcParticle.template mothers_as<aod::McParticles>()) {
2012-
auto daughter0 = mother.template daughters_as<aod::McParticles>().begin();
2013-
double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()};
2014-
double vertexMoth[3] = {mother.vx(), mother.vy(), mother.vz()};
2015-
auto decayLength = RecoDecay::distance(vertexMoth, vertexDau);
1992+
if (IsD0Mother) {
1993+
hDcaXYMCD0[i]->Fill(track.pt(), track.dcaXY());
1994+
hDcaZMCD0[i]->Fill(track.pt(), track.dcaZ());
1995+
}
1996+
if (IsCharmMother) {
1997+
hDcaXYMCCharm[i]->Fill(track.pt(), track.dcaXY());
1998+
hdcaZMCCharm[i]->Fill(track.pt(), track.dcaZ());
1999+
}
2000+
if (IsBeautyMother) {
2001+
hDcaXYMCBeauty[i]->Fill(track.pt(), track.dcaXY());
2002+
hDcaZMCBeauty[i]->Fill(track.pt(), track.dcaZ());
2003+
}
2004+
if (IsNotHFMother) {
2005+
hDcaXYMCNotHF[i]->Fill(track.pt(), track.dcaXY());
2006+
hDcaZMCNotHF[i]->Fill(track.pt(), track.dcaZ());
2007+
}
20162008

2017-
if (IsD0Mother) {
2018-
hDecayLengthMCD0[i]->Fill(track.pt(), decayLength);
2019-
}
2020-
if (IsCharmMother) {
2021-
hDecayLengthMCCharm[i]->Fill(track.pt(), decayLength);
2022-
}
2023-
if (IsBeautyMother) {
2024-
hDecayLengthMCBeauty[i]->Fill(track.pt(), decayLength);
2025-
}
2026-
if (IsNotHFMother) {
2027-
hDecayLengthMCNotHF[i]->Fill(track.pt(), decayLength);
2009+
if (mcParticle.has_mothers()) {
2010+
for (const auto& mother : mcParticle.template mothers_as<aod::McParticles>()) {
2011+
auto daughter0 = mother.template daughters_as<aod::McParticles>().begin();
2012+
double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()};
2013+
double vertexMoth[3] = {mother.vx(), mother.vy(), mother.vz()};
2014+
auto decayLength = RecoDecay::distance(vertexMoth, vertexDau);
2015+
2016+
if (IsD0Mother) {
2017+
hDecayLengthMCD0[i]->Fill(track.pt(), decayLength);
2018+
}
2019+
if (IsCharmMother) {
2020+
hDecayLengthMCCharm[i]->Fill(track.pt(), decayLength);
2021+
}
2022+
if (IsBeautyMother) {
2023+
hDecayLengthMCBeauty[i]->Fill(track.pt(), decayLength);
2024+
}
2025+
if (IsNotHFMother) {
2026+
hDecayLengthMCNotHF[i]->Fill(track.pt(), decayLength);
2027+
}
20282028
}
20292029
}
20302030
}
20312031
}
20322032
}
2033+
} else {
2034+
if (!mcParticle.isPhysicalPrimary()) {
2035+
if (mcParticle.getProcess() == 4) {
2036+
histos.fill(HIST(hdcaxystr[i]), track.pt(), track.dcaXY());
2037+
} else {
2038+
histos.fill(HIST(hdcaxymat[i]), track.pt(), track.dcaXY());
2039+
}
2040+
} else {
2041+
histos.fill(HIST(hdcaxyprm[i]), track.pt(), track.dcaXY());
2042+
}
20332043
}
20342044

20352045
if ((collision.has_mcCollision() && (mcParticle.mcCollisionId() != collision.mcCollisionId())) || !collision.has_mcCollision()) {
@@ -2042,7 +2052,7 @@ struct tofSpectra {
20422052
} else {
20432053
hDcaXYWrongCollisionPrm[i]->Fill(track.pt(), track.dcaXY());
20442054
}
2045-
}
2055+
}
20462056

20472057
if (!passesDCAxyCut(track)) { // Skipping tracks that don't pass the standard cuts
20482058
return;
@@ -2768,4 +2778,4 @@ struct tofSpectra {
27682778

27692779
}; // end of spectra task
27702780

2771-
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<tofSpectra>(cfgc)}; }
2781+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<tofSpectra>(cfgc)}; }

0 commit comments

Comments
 (0)