Skip to content

Commit 2e51c2c

Browse files
author
Victor
committed
[PWGCF] DptDpt - Add support for minimum number of ITS clusters cut
1 parent c91847f commit 2e51c2c

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

PWGCF/Core/AnalysisConfigurableCuts.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11+
12+
/// \file AnalysisConfigurableCuts.h
13+
/// \brief Convenience classes to support configurable cuts
14+
/// \author victor.gonzalez.sebastian@gmail.com
15+
1116
#ifndef PWGCF_CORE_ANALYSISCONFIGURABLECUTS_H_
1217
#define PWGCF_CORE_ANALYSISCONFIGURABLECUTS_H_
1318

19+
#include <TMath.h>
20+
#include <TNamed.h>
21+
#include <TObject.h>
22+
23+
#include <Rtypes.h>
24+
1425
#include <string>
1526
#include <vector>
16-
#include <Rtypes.h>
17-
#include <TObject.h>
18-
#include <TNamed.h>
19-
#include <TMath.h>
2027

2128
namespace o2
2229
{
@@ -95,6 +102,8 @@ class TrackSelectionTuneCfg
95102
bool mUseIt = false; ///< use this track selection tuning configuration
96103
int mTPCclusters = 0; ///< minimum number of TPC clusters
97104
bool mUseTPCclusters = false; ///< use or not the number of TPC clusters
105+
int mITSclusters = 0; ///< minimum number of ITS clusters
106+
bool mUseITSclusters = false; ///< use or not the number of ITS clusters
98107
int mTPCxRows = 70; ///< minimum number of TPC crossed rows
99108
bool mUseTPCxRows = false; ///< use or not the number of TPC crossed rows
100109
float mTPCXRoFClusters = 0.8; ///< minimum value of the TPC ratio no of crossed rows over findable clusters

PWGCF/TableProducer/dptDptFilter.h

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ bool onlyInOneSide = false; ///< select only tracks that don't cross the
523523
extern TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance
524524

525525
/* selection criteria from PWGMM */
526-
static constexpr int kTrackTypePWGMM = 4;
526+
static constexpr int TrackTypePWGMM = 4;
527527
// default quality criteria for tracks with ITS contribution
528528
static constexpr o2::aod::track::TrackSelectionFlags::flagtype TrackSelectionITS =
529529
o2::aod::track::TrackSelectionFlags::kITSNCls | o2::aod::track::TrackSelectionFlags::kITSChi2NDF |
@@ -769,6 +769,11 @@ struct DptDptTrackSelection {
769769
}
770770
if (tune.mUseIt) {
771771
for (auto const& filter : trackFilters) {
772+
if (tune.mUseITSclusters) {
773+
filter->stdTrackSelection->ResetITSRequirements();
774+
filter->stdTrackSelection->SetRequireHitsInITSLayers(1, {0, 1, 2});
775+
filter->stdTrackSelection->SetMinNClustersITS(tune.mITSclusters);
776+
}
772777
if (tune.mUseTPCclusters) {
773778
filter->stdTrackSelection->SetMinNClustersTPC(tune.mTPCclusters);
774779
}
@@ -1136,8 +1141,8 @@ inline bool triggerSelection<aod::McCollision>(aod::McCollision const&)
11361141
//////////////////////////////////////////////////////////////////////////////////
11371142
/// Multiplicity extraction
11381143
//////////////////////////////////////////////////////////////////////////////////
1139-
static constexpr float kValidPercentileLowLimit = 0.0f;
1140-
static constexpr float kValidPercentileUpLimit = 100.0f;
1144+
static constexpr float ValidPercentileLowLimit = 0.0f;
1145+
static constexpr float ValidPercentileUpLimit = 100.0f;
11411146

11421147
/// \brief Extract the collision multiplicity from the event selection information
11431148
template <typename CollisionObject>
@@ -1224,7 +1229,7 @@ template <typename CollisionObject>
12241229
inline bool centralitySelectionMult(CollisionObject collision, float& centmult)
12251230
{
12261231
float mult = getCentMultPercentile(collision);
1227-
if (mult < kValidPercentileUpLimit && kValidPercentileLowLimit < mult) {
1232+
if (mult < ValidPercentileUpLimit && ValidPercentileLowLimit < mult) {
12281233
centmult = mult;
12291234
collisionFlags.set(CollSelCENTRALITYBIT);
12301235
return true;
@@ -1303,7 +1308,7 @@ inline bool centralitySelection<soa::Join<aod::CollisionsEvSelRun2Cent, aod::McC
13031308
template <>
13041309
inline bool centralitySelection<aod::McCollision>(aod::McCollision const&, float& centmult)
13051310
{
1306-
if (centmult < kValidPercentileUpLimit && kValidPercentileLowLimit < centmult) {
1311+
if (centmult < ValidPercentileUpLimit && ValidPercentileLowLimit < centmult) {
13071312
return true;
13081313
} else {
13091314
return false;
@@ -1493,14 +1498,14 @@ struct TpcExcludeTrack {
14931498
}
14941499
explicit TpcExcludeTrack(TpcExclusionMethod m)
14951500
{
1496-
static constexpr float kDefaultPhiBinShift = 0.5f;
1497-
static constexpr int kDefaultNoOfPhiBins = 72;
1501+
static constexpr float DefaultPhiBinShift = 0.5f;
1502+
static constexpr int DefaultNoOfPhiBins = 72;
14981503
switch (m) {
14991504
case kNOEXCLUSION:
15001505
method = m;
15011506
break;
15021507
case kSTATIC:
1503-
if (phibinshift == kDefaultPhiBinShift && phibins == kDefaultNoOfPhiBins) {
1508+
if (phibinshift == DefaultPhiBinShift && phibins == DefaultNoOfPhiBins) {
15041509
method = m;
15051510
} else {
15061511
LOGF(fatal, "Static TPC exclusion method with bin shift: %.2f and number of bins %d. Please fix it", phibinshift, phibins);
@@ -1529,8 +1534,8 @@ struct TpcExcludeTrack {
15291534
template <typename TrackObject>
15301535
bool exclude(TrackObject const& track)
15311536
{
1532-
constexpr int kNoOfTpcSectors = 18;
1533-
constexpr float kTpcPhiSectorWidth = (constants::math::TwoPI) / kNoOfTpcSectors;
1537+
constexpr int NoOfTpcSectors = 18;
1538+
constexpr float TpcPhiSectorWidth = (constants::math::TwoPI) / NoOfTpcSectors;
15341539

15351540
switch (method) {
15361541
case kNOEXCLUSION: {
@@ -1546,7 +1551,7 @@ struct TpcExcludeTrack {
15461551
}
15471552
} break;
15481553
case kDYNAMIC: {
1549-
float phiInTpcSector = std::fmod(track.phi(), kTpcPhiSectorWidth);
1554+
float phiInTpcSector = std::fmod(track.phi(), TpcPhiSectorWidth);
15501555
if (track.sign() > 0) {
15511556
return (phiInTpcSector < positiveUpCut->Eval(track.pt())) && (positiveLowCut->Eval(track.pt()) < phiInTpcSector);
15521557
} else {
@@ -1580,7 +1585,7 @@ inline bool matchTrackType(TrackObject const& track)
15801585
{
15811586
using namespace o2::aod::track;
15821587

1583-
if (tracktype == kTrackTypePWGMM) {
1588+
if (tracktype == TrackTypePWGMM) {
15841589
// under tests MM track selection
15851590
// see: https://indico.cern.ch/event/1383788/contributions/5816953/attachments/2805905/4896281/TrackSel_GlobalTracks_vs_MMTrackSel.pdf
15861591
// it should be equivalent to this
@@ -1672,8 +1677,8 @@ void exploreMothers(ParticleObject& particle, MCCollisionObject& collision)
16721677

16731678
inline float getCharge(float pdgCharge)
16741679
{
1675-
static constexpr int kNoOfBasicChargesPerUnitCharge = 3;
1676-
float charge = (pdgCharge / kNoOfBasicChargesPerUnitCharge >= 1) ? 1.0 : ((pdgCharge / kNoOfBasicChargesPerUnitCharge <= -1) ? -1.0 : 0);
1680+
static constexpr int NoOfBasicChargesPerUnitCharge = 3;
1681+
float charge = (pdgCharge / NoOfBasicChargesPerUnitCharge >= 1) ? 1.0 : ((pdgCharge / NoOfBasicChargesPerUnitCharge <= -1) ? -1.0 : 0);
16771682
return charge;
16781683
}
16791684

0 commit comments

Comments
 (0)