404 const Int_t MStn = 11 ;
418 double GemDZ10[7][4] = {{0.243654, 0.250775, 0.173749, 0.161366},
419 {-0.143876, -0.150758, 0.109959, 0.156433},
420 {-0.110145, -0.165981, -0.213889, -0.229543},
421 {0.103517, 0.036342, 0.086135, 0.0941369},
422 {-0.037648, -0.0941807, -0.180758, -0.176327},
423 {-0.0674491, -0.0367844, -0.0972473, -0.0584354},
427 Double_t StsDX[MStn][8] = {
428 {0., 0., 0., 0., 0., 0., 0., 0.},
429 {0., 0., 0., 0., 0., 0., 0., 0.},
430 {0., 0., 0., 0., 0., 0., 0., 0.},
431 {0., 0., 0., 0., 0., 0., 0., 0.},
432 {2.28613e-01, 2.34606e-01, 3.70449e-01, 4.39267e-01, 2.67664e-01, 2.84859e-01, 3.41005e-01, 4.16753e-01},
433 {3.17030e-01, 2.45618e-01, 4.29878e-01, 4.29169e-01, 2.60443e-01, 1.79925e-01, 3.76252e-01, 3.71674e-01},
434 {1.25543e-01, 1.37935e-01, 2.77096e-01, 3.51704e-01, 2.16012e-01, 2.12139e-01, 2.88912e-01, 3.57699e-01},
435 {3.17647e-01, 2.36295e-01, 3.75431e-01, 3.80575e-01, 1.68884e-01, 8.80524e-02, 2.51805e-01, 2.56513e-01},
436 {-3.01883e-02, -2.87880e-02, 1.09744e-01, 1.90429e-01, 1.78162e-02, 1.32671e-02, 9.23760e-02, 1.67779e-01},
437 {1.43966e-01, 5.53303e-02, 2.48555e-01, 2.49193e-01, 3.88544e-02, -3.31393e-02, 7.96085e-02, 7.41273e-02},
438 {0., -5.63645e-04, 0.05, 8.74027e-04, 0., 3.60763e-03, 0.074, 1.49797e-01}};
439 Double_t StsDY[MStn][8] = {
440 {0., 0., 0., 0., 0., 0., 0., 0.},
441 {0., 0., 0., 0., 0., 0., 0., 0.},
442 {0., 0., 0., 0., 0., 0., 0., 0.},
443 {0., 0., 0., 0., 0., 0., 0., 0.},
444 {-2.40830e-01, -2.27117e-01, -4.41393e-01, -2.98662e-01, -1.47376e-01, -5.64919e-01, 3.60250e-02, -2.15290e-01},
445 {-4.83443e-01, -3.63780e-01, -3.52015e-01, -3.36903e-01, -1.14008e-01, -3.49136e-01, -2.14579e-01,
447 {-1.91062e-01, -2.04515e-01, -3.79972e-01, -2.57092e-01, -1.01400e-01, -5.18137e-01, 5.39497e-02, -1.85679e-01},
448 {-4.55871e-01, -3.48696e-01, -2.33191e-01, -2.40044e-01, -5.37329e-02, -3.00596e-01, -1.98740e-01,
450 {-2.31062e-01, -2.58276e-01, -4.03759e-01, -2.70196e-01, -8.53213e-02, -5.14891e-01, 3.15495e-02, -2.08464e-01},
451 {-2.58821e-01, -1.58621e-01, -9.84743e-02, -1.05756e-01, 1.54258e-01, -1.04935e-01, 1.83280e-02, -3.86622e-01},
452 {0., -5.86937e-03, -0.23, -1.45342e-01, 0., -3.98117e-01, 0.15, -1.04839e-01}};
454 Double_t SiDX[4][18] = {{2.68835e-01, 2.39831e-01, 2.52506e-01, 2.05206e-01, 2.11052e-01, 0.20737190, 0, 0, 0, 0, 0,
455 0, 0, 0, 0, 0, 0, 0},
456 {3.15120e-01, 2.74671e-01, 2.55372e-01, 2.83446e-01, 2.79317e-01, 3.48623e-01, 3.18654e-01,
457 3.00181e-01, 3.16157e-01, 3.80363e-01, 0, 0, 0, 0, 0, 0, 0, 0},
458 {1.65037e-01, 2.71806e-01, 2.66914e-01, 2.40166e-01, 2.59614e-01, 2.66288e-01, 2.83516e-01,
459 2.88311e-01, 2.61280e-01, 3.02609e-01, 2.96469e-01, 2.98769e-01, 2.66650e-01, 3.72627e-01,
461 {3.01013e-01, 3.62381e-01, 3.03249e-01, 3.06502e-01, 2.75747e-01, 2.95530e-01, 3.05152e-01,
462 3.42706e-01, 3.09787e-01, 2.24795e-01, 2.31845e-01, 2.59297e-01, 2.17342e-01, 2.20424e-01,
463 2.06861e-01, 2.49563e-01, 2.64846e-01, 2.02358e-01}};
464 Double_t SiDY[4][18] = {
465 {-0.272688, -0.300649, -0.343639, -0.313878, -0.331129, -0.299529, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
466 {-0.342847, -0.343267, -0.328436, -0.354188, -0.332445, -0.349645, -0.332025, -0.294098, -0.249696, -0.217585,
467 0, 0, 0, 0, 0, 0, 0, 0},
468 {-0.398784, -0.342968, -0.325462, -0.325316, -0.338778, -0.338966, -0.324549, -0.339105, -0.314266, -0.301756,
469 -0.288295, -0.272864, -0.272913, -0.21294, 0, 0, 0, 0},
470 {-0.269827, -0.227419, -0.295412, -0.274608, -0.322856, -0.33417, -0.361013, -0.397192, -0.368905, -0.217688,
471 -0.240085, -0.266281, -0.285738, -0.269306, -0.292405, -0.297714, -0.323987, -0.379705}};
472 Double_t SiDZ[4][18] = {
473 {-0.4, -0.3, -0.23, -0.27, -0.3, -0.23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
474 {-0.5, -0.4, -0.4, -0.28, -0.25, -0.45, -0.45, -0.3, -0.23, -0.2, 0, 0, 0, 0, 0, 0, 0, 0},
475 {-0.3, -0.5, -0.45, -0.4, -0.3, -0.2, -0.2, -0.25, -0.2, -0.3, -0.3, -0.4, -0.5, -0.27, 0, 0, 0, 0},
476 {-0.5, -0.6, -0.4, -0.5, -0.3, -0.35, -0.2, -0.1, -0.4, -0.6, -0.6, -0.6, -0.5, -0.35, -0.2, -0.1, 0.1, 0.}};
479 const Double_t p0si[4][18] = {{3.865e-2, 6.497e-2, 3.848e-2, -3.535e-2, -2.711e-2, -4.438e-2},
480 {-3.011e-2, -6.724e-3, -2.784e-2, -1.761e-2, -1.431e-2, 2.650e-2, 1.818e-2, 1.052e-2,
482 {-1.639e-2, -1.628e-2, -4.100e-2, -2.524e-2, -2.082e-2, -3.096e-3, -1.535e-2,
483 -1.594e-2, 1.974e-2, 1.212e-2, 1.859e-2, 3.067e-2, 2.477e-2, -3.289e-3},
484 {5.774e-2, 5.280e-2, 4.679e-2, 6.866e-2, 6.183e-2, 4.256e-2, 4.247e-2, -5.477e-3,
485 2.597e-2, 1.403e-2, -2.016e-2, -3.445e-2, -3.345e-2, -3.685e-2, -4.381e-2, -6.655e-2,
486 -2.791e-2, -4.438e-2}};
487 const Double_t p1si[4][18] = {
488 {-8.887e-3, -1.128e-2, -6.696e-3, -1.042e-2, -7.374e-3, -1.303e-2},
489 {4.338e-3, 8.247e-4, 3.374e-3, 1.151e-3, 1.616e-3, 7.210e-3, 3.103e-3, 1.564e-3, 2.896e-3, 5.346e-3},
490 {3.678e-3, 1.777e-3, 4.869e-3, 2.708e-3, 2.610e-3, 4.911e-4, 2.753e-3, -2.473e-3, 3.427e-3, 1.598e-3, 2.388e-3,
491 3.975e-3, 3.602e-3, 1.143e-3},
492 {-4.152e-3, -6.035e-3, -4.377e-3, -6.320e-3, -5.058e-3, -3.510e-3, -3.763e-3, 4.285e-4, -5.000e-3, 1.801e-3,
493 -3.673e-3, -3.629e-3, -3.629e-3, -3.660e-3, -4.075e-3, -7.053e-3, -4.439e-3, -6.091e-3}};
495 const Double_t p10si[4][18] = {{-2.385e-3, 6.372e-4, 8.679e-4, -2.758e-3, -5.495e-3, -4.838e-3},
496 {-3.930e-3, 2.765e-3, -3.730e-4, -5.525e-4, 1.433e-3, 1.042e-3, 2.216e-3, 3.619e-3,
498 {2.693e-3, 2.794e-3, -4.447e-3, -3.237e-4, 8.975e-4, 8.401e-4, -2.997e-3, -3.868e-3,
499 2.667e-3, -6.283e-4, 3.312e-3, 3.420e-3, 5.233e-3, -4.670e-3},
500 {7.950e-3, 2.818e-3, -1.178e-3, 3.522e-3, -1.457e-4, -2.013e-3, 3.139e-3, -1.060e-2,
501 -5.446e-3, 4.349e-3, 9.024e-4, -1.297e-3, -2.652e-3, -7.524e-3, -4.564e-3,
502 -9.118e-3, 8.307e-3, -5.750e-3}};
503 const Double_t p11si[4][18] = {
504 {3.525e-4, 4.803e-5, -4.898e-4, -5.709e-4, -1.111e-3, -1.295e-3},
505 {5.953e-4, -4.350e-4, 6.053e-5, 4.750e-5, 1.259e-4, 6.429e-4, 2.556e-4, 3.749e-4, 1.500e-4, 7.110e-4},
506 {1.719e-5, -3.435e-4, 6.088e-4, 1.112e-4, 2.683e-4, -6.623e-5, 4.340e-4, -6.263e-4, 4.717e-4, -1.268e-4,
507 4.721e-4, 5.582e-4, 6.571e-4, -4.956e-4},
508 {-4.333e-4, -3.287e-4, -7.432e-6, -4.067e-4, -6.684e-5, 3.667e-5, -4.441e-4, 8.977e-4, 7.495e-4, 5.340e-4,
509 -1.572e-4, -5.901e-5, -3.272e-4, -6.975e-4, -3.440e-4, -9.403e-4, 5.092e-4, -1.083e-3}};
515 static TH2D *hLorCorX[2][17] = {{
nullptr}, {
nullptr}}, *hLorCorY[2][17] = {{
nullptr}, {
nullptr}};
516 static int irun = -1;
517 static Double_t zStat[19] = {0};
520 irun = ((
DstEventHeader*)FairRootManager::Instance()->GetObject(
"DstEventHeader."))->GetRunId();
526 else if (hLorCorX[0][0] ==
nullptr) {
532 for (
int ista = 0; ista < nsta0; ++ista)
536 for (
int ista = 0; ista < nsta; ++ista)
539 for (
int ista = 0; ista < nsta1; ++ista)
542 for (
int j = 0; j < nsta0 + nsta + nsta1; ++j)
543 cout <<
" Stat: " << j <<
" " << zStat[j] << endl;
545 map<int, vector<Double_t>> lorCorX[2], lorCorY[2];
548 for (
int igem = 0; igem < 2; ++igem) {
550 Double_t dx = 160.0 / nx, dy = 45.0 / ny;
553 for (
int iupd = 0; iupd < 2; ++iupd) {
554 int istb = (igem == 0) ? 0 : nsta + nsta0;
555 int iste = (igem == 0) ? nsta + nsta0 : nsta + nsta1 + nsta0;
556 if (iste > (
int)lorCorX[0].size())
559 for (
int ist = istb; ist < iste; ++ist) {
560 TString hName =
"hLorCorX_";
567 hLorCorX[iupd][ist] =
new TH2D(hName,
"", nx, -80, 80, ny, 0, 45);
569 nxfsd = lorCorX[0][ist + 1].size();
570 hLorCorX[iupd][ist] =
new TH2D(hName,
"", nxfsd, 0, nxfsd, ny, 0, ny);
578 hLorCorY[iupd][ist] =
new TH2D(hName,
"", nx, -80, 80, ny, 0, 45);
580 hLorCorY[iupd][ist] =
new TH2D(hName,
"", nxfsd, 0, nxfsd, ny, 0, ny);
583 if (lorCorX[iupd].find(ist + 1) == lorCorX[iupd].end())
586 for (
int j = 0; j < 24; ++j) {
590 int ireg = TMath::Abs(ireg1);
595 Double_t x = (ix2 + 0.5) * dx;
598 Double_t y = (iy2 + 0.5) * dy;
599 hLorCorX[iupd][ist]->Fill(x, y, lorCorX[iupd][ist + 1][j]);
600 if (lorCorY[iupd].find(ist + 1) != lorCorY[iupd].end())
601 hLorCorY[iupd][ist]->Fill(x, y, lorCorY[iupd][ist + 1][j]);
604 for (
int j = 0; j < nxfsd; ++j) {
605 hLorCorX[iupd][ist]->Fill(j + 0.5, 0.5, lorCorX[iupd][ist + 1][j]);
606 hLorCorY[iupd][ist]->Fill(j + 0.5, 0.5, lorCorY[iupd][ist + 1][j]);
620 hit->SetX(hit->GetX() - SiDX[ista][isec]);
621 hit->SetY(hit->GetY() - SiDY[ista][isec]);
622 hit->SetZ(hit->GetZ() + SiDZ[ista][isec]);
624 hit->SetX(hit->GetX()
625 - (p0si[ista][isec] / 2 + p1si[ista][isec] / 2 * hit->GetY() + p10si[ista][isec]
626 + p11si[ista][isec] * hit->GetY()));
632 hit->SetX(hit->GetX() - StsDX[ista][isec]);
633 hit->SetY(hit->GetY() - StsDY[ista][isec]);
634 hit->SetZ(hit->GetZ() + GemDZ10[ista - 4][isec / 2]);
638 if (ista == 4 && isec == 3) {
639 if (hit->GetX() >= -28.8 && hit->GetX() < -18.5) {
640 hit->SetX(hit->GetX() - 0.16);
641 hit->SetY(hit->GetY() - 0.16 / TMath::Tan(15.0 * TMath::DegToRad()));
648 Double_t xshift[9] = {0.024, 0.058, 0.039, 0.050, 0.005, 0.028, 0.000};
649 Double_t alpha = 0.0055;
650 Double_t xnew = hit->GetX() * TMath::Cos(alpha) - (hit->GetZ() - zStat[ista]) * TMath::Sin(alpha);
651 Double_t znew = hit->GetX() * TMath::Sin(alpha) + (hit->GetZ() - zStat[ista]) * TMath::Cos(alpha);
652 hit->SetX(xnew + xshift[ista - 4]);
657 hit->SetZ(znew + zStat[ista]);
673 Double_t xh = hit->GetX(), yh = TMath::Abs(hit->GetY()), xh1 = xh, yh1 = yh;
674 TH2D* h2 = hLorCorX[iupd][ista];
677 if (xh1 >= h2->GetXaxis()->GetXmax())
678 xh1 = h2->GetXaxis()->GetXmax() - 0.1;
679 else if (xh1 < h2->GetXaxis()->GetXmin())
680 xh1 = h2->GetXaxis()->GetXmin() + 0.1;
681 if (yh1 >= h2->GetYaxis()->GetXmax())
682 yh1 = h2->GetYaxis()->GetXmax() - 0.1;
683 else if (yh1 < h2->GetYaxis()->GetXmin())
684 yh1 = h2->GetYaxis()->GetXmin() + 0.1;
689 dx = h2->Interpolate(xh1, yh1);
691 int jx = h2->GetXaxis()->FindBin(xh1);
692 int jy = h2->GetYaxis()->FindBin(yh1);
693 dx = h2->GetBinContent(jx, jy);
695 hit->SetX(xh - dx * 0.65);
698 h2 = hLorCorY[iupd][ista];
701 dy = h2->Interpolate(xh1, yh1);
703 int jx = h2->GetXaxis()->FindBin(xh1);
704 int jy = h2->GetYaxis()->FindBin(yh1);
705 dy = h2->GetBinContent(jx, jy);
710 Double_t ynew = yh - dy * 0.65;
716 int iupd = isec / hLorCorX[0][ista]->GetNbinsX();
717 int ireg = isec % hLorCorX[0][ista]->GetNbinsX();
718 TH2D* h2 = hLorCorX[iupd][ista];
719 Double_t dx = h2->GetBinContent(ireg + 1, 1);
720 hit->SetX(hit->GetX() - dx * 0.65);
722 h2 = hLorCorY[iupd][ista];
723 Double_t dy = h2->GetBinContent(ireg + 1, 1);
724 hit->SetY(hit->GetY() - dy * 0.65);