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
57 changes: 32 additions & 25 deletions PWGLF/TableProducer/lambdakzerobuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ using namespace o2::framework;
using namespace o2::framework::expressions;
using std::array;

//use parameters + cov mat non-propagated, aux info + (extension propagated)
// use parameters + cov mat non-propagated, aux info + (extension propagated)
using FullTracksExt = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::TracksDCA>;
using FullTracksExtMC = soa::Join<FullTracksExt, aod::McTrackLabels>;
using FullTracksExtIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TracksDCA>;
Expand Down Expand Up @@ -98,8 +98,8 @@ struct lambdakzeroBuilder {

int mRunNumber;
float d_bz;
float maxSnp; //max sine phi for propagation
float maxStep; //max step size (cm) for propagation
float maxSnp; // max sine phi for propagation
float maxStep; // max step size (cm) for propagation

// for debugging
#ifdef MY_DEBUG
Expand Down Expand Up @@ -141,8 +141,8 @@ struct lambdakzeroBuilder {
// using namespace analysis::lambdakzerobuilder;
mRunNumber = 0;
d_bz = 0;
maxSnp = 0.85f; //could be changed later
maxStep = 2.00f; //could be changed later
maxSnp = 0.85f; // could be changed later
maxStep = 2.00f; // could be changed later

ccdb->setURL("http://alice-ccdb.cern.ch");
ccdb->setCaching(true);
Expand All @@ -160,6 +160,13 @@ struct lambdakzeroBuilder {
o2::base::Propagator::initFieldFromGRP(grpo);
o2::base::Propagator::Instance()->setMatLUT(lut);
}

if (doprocessRun3 && doprocessRun2) {
LOGF(fatal, "processRun3 and processRun2 are both set to true; try again with only one of them set to true");
}
if (!doprocessRun3 && !doprocessRun2) {
LOGF(fatal, "processRun3 nor processRun2 are both set to false; try again with only one of them set to false");
}
}

float getMagneticField(uint64_t timestamp)
Expand Down Expand Up @@ -226,7 +233,7 @@ struct lambdakzeroBuilder {
#endif
MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "V0 builder: found K0S from Lc, posTrack --> " << labelPos << ", negTrack --> " << labelNeg);

//value 0.5: any considered V0
// value 0.5: any considered V0
registry.fill(HIST("hV0Criteria"), 0.5);
if (isRun2) {
if (!(V0.posTrack_as<MyTracks>().trackType() & o2::aod::track::TPCrefit)) {
Expand All @@ -240,7 +247,7 @@ struct lambdakzeroBuilder {
continue; // TPC refit
}
}
//Passes TPC refit
// Passes TPC refit
registry.fill(HIST("hV0Criteria"), 1.5);
if (V0.posTrack_as<MyTracks>().tpcNClsCrossedRows() < mincrossedrows) {
MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has " << V0.posTrack_as<MyTracks>().tpcNClsCrossedRows() << " crossed rows, cut at " << mincrossedrows);
Expand All @@ -252,7 +259,7 @@ struct lambdakzeroBuilder {
v0dataLink(-1);
continue;
}
//passes crossed rows
// passes crossed rows
registry.fill(HIST("hV0Criteria"), 2.5);
if (fabs(V0.posTrack_as<MyTracks>().dcaXY()) < dcapostopv) {
MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has dcaXY " << V0.posTrack_as<MyTracks>().dcaXY() << " , cut at " << dcanegtopv);
Expand All @@ -265,7 +272,7 @@ struct lambdakzeroBuilder {
continue;
}
MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "Filling good indices: posTrack --> " << labelPos << ", negTrack --> " << labelNeg);
//passes DCAxy
// passes DCAxy
registry.fill(HIST("hV0Criteria"), 3.5);

// Candidate building part
Expand All @@ -290,7 +297,7 @@ struct lambdakzeroBuilder {
continue;
}

//passes diff coll check
// passes diff coll check
registry.fill(HIST("hV0Criteria"), 4.5);

// Act on copies for minimization
Expand All @@ -305,7 +312,7 @@ struct lambdakzeroBuilder {
continue;
}

//passes V0 fitter minimization successfully
// passes V0 fitter minimization successfully
registry.fill(HIST("hV0Criteria"), 5.5);

double finalXpos = fitter.getTrack(0).getX();
Expand All @@ -331,7 +338,7 @@ struct lambdakzeroBuilder {
continue;
}

//Passes step 2 of V0 fitter
// Passes step 2 of V0 fitter
registry.fill(HIST("hV0Criteria"), 6.5);

pTrack.getPxPyPzGlo(pvec0);
Expand All @@ -351,7 +358,7 @@ struct lambdakzeroBuilder {
continue;
}

//Passes DCA between daughters check
// Passes DCA between daughters check
registry.fill(HIST("hV0Criteria"), 7.5);

auto V0CosinePA = RecoDecay::cpa(array{collision.posX(), collision.posY(), collision.posZ()}, array{pos[0], pos[1], pos[2]}, array{pvec0[0] + pvec1[0], pvec0[1] + pvec1[1], pvec0[2] + pvec1[2]});
Expand All @@ -361,7 +368,7 @@ struct lambdakzeroBuilder {
continue;
}

//Passes CosPA check
// Passes CosPA check
registry.fill(HIST("hV0Criteria"), 8.5);

auto V0radius = RecoDecay::sqrtSumOfSquares(pos[0], pos[1]); // probably find better name to differentiate the cut from the variable
Expand All @@ -371,7 +378,7 @@ struct lambdakzeroBuilder {
continue;
}

//Passes radius check
// Passes radius check
registry.fill(HIST("hV0Criteria"), 9.5);

MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "in builder 1, keeping K0S candidate: posTrack --> " << labelPos << ", negTrack --> " << labelNeg);
Expand Down Expand Up @@ -428,7 +435,7 @@ struct lambdakzeroBuilder {
#endif
MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "V0 builder: found K0S from Lc, posTrack --> " << labelPos << ", negTrack --> " << labelNeg);

//value 0.5: any considered V0
// value 0.5: any considered V0
registry.fill(HIST("hV0Criteria"), 0.5);
if (isRun2) {
if (!(V0.posTrack_as<MyTracksIU>().trackType() & o2::aod::track::TPCrefit)) {
Expand All @@ -442,7 +449,7 @@ struct lambdakzeroBuilder {
continue; // TPC refit
}
}
//Passes TPC refit
// Passes TPC refit
registry.fill(HIST("hV0Criteria"), 1.5);
if (V0.posTrack_as<MyTracksIU>().tpcNClsCrossedRows() < mincrossedrows) {
MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has " << V0.posTrack_as<MyTracksIU>().tpcNClsCrossedRows() << " crossed rows, cut at " << mincrossedrows);
Expand All @@ -454,7 +461,7 @@ struct lambdakzeroBuilder {
v0dataLink(-1);
continue;
}
//passes crossed rows
// passes crossed rows
registry.fill(HIST("hV0Criteria"), 2.5);
if (fabs(V0.posTrack_as<MyTracksIU>().dcaXY()) < dcapostopv) {
MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has dcaXY " << V0.posTrack_as<MyTracksIU>().dcaXY() << " , cut at " << dcanegtopv);
Expand All @@ -467,7 +474,7 @@ struct lambdakzeroBuilder {
continue;
}
MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "Filling good indices: posTrack --> " << labelPos << ", negTrack --> " << labelNeg);
//passes DCAxy
// passes DCAxy
registry.fill(HIST("hV0Criteria"), 3.5);

// Candidate building part
Expand All @@ -492,7 +499,7 @@ struct lambdakzeroBuilder {
continue;
}

//passes diff coll check
// passes diff coll check
registry.fill(HIST("hV0Criteria"), 4.5);

// Act on copies for minimization
Expand All @@ -507,7 +514,7 @@ struct lambdakzeroBuilder {
continue;
}

//passes V0 fitter minimization successfully
// passes V0 fitter minimization successfully
registry.fill(HIST("hV0Criteria"), 5.5);

double finalXpos = fitter.getTrack(0).getX();
Expand All @@ -533,7 +540,7 @@ struct lambdakzeroBuilder {
continue;
}

//Passes step 2 of V0 fitter
// Passes step 2 of V0 fitter
registry.fill(HIST("hV0Criteria"), 6.5);

pTrack.getPxPyPzGlo(pvec0);
Expand All @@ -553,7 +560,7 @@ struct lambdakzeroBuilder {
continue;
}

//Passes DCA between daughters check
// Passes DCA between daughters check
registry.fill(HIST("hV0Criteria"), 7.5);

auto V0CosinePA = RecoDecay::cpa(array{collision.posX(), collision.posY(), collision.posZ()}, array{pos[0], pos[1], pos[2]}, array{pvec0[0] + pvec1[0], pvec0[1] + pvec1[1], pvec0[2] + pvec1[2]});
Expand All @@ -563,7 +570,7 @@ struct lambdakzeroBuilder {
continue;
}

//Passes CosPA check
// Passes CosPA check
registry.fill(HIST("hV0Criteria"), 8.5);

auto V0radius = RecoDecay::sqrtSumOfSquares(pos[0], pos[1]); // probably find better name to differentiate the cut from the variable
Expand All @@ -573,7 +580,7 @@ struct lambdakzeroBuilder {
continue;
}

//Passes radius check
// Passes radius check
registry.fill(HIST("hV0Criteria"), 9.5);

MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "in builder 1, keeping K0S candidate: posTrack --> " << labelPos << ", negTrack --> " << labelNeg);
Expand Down
49 changes: 45 additions & 4 deletions PWGLF/TableProducer/lambdakzerofinder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ struct lambdakzerofinder {
}
};

struct lambdakzerofinderQA {
struct lambdakzerofinderQa {
// Basic checks
// Selection criteria
Configurable<double> v0cospa{"v0cospa", 0.998, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0)
Expand All @@ -277,11 +277,51 @@ struct lambdakzerofinderQA {
},
};

void init(InitContext const&)
{
if (doprocessRun3 && doprocessRun2) {
LOGF(fatal, "processRun3 and processRun2 are both set to true; try again with only one of them set to true");
}
if (!doprocessRun3 && !doprocessRun2) {
LOGF(fatal, "processRun3 nor processRun2 are both set to false; try again with only one of them set to false");
}
}

Filter preFilterV0 = nabs(aod::v0data::dcapostopv) > dcapostopv&& nabs(aod::v0data::dcanegtopv) > dcanegtopv&& aod::v0data::dcaV0daughters < dcav0dau;

/// Connect to V0Data: newly indexed, note: V0Datas table incompatible with standard V0 table!
void process(soa::Join<aod::Collisions, aod::EvSels, aod::CentRun2V0Ms>::iterator const& collision,
soa::Filtered<aod::V0Datas> const& fullV0s)
void processRun3(soa::Join<aod::Collisions, aod::EvSels, aod::CentFV0As>::iterator const& collision,
soa::Filtered<aod::V0Datas> const& fullV0s)
{
if (!collision.sel8()) {
return;
}

Long_t lNCand = 0;
for (auto& v0 : fullV0s) {
if (v0.v0radius() > v0radius && v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > v0cospa) {
registry.fill(HIST("hV0Radius"), v0.v0radius());
registry.fill(HIST("hV0CosPA"), v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ()));
registry.fill(HIST("hDCAPosToPV"), v0.dcapostopv());
registry.fill(HIST("hDCANegToPV"), v0.dcanegtopv());
registry.fill(HIST("hDCAV0Dau"), v0.dcaV0daughters());

if (TMath::Abs(v0.yLambda()) < 0.5) {
registry.fill(HIST("h3dMassLambda"), collision.centFV0A(), v0.pt(), v0.mLambda());
registry.fill(HIST("h3dMassAntiLambda"), collision.centFV0A(), v0.pt(), v0.mAntiLambda());
}
if (TMath::Abs(v0.yK0Short()) < 0.5) {
registry.fill(HIST("h3dMassK0Short"), collision.centFV0A(), v0.pt(), v0.mK0Short());
}
lNCand++;
}
}
registry.fill(HIST("hCandPerEvent"), lNCand);
}
PROCESS_SWITCH(lambdakzerofinderQa, processRun3, "Process Run 3 data", true);

void processRun2(soa::Join<aod::Collisions, aod::EvSels, aod::CentRun2V0Ms>::iterator const& collision,
soa::Filtered<aod::V0Datas> const& fullV0s)
{
if (!collision.alias()[kINT7]) {
return;
Expand Down Expand Up @@ -311,6 +351,7 @@ struct lambdakzerofinderQA {
}
registry.fill(HIST("hCandPerEvent"), lNCand);
}
PROCESS_SWITCH(lambdakzerofinderQa, processRun2, "Process Run 2 data", false);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that they are not supposed to be ran together, could you add a check in the init function to ensure that it is the case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is something I should probably add to the analysers as well if I add it here; will do in a bit and update the PR

};

/// Extends the v0data table with expression columns
Expand All @@ -324,6 +365,6 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
return WorkflowSpec{
adaptAnalysisTask<lambdakzeroprefilter>(cfgc, TaskName{"lf-lambdakzeroprefilter"}),
adaptAnalysisTask<lambdakzerofinder>(cfgc, TaskName{"lf-lambdakzerofinder"}),
adaptAnalysisTask<lambdakzerofinderQA>(cfgc, TaskName{"lf-lambdakzerofinderQA"}),
adaptAnalysisTask<lambdakzerofinderQa>(cfgc, TaskName{"lf-lambdakzerofinderQA"}),
adaptAnalysisTask<lambdakzeroinitializer>(cfgc, TaskName{"lf-lambdakzeroinitializer"})};
}
27 changes: 17 additions & 10 deletions PWGLF/Tasks/cascadeanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ using namespace o2::framework::expressions;
using std::array;

struct cascadeQa {
//Basic checks
// Basic checks
HistogramRegistry registry{
"registry",
{
Expand All @@ -79,14 +79,14 @@ struct cascadeQa {
void process(aod::Collision const& collision, aod::CascDataExt const& Cascades)
{
for (auto& casc : Cascades) {
if (casc.sign() < 0) { //FIXME: could be done better...
if (casc.sign() < 0) { // FIXME: could be done better...
registry.fill(HIST("hMassXiMinus"), casc.mXi());
registry.fill(HIST("hMassOmegaMinus"), casc.mOmega());
} else {
registry.fill(HIST("hMassXiPlus"), casc.mXi());
registry.fill(HIST("hMassOmegaPlus"), casc.mOmega());
}
//The basic eleven!
// The basic eleven!
registry.fill(HIST("hV0Radius"), casc.v0radius());
registry.fill(HIST("hCascRadius"), casc.cascradius());
registry.fill(HIST("hV0CosPA"), casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()));
Expand Down Expand Up @@ -119,11 +119,18 @@ struct cascadeAnalysis {
registry.add("h3dMassXiPlus", "h3dMassXiPlus", {HistType::kTH3F, {centAxis, ptAxis, massAxisXi}});
registry.add("h3dMassOmegaMinus", "h3dMassOmegaMinus", {HistType::kTH3F, {centAxis, ptAxis, massAxisOmega}});
registry.add("h3dMassOmegaPlus", "h3dMassOmegaPlus", {HistType::kTH3F, {centAxis, ptAxis, massAxisOmega}});

if (doprocessRun3 && doprocessRun2) {
LOGF(fatal, "processRun3 and processRun2 are both set to true; try again with only one of them set to true");
}
if (!doprocessRun3 && !doprocessRun2) {
LOGF(fatal, "processRun3 nor processRun2 are both set to false; try again with only one of them set to false");
}
}

//Selection criteria
Configurable<double> v0cospa{"v0cospa", 0.999, "V0 CosPA"}; //double -> N.B. dcos(x)/dx = 0 at x=0)
Configurable<double> casccospa{"casccospa", 0.999, "Casc CosPA"}; //double -> N.B. dcos(x)/dx = 0 at x=0)
// Selection criteria
Configurable<double> v0cospa{"v0cospa", 0.999, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0)
Configurable<double> casccospa{"casccospa", 0.999, "Casc CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0)
Configurable<float> dcav0dau{"dcav0dau", 1.0, "DCA V0 Daughters"};
Configurable<float> dcacascdau{"dcacascdau", .3, "DCA Casc Daughters"};
Configurable<float> dcanegtopv{"dcanegtopv", .1, "DCA Neg To PV"};
Expand All @@ -145,13 +152,13 @@ struct cascadeAnalysis {
return;
}
for (auto& casc : Cascades) {
//FIXME: dynamic columns cannot be filtered on?
// FIXME: dynamic columns cannot be filtered on?
if (casc.v0radius() > v0radius &&
casc.cascradius() > cascradius &&
casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > v0cospa &&
casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospa &&
casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) > dcav0topv) {
if (casc.sign() < 0) { //FIXME: could be done better...
if (casc.sign() < 0) { // FIXME: could be done better...
if (TMath::Abs(casc.yXi()) < 0.5) {
registry.fill(HIST("h3dMassXiMinus"), 0., casc.pt(), casc.mXi());
}
Expand Down Expand Up @@ -180,13 +187,13 @@ struct cascadeAnalysis {
return;
}
for (auto& casc : Cascades) {
//FIXME: dynamic columns cannot be filtered on?
// FIXME: dynamic columns cannot be filtered on?
if (casc.v0radius() > v0radius &&
casc.cascradius() > cascradius &&
casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > v0cospa &&
casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospa &&
casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) > dcav0topv) {
if (casc.sign() < 0) { //FIXME: could be done better...
if (casc.sign() < 0) { // FIXME: could be done better...
if (TMath::Abs(casc.yXi()) < 0.5) {
registry.fill(HIST("h3dMassXiMinus"), collision.centRun2V0M(), casc.pt(), casc.mXi());
}
Expand Down
Loading