Skip to content

Commit 90b2733

Browse files
eeremenkEkaterina Eremenko
andauthored
ITS Track: V0s Invariant Mass histograms added (#1823)
* V0s Invariant Mass histograms added * added switch for the invariant masses * clang format fix * switch default changed to 0 --------- Co-authored-by: Ekaterina Eremenko <eremeeka@fjfi.cvut.cz>
1 parent 15fa0f1 commit 90b2733

3 files changed

Lines changed: 137 additions & 1 deletion

File tree

Modules/ITS/include/ITS/ITSTrackTask.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ class ITSTrackTask : public TaskInterface
9494
std::unique_ptr<TH2DRatio> hHitFirstLayerPhi7cls;
9595
TH2D* hClusterVsBunchCrossing;
9696
TH2D* hNClusterVsChipITS;
97+
// Histograms for inv mass k0s, lambda
98+
TH1D* hInvMassK0s;
99+
TH1D* hInvMassLambda;
100+
TH1D* hInvMassLambdaBar;
101+
102+
float mPiInvMass = 0.14;
103+
float mProtonInvMass = 0.938;
104+
Int_t mInvMasses = 0; // switch for the V0 invariant mass computation, 1 (default) - on, 0 - off
97105

98106
float mVertexXYsize = 0.5;
99107
float mVertexZsize = 15.;

Modules/ITS/itsTrack.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"doTTree": "0",
4545
"nBCbins": "103",
4646
"dicttimestamp" : "0",
47-
"doNorm" : "1"
47+
"doNorm" : "1",
48+
"InvMasses" : "0"
4849
}
4950

5051
}

Modules/ITS/src/ITSTrackTask.cxx

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include "Common/TH1Ratio.h"
3333
#include "Common/TH2Ratio.h"
3434

35+
#include "DCAFitter/DCAFitterN.h"
36+
3537
using namespace o2::itsmft;
3638
using namespace o2::its;
3739

@@ -68,6 +70,7 @@ void ITSTrackTask::initialize(o2::framework::InitContext& /*ctx*/)
6870
mDoTTree = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "doTTree", mDoTTree);
6971
nBCbins = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "nBCbins", nBCbins);
7072
mDoNorm = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "doNorm", mDoNorm);
73+
mInvMasses = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "InvMasses", mInvMasses);
7174

7275
createAllHistos();
7376
publishHistos();
@@ -177,6 +180,22 @@ void ITSTrackTask::monitorData(o2::framework::ProcessingContext& ctx)
177180
hVerticesRof->Fill(nvtxROF);
178181
}
179182

183+
// DCAFitter2 class initialization for the v0 part
184+
using Vec3D = ROOT::Math::SVector<double, 3>; // this is a type of the fitted vertex
185+
o2::vertexing::DCAFitter2 ft;
186+
ft.setBz(5.0);
187+
ft.setPropagateToPCA(true);
188+
ft.setMaxR(30);
189+
ft.setMaxDZIni(0.1);
190+
ft.setMaxDXYIni(0.1);
191+
ft.setMinParamChange(1e-3);
192+
ft.setMinRelChi2Change(0.9);
193+
ft.setMaxChi2(10);
194+
// prepare variables for v0
195+
float vx = 0, vy = 0, vz = 0;
196+
float dca[2]{ 0., 0. };
197+
float bz = 5.0;
198+
180199
// loop on tracks per ROF
181200
for (int iROF = 0; iROF < trackRofArr.size(); iROF++) {
182201

@@ -234,6 +253,91 @@ void ITSTrackTask::monitorData(o2::framework::ProcessingContext& ctx)
234253
double clusterSizeWithCorrection = (double)clSize[index] * (std::cos(std::atan(out.getTgl())));
235254
hNClusterVsChipITS->Fill(ChipID + 1, clusterSizeWithCorrection);
236255
}
256+
257+
// Find V0s
258+
if (mInvMasses == 1) {
259+
if (track.getSign() < 0) // choose only positive tracks
260+
continue;
261+
track.getImpactParams(vx, vy, vz, bz, dca);
262+
if ((track.getNumberOfClusters() < 6) || (abs(track.getTgl()) > 1.5) || (abs(dca[0]) < 0.06)) // conditions for the track acceptance
263+
continue;
264+
265+
for (int intrack = start; intrack < end; intrack++) { // goes through the tracks one more time
266+
auto& ntrack = trackArr[intrack];
267+
if (ntrack.getSign() > 0) // choose only negative tracks
268+
continue;
269+
ntrack.getImpactParams(vx, vy, vz, bz, dca);
270+
if ((ntrack.getNumberOfClusters() < 6) || (abs(ntrack.getTgl()) > 1.5) || (abs(dca[0]) < 0.06)) // conditions for the track acceptance
271+
continue;
272+
273+
int nc = 0;
274+
try {
275+
nc = ft.process(track, ntrack);
276+
} catch (...) {
277+
continue;
278+
}
279+
if (nc == 0)
280+
continue;
281+
282+
int ibest = 0;
283+
float bestChi2 = 1e7;
284+
for (int i = 0; i < nc; i++) {
285+
auto chi2 = ft.getChi2AtPCACandidate(i);
286+
if (chi2 > bestChi2)
287+
continue;
288+
bestChi2 = chi2;
289+
ibest = i;
290+
}
291+
// conditions for v0
292+
auto vtx = ft.getPCACandidate(ibest);
293+
auto x = vtx[0] + 0.02985;
294+
auto y = vtx[1] + 0.01949;
295+
auto r = sqrt(x * x + y * y);
296+
if ((r < 0.5) || (r > 3.5))
297+
continue;
298+
299+
const auto& t0 = ft.getTrack(0, ibest); // Positive daughter track
300+
const auto& t1 = ft.getTrack(1, ibest); // Negative daughter track
301+
302+
auto r0 = t0.getXYZGlo();
303+
auto r1 = t1.getXYZGlo();
304+
auto dx = r0.X() - r1.X();
305+
auto dy = r0.Y() - r1.Y();
306+
auto dz = r0.Z() - r1.Z();
307+
auto d = sqrt(dx * dx + dy * dy + dz * dz);
308+
if (d > 0.02)
309+
continue;
310+
std::array<float, 3> p0; // Positive daughter momentum
311+
t0.getPxPyPzGlo(p0);
312+
std::array<float, 3> p1; // Negative daughter momentum
313+
t1.getPxPyPzGlo(p1);
314+
std::array<float, 3> v0p; // V0 particle momentum
315+
v0p = { p0[0] + p1[0], p0[1] + p1[1], p0[2] + p1[2] };
316+
317+
// Strangness inv mass calculation
318+
auto pV0 = sqrt(v0p[0] * v0p[0] + v0p[1] * v0p[1] + v0p[2] * v0p[2]); // Particle momentum
319+
auto p2DaughterPos = p0[0] * p0[0] + p0[1] * p0[1] + p0[2] * p0[2]; // Positive daughter momentum
320+
auto p2DaughterNeg = p1[0] * p1[0] + p1[1] * p1[1] + p1[2] * p1[2]; // Negative daughter momentum
321+
// K0s
322+
auto enDaughterPos = sqrt(mPiInvMass * mPiInvMass + p2DaughterPos); // Positive daughter energy
323+
auto enDaughterNeg = sqrt(mPiInvMass * mPiInvMass + p2DaughterNeg); // Negative daughter energy
324+
auto enV0 = enDaughterPos + enDaughterNeg;
325+
auto K0sInvMass = sqrt(enV0 * enV0 - pV0 * pV0);
326+
hInvMassK0s->Fill(K0sInvMass);
327+
// Lambda
328+
enDaughterPos = sqrt(mProtonInvMass * mProtonInvMass + p2DaughterPos); // Positive daughter energy
329+
enDaughterNeg = sqrt(mPiInvMass * mPiInvMass + p2DaughterNeg); // Negative daughter energy
330+
enV0 = enDaughterPos + enDaughterNeg;
331+
auto LambdaInvMass = sqrt(enV0 * enV0 - pV0 * pV0);
332+
hInvMassLambda->Fill(LambdaInvMass);
333+
// LambdaBar
334+
enDaughterPos = sqrt(mPiInvMass * mPiInvMass + p2DaughterPos); // Positive daughter energy
335+
enDaughterNeg = sqrt(mProtonInvMass * mProtonInvMass + p2DaughterNeg); // Negative daughter energy
336+
enV0 = enDaughterPos + enDaughterNeg;
337+
auto LambdaBarInvMass = sqrt(enV0 * enV0 - pV0 * pV0);
338+
hInvMassLambdaBar->Fill(LambdaBarInvMass);
339+
}
340+
}
237341
}
238342

239343
int nTotCls = clusRofArr[iROF].getNEntries();
@@ -336,6 +440,10 @@ void ITSTrackTask::reset()
336440
hHitFirstLayerPhi7cls->Reset();
337441
hClusterVsBunchCrossing->Reset();
338442
hNClusterVsChipITS->Reset();
443+
444+
hInvMassK0s->Reset();
445+
hInvMassLambda->Reset();
446+
hInvMassLambdaBar->Reset();
339447
}
340448

341449
void ITSTrackTask::createAllHistos()
@@ -532,6 +640,25 @@ void ITSTrackTask::createAllHistos()
532640
auto line = new TLine(ChipBoundary[l], 0, ChipBoundary[l], 15);
533641
hNClusterVsChipITS->GetListOfFunctions()->Add(line);
534642
}
643+
644+
// Invariant mass K0s, Lambda, LambdaBar
645+
hInvMassK0s = new TH1D("hInvMassK0s", "K0s invariant mass", 80, 0.0, 1.0);
646+
hInvMassK0s->SetTitle(Form("Invariant mass of K0s"));
647+
addObject(hInvMassK0s);
648+
formatAxes(hInvMassK0s, "m_{inv} (Gev/c)", "Counts", 1, 1.10);
649+
hInvMassK0s->SetStats(0);
650+
651+
hInvMassLambda = new TH1D("hInvMassLambda", "Lambda invariant mass", 80, 1.0, 2.0);
652+
hInvMassLambda->SetTitle(Form("Invariant mass of Lambda"));
653+
addObject(hInvMassLambda);
654+
formatAxes(hInvMassLambda, "m_{inv} (Gev/c)", "Counts", 1, 1.10);
655+
hInvMassLambda->SetStats(0);
656+
657+
hInvMassLambdaBar = new TH1D("hInvMassLambdaBar", "LambdaBar invariant mass", 80, 1.0, 2.0);
658+
hInvMassLambdaBar->SetTitle(Form("Invariant mass of LambdaBar"));
659+
addObject(hInvMassLambdaBar);
660+
formatAxes(hInvMassLambdaBar, "m_{inv} (Gev/c)", "Counts", 1, 1.10);
661+
hInvMassLambdaBar->SetStats(0);
535662
}
536663

537664
void ITSTrackTask::addObject(TObject* aObject)

0 commit comments

Comments
 (0)