Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please consider the following formatting changes to #4274 #213

Merged
merged 1 commit into from
Jan 11, 2024
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
22 changes: 11 additions & 11 deletions PWGLF/DataModel/LFStrangenessPIDTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ DECLARE_SOA_COLUMN(PosTOFDeltaTK0Pi, posTOFDeltaTK0Pi, float); //! positive trac
DECLARE_SOA_COLUMN(NegTOFDeltaTK0Pi, negTOFDeltaTK0Pi, float); //! positive track TOFDeltaT from pion <- k0short expectation

// delta-decay-times (event-time-independent)
DECLARE_SOA_COLUMN(DeltaDecayTimeLambda, deltaDecayTimeLambda, float); //! delta-decay time estimate from proton/pion from Lambda
DECLARE_SOA_COLUMN(DeltaDecayTimeLambda, deltaDecayTimeLambda, float); //! delta-decay time estimate from proton/pion from Lambda
DECLARE_SOA_COLUMN(DeltaDecayTimeAntiLambda, deltaDecayTimeAntiLambda, float); //! delta-decay time estimate from pion/proton from AntiLambda
DECLARE_SOA_COLUMN(DeltaDecayTimeK0Short, deltaDecayTimeK0Short, float); //! delta-decay time estimate from pion/pion from K0Short
DECLARE_SOA_COLUMN(DeltaDecayTimeK0Short, deltaDecayTimeK0Short, float); //! delta-decay time estimate from pion/pion from K0Short

// n-sigmas - unused as of now
// n-sigmas - unused as of now
DECLARE_SOA_COLUMN(PosNSigmaLaPi, posNSigmaLaPi, float); //! positive track NSigma from pion <- lambda expectation
DECLARE_SOA_COLUMN(PosNSigmaLaPr, posNSigmaLaPr, float); //! positive track NSigma from proton <- lambda expectation
DECLARE_SOA_COLUMN(NegNSigmaLaPi, negNSigmaLaPi, float); //! negative track NSigma from pion <- lambda expectation
Expand All @@ -81,12 +81,12 @@ DECLARE_SOA_COLUMN(TofBetaAntiLambda, tofBetaAntiLambda, float); //! beta value
DECLARE_SOA_COLUMN(TofBetaK0Short, tofBetaK0Short, float); //! beta value with K0Short hypothesis

// debug quantities
DECLARE_SOA_COLUMN(V0LifetimeLambda, v0LifetimeLambda, float); //! lifetime of V0 assuming lambda mass (ps)
DECLARE_SOA_COLUMN(V0LifetimeK0Short, v0LifetimeK0Short, float); //! lifetime of V0 assuming K0 mass (ps)
DECLARE_SOA_COLUMN(PosLifetimePr, posLifetimePr, float); //! lifetime (to TOF) of pos prong assuming proton mass (ps)
DECLARE_SOA_COLUMN(PosLifetimePi, posLifetimePi, float); //! lifetime (to TOF) of pos prong assuming pion mass (ps)
DECLARE_SOA_COLUMN(NegLifetimePr, negLifetimePr, float); //! lifetime (to TOF) of neg prong assuming proton mass (ps)
DECLARE_SOA_COLUMN(NegLifetimePi, negLifetimePi, float); //! lifetime (to TOF) of neg prong assuming pion mass (ps)
DECLARE_SOA_COLUMN(V0LifetimeLambda, v0LifetimeLambda, float); //! lifetime of V0 assuming lambda mass (ps)
DECLARE_SOA_COLUMN(V0LifetimeK0Short, v0LifetimeK0Short, float); //! lifetime of V0 assuming K0 mass (ps)
DECLARE_SOA_COLUMN(PosLifetimePr, posLifetimePr, float); //! lifetime (to TOF) of pos prong assuming proton mass (ps)
DECLARE_SOA_COLUMN(PosLifetimePi, posLifetimePi, float); //! lifetime (to TOF) of pos prong assuming pion mass (ps)
DECLARE_SOA_COLUMN(NegLifetimePr, negLifetimePr, float); //! lifetime (to TOF) of neg prong assuming proton mass (ps)
DECLARE_SOA_COLUMN(NegLifetimePi, negLifetimePi, float); //! lifetime (to TOF) of neg prong assuming pion mass (ps)
} // namespace v0data

DECLARE_SOA_TABLE(V0TOFs, "AOD", "V0TOF", // raw information table (for debug, etc)
Expand All @@ -98,8 +98,8 @@ DECLARE_SOA_TABLE(V0TOFPIDs, "AOD", "V0TOFPID", // processed info table (for ana
v0data::PosTOFDeltaTLaPi, v0data::PosTOFDeltaTLaPr,
v0data::NegTOFDeltaTLaPi, v0data::NegTOFDeltaTLaPr,
v0data::PosTOFDeltaTK0Pi, v0data::NegTOFDeltaTK0Pi,
v0data::DeltaDecayTimeLambda,
v0data::DeltaDecayTimeAntiLambda,
v0data::DeltaDecayTimeLambda,
v0data::DeltaDecayTimeAntiLambda,
v0data::DeltaDecayTimeK0Short);

DECLARE_SOA_TABLE(V0TOFDebugs, "AOD", "V0TOFDEBUG", // table with intermediate information solely for debugging
Expand Down
70 changes: 35 additions & 35 deletions PWGLF/TableProducer/lambdakzeropid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ using TaggedV0s = soa::Join<aod::V0s, aod::V0Tags>;
// For MC association in pre-selection
using LabeledTracksExtra = soa::Join<aod::TracksExtra, aod::McTrackLabels>;

// Cores with references and TOF pid
// Cores with references and TOF pid
using V0FullCores = soa::Join<aod::V0Cores, aod::V0TOFs, aod::V0CollRefs>;

struct lambdakzeropid {
// TOF pid for strangeness (recalculated with topology)
Produces<aod::V0TOFPIDs> v0tofpid; // table with Nsigmas
Produces<aod::V0TOFBetas> v0tofbeta; // table with betas
Produces<aod::V0TOFBetas> v0tofbeta; // table with betas
Produces<aod::V0TOFDebugs> v0tofdebugs; // table with extra debug information

Service<o2::ccdb::BasicCCDBManager> ccdb;
Expand Down Expand Up @@ -235,7 +235,7 @@ struct lambdakzeropid {
if (thisLength < length && thisLength > 0)
length = thisLength;
}
if ( length > 1e+5 )
if (length > 1e+5)
length = -100; // force negative to avoid misunderstandings
return length;
}
Expand All @@ -253,14 +253,14 @@ struct lambdakzeropid {
ccdb->setFatalWhenNull(false);

// per event
histos.add("hCandidateCounter", "hCandidateCounter", kTH1F, {{500,-0.5f,499.5f}});
histos.add("hCandidateCounter", "hCandidateCounter", kTH1F, {{500, -0.5f, 499.5f}});

// measured vs expected total time QA
if(doQA){
if (doQA) {
histos.add("h2dProtonMeasuredVsExpected", "h2dProtonMeasuredVsExpected", {HistType::kTH2F, {axisTime, axisTime}});
histos.add("h2dPionMeasuredVsExpected", "h2dPionMeasuredVsExpected", {HistType::kTH2F, {axisTime, axisTime}});

// delta lambda decay time
// delta lambda decay time
histos.add("h2dLambdaDeltaDecayTime", "h2dLambdaDeltaDecayTime", {HistType::kTH2F, {axisPt, axisDeltaTime}});
}
}
Expand Down Expand Up @@ -331,8 +331,8 @@ struct lambdakzeropid {
float timeLambda = lengthV0 / velocityLambda; // in picoseconds

// initialize from V0 position and momenta
o2::track::TrackPar posTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxpos(), v0.pypos(), v0.pzpos()}, +1);
o2::track::TrackPar negTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxneg(), v0.pyneg(), v0.pzneg()}, -1);
o2::track::TrackPar posTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxpos(), v0.pypos(), v0.pzpos()}, +1);
o2::track::TrackPar negTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxneg(), v0.pyneg(), v0.pzneg()}, -1);

float deltaTimePositiveLambdaPi = -1e+6;
float deltaTimeNegativeLambdaPi = -1e+6;
Expand All @@ -353,42 +353,42 @@ struct lambdakzeropid {
float timeNegativePr = lengthNegative / velocityNegativePr;
float timeNegativePi = lengthNegative / velocityNegativePi;

if( v0.posTOFSignal() > 0 && v0.posTOFEventTime() > 0 && lengthPositive > 0){
if (v0.posTOFSignal() > 0 && v0.posTOFEventTime() > 0 && lengthPositive > 0) {
deltaTimePositiveLambdaPr = (v0.posTOFSignal() - v0.posTOFEventTime()) - (timeLambda + timePositivePr);
deltaTimePositiveLambdaPi = (v0.posTOFSignal() - v0.posTOFEventTime()) - (timeLambda + timePositivePi);
deltaTimePositiveK0ShortPi = (v0.posTOFSignal() - v0.posTOFEventTime()) - (timeK0Short + timeNegativePi);
}
if( v0.negTOFSignal() > 0 && v0.negTOFEventTime() > 0 && lengthNegative > 0){
if (v0.negTOFSignal() > 0 && v0.negTOFEventTime() > 0 && lengthNegative > 0) {
deltaTimeNegativeLambdaPr = (v0.negTOFSignal() - v0.negTOFEventTime()) - (timeLambda + timeNegativePr);
deltaTimeNegativeLambdaPi = (v0.negTOFSignal() - v0.negTOFEventTime()) - (timeLambda + timeNegativePi);
deltaTimeNegativeK0ShortPi = (v0.negTOFSignal() - v0.negTOFEventTime()) - (timeK0Short + timeNegativePi);
}
float deltaDecayTimeLambda = -10e+4;
float deltaDecayTimeAntiLambda = -10e+4;
float deltaDecayTimeK0Short = -10e+4;
if( v0.posTOFSignal() > 0 && v0.negTOFSignal() > 0 && lengthPositive > 0 && lengthNegative > 0){ // does not depend on event time
deltaDecayTimeLambda = (v0.posTOFSignal() - timePositivePr) - (v0.negTOFSignal() - timeNegativePi);
deltaDecayTimeAntiLambda = (v0.posTOFSignal() - timePositivePi) - (v0.negTOFSignal() - timeNegativePr);
deltaDecayTimeK0Short = (v0.posTOFSignal() - timePositivePi) - (v0.negTOFSignal() - timeNegativePi);
if (v0.posTOFSignal() > 0 && v0.negTOFSignal() > 0 && lengthPositive > 0 && lengthNegative > 0) { // does not depend on event time
deltaDecayTimeLambda = (v0.posTOFSignal() - timePositivePr) - (v0.negTOFSignal() - timeNegativePi);
deltaDecayTimeAntiLambda = (v0.posTOFSignal() - timePositivePi) - (v0.negTOFSignal() - timeNegativePr);
deltaDecayTimeK0Short = (v0.posTOFSignal() - timePositivePi) - (v0.negTOFSignal() - timeNegativePi);
}

// calculate betas

float evTimeMean = 0.5f*(v0.posTOFEventTime() + v0.negTOFEventTime());
float decayTimeLambda = 0.5f*((v0.posTOFSignal() - timePositivePr) + (v0.negTOFSignal() - timeNegativePi)) - evTimeMean;
float decayTimeAntiLambda = 0.5f*((v0.posTOFSignal() - timePositivePi) + (v0.negTOFSignal() - timeNegativePr)) - evTimeMean;
float decayTimeK0Short = 0.5f*((v0.posTOFSignal() - timePositivePi) + (v0.negTOFSignal() - timeNegativePi)) - evTimeMean;
float evTimeMean = 0.5f * (v0.posTOFEventTime() + v0.negTOFEventTime());
float decayTimeLambda = 0.5f * ((v0.posTOFSignal() - timePositivePr) + (v0.negTOFSignal() - timeNegativePi)) - evTimeMean;
float decayTimeAntiLambda = 0.5f * ((v0.posTOFSignal() - timePositivePi) + (v0.negTOFSignal() - timeNegativePr)) - evTimeMean;
float decayTimeK0Short = 0.5f * ((v0.posTOFSignal() - timePositivePi) + (v0.negTOFSignal() - timeNegativePi)) - evTimeMean;

float betaLambda = -1e+6;
float betaAntiLambda = -1e+6;
float betaK0Short = -1e+6;
if( v0.posTOFSignal() > 0 && v0.negTOFSignal() > 0 && v0.posTOFEventTime() > 0 && v0.negTOFEventTime() > 0){
betaLambda = (lengthV0/decayTimeLambda)/0.0299792458;
betaAntiLambda = (lengthV0/decayTimeAntiLambda)/0.0299792458;
betaK0Short = (lengthV0/decayTimeK0Short)/0.0299792458;

if (v0.posTOFSignal() > 0 && v0.negTOFSignal() > 0 && v0.posTOFEventTime() > 0 && v0.negTOFEventTime() > 0) {
betaLambda = (lengthV0 / decayTimeLambda) / 0.0299792458;
betaAntiLambda = (lengthV0 / decayTimeAntiLambda) / 0.0299792458;
betaK0Short = (lengthV0 / decayTimeK0Short) / 0.0299792458;
}

v0tofpid(lengthPositive, lengthNegative,
deltaTimePositiveLambdaPi, deltaTimePositiveLambdaPr,
deltaTimeNegativeLambdaPi, deltaTimeNegativeLambdaPr,
Expand All @@ -397,17 +397,17 @@ struct lambdakzeropid {
v0tofbeta(betaLambda, betaAntiLambda, betaK0Short);
v0tofdebugs(timeLambda, timeK0Short, timePositivePr, timePositivePi, timeNegativePr, timeNegativePi);

if(doQA){
if(v0.posTOFSignal()>0 && v0.posTOFEventTime()>0)
histos.fill(HIST("h2dProtonMeasuredVsExpected"),
(timeLambda + timePositivePr),
(v0.posTOFSignal() - v0.posTOFEventTime()));
if(v0.negTOFSignal()>0 && v0.negTOFEventTime()>0)
histos.fill(HIST("h2dPionMeasuredVsExpected"),
(timeLambda + timeNegativePi),
(v0.negTOFSignal() - v0.negTOFEventTime()));

// delta lambda decay time
if (doQA) {
if (v0.posTOFSignal() > 0 && v0.posTOFEventTime() > 0)
histos.fill(HIST("h2dProtonMeasuredVsExpected"),
(timeLambda + timePositivePr),
(v0.posTOFSignal() - v0.posTOFEventTime()));
if (v0.negTOFSignal() > 0 && v0.negTOFEventTime() > 0)
histos.fill(HIST("h2dPionMeasuredVsExpected"),
(timeLambda + timeNegativePi),
(v0.negTOFSignal() - v0.negTOFEventTime()));

// delta lambda decay time
histos.fill(HIST("h2dLambdaDeltaDecayTime"), v0.pt(), deltaDecayTimeLambda);
}
}
Expand Down
Loading
Loading