Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions PWGEM/Dilepton/Core/EMTrackCut.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGEM/Dilepton/Core/EMTrackCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

Check failure on line 11 in PWGEM/Dilepton/Core/EMTrackCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in PWGEM/Dilepton/Core/EMTrackCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in PWGEM/Dilepton/Core/EMTrackCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
//
// Class for track selection
//
Expand All @@ -31,7 +31,7 @@
#include <utility>
#include <vector>

using namespace o2::aod::pwgem::dilepton::utils::emtrackutil;

Check failure on line 34 in PWGEM/Dilepton/Core/EMTrackCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.

class EMTrackCut : public TNamed
{
Expand Down Expand Up @@ -59,7 +59,7 @@
};

template <typename TTrack>
bool IsSelected(TTrack const& track) const

Check failure on line 62 in PWGEM/Dilepton/Core/EMTrackCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
{
// if (!track.hasITS() || !track.hasTPC()) {
// return false;
Expand Down Expand Up @@ -128,7 +128,7 @@
}

template <typename T>
bool IsSelectedTrack(T const& track, const EMTrackCuts& cut) const

Check failure on line 131 in PWGEM/Dilepton/Core/EMTrackCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
{
switch (cut) {
case EMTrackCuts::kTrackPtRange:
Expand All @@ -140,11 +140,11 @@
case EMTrackCuts::kTrackPhiRange:
return track.phi() > mMinTrackPhi && track.phi() < mMaxTrackPhi;

case EMTrackCuts::kDCAxy:
return std::fabs(track.dcaXY()) < ((mMaxDcaXYPtDep) ? mMaxDcaXYPtDep(track.pt()) : mMaxDcaXY);
// case EMTrackCuts::kDCAxy:
// return std::fabs(track.dcaXY()) < ((mMaxDcaXYPtDep) ? mMaxDcaXYPtDep(track.pt()) : mMaxDcaXY);

case EMTrackCuts::kDCAz:
return std::fabs(track.dcaZ()) < mMaxDcaZ;
// case EMTrackCuts::kDCAz:
// return std::fabs(track.dcaZ()) < mMaxDcaZ;

case EMTrackCuts::kTrackBit: {
// for (int i = 0; i < 10; i++) {
Expand Down Expand Up @@ -183,9 +183,9 @@
}

// Setters
void SetTrackPtRange(float minPt = 0.f, float maxPt = 1e10f);

Check failure on line 186 in PWGEM/Dilepton/Core/EMTrackCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
void SetTrackEtaRange(float minEta = -1e10f, float maxEta = 1e10f);

Check failure on line 187 in PWGEM/Dilepton/Core/EMTrackCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
void SetTrackPhiRange(float minPhi = 0.f, float maxPhi = 6.3f);

Check failure on line 188 in PWGEM/Dilepton/Core/EMTrackCut.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
void SetMinNClustersTPC(int minNClustersTPC);
void SetMinNCrossedRowsTPC(int minNCrossedRowsTPC);
void SetMinNCrossedRowsOverFindableClustersTPC(float minNCrossedRowsOverFindableClustersTPC);
Expand Down
42 changes: 6 additions & 36 deletions PWGEM/Dilepton/DataModel/dileptonTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -822,42 +822,12 @@ namespace emprimarytrack
DECLARE_SOA_INDEX_COLUMN(EMEvent, emevent); //!
DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //!
DECLARE_SOA_COLUMN(TrackId, trackId, int); //!
// DECLARE_SOA_COLUMN(Sign, sign, int8_t); //!
DECLARE_SOA_COLUMN(Sign, sign, int8_t); //!
DECLARE_SOA_COLUMN(TrackBit, trackBit, uint16_t); //!
DECLARE_SOA_COLUMN(PtUINT16, ptuint16, uint16_t); //! 0 - 65535
DECLARE_SOA_COLUMN(DcaZINT16, dcaZint16, int16_t); //! -32768 - +32767
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](uint16_t ptuint16) -> float { return static_cast<float>(ptuint16) * 1e-4; });
DECLARE_SOA_DYNAMIC_COLUMN(DcaZ, dcaZ, [](int16_t dcaZint16) -> float { return static_cast<float>(dcaZint16) * 1e-4; });
// DECLARE_SOA_DYNAMIC_COLUMN(Signed1Pt, signed1Pt, [](float pt, int8_t sign) -> float { return sign * 1. / pt; });
// DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) -> float { return pt * std::cosh(eta); });
// DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) -> float { return pt * std::cos(phi); });
// DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) -> float { return pt * std::sin(phi); });
// DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) -> float { return pt * std::sinh(eta); });
} // namespace emprimarytrack

DECLARE_SOA_TABLE_VERSIONED(EMPrimaryTracks_000, "AOD", "EMPRIMARYTRACK", 0, //!
o2::soa::Index<>, emprimarytrack::CollisionId, emprimarytrack::TrackId, /* emprimarytrack::Sign,*/
emprimarytrack::PtUINT16, track::Eta, track::Phi, track::DcaXY, emprimarytrack::DcaZINT16, emprimarytrack::TrackBit,

// track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared, track::TPCChi2NCl,
// track::ITSClusterSizes, track::ITSChi2NCl, track::DetectorMap,

// // dynamic column
// track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
// track::TPCNClsCrossedRows<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
// track::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
// track::TPCFoundOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
// track::TPCFractionSharedCls<track::TPCNClsShared, track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
// track::v001::ITSClusterMap<track::ITSClusterSizes>, track::v001::ITSNCls<track::ITSClusterSizes>, track::v001::ITSNClsInnerBarrel<track::ITSClusterSizes>,

// track::HasITS<track::DetectorMap>, track::HasTPC<track::DetectorMap>, track::HasTRD<track::DetectorMap>, track::HasTOF<track::DetectorMap>,
// emprimarytrack::Signed1Pt<track::Pt, emprimarytrack::Sign>,
// emprimarytrack::P<track::Pt, track::Eta>,
// emprimarytrack::Px<track::Pt, track::Phi>,
// emprimarytrack::Py<track::Pt, track::Phi>,
// emprimarytrack::Pz<track::Pt, track::Eta>
emprimarytrack::Pt<emprimarytrack::PtUINT16>,
emprimarytrack::DcaZ<emprimarytrack::DcaZINT16>);
DECLARE_SOA_TABLE_VERSIONED(EMPrimaryTracks_000, "AOD", "EMPRIMARYTRACK", 0, //! primary charged track table for 2PC
o2::soa::Index<>, emprimarytrack::CollisionId, emprimarytrack::TrackId, emprimarytrack::Sign, track::Pt, track::Eta, track::Phi, emprimarytrack::TrackBit);

using EMPrimaryTracks = EMPrimaryTracks_000;
// iterators
Expand All @@ -867,9 +837,9 @@ DECLARE_SOA_TABLE(EMPrimaryTrackEMEventIds, "AOD", "PRMTRKEMEVENTID", emprimaryt
// iterators
using EMPrimaryTrackEMEventId = EMPrimaryTrackEMEventIds::iterator;

// DECLARE_SOA_TABLE(EMPrimaryTrackEMEventIdsTMP, "AOD", "PRMTRKEVIDTMP", track::CollisionId); // To be joined with EMPrimaryTracks in associateDileptonToEMEvent
// // iterators
// using EMPrimaryTrackEMEventIdTMP = EMPrimaryTrackEMEventIdsTMP::iterator;
DECLARE_SOA_TABLE(EMPrimaryTrackEMEventIdsTMP, "AOD", "PRMTRKEVIDTMP", track::CollisionId); // To be joined with EMPrimaryTracks in associateDileptonToEMEvent
// iterators
using EMPrimaryTrackEMEventIdTMP = EMPrimaryTrackEMEventIdsTMP::iterator;

// Dummy data for MC
namespace emdummydata
Expand Down
3 changes: 3 additions & 0 deletions PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <string>

using namespace o2;
using namespace o2::aod;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::soa;
Expand Down Expand Up @@ -307,6 +308,7 @@ struct AssociateDileptonToEMEvent {
PresliceUnsorted<aod::EMPrimaryElectrons> perCollision_el = aod::emprimaryelectron::collisionId;
PresliceUnsorted<aod::EMPrimaryMuons> perCollision_mu = aod::emprimarymuon::collisionId;
Preslice<aod::EMPrimaryTracks> perCollision_track = aod::emprimarytrack::collisionId;
// Preslice<aod::EMPrimaryTrackEMEventIdsTMP> perCollision_track = aod::track::collisionId;

void init(o2::framework::InitContext&) {}

Expand Down Expand Up @@ -342,6 +344,7 @@ struct AssociateDileptonToEMEvent {
}

void processChargedTrack(aod::EMEvents const& collisions, aod::EMPrimaryTracks const& tracks)
// void processChargedTrack(aod::EMEvents const& collisions, aod::EMPrimaryTrackEMEventIdsTMP const& tracks)
{
fillEventId(collisions, tracks, prmtrackeventid, perCollision_track);
}
Expand Down
28 changes: 21 additions & 7 deletions PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ struct skimmerPrimaryTrack {
Configurable<float> minpt{"minpt", 0.2, "min pt for ITS-TPC track"};
Configurable<float> maxpt{"maxpt", 5.0, "max pt for ITS-TPC track"};
Configurable<float> maxeta{"maxeta", 0.8, "eta acceptance"};
Configurable<float> dca_xy_max{"dca_xy_max", 0.5, "max DCAxy in cm"};
Configurable<float> dca_z_max{"dca_z_max", 0.5, "max DCAz in cm"};
Configurable<float> dca_xy_max{"dca_xy_max", 1.0, "max DCAxy in cm"};
Configurable<float> dca_z_max{"dca_z_max", 1.0, "max DCAz in cm"};
Configurable<float> max_frac_shared_clusters_tpc{"max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"};

// Configurable<int> min_ncluster_tpc{"min_ncluster_tpc", 0, "min ncluster tpc"};
// Configurable<int> mincrossedrows{"mincrossedrows", 70, "min. crossed rows"};
// Configurable<float> min_tpc_cr_findable_ratio{"min_tpc_cr_findable_ratio", 0.8, "min. TPC Ncr/Nf ratio"};
// Configurable<float> max_frac_shared_clusters_tpc{"max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"};
// Configurable<int> min_ncluster_its{"min_ncluster_its", 4, "min ncluster its"};
// Configurable<int> min_ncluster_itsib{"min_ncluster_itsib", 1, "min ncluster itsib"};
// Configurable<float> maxchi2tpc{"maxchi2tpc", 5.0, "max. chi2/NclsTPC"};
Expand Down Expand Up @@ -225,9 +225,9 @@ struct skimmerPrimaryTrack {
return false;
}

// if (track.tpcFractionSharedCls() > max_frac_shared_clusters_tpc) {
// return false;
// }
if (track.tpcFractionSharedCls() > max_frac_shared_clusters_tpc) {
return false;
}

o2::dataformats::DCA mDcaInfoCov;
mDcaInfoCov.set(999, 999, 999, 999, 999);
Expand Down Expand Up @@ -317,7 +317,21 @@ struct skimmerPrimaryTrack {
trackBit |= static_cast<uint16_t>(RefTrackBit::kFracSharedTPC07);
}

emprimarytracks(collision.globalIndex(), track.globalIndex(), static_cast<uint16_t>(pt * 1e+4), eta, phi, dcaXY, static_cast<int16_t>(dcaZ * 1e+4), trackBit);
if (std::fabs(dcaZ) < 0.5) {
trackBit |= static_cast<uint16_t>(RefTrackBit::kDCAz05cm);
}
if (std::fabs(dcaZ) < 0.3) {
trackBit |= static_cast<uint16_t>(RefTrackBit::kDCAz03cm);
}

if (std::fabs(dcaXY) < 0.5) {
trackBit |= static_cast<uint16_t>(RefTrackBit::kDCAxy05cm);
}
if (std::fabs(dcaXY) < 0.3) {
trackBit |= static_cast<uint16_t>(RefTrackBit::kDCAxy03cm);
}

emprimarytracks(collision.globalIndex(), track.globalIndex(), track.sign(), pt, eta, phi, trackBit);
// prmtrackeventidtmp(collision.globalIndex());

stored_trackIds.emplace_back(std::pair<int, int>{collision.globalIndex(), track.globalIndex()});
Expand Down
6 changes: 5 additions & 1 deletion PWGEM/Dilepton/Utils/EMTrackUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace o2::aod::pwgem::dilepton::utils::emtrackutil
{

enum class RefTrackBit : uint16_t { // This is not for leptons, but charged particles for ref. flow.
enum class RefTrackBit : uint16_t { // This is not for leptons, but charged tracks for reference flow.
kNclsITS5 = 1,
kNclsITS6 = 2,
kNcrTPC70 = 4,
Expand All @@ -38,6 +38,10 @@ enum class RefTrackBit : uint16_t { // This is not for leptons, but charged part
kChi2TPC4 = 128,
kChi2TPC3 = 256,
kFracSharedTPC07 = 512,
kDCAxy05cm = 1024, // default is 1 cm
kDCAxy03cm = 2048,
kDCAz05cm = 4096, // default is 1cm
kDCAz03cm = 8192,
};

//_______________________________________________________________________
Expand Down
Loading