Skip to content

Commit 513346f

Browse files
victor-gonzalezVictor
andauthored
[PWGCF] DptDpt - First method for TPC tracks excluding (#8972)
Co-authored-by: Victor <victor@cern.ch>
1 parent 1f4a4f5 commit 513346f

File tree

5 files changed

+116
-6
lines changed

5 files changed

+116
-6
lines changed

PWGCF/TableProducer/dptdptfilter.cxx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ using DptDptFullTracksFullPIDDetLevel = soa::Join<DptDptFullTracksDetLevel, DptD
7575
using DptDptFullTracksFullPIDDetLevelAmbiguous = soa::Join<DptDptFullTracksDetLevelAmbiguous, DptDptTracksFullPID>;
7676

7777
bool fullDerivedData = false; /* produce full derived data for its external storage */
78+
TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance
7879

7980
/// \enum MatchRecoGenSpecies
8081
/// \brief The species considered by the matching test
@@ -367,6 +368,7 @@ struct DptDptFilter {
367368
Configurable<std::string> cfgTriggSel{"triggsel", "MB", "Trigger selection: MB,VTXTOFMATCHED,VTXTRDMATCHED,VTXTRDTOFMATCHED,None. Default MB"};
368369
Configurable<std::string> cfgCentSpec{"centralities", "00-10,10-20,20-30,30-40,40-50,50-60,60-70,70-80", "Centrality/multiplicity ranges in min-max separated by commas"};
369370
Configurable<float> cfgOverallMinP{"overallminp", 0.0f, "The overall minimum momentum for the analysis. Default: 0.0"};
371+
Configurable<int> cfgTpcExclusionMethod{"cfgTpcExclusionMethod", 0, "The method for excluding tracks within the TPC. 0: no exclusion; 1: static; 2: dynamic. Default: 0"};
370372
Configurable<o2::analysis::DptDptBinningCuts> cfgBinning{"binning",
371373
{28, -7.0, 7.0, 18, 0.2, 2.0, 16, -0.8, 0.8, 72, 0.5},
372374
"triplets - nbins, min, max - for z_vtx, pT, eta and phi, binning plus bin fraction of phi origin shift"};
@@ -801,7 +803,15 @@ struct DptDptFilterTracks {
801803
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mEtabins", etabins, false);
802804
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mEtamin", etalow, false);
803805
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mEtamax", etaup, false);
804-
806+
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mPhibins", phibins, false);
807+
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mPhibinshift", phibinshift, false);
808+
809+
TpcExclusionMethod tpcExclude = kNOEXCLUSION; ///< exclude tracks within the TPC according to this method
810+
{
811+
int tmpTpcExclude = 0;
812+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgTpcExclusionMethod", tmpTpcExclude, false);
813+
tpcExclude = static_cast<TpcExclusionMethod>(tmpTpcExclude);
814+
}
805815
/* self configure the CCDB access to the input file */
806816
getTaskOptionValue(initContext, "dpt-dpt-filter", "input_ccdburl", cfgCCDBUrl, false);
807817
getTaskOptionValue(initContext, "dpt-dpt-filter", "input_ccdbpath", cfgCCDBPathName, false);
@@ -816,6 +826,9 @@ struct DptDptFilterTracks {
816826
recoIdMethod = cfgRecoIdMethod;
817827
onlyInOneSide = cfgOnlyInOneSide.value;
818828

829+
/* the TPC excluder object instance */
830+
tpcExcluder = TpcExcludeTrack(tpcExclude);
831+
819832
/* self configure system type and data type */
820833
/* if the system type is not known at this time, we have to put the initialization somewhere else */
821834
std::string tmpstr;

PWGCF/TableProducer/dptdptfilter.h

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
#include "Common/DataModel/Multiplicity.h"
3636
#include "Common/DataModel/Centrality.h"
3737
#include "Common/DataModel/TrackSelectionTables.h"
38+
#include "Common/Core/RecoDecay.h"
3839
#include "Common/Core/TrackSelection.h"
3940
#include "Common/Core/TrackSelectionDefaults.h"
4041
#include "PWGCF/Core/AnalysisConfigurableCuts.h"
41-
#include <TDatabasePDG.h>
4242

4343
namespace o2
4444
{
@@ -147,6 +147,14 @@ enum StrongDebugging {
147147
kDEBUG ///< output debugging information on a per track basis to a text file
148148
};
149149

150+
/// \enum TpcExclusionMethod
151+
/// \brief Methods for excluding tracks witin the TPC
152+
enum TpcExclusionMethod {
153+
kNOEXCLUSION = 0, ///< do not exclude tracks within the TPC
154+
kSTATIC, ///< exclude tracks statically on the bins of the TPC sector borders; only valid if 72 bins and origin shifted by 0.5
155+
kDYNAMIC ///< pT dependent exclusion matching the sector borders a la Alex Dobrin
156+
};
157+
150158
//============================================================================================
151159
// The debug output stream
152160
//============================================================================================
@@ -172,9 +180,13 @@ float etalow = -0.8, etaup = 0.8;
172180
int zvtxbins = 40;
173181
float zvtxlow = -10.0, zvtxup = 10.0;
174182
int phibins = 72;
175-
float philow = 0.0;
183+
float philow = 0.0f;
176184
float phiup = constants::math::TwoPI;
177-
bool onlyInOneSide = false; /* select only tracks that don't cross the TPC central membrane */
185+
float phibinshift = 0.0f;
186+
187+
struct TpcExcludeTrack; ///< forward declaration of the excluder object
188+
bool onlyInOneSide = false; ///< select only tracks that don't cross the TPC central membrane
189+
extern TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance
178190

179191
/* selection criteria from PWGMM */
180192
// default quality criteria for tracks with ITS contribution
@@ -986,6 +998,73 @@ inline bool isEventSelected(CollisionObject const& collision, float& centormult)
986998
/// Track selection
987999
//////////////////////////////////////////////////////////////////////////////////
9881000

1001+
struct TpcExcludeTrack {
1002+
TpcExcludeTrack()
1003+
{
1004+
method = kNOEXCLUSION;
1005+
}
1006+
explicit TpcExcludeTrack(TpcExclusionMethod m)
1007+
{
1008+
switch (m) {
1009+
case kNOEXCLUSION:
1010+
method = m;
1011+
break;
1012+
case kSTATIC:
1013+
if (phibinshift == 0.5f && phibins == 72) {
1014+
method = m;
1015+
} else {
1016+
LOGF(fatal, "Static TPC exclusion method with bin shift: %.2f and number of bins %d. Please fix it", phibinshift, phibins);
1017+
}
1018+
break;
1019+
case kDYNAMIC:
1020+
LOGF(fatal, "Dynamic TPC exclusion method still not implemented");
1021+
method = m;
1022+
break;
1023+
default:
1024+
LOGF(fatal, "Wrong TPC tracks exclusion method %d. Please, fix it", static_cast<int>(m));
1025+
}
1026+
philow = 0.0f;
1027+
phiup = constants::math::TwoPI;
1028+
phibinwidth = (phiup - philow) / static_cast<float>(phibins);
1029+
phiup = phiup - phibinwidth * phibinshift;
1030+
philow = philow - phibinwidth * phibinshift;
1031+
}
1032+
1033+
template <typename TrackObject>
1034+
int getPhiBinIx(TrackObject const& track)
1035+
{
1036+
float phi = RecoDecay::constrainAngle(track.phi(), philow);
1037+
return static_cast<int>((phi - philow) / phibinwidth);
1038+
}
1039+
1040+
template <typename TrackObject>
1041+
bool exclude(TrackObject const& track)
1042+
{
1043+
switch (method) {
1044+
case kNOEXCLUSION: {
1045+
return false;
1046+
} break;
1047+
case kSTATIC: {
1048+
int phiBinIx = getPhiBinIx(track);
1049+
/* bins multiple of four have got sector border */
1050+
if ((phiBinIx % 4) != 0) {
1051+
return false;
1052+
} else {
1053+
return true;
1054+
}
1055+
} break;
1056+
case kDYNAMIC: {
1057+
return false;
1058+
} break;
1059+
default:
1060+
return false;
1061+
}
1062+
}
1063+
1064+
TpcExclusionMethod method = kNOEXCLUSION;
1065+
float phibinwidth = 0.0;
1066+
};
1067+
9891068
template <typename TrackObject>
9901069
inline bool matchTrackType(TrackObject const& track)
9911070
{
@@ -1072,7 +1151,7 @@ inline bool inTheAcceptance(TrackObject const& track)
10721151
}
10731152

10741153
if (ptlow < track.pt() && track.pt() < ptup && etalow < track.eta() && track.eta() < etaup) {
1075-
return true;
1154+
return !tpcExcluder.exclude(track);
10761155
}
10771156
return false;
10781157
}

PWGCF/Tasks/dptdptcorrelations.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ using namespace o2::framework::expressions;
5757
namespace correlationstask
5858
{
5959
using namespace o2::analysis::dptdptfilter;
60-
float phibinshift = 0.5;
6160
float etabinwidth = (etaup - etalow) / static_cast<float>(etabins);
6261
float phibinwidth = (phiup - philow) / static_cast<float>(phibins);
6362
int deltaetabins = etabins * 2 - 1;

PWGCF/Tasks/match-reco-gen.cxx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ std::vector<std::vector<int64_t>> mclabelpos[2];
5151
std::vector<std::vector<int64_t>> mclabelneg[2];
5252
} // namespace o2::analysis::recogenmap
5353

54+
namespace o2::analysis::dptdptfilter
55+
{
56+
TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance
57+
} // namespace o2::analysis::dptdptfilter
58+
5459
/// \brief Checks the correspondence generator level <=> detector level
5560
struct CheckGeneratorLevelVsDetectorLevel {
5661
Configurable<int> cfgTrackType{"trktype", 1, "Type of selected tracks: 0 = no selection, 1 = global tracks FB96"};
@@ -62,6 +67,7 @@ struct CheckGeneratorLevelVsDetectorLevel {
6267
Configurable<o2::analysis::DptDptBinningCuts> cfgBinning{"binning",
6368
{28, -7.0, 7.0, 18, 0.2, 2.0, 16, -0.8, 0.8, 72, 0.5},
6469
"triplets - nbins, min, max - for z_vtx, pT, eta and phi, binning plus bin fraction of phi origin shift"};
70+
Configurable<int> cfgTpcExclusionMethod{"cfgTpcExclusionMethod", 0, "The method for excluding tracks within the TPC. 0: no exclusion; 1: static; 2: dynamic. Default: 0"};
6571
Configurable<o2::analysis::CheckRangeCfg> cfgTraceDCAOutliers{"trackdcaoutliers", {false, 0.0, 0.0}, "Track the generator level DCAxy outliers: false/true, low dcaxy, up dcaxy. Default {false,0.0,0.0}"};
6672
Configurable<float> cfgTraceOutOfSpeciesParticles{"trackoutparticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"};
6773
Configurable<int> cfgRecoIdMethod{"recoidmethod", 0, "Method for identifying reconstructed tracks: 0 PID, 1 mcparticle. Default 0"};
@@ -96,6 +102,14 @@ struct CheckGeneratorLevelVsDetectorLevel {
96102
zvtxbins = cfgBinning->mZVtxbins;
97103
zvtxlow = cfgBinning->mZVtxmin;
98104
zvtxup = cfgBinning->mZVtxmax;
105+
phibins = cfgBinning->mPhibins;
106+
phibinshift = cfgBinning->mPhibinshift;
107+
108+
/* the TPC excluder object instance */
109+
TpcExclusionMethod tpcExclude = kNOEXCLUSION; ///< exclude tracks within the TPC according to this method
110+
tpcExclude = static_cast<TpcExclusionMethod>(cfgTpcExclusionMethod.value);
111+
tpcExcluder = TpcExcludeTrack(tpcExclude);
112+
99113
/* the track types and combinations */
100114
tracktype = cfgTrackType.value;
101115
initializeTrackSelection(cfgTuneTrackSelection);

PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ using namespace o2::framework::expressions;
5050
#define HNAMESTRING(thehnamefmt, thehnamepars...) FORMATSTRING(thehnamefmt, thehnamepars)
5151
#define HTITLESTRING(thehtitlefmt, thehtitlepars...) FORMATSTRING(thehtitlefmt, thehtitlepars)
5252

53+
namespace o2::analysis::dptdptfilter
54+
{
55+
TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance
56+
} // namespace o2::analysis::dptdptfilter
57+
5358
namespace efficiencyandqatask
5459
{
5560
/// \enum KindOfProcessQA

0 commit comments

Comments
 (0)