Skip to content

Commit 318d01b

Browse files
fgrosaalibuildmfaggin
authored
[DPG] Add possibility to skip TPC-only tracks (#11867)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch> Co-authored-by: Mattia Faggin <mattia.faggin@cern.ch>
1 parent 1b3fd6f commit 318d01b

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,31 @@
1414
///
1515
/// \author Fabrizio Grosa <fabrizio.grosa@cern.ch>, CERN
1616

17-
#include "CCDB/BasicCCDBManager.h"
18-
#include "CommonConstants/PhysicsConstants.h"
17+
#include "PWGHF/Utils/utilsAnalysis.h"
18+
1919
#include "Common/Core/RecoDecay.h"
2020
#include "Common/Core/TrackSelection.h"
2121
#include "Common/Core/trackUtilities.h"
2222
#include "Common/DataModel/CollisionAssociationTables.h"
2323
#include "Common/DataModel/EventSelection.h"
2424
#include "Common/DataModel/PIDResponse.h"
2525
#include "Common/DataModel/TrackSelectionTables.h"
26+
#include "Tools/ML/MlResponse.h"
27+
28+
#include "CCDB/BasicCCDBManager.h"
29+
#include "CommonConstants/PhysicsConstants.h"
30+
#include "DCAFitter/DCAFitterN.h"
2631
#include "DataFormatsParameters/GRPMagField.h"
2732
#include "DataFormatsParameters/GRPObject.h"
28-
#include "DCAFitter/DCAFitterN.h"
2933
#include "Framework/AnalysisTask.h"
3034
#include "Framework/runDataProcessing.h"
31-
#include "PWGHF/Utils/utilsAnalysis.h"
32-
#include "Tools/ML/MlResponse.h"
35+
3336
#include <TPDGCode.h>
3437

38+
#include <algorithm>
39+
#include <string>
40+
#include <vector>
41+
3542
using namespace o2;
3643
using namespace o2::framework;
3744
using namespace o2::framework::expressions;
@@ -734,7 +741,7 @@ struct TagTwoProngDisplacedVertices {
734741
} else if (fillTopoVarsTable == 3 && !TESTBIT(isSignal, aod::tagandprobe::SignalFlags::BkgFromNoHf)) { // only background excluding tracks from other HF decays
735742
fillTable = false;
736743
}
737-
float pseudoRndm = trackFirst.pt() * 1000. - (int64_t)(trackFirst.pt() * 1000);
744+
float pseudoRndm = trackFirst.pt() * 1000. - static_cast<int64_t>(trackFirst.pt() * 1000);
738745
if (ptTag < ptTagMaxForDownsampling && pseudoRndm >= downsamplingForTopoVarTable) {
739746
fillTable = false;
740747
}
@@ -899,7 +906,7 @@ struct TagTwoProngDisplacedVertices {
899906
} else if (fillTopoVarsTable == 3 && !TESTBIT(isSignal, aod::tagandprobe::SignalFlags::BkgFromNoHf)) { // only background excluding tracks from other HF decays
900907
fillTable = false;
901908
}
902-
float pseudoRndm = trackPos.pt() * 1000. - (int64_t)(trackPos.pt() * 1000);
909+
float pseudoRndm = trackPos.pt() * 1000. - static_cast<int64_t>(trackPos.pt() * 1000);
903910
if (ptTag < ptTagMaxForDownsampling && pseudoRndm >= downsamplingForTopoVarTable) {
904911
fillTable = false;
905912
}
@@ -1150,6 +1157,7 @@ struct ProbeThirdTrack {
11501157
Configurable<LabeledArray<double>> mlCutsDzeroFromDstar{"mlCutsDzeroFromDstar", {aod::tagandprobe::mlCuts[0], aod::tagandprobe::nBinsPt, 3, aod::tagandprobe::labelsEmpty, aod::tagandprobe::labelsMlScores}, "ML Selections for Kpi pairs from D0 <- D*+ decays"};
11511158
} mlConfig;
11521159
Configurable<float> ptCandMin{"ptCandMin", 0.f, "Minimum candidate pt for THnSparse filling"};
1160+
Configurable<bool> fillTpcOnlyCase{"fillTpcOnlyCase", true, "Fill output for TPC only case (not needed for thinned data or Pb-Pb)"};
11531161

11541162
ConfigurableAxis axisPtProbe{"axisPtProbe", {VARIABLE_WIDTH, 0.05f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.2f, 1.5f, 2.0f, 2.5f, 3.0f, 3.5f, 4.0f, 4.5f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.f, 12.f, 15.f, 20.f, 25.f, 30.f}, "Axis for pt Probe"};
11551163
ConfigurableAxis axisPtTag{"axisPtTag", {VARIABLE_WIDTH, 0.05f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.2f, 1.5f, 2.0f, 2.5f, 3.0f, 3.5f, 4.0f, 4.5f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.f, 12.f, 15.f, 20.f, 25.f, 30.f}, "Axis for pt Tag"};
@@ -1250,6 +1258,9 @@ struct ProbeThirdTrack {
12501258

12511259
for (int iChannel{0}; iChannel < aod::tagandprobe::TagChannels::NTagChannels; ++iChannel) {
12521260
for (int iTrackType{0}; iTrackType < aod::tagandprobe::TrackTypes::NTrackTypes; ++iTrackType) {
1261+
if (!fillTpcOnlyCase && iTrackType == aod::tagandprobe::TrackTypes::GlobalWoDcaWoIts) {
1262+
continue;
1263+
}
12531264
histos[iChannel][iTrackType] = registry.add<THnSparse>(Form("h%sVsPtProbeTag_%s", tagChannels[iChannel].data(), trackTypes[iTrackType].data()),
12541265
"; #it{p}_{T}(D) (GeV/#it{c}); #it{p}_{T}(tag) (GeV/#it{c}); #it{p}_{T}(probe) (GeV/#it{c}); #it{p}_{T}^{TPC in}(probe) (GeV/#it{c}); #it{M}(D) (GeV/#it{c}^{2}); #it{M}(tag) (GeV/#it{c}^{2}); #it{#eta}(probe); #it{N}_{cross rows}^{TPC}(probe); #chi^{2}/#it{N}_{clusters}^{TPC}(probe); #it{N}_{clusters}^{ITS}(probe);",
12551266
HistType::kTHnSparseF, {axisPtD, axisPtTag, axisPtProbe, axisPtProbe, axisMass[iChannel], axisMassTag[iChannel], axisEtaProbe, axisNumCrossRowTpc, axisTpcChi2PerClus, axisNumCluIts});
@@ -1346,6 +1357,9 @@ struct ProbeThirdTrack {
13461357
continue;
13471358
}
13481359
for (int iTrackType{0}; iTrackType < aod::tagandprobe::TrackTypes::NTrackTypes; ++iTrackType) {
1360+
if (!fillTpcOnlyCase && iTrackType == aod::tagandprobe::TrackTypes::GlobalWoDcaWoIts) {
1361+
continue;
1362+
}
13491363
if (trackSelector[iTrackType].IsSelected(trackThird)) {
13501364
histos[channel][iTrackType]->Fill(ptD, ptTag, ptTrackThird, ptTpcInnerTrackThird, invMass, invMassTag, etaTrackThird, numTpcCrossRowTrackThird, numTpcChi2NumCluTrackThird, numItsCluTrackThird);
13511365
}

0 commit comments

Comments
 (0)