Skip to content

Commit

Permalink
fix filtering and minor edits (AliceO2Group#5245)
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeric-landou authored and jgrosseo committed Aug 18, 2021
1 parent ac825ca commit 9fc2528
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
20 changes: 15 additions & 5 deletions Tasks/PWGLF/lambdakzeroanalysis.cxx
Expand Up @@ -90,11 +90,12 @@ struct lambdakzeroanalysis {
Configurable<float> dcanegtopv{"dcanegtopv", .1, "DCA Neg To PV"};
Configurable<float> dcapostopv{"dcapostopv", .1, "DCA Pos To PV"};
Configurable<float> v0radius{"v0radius", 5.0, "v0radius"};
Configurable<float> rapidity{"rapidity", 0.5, "rapidity"};

Filter preFilterV0 = aod::v0data::dcapostopv > dcapostopv&&
aod::v0data::dcanegtopv > dcanegtopv&& aod::v0data::dcaV0daughters < dcav0dau;
// Filter preFilterV0 = aod::v0data::dcapostopv > dcapostopv&&
// aod::v0data::dcanegtopv > dcanegtopv&& aod::v0data::dcaV0daughters < dcav0dau; we can use this again once (and if) math expressions can be used there

void process(soa::Join<aod::Collisions, aod::EvSels, aod::Cents>::iterator const& collision, soa::Filtered<aod::V0DataExt> const& fullV0s)
void process(soa::Join<aod::Collisions, aod::EvSels, aod::Cents>::iterator const& collision, aod::V0DataExt const& fullV0s)
{
if (!collision.alias()[kINT7]) {
return;
Expand All @@ -106,11 +107,20 @@ struct lambdakzeroanalysis {
for (auto& v0 : fullV0s) {
//FIXME: could not find out how to filter cosPA and radius variables (dynamic columns)
if (v0.v0radius() > v0radius && v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > v0cospa) {
if (TMath::Abs(v0.yLambda()) < 0.5) {
if (fabs(v0.dcapostopv()) < dcapostopv) {
continue;
}
if (fabs(v0.dcanegtopv()) < dcanegtopv) {
continue;
}
if (fabs(v0.dcaV0daughters()) > dcav0dau) {
continue;
}
if (TMath::Abs(v0.yLambda()) < rapidity) {
h3dMassLambda->Fill(collision.centV0M(), v0.pt(), v0.mLambda());
h3dMassAntiLambda->Fill(collision.centV0M(), v0.pt(), v0.mAntiLambda());
}
if (TMath::Abs(v0.yK0Short()) < 0.5) {
if (TMath::Abs(v0.yK0Short()) < rapidity) {
h3dMassK0Short->Fill(collision.centV0M(), v0.pt(), v0.mK0Short());
}
}
Expand Down
12 changes: 8 additions & 4 deletions Tasks/PWGLF/lambdakzerobuilder.cxx
Expand Up @@ -81,7 +81,7 @@ struct lambdakzeroprefilterpairs {
Configurable<float> dcanegtopv{"dcanegtopv", .1, "DCA Neg To PV"};
Configurable<float> dcapostopv{"dcapostopv", .1, "DCA Pos To PV"};
Configurable<int> mincrossedrows{"mincrossedrows", 70, "min crossed rows"};
Configurable<bool> tpcrefit{"tpcrefit", 1, "demand TPC refit"};
Configurable<int> tpcrefit{"tpcrefit", 1, "demand TPC refit"};

OutputObj<TH1F> hGoodIndices{TH1F("hGoodIndices", "", 4, 0, 4)};

Expand Down Expand Up @@ -132,7 +132,7 @@ struct lambdakzerobuilder {

//Configurables
Configurable<double> d_bz{"d_bz", -5.0, "bz field"};
Configurable<double> d_UseAbsDCA{"d_UseAbsDCA", kTRUE, "Use Abs DCAs"};
// Configurable<int> d_UseAbsDCA{"d_UseAbsDCA", 1, "Use Abs DCAs"}; uncomment this once we want to use the weighted DCA

//Selection criteria
Configurable<double> v0cospa{"v0cospa", 0.995, "V0 CosPA"}; //double -> N.B. dcos(x)/dx = 0 at x=0)
Expand All @@ -156,7 +156,7 @@ struct lambdakzerobuilder {
fitter.setMinRelChi2Change(0.9);
fitter.setMaxDZIni(1e9);
fitter.setMaxChi2(1e9);
fitter.setUseAbsDCA(d_UseAbsDCA);
fitter.setUseAbsDCA(true); // use d_UseAbsDCA once we want to use the weighted DCA

hEventCounter->Fill(0.5);
std::array<float, 3> pVtx = {collision.posX(), collision.posY(), collision.posZ()};
Expand Down Expand Up @@ -189,11 +189,15 @@ struct lambdakzerobuilder {
}

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]});

if (V0CosinePA < v0cospa) {
continue;
}

auto V0radius = RecoDecay::sqrtSumOfSquares(pos[0], pos[1]); //probably find better name to differentiate the cut from the variable
if (V0radius < v0radius) {
continue;
}

hV0Candidate->Fill(1.5);
v0data(
V0.posTrack_as<FullTracksExt>().globalIndex(),
Expand Down

0 comments on commit 9fc2528

Please sign in to comment.