|
32 | 32 | #include "Common/TH1Ratio.h" |
33 | 33 | #include "Common/TH2Ratio.h" |
34 | 34 |
|
| 35 | +#include "DCAFitter/DCAFitterN.h" |
| 36 | + |
35 | 37 | using namespace o2::itsmft; |
36 | 38 | using namespace o2::its; |
37 | 39 |
|
@@ -68,6 +70,7 @@ void ITSTrackTask::initialize(o2::framework::InitContext& /*ctx*/) |
68 | 70 | mDoTTree = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "doTTree", mDoTTree); |
69 | 71 | nBCbins = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "nBCbins", nBCbins); |
70 | 72 | mDoNorm = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "doNorm", mDoNorm); |
| 73 | + mInvMasses = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "InvMasses", mInvMasses); |
71 | 74 |
|
72 | 75 | createAllHistos(); |
73 | 76 | publishHistos(); |
@@ -177,6 +180,22 @@ void ITSTrackTask::monitorData(o2::framework::ProcessingContext& ctx) |
177 | 180 | hVerticesRof->Fill(nvtxROF); |
178 | 181 | } |
179 | 182 |
|
| 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 | + |
180 | 199 | // loop on tracks per ROF |
181 | 200 | for (int iROF = 0; iROF < trackRofArr.size(); iROF++) { |
182 | 201 |
|
@@ -234,6 +253,91 @@ void ITSTrackTask::monitorData(o2::framework::ProcessingContext& ctx) |
234 | 253 | double clusterSizeWithCorrection = (double)clSize[index] * (std::cos(std::atan(out.getTgl()))); |
235 | 254 | hNClusterVsChipITS->Fill(ChipID + 1, clusterSizeWithCorrection); |
236 | 255 | } |
| 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 | + } |
237 | 341 | } |
238 | 342 |
|
239 | 343 | int nTotCls = clusRofArr[iROF].getNEntries(); |
@@ -336,6 +440,10 @@ void ITSTrackTask::reset() |
336 | 440 | hHitFirstLayerPhi7cls->Reset(); |
337 | 441 | hClusterVsBunchCrossing->Reset(); |
338 | 442 | hNClusterVsChipITS->Reset(); |
| 443 | + |
| 444 | + hInvMassK0s->Reset(); |
| 445 | + hInvMassLambda->Reset(); |
| 446 | + hInvMassLambdaBar->Reset(); |
339 | 447 | } |
340 | 448 |
|
341 | 449 | void ITSTrackTask::createAllHistos() |
@@ -532,6 +640,25 @@ void ITSTrackTask::createAllHistos() |
532 | 640 | auto line = new TLine(ChipBoundary[l], 0, ChipBoundary[l], 15); |
533 | 641 | hNClusterVsChipITS->GetListOfFunctions()->Add(line); |
534 | 642 | } |
| 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); |
535 | 662 | } |
536 | 663 |
|
537 | 664 | void ITSTrackTask::addObject(TObject* aObject) |
|
0 commit comments