Skip to content

Commit ebdb0e1

Browse files
author
Francesco Mazzaschi
committed
Add mother decay radius and remove track tuner
1 parent 93aaf9e commit ebdb0e1

File tree

2 files changed

+25
-55
lines changed

2 files changed

+25
-55
lines changed

PWGLF/DataModel/LFSlimNucleiTables.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ DECLARE_SOA_COLUMN(ITSclsMap, itsClsMap, uint8_t);
4444
DECLARE_SOA_COLUMN(TPCnCls, tpcNCls, uint8_t);
4545
DECLARE_SOA_COLUMN(TPCnClsShared, tpcNClsShared, uint8_t);
4646
DECLARE_SOA_COLUMN(ITSclusterSizes, itsClusterSizes, uint32_t);
47+
DECLARE_SOA_COLUMN(SurvivedEventSelection, survivedEventSelection, bool);
4748
DECLARE_SOA_COLUMN(gPt, genPt, float);
4849
DECLARE_SOA_COLUMN(gEta, genEta, float);
4950
DECLARE_SOA_COLUMN(gPhi, genPhi, float);
5051
DECLARE_SOA_COLUMN(PDGcode, pdgCode, int);
5152
DECLARE_SOA_COLUMN(MotherPDGcode, MotherpdgCode, int);
52-
DECLARE_SOA_COLUMN(SurvivedEventSelection, survivedEventSelection, bool);
53+
DECLARE_SOA_COLUMN(MotherDecRad, motherDecRad, float);
5354
DECLARE_SOA_COLUMN(AbsoDecL, absoDecL, float);
5455

5556
} // namespace NucleiTableNS
@@ -151,12 +152,13 @@ DECLARE_SOA_TABLE(NucleiTableMC, "AOD", "NUCLEITABLEMC",
151152
NucleiTableNS::TPCnCls,
152153
NucleiTableNS::TPCnClsShared,
153154
NucleiTableNS::ITSclusterSizes,
155+
NucleiTableNS::SurvivedEventSelection,
154156
NucleiTableNS::gPt,
155157
NucleiTableNS::gEta,
156158
NucleiTableNS::gPhi,
157159
NucleiTableNS::PDGcode,
158160
NucleiTableNS::MotherPDGcode,
159-
NucleiTableNS::SurvivedEventSelection,
161+
NucleiTableNS::MotherDecRad,
160162
NucleiTableNS::AbsoDecL);
161163

162164
DECLARE_SOA_TABLE(NucleiPairTable, "AOD", "NUCLEIPAIRTABLE",

PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx

Lines changed: 21 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include "Common/TableProducer/PID/pidTOFBase.h"
4242
#include "Common/Core/EventPlaneHelper.h"
4343
#include "Common/DataModel/Qvectors.h"
44-
#include "Common/Tools/TrackTuner.h"
4544
#include "Common/Core/RecoDecay.h"
4645

4746
#include "DataFormatsParameters/GRPMagField.h"
@@ -273,7 +272,6 @@ struct nucleiSpectra {
273272
Service<o2::ccdb::BasicCCDBManager> ccdb;
274273
Zorro zorro;
275274
OutputObj<ZorroSummary> zorroSummary{"zorroSummary"};
276-
TrackTuner trackTunerObj;
277275

278276
Configurable<bool> cfgCompensatePIDinTracking{"cfgCompensatePIDinTracking", false, "If true, divide tpcInnerParam by the electric charge"};
279277

@@ -282,8 +280,8 @@ struct nucleiSpectra {
282280
Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"};
283281
Configurable<float> cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"};
284282
Configurable<float> cfgCutTpcMom{"cfgCutTpcMom", 0.2f, "Minimum TPC momentum for tracks"};
285-
Configurable<float> cfgCutRapidityMin{"cfgCutRapidityMin", -0.5, "Minimum rapidity for tracks"};
286-
Configurable<float> cfgCutRapidityMax{"cfgCutRapidityMax", 0.5, "Maximum rapidity for tracks"};
283+
Configurable<float> cfgCutRapidityMin{"cfgCutRapidityMin", -1., "Minimum rapidity for tracks"};
284+
Configurable<float> cfgCutRapidityMax{"cfgCutRapidityMax", 1., "Maximum rapidity for tracks"};
287285
Configurable<bool> cfgCutOnReconstructedRapidity{"cfgCutOnReconstructedRapidity", false, "Cut on reconstructed rapidity"};
288286
Configurable<float> cfgCutNclusITS{"cfgCutNclusITS", 5, "Minimum number of ITS clusters"};
289287
Configurable<float> cfgCutNclusTPC{"cfgCutNclusTPC", 70, "Minimum number of TPC clusters"};
@@ -327,9 +325,7 @@ struct nucleiSpectra {
327325

328326
Configurable<bool> cfgSkimmedProcessing{"cfgSkimmedProcessing", false, "Skimmed dataset processing"};
329327

330-
// configurables for track tuner
331-
Configurable<bool> cfgUseTrackTuner{"cfgUseTrackTuner", false, "Apply track tuner corrections to MC tracks"};
332-
Configurable<std::string> cfgTrackTunerParams{"cfgTrackTunerParams", "debugInfo=0|updateTrackDCAs=1|updateTrackCovMat=1|updateCurvature=0|updateCurvatureIU=0|updatePulls=1|isInputFileFromCCDB=1|pathInputFile=Users/m/mfaggin/test/inputsTrackTuner/pp2023/smoothHighPtMC|nameInputFile=trackTuner_DataLHC23fPass1_McLHC23k4b_run535085.root|pathFileQoverPt=Users/h/hsharma/qOverPtGraphs|nameFileQoverPt=D0sigma_Data_removal_itstps_MC_LHC22b1b.root|usePvRefitCorrections=0|qOverPtMC=-1.|qOverPtData=-1.", "TrackTuner parameter initialization (format: <name>=<value>|<name>=<value>)"};
328+
333329
// running variables for track tuner
334330
o2::dataformats::DCA mDcaInfoCov;
335331
o2::track::TrackParametrizationWithError<float> mTrackParCov;
@@ -516,7 +512,7 @@ struct nucleiSpectra {
516512
spectra.add("hTpcSignalData", "Specific energy loss", HistType::kTH2F, {{600, -6., 6., "#it{p} (GeV/#it{c})"}, {1400, 0, 1400, "d#it{E} / d#it{X} (a. u.)"}});
517513
spectra.add("hTpcSignalDataSelected", "Specific energy loss for selected particles", HistType::kTH2F, {{600, -6., 6., "#it{p} (GeV/#it{c})"}, {1400, 0, 1400, "d#it{E} / d#it{X} (a. u.)"}});
518514
spectra.add("hTofSignalData", "TOF beta", HistType::kTH2F, {{500, 0., 5., "#it{p} (GeV/#it{c})"}, {750, 0, 1.5, "TOF #beta"}});
519-
spectra.add("hMCDCAxyVsDecRadius", "DCA xy vs DecayRadius", HistType::kTH2F, {{20, 0., 0.2, "Decay radius"}, {150, -0.05, 0.05, "DCA_{xy} (cm)"}});
515+
520516
for (int iC{0}; iC < 2; ++iC) {
521517
nuclei::hGloTOFtracks[iC] = spectra.add<TH2>(fmt::format("hTPCTOFtracks{}", nuclei::matter[iC]).data(), fmt::format("Global vs TOF matched {} tracks in a collision", nuclei::chargeLabelNames[iC]).data(), HistType::kTH2D, {{300, -0.5, 300.5, "Number of global tracks"}, {300, -0.5, 300.5, "Number of TOF matched tracks"}});
522518

@@ -562,12 +558,6 @@ struct nucleiSpectra {
562558
}
563559

564560
nuclei::lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>("GLO/Param/MatLUT"));
565-
// TrackTuner initialization
566-
if (cfgUseTrackTuner) {
567-
std::string outputStringParams = trackTunerObj.configParams(cfgTrackTunerParams);
568-
spectra.add("hTrackTunedTracks", outputStringParams.c_str(), HistType::kTH1F, {{1, 0.5, 1.5, ""}});
569-
trackTunerObj.getDcaGraphs();
570-
}
571561
}
572562

573563
template <typename Tcoll>
@@ -665,20 +655,6 @@ struct nucleiSpectra {
665655
mDcaInfoCov.set(999, 999, 999, 999, 999);
666656
setTrackParCov(track, mTrackParCov);
667657
mTrackParCov.setPID(track.pidForTracking());
668-
if constexpr (
669-
requires {
670-
track.has_mcParticle();
671-
}) {
672-
if (cfgUseTrackTuner) {
673-
bool hasMcParticle = track.has_mcParticle();
674-
if (hasMcParticle) {
675-
spectra.get<TH1>(HIST("hTrackTunedTracks"))->Fill(1); // all tracks
676-
auto mcParticle = track.mcParticle();
677-
trackTunerObj.tuneTrackParams(mcParticle, mTrackParCov, matCorr, &mDcaInfoCov, spectra.get<TH1>(HIST("hTrackTunedTracks")));
678-
}
679-
}
680-
}
681-
682658
std::array<float, 2> dcaInfo;
683659
o2::base::Propagator::Instance()->propagateToDCA(collVtx, mTrackParCov, mBz, 2.f, static_cast<o2::base::Propagator::MatCorrType>(cfgMaterialCorrection.value), &dcaInfo);
684660

@@ -957,24 +933,6 @@ struct nucleiSpectra {
957933
if (!c.correctPV) {
958934
c.flags |= kIsAmbiguous;
959935
}
960-
if (!particle.isPhysicalPrimary()) {
961-
c.isSecondary = true;
962-
if (particle.getProcess() == 4) {
963-
c.fromWeakDecay = true;
964-
}
965-
} else {
966-
// if the particle has a hf mother it is flagged as secondary
967-
if (particle.has_mothers()) {
968-
for (auto& motherparticle : particle.mothers_as<aod::McParticles>()) {
969-
if (std::find(nuclei::hfMothCodes.begin(), nuclei::hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != nuclei::hfMothCodes.end()) {
970-
c.isSecondary = true;
971-
c.fromWeakDecay = true;
972-
break;
973-
}
974-
}
975-
}
976-
}
977-
978936
if (c.fillDCAHist && cfgDCAHists->get(iS, c.pt < 0)) {
979937
nuclei::hDCAHists[c.pt < 0][iS]->Fill(std::abs(c.pt), c.DCAxy, c.DCAz, c.nSigmaTPC[iS], c.tofMasses[iS], c.ITSnCls, c.TPCnCls, c.correctPV, c.isSecondary, c.fromWeakDecay);
980938
}
@@ -983,31 +941,38 @@ struct nucleiSpectra {
983941
if (!storeIt) {
984942
continue;
985943
}
986-
int MotherpdgCode = 0;
944+
if (particle.y() < cfgCutRapidityMin || particle.y() > cfgCutRapidityMax) {
945+
continue;
946+
}
947+
948+
int motherPdgCode = 0;
949+
float motherDecRadius = -1;
987950
isReconstructed[particle.globalIndex()] = true;
988951
if (particle.isPhysicalPrimary()) {
989952
c.flags |= kIsPhysicalPrimary;
990953
if (particle.has_mothers()) {
991954
for (auto& motherparticle : particle.mothers_as<aod::McParticles>()) {
992955
if (std::find(nuclei::hfMothCodes.begin(), nuclei::hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != nuclei::hfMothCodes.end()) {
993956
c.flags |= kIsSecondaryFromWeakDecay;
994-
MotherpdgCode = motherparticle.pdgCode();
995-
float decRadius = std::hypot(particle.vx() - motherparticle.vx(), particle.vy() - motherparticle.vy());
996-
spectra.fill(HIST("hMCDCAxyVsDecRadius"), decRadius, c.DCAxy);
957+
motherPdgCode = motherparticle.pdgCode();
958+
motherDecRadius = std::hypot(particle.vx() - motherparticle.vx(), particle.vy() - motherparticle.vy());
997959
break;
998960
}
999961
}
1000962
}
1001963
} else if (particle.has_mothers()) {
1002964
c.flags |= kIsSecondaryFromWeakDecay;
1003965
for (auto& motherparticle : particle.mothers_as<aod::McParticles>()) {
1004-
MotherpdgCode = motherparticle.pdgCode();
966+
motherPdgCode = motherparticle.pdgCode();
967+
motherDecRadius = std::hypot(particle.vx() - motherparticle.vx(), particle.vy() - motherparticle.vy());
1005968
}
1006969
} else {
1007970
c.flags |= kIsSecondaryFromMaterial;
1008971
}
972+
973+
isReconstructed[particle.globalIndex()] = true;
1009974
float absoDecL = computeAbsoDecL(particle);
1010-
nucleiTableMC(c.pt, c.eta, c.phi, c.tpcInnerParam, c.beta, c.zVertex, c.DCAxy, c.DCAz, c.TPCsignal, c.ITSchi2, c.TPCchi2, c.TOFchi2, c.flags, c.TPCfindableCls, c.TPCcrossedRows, c.ITSclsMap, c.TPCnCls, c.TPCnClsShared, c.clusterSizesITS, particle.pt(), particle.eta(), particle.phi(), particle.pdgCode(), MotherpdgCode, goodCollisions[particle.mcCollisionId()], absoDecL);
975+
nucleiTableMC(c.pt, c.eta, c.phi, c.tpcInnerParam, c.beta, c.zVertex, c.DCAxy, c.DCAz, c.TPCsignal, c.ITSchi2, c.TPCchi2, c.TOFchi2, c.flags, c.TPCfindableCls, c.TPCcrossedRows, c.ITSclsMap, c.TPCnCls, c.TPCnClsShared, c.clusterSizesITS, goodCollisions[particle.mcCollisionId()], particle.pt(), particle.eta(), particle.phi(), particle.pdgCode(), motherPdgCode, motherDecRadius, absoDecL);
1011976
}
1012977

1013978
int index{0};
@@ -1023,6 +988,7 @@ struct nucleiSpectra {
1023988

1024989
uint16_t flags = 0;
1025990
int motherPdgCode = 0;
991+
float motherDecRadius = -1;
1026992
if (particle.isPhysicalPrimary()) {
1027993
flags |= kIsPhysicalPrimary;
1028994
nuclei::hGenNuclei[iS][particle.pdgCode() < 0]->Fill(1., particle.pt());
@@ -1031,6 +997,7 @@ struct nucleiSpectra {
1031997
if (std::find(nuclei::hfMothCodes.begin(), nuclei::hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != nuclei::hfMothCodes.end()) {
1032998
flags |= kIsSecondaryFromWeakDecay;
1033999
motherPdgCode = motherparticle.pdgCode();
1000+
motherDecRadius = std::hypot(particle.vx() - motherparticle.vx(), particle.vy() - motherparticle.vy());
10341001
break;
10351002
}
10361003
}
@@ -1039,6 +1006,7 @@ struct nucleiSpectra {
10391006
flags |= kIsSecondaryFromWeakDecay;
10401007
for (auto& motherparticle : particle.mothers_as<aod::McParticles>()) {
10411008
motherPdgCode = motherparticle.pdgCode();
1009+
motherDecRadius = std::hypot(particle.vx() - motherparticle.vx(), particle.vy() - motherparticle.vy());
10421010
}
10431011
} else {
10441012
flags |= kIsSecondaryFromMaterial;
@@ -1047,7 +1015,7 @@ struct nucleiSpectra {
10471015
if (!isReconstructed[index] && (cfgTreeConfig->get(iS, 0u) || cfgTreeConfig->get(iS, 1u))) {
10481016
float absDecL = computeAbsoDecL(particle);
10491017

1050-
nucleiTableMC(999., 999., 999., 0., 0., 999., 999., 999., -1, -1, -1, -1, flags, 0, 0, 0, 0, 0, 0, particle.pt(), particle.eta(), particle.phi(), particle.pdgCode(), motherPdgCode, goodCollisions[particle.mcCollisionId()], absDecL);
1018+
nucleiTableMC(999., 999., 999., 0., 0., 999., 999., 999., -1, -1, -1, -1, flags, 0, 0, 0, 0, 0, 0, goodCollisions[particle.mcCollisionId()], particle.pt(), particle.eta(), particle.phi(), particle.pdgCode(), motherPdgCode, motherDecRadius, absDecL);
10511019
}
10521020
break;
10531021
}

0 commit comments

Comments
 (0)