Skip to content

Commit

Permalink
[PWGLF] Add ITS PID in resonance flow task (#9430)
Browse files Browse the repository at this point in the history
  • Loading branch information
skundu692 authored Jan 21, 2025
1 parent 6e4f2de commit 00f91f2
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 76 deletions.
2 changes: 1 addition & 1 deletion PWGLF/TableProducer/Common/epvector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ struct epvector {

void init(o2::framework::InitContext&)
{
std::vector<double> occupancyBinning = {0.0, 500.0, 1000.0, 1500.0, 2000.0, 3000.0, 4000.0, 5000.0, 50000.0};
std::vector<double> occupancyBinning = {-0.5, 500.0, 1000.0, 1500.0, 2000.0, 3000.0, 4000.0, 5000.0, 50000.0};

const AxisSpec centAxis{configAxisCentrality, "V0M (%)"};
// AxisSpec centAxis = {8, 0, 80, "V0M (%)"};
Expand Down
93 changes: 21 additions & 72 deletions PWGLF/Tasks/Resonances/highmasslambda.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "DataFormatsParameters/GRPMagField.h"
#include "CCDB/BasicCCDBManager.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "Common/DataModel/PIDResponseITS.h"

using namespace o2;
using namespace o2::framework;
Expand All @@ -66,7 +67,6 @@ struct highmasslambda {
float d_bz;
Service<o2::ccdb::BasicCCDBManager> ccdb;
Service<o2::framework::O2DatabasePDG> pdg;

// CCDB options
// Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
// Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"};
Expand All @@ -92,7 +92,7 @@ struct highmasslambda {
Configurable<bool> rejectPID{"rejectPID", true, "pion, kaon, electron rejection"};
Configurable<float> cfgCutTOFBeta{"cfgCutTOFBeta", 0.0, "cut TOF beta"};
Configurable<bool> ispTdifferentialDCA{"ispTdifferentialDCA", true, "is pT differential DCA"};
Configurable<bool> isPVContributor{"isPVContributor", true, "is PV contributor"};
Configurable<bool> useGlobalTrack{"useGlobalTrack", true, "use global track"};
Configurable<float> confMinRot{"confMinRot", 5.0 * TMath::Pi() / 6.0, "Minimum of rotation"};
Configurable<float> confMaxRot{"confMaxRot", 7.0 * TMath::Pi() / 6.0, "Maximum of rotation"};
Configurable<float> confRapidity{"confRapidity", 0.8, "cut on Rapidity"};
Expand Down Expand Up @@ -172,7 +172,7 @@ struct highmasslambda {

void init(o2::framework::InitContext&)
{
std::vector<double> occupancyBinning = {0.0, 500.0, 1000.0, 1500.0, 2000.0, 3000.0, 4000.0, 5000.0, 50000.0};
std::vector<double> occupancyBinning = {-0.5, 500.0, 1000.0, 1500.0, 2000.0, 3000.0, 4000.0, 5000.0, 50000.0};
// std::vector<double> dcaBinning = {0.0, 0.0005, 0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.012, 0.014, 0.016, 0.02, 0.03, 0.05, 0.1, 0.5, 1.0};
std::vector<double> dcaBinning = {0.0, 0.0005, 0.001, 0.0012, 0.0014, 0.0016, 0.002, 0.0025, 0.003, 0.004, 0.005, 0.006, 0.008, 0.01, 0.015, 0.02, 0.04, 0.05, 0.06, 0.08, 0.1, 0.3, 1.0};
std::vector<double> ptProtonBinning = {0.2, 0.3, 0.5, 0.6, 0.8, 1.2, 1.4, 1.6, 2.0, 3.0, 4.0, 6.0};
Expand Down Expand Up @@ -270,10 +270,10 @@ struct highmasslambda {
template <typename T>
bool selectionTrack(const T& candidate)
{
if (isPVContributor && !(candidate.isGlobalTrack() && candidate.isPVContributor() && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster && candidate.itsNClsInnerBarrel() >= 1)) {
if (useGlobalTrack && !(candidate.isGlobalTrackWoDCA() && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster)) {
return false;
}
if (!isPVContributor && !(candidate.isGlobalTrackWoDCA() && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster && candidate.itsNClsInnerBarrel() >= 1)) {
if (!useGlobalTrack && !(candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster)) {
return false;
}

Expand Down Expand Up @@ -386,82 +386,36 @@ struct highmasslambda {
return true;
}

// TPC TOF
// TOF Veto
template <typename T>
bool selectionPID1(const T& candidate)
{
if (candidate.tpcInnerParam() < 0.85 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
return true;
}
if (candidate.tpcInnerParam() >= 0.85) {
if (candidate.hasTOF()) {
if (candidate.beta() > cfgCutTOFBeta && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaPr()) < nsigmaCutTOF) {
return true;
}
if (candidate.hasTOF()) {
if (candidate.beta() > cfgCutTOFBeta && candidate.tpcNSigmaPr() > -nsigmaCutTPC && candidate.tpcNSigmaPr() < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaPr()) < nsigmaCutTOF) {
return true;
}
if (!candidate.hasTOF()) {
if (candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
return true;
}
}
if (!candidate.hasTOF()) {
if (candidate.tpcNSigmaPr() > -nsigmaCutTPC && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
return true;
}
}
return false;
}

// TOF Veto
// TPC TOF
template <typename T>
bool selectionPID2(const T& candidate)
{
if (candidate.tpcInnerParam() < 0.85 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
if (candidate.tpcInnerParam() < 1.0 && candidate.tpcNSigmaPr() > -nsigmaCutTPC && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
return true;
}
if (candidate.tpcInnerParam() >= 0.85 && candidate.beta() > cfgCutTOFBeta && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaPr()) < nsigmaCutTOF) {
if (candidate.tpcInnerParam() >= 1.0 && candidate.tpcInnerParam() < 2.0 && candidate.beta() > cfgCutTOFBeta && candidate.tpcNSigmaPr() > -nsigmaCutTPC && candidate.tpcNSigmaPr() < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaPr()) < nsigmaCutTOF) {
return true;
}
return false;
}

// TOF veto loose
template <typename T>
bool selectionPID3(const T& candidate)
{
if (candidate.tpcInnerParam() < 0.85 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
if (candidate.tpcInnerParam() >= 2.0 && candidate.tpcNSigmaPr() > -nsigmaCutTPC && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
return true;
}
if (candidate.tpcInnerParam() >= 0.85) {
if (candidate.hasTOF()) {
if (candidate.beta() > cfgCutTOFBeta && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaPr()) < nsigmaCutTOF) {
return true;
}
}
if (!candidate.hasTOF()) {
if (candidate.tpcInnerParam() < 1.5 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
return true;
}
}
}
return false;
}

// TOF veto very loose
template <typename T>
bool selectionPID4(const T& candidate)
{
if (candidate.tpcInnerParam() < 0.85 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
return true;
}
if (candidate.tpcInnerParam() >= 0.85) {
if (candidate.hasTOF()) {
if (candidate.beta() > cfgCutTOFBeta && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaPr()) < nsigmaCutTOF) {
return true;
}
}
if (!candidate.hasTOF()) {
if (candidate.tpcInnerParam() < 1.8 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
return true;
}
}
}
return false;
}

Expand Down Expand Up @@ -564,6 +518,7 @@ struct highmasslambda {
if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
return;
}
o2::aod::ITSResponse itsResponse;
auto centrality = collision.centFT0C();
auto multTPC = collision.multNTracksPV();
histos.fill(HIST("hFTOCvsTPCNoCut"), centrality, multTPC);
Expand Down Expand Up @@ -611,13 +566,9 @@ struct highmasslambda {
if (PIDstrategy == 1 && !selectionPID2(track1)) {
continue;
}
if (PIDstrategy == 2 && !selectionPID3(track1)) {
if (track1.p() < 1.0 && !(itsResponse.nSigmaITS<o2::track::PID::Proton>(track1) > -2.5 && itsResponse.nSigmaITS<o2::track::PID::Proton>(track1) < 2.5)) {
continue;
}
if (PIDstrategy == 3 && !selectionPID4(track1)) {
continue;
}

if (track1.hasTOF()) {
histos.fill(HIST("hNsigmaProtonTOFPre"), track1.tofNSigmaPr(), track1.pt());
}
Expand Down Expand Up @@ -774,6 +725,7 @@ struct highmasslambda {
if (!collision2.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
continue;
}
o2::aod::ITSResponse itsResponse;
auto centrality = collision1.centFT0C();
auto psiFT0C = collision1.psiFT0C();
auto QFT0C = collision1.qFT0C();
Expand All @@ -797,10 +749,7 @@ struct highmasslambda {
if (PIDstrategy == 1 && !selectionPID2(track1)) {
continue;
}
if (PIDstrategy == 2 && !selectionPID3(track1)) {
continue;
}
if (PIDstrategy == 3 && !selectionPID4(track1)) {
if (track1.p() < 1.0 && !(itsResponse.nSigmaITS<o2::track::PID::Proton>(track1) > -2.5 && itsResponse.nSigmaITS<o2::track::PID::Proton>(track1) < 2.5)) {
continue;
}

Expand Down
21 changes: 18 additions & 3 deletions PWGLF/Tasks/Resonances/phipbpb.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "CCDB/BasicCCDBManager.h"
#include "Common/DataModel/PIDResponseITS.h"

using namespace o2;
using namespace o2::framework;
Expand Down Expand Up @@ -145,7 +146,7 @@ struct phipbpb {
void init(o2::framework::InitContext&)
{
// std::vector<double> occupancyBinning = {0.0, 500.0, 1000.0, 3000.0, 6000.0, 50000.0};
std::vector<double> occupancyBinning = {0.0, 500.0, 1000.0, 1500.0, 2000.0, 3000.0, 4000.0, 5000.0, 50000.0};
std::vector<double> occupancyBinning = {-0.5, 500.0, 1000.0, 1500.0, 2000.0, 3000.0, 4000.0, 5000.0, 50000.0};
const AxisSpec thnAxisInvMass{configThnAxisInvMass, "#it{M} (GeV/#it{c}^{2})"};
const AxisSpec thnAxisPt{configThnAxisPt, "#it{p}_{T} (GeV/#it{c})"};
const AxisSpec thnAxisCosThetaStar{configThnAxisCosThetaStar, "cos(#vartheta_{OP})"};
Expand Down Expand Up @@ -269,7 +270,7 @@ struct phipbpb {
if (useGlobalTrack && !(candidate.isGlobalTrack() && candidate.isPVContributor() && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster)) {
return false;
}
if (!useGlobalTrack && !(candidate.isPVContributor() && candidate.itsNCls() > cfgITScluster)) {
if (!useGlobalTrack && !(candidate.tpcNClsFound() > cfgTPCcluster)) {
return false;
}
return true;
Expand Down Expand Up @@ -354,7 +355,7 @@ struct phipbpb {
ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for bin"};
ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {20, 0, 100}, "multiplicity percentile for bin"};
ConfigurableAxis axisEPAngle{"axisEPAngle", {6, -TMath::Pi() / 2, TMath::Pi() / 2}, "event plane angle"};
ConfigurableAxis axisOccup{"axisOccup", {20, 0.0, 40000.0}, "occupancy axis"};
ConfigurableAxis axisOccup{"axisOccup", {20, -0.5, 40000.0}, "occupancy axis"};

using BinningTypeVertexContributor = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C, o2::aod::evsel::NumTracksInTimeRange>;
ROOT::Math::PxPyPzMVector PhiMesonMother, KaonPlus, KaonMinus, fourVecDauCM;
Expand All @@ -381,6 +382,7 @@ struct phipbpb {
auto QTPCR = collision.qTPCR();
auto QTPCL = collision.qTPCL();
int occupancy = collision.trackOccupancyInTimeRange();
o2::aod::ITSResponse itsResponse;
if (occupancy > cfgCutOccupancy) {
return;
}
Expand Down Expand Up @@ -427,6 +429,9 @@ struct phipbpb {
if (!ispTdepPID && !selectionPID(track1)) {
continue;
}
if (useGlobalTrack && track1.p() < 1.0 && !(itsResponse.nSigmaITS<o2::track::PID::Kaon>(track1) > -2.5 && itsResponse.nSigmaITS<o2::track::PID::Kaon>(track1) < 2.5)) {
continue;
}
histos.fill(HIST("hTPCglobalmomcorr"), track1.p() / track1.sign(), track1.p() - track1.tpcInnerParam(), centrality);
histos.fill(HIST("hEta"), track1.eta());
histos.fill(HIST("hDcaxy"), track1.dcaXY());
Expand Down Expand Up @@ -462,6 +467,9 @@ struct phipbpb {
if (removefaketrak && isFakeKaon(track2)) {
continue;
}
if (useGlobalTrack && track2.p() < 1.0 && !(itsResponse.nSigmaITS<o2::track::PID::Kaon>(track2) > -2.5 && itsResponse.nSigmaITS<o2::track::PID::Kaon>(track2) < 2.5)) {
continue;
}
KaonPlus = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
KaonMinus = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massKa);
PhiMesonMother = KaonPlus + KaonMinus;
Expand Down Expand Up @@ -511,6 +519,7 @@ struct phipbpb {
if (collision1.bcId() == collision2.bcId()) {
continue;
}
o2::aod::ITSResponse itsResponse;
int occupancy1 = collision1.trackOccupancyInTimeRange();
int occupancy2 = collision2.trackOccupancyInTimeRange();
if (occupancy1 > cfgCutOccupancy) {
Expand Down Expand Up @@ -539,6 +548,12 @@ struct phipbpb {
if (track1.sign() * track2.sign() > 0) {
continue;
}
if (useGlobalTrack && track1.p() < 1.0 && !(itsResponse.nSigmaITS<o2::track::PID::Kaon>(track1) > -2.5 && itsResponse.nSigmaITS<o2::track::PID::Kaon>(track1) < 2.5)) {
continue;
}
if (useGlobalTrack && track2.p() < 1.0 && !(itsResponse.nSigmaITS<o2::track::PID::Kaon>(track2) > -2.5 && itsResponse.nSigmaITS<o2::track::PID::Kaon>(track2) < 2.5)) {
continue;
}
if (!selectionTrack(track1) || !selectionTrack(track2)) {
continue;
}
Expand Down

0 comments on commit 00f91f2

Please sign in to comment.