53 phHitsStsTime =
new TH1F(
"phHitsStsTime",
"phHitsStsTime", 1000, 0, 1000);
54 phHitsHodoATime =
new TH1F(
"phHitsHodoATime",
"phHitsHodoATime", 1000, 0, 1000);
55 phHitsHodoBTime =
new TH1F(
"phHitsHodoBTime",
"phHitsHodoBTime", 1000, 0, 1000);
59 phHitsPositionHodoA =
new TH2F(
"phHitsPositionHodoA",
"Position of the hits in hodoscope A; X [cm]; Y [cm]", 80, -4.0,
62 new TH2F(
"phHitsPositionSts",
"Position of the hits in hodoscope B; X [cm]; Y [cm]", 80, -4.0, 4.0, 80, -4.0, 4.0);
63 phHitsPositionHodoB =
new TH2F(
"phHitsPositionHodoB",
"Position of the hits in hodoscope B; X [cm]; Y [cm]", 80, -4.0,
68 new TH2F(
"phNbHitsCompHodo",
"Number of hits per TS in Hodo A vs Hodo B; Nb Hits A[]; Nb Hits B []", 100, 0.0,
69 20000.0, 100, 0.0, 20000.0);
71 new TH2F(
"phNbHitsCompStsHodoA",
"Number of hits per TS in STS vs Hodo A; Nb Hits STS[]; Nb Hits A []", 100, 0.0,
72 20000.0, 100, 0.0, 20000.0);
74 new TH2F(
"phNbHitsCompStsHodoB",
"Number of hits per TS in STS vs Hodo B; Nb Hits STS[]; Nb Hits B []", 100, 0.0,
75 20000.0, 100, 0.0, 20000.0);
78 phHitsCoincCorrXX =
new TH2F(
"phHitsCoincCorrXX",
"XX correlation of the coincident hits; X_A [cm]; X_B [cm]", 160,
79 -8.0, 8.0, 160, -8.0, 8.0);
80 phHitsCoincCorrYY =
new TH2F(
"phHitsCoincCorrYY",
"YY correlation of the coincident hits; Y_A [cm]; Y_B [cm]", 160,
81 -8.0, 8.0, 160, -8.0, 8.0);
82 phHitsCoincCorrXY =
new TH2F(
"phHitsCoincCorrXY",
"XY correlation of the coincident hits; X_A [cm]; Y_B [cm]", 160,
83 -8.0, 8.0, 160, -8.0, 8.0);
84 phHitsCoincCorrYX =
new TH2F(
"phHitsCoincCorrYX",
"YX correlation of the coincident hits; Y_A [cm]; X_B [cm]", 160,
85 -8.0, 8.0, 160, -8.0, 8.0);
88 new TH2F(
"phHitsPositionCoincA",
"Position of the coincident hits in hodoscope A; X [cm]; Y [cm]", 80, -4.0, 4.0,
91 new TH2F(
"phHitsPositionCoincB",
"Position of the coincident hits in hodoscope B; X [cm]; Y [cm]", 80, -4.0, 4.0,
94 new TH2F(
"phHitsPositionDiff",
"Position difference of the coincident hits; X_B - X_A [cm]; Y_B- Y_A [cm]", 160,
95 -8.0, 8.0, 160, -8.0, 8.0);
96 phHitsTimeDiff =
new TH1F(
"phHitsTimeDiff",
"Time difference of the coincident hits; t_B - t_A [ns]",
99 phHitsCoincDist =
new TH1F(
"phHitsCoincDist",
"XY distance of the coincident hits; Dist. [cm]", 100, 0.0, 10.0);
101 new TH1F(
"phHitsCoincAngle",
"Vertical angle of the coincident hits; Angle [deg.]", 180, -90.0, 90.0);
105 new TH2F(
"phHitsSingleCoincCorrXX",
"XX correlation of the coincident hits; X_A [cm]; X_B [cm]", 160, -8.0, 8.0,
108 new TH2F(
"phHitsSingleCoincCorrYY",
"YY correlation of the coincident hits; Y_A [cm]; Y_B [cm]", 160, -8.0, 8.0,
111 new TH2F(
"phHitsSingleCoincCorrXY",
"XY correlation of the coincident hits; X_A [cm]; Y_B [cm]", 160, -8.0, 8.0,
114 new TH2F(
"phHitsSingleCoincCorrYX",
"YX correlation of the coincident hits; Y_A [cm]; X_B [cm]", 160, -8.0, 8.0,
118 new TH2F(
"phHitsSinglePositionCoincA",
"Position of the coincident hits in hodoscope A; X [cm]; Y [cm]", 80, -4.0,
121 new TH2F(
"phHitsSinglePositionCoincB",
"Position of the coincident hits in hodoscope B; X [cm]; Y [cm]", 80, -4.0,
124 new TH2F(
"phHitsSinglePositionDiff",
"Position difference of the coincident hits; X_B - X_A [cm]; Y_B- Y_A [cm]",
125 160, -8.0, 8.0, 160, -8.0, 8.0);
126 phHitsSingleTimeDiff =
new TH1F(
"phHitsSingleTimeDiff",
"Time difference of the coincident hits; t_B - t_A [ns]",
130 new TH1F(
"phHitsSingleCoincDist",
"XY distance of the coincident hits; Dist. [cm]", 100, 0.0, 10.0);
132 new TH1F(
"phHitsSingleCoincAngle",
"Vertical angle of the coincident hits; Angle [deg.]", 180, -90.0, 90.0);
135 phHitsBestCoincCorrXX =
new TH2F(
"phHitsBestCoincCorrXX",
"XX correlation of the coincident hits; X_A [cm]; X_B [cm]",
136 160, -8.0, 8.0, 160, -8.0, 8.0);
137 phHitsBestCoincCorrYY =
new TH2F(
"phHitsBestCoincCorrYY",
"YY correlation of the coincident hits; Y_A [cm]; Y_B [cm]",
138 160, -8.0, 8.0, 160, -8.0, 8.0);
139 phHitsBestCoincCorrXY =
new TH2F(
"phHitsBestCoincCorrXY",
"XY correlation of the coincident hits; X_A [cm]; Y_B [cm]",
140 160, -8.0, 8.0, 160, -8.0, 8.0);
141 phHitsBestCoincCorrYX =
new TH2F(
"phHitsBestCoincCorrYX",
"YX correlation of the coincident hits; Y_A [cm]; X_B [cm]",
142 160, -8.0, 8.0, 160, -8.0, 8.0);
145 new TH2F(
"phHitsBestPositionCoincA",
"Position of the coincident hits in hodoscope A; X [cm]; Y [cm]", 80, -4.0,
148 new TH2F(
"phHitsBestPositionCoincB",
"Position of the coincident hits in hodoscope B; X [cm]; Y [cm]", 80, -4.0,
151 new TH2F(
"phHitsBestPositionDiff",
"Position difference of the coincident hits; X_B - X_A [cm]; Y_B- Y_A [cm]", 160,
152 -8.0, 8.0, 160, -8.0, 8.0);
153 phHitsBestTimeDiff =
new TH1F(
"phHitsBestTimeDiff",
"Time difference of the coincident hits; t_B - t_A [ns]",
157 new TH1F(
"phHitsBestCoincDist",
"XY distance of the coincident hits; Dist. [cm]", 100, 0.0, 10.0);
159 new TH1F(
"phHitsBestCoincAngle",
"Vertical angle of the coincident hits; Angle [deg.]", 180, -90.0, 90.0);
162 phHitsPositionCoincExtr =
new TH2F(
"phHitsPositionCoincExtr",
"Position of the extrapolated hits ; X [cm]; Y [cm]",
163 80, -4.0, 4.0, 80, -4.0, 4.0);
167 new TH2F(
"phHitsStsCoincCorrXX",
"XX correlation of the coincident hits; X_extr [cm]; X_STS [cm]", 160, -8.0, 8.0,
170 new TH2F(
"phHitsStsCoincCorrYY",
"YY correlation of the coincident hits; Y_extr [cm]; Y_STS [cm]", 160, -8.0, 8.0,
173 new TH2F(
"phHitsStsCoincCorrXY",
"XY correlation of the coincident hits; X_extr [cm]; Y_STS [cm]", 160, -8.0, 8.0,
176 new TH2F(
"phHitsStsCoincCorrYX",
"YX correlation of the coincident hits; Y_extr [cm]; X_STS [cm]", 160, -8.0, 8.0,
180 "phHitsStsPositionCoincExtr",
"Position of the extrapolated hits ; X [cm]; Y [cm]", 80, -4.0, 4.0, 80, -4.0, 4.0);
181 phHitsStsPositionCoinc =
new TH2F(
"phHitsStsPositionCoinc",
"Position of the coincident hits in Sts; X [cm]; Y [cm]",
182 80, -4.0, 4.0, 80, -4.0, 4.0);
184 new TH1F(
"phHitsStsTimeDiff",
"Position difference of STS hit with the best coincident hits; t_Sts - t_(AB) [ns]",
187 "phHitsStsPositionDiff",
"Position difference of the coincident hits; X_STS - X_extr [cm]; Y_STS- Y_extr [cm]", 160,
188 -8.0, 8.0, 160, -8.0, 8.0);
190 "phHitsStsPositionDiffInv",
"Position difference of the coincident hits; X_STS - Y_extr [cm]; Y_STS- Y_extr [cm]",
191 160, -8.0, 8.0, 160, -8.0, 8.0);
197 new TH2F(
"phHitsStsBestCoincCorrXX",
"XX correlation of the coincident hits; X_extr [cm]; X_STS [cm]", 160, -8.0,
198 8.0, 160, -8.0, 8.0);
200 new TH2F(
"phHitsStsBestCoincCorrYY",
"YY correlation of the coincident hits; Y_extr [cm]; Y_STS [cm]", 160, -8.0,
201 8.0, 160, -8.0, 8.0);
203 new TH2F(
"phHitsStsBestCoincCorrXY",
"XY correlation of the coincident hits; X_extr [cm]; Y_STS [cm]", 160, -8.0,
204 8.0, 160, -8.0, 8.0);
206 new TH2F(
"phHitsStsBestCoincCorrYX",
"YX correlation of the coincident hits; Y_extr [cm]; X_STS [cm]", 160, -8.0,
207 8.0, 160, -8.0, 8.0);
210 new TH2F(
"phHitsStsBestPositionCoincExtr",
"Position of the extrapolated hits ; X [cm]; Y [cm]", 80, -4.0, 4.0, 80,
213 new TH2F(
"phHitsStsBestPositionCoinc",
"Position of the coincident hits in Sts; X [cm]; Y [cm]", 80, -4.0, 4.0, 80,
216 new TH2F(
"phHitsStsBestPositionShiftCoinc",
"Position of the coincident hits in Sts; X [cm]; Y [cm]", 80, -4.0, 4.0,
220 "Position difference of STS hit with the best coincident hits; t_Sts - t_(AB) [ns]",
223 "phHitsStsBestPositionDiff",
224 "Position difference of STS hit with the best coincident hits; X_Sts - X_extr(AB) [cm]; Y_Sts- Y_extr(AB) [cm]",
225 400, -8.0, 8.0, 400, -8.0, 8.0);
227 "Position difference of STS hit (inverted) with the best coincident hits; "
228 "X_Sts - Y_extr(AB) [cm]; Y_Sts- X_extr(AB) [cm]",
229 400, -8.0, 8.0, 400, -8.0, 8.0);
231 "Difference of STS hit with the best coincident hits; X_Sts - X_extr(AB) [cm]; Y_Sts- "
232 "Y_extr(AB) [cm]; t_Sts - t_mean(AB) [ns]",
237 new TH2F(
"phHitsStsEff",
"Position of the coincident hits in Sts; X [cm]; Y [cm]", 80, -4.0, 4.0, 80, -4.0, 4.0);
241 FairRunOnline* run = FairRunOnline::Instance();
243 THttpServer* server = run->GetHttpServer();
244 if (
nullptr != server) {
328 Double_t dOffsetX = 0.0;
329 Double_t dOffsetY = 0.0;
330 Double_t dOffsetT = -6.38091e+00;
331 Double_t dOffsetXSts = -2.55;
332 Double_t dOffsetYSts = -1.46;
333 Double_t dOffsetTSts = -5.22608e+00;
334 Double_t dSigmaXSts = 6.79000e-02;
335 Double_t dSigmaYSts = 2.81408e-02;
338 Int_t iNbHits =
arrayHits->GetEntriesFast();
339 std::cout <<
"executing TS " <<
fNbTs <<
" StsClusters: " << iNbClusters <<
" StsHits: " << iNbHits << std::endl;
342 std::vector<CbmStsHit*> vHitsHodoA;
343 std::vector<CbmStsHit*> vHitsSts;
344 std::vector<CbmStsHit*> vHitsHodoB;
349 for (Int_t iHit = 0; iHit < iNbHits; ++iHit) {
351 Double_t dX = pHit->
GetX();
352 Double_t dY = pHit->
GetY();
359 vHitsHodoA.push_back(pHit);
365 vHitsSts.push_back(pHit);
371 vHitsHodoB.push_back(pHit);
375 std::cout <<
"TS: " <<
fNbTs <<
" " << vHitsHodoA.size() <<
" " << vHitsHodoB.size() <<
" " << vHitsSts.size()
390 for (UInt_t uHitA = 0; uHitA < vHitsHodoA.size(); ++uHitA) {
391 Double_t dBestTime = 1e9;
392 UInt_t uBestB = vHitsHodoB.size();
394 Double_t dTimeA = vHitsHodoA[uHitA]->GetTime();
395 for (UInt_t uHitB = 0; uHitB < vHitsHodoB.size(); ++uHitB) {
396 Double_t dTimeB = vHitsHodoB[uHitB]->GetTime();
411 phHitsPositionDiff->Fill(vHitsHodoB[uHitB]->GetX() - vHitsHodoA[uHitA]->GetX() - dOffsetX,
412 vHitsHodoB[uHitB]->GetY() - vHitsHodoA[uHitA]->GetY() - dOffsetY);
414 Double_t dHitsDistXY = TMath::Sqrt((vHitsHodoA[uHitA]->GetX() - vHitsHodoB[uHitB]->GetX() - dOffsetX)
415 * (vHitsHodoA[uHitA]->GetX() - vHitsHodoB[uHitB]->GetX() - dOffsetX)
416 + (vHitsHodoA[uHitA]->GetY() - vHitsHodoB[uHitB]->GetY() - dOffsetY)
417 * (vHitsHodoA[uHitA]->GetY() - vHitsHodoB[uHitB]->GetY() - dOffsetY));
418 Double_t dHitsDistZ = TMath::Abs(vHitsHodoA[uHitA]->GetZ() - vHitsHodoB[uHitB]->GetZ());
419 Double_t dAngle = TMath::RadToDeg() * TMath::ATan2(dHitsDistXY, dHitsDistZ);
423 if (TMath::Abs(dTimeB - dTimeA - dOffsetT) < dBestTime) {
424 dBestTime = TMath::Abs(dTimeB - dTimeA);
429 if (uBestB < vHitsHodoB.size()) {
430 Double_t dTimeB = vHitsHodoB[uBestB]->GetTime();
443 vHitsHodoB[uBestB]->GetY() - vHitsHodoA[uHitA]->GetY() - dOffsetY);
446 Double_t dHitsDistXY = TMath::Sqrt((vHitsHodoA[uHitA]->GetX() - vHitsHodoB[uBestB]->GetX() - dOffsetX)
447 * (vHitsHodoA[uHitA]->GetX() - vHitsHodoB[uBestB]->GetX() - dOffsetX)
448 + (vHitsHodoA[uHitA]->GetY() - vHitsHodoB[uBestB]->GetY() - dOffsetY)
449 * (vHitsHodoA[uHitA]->GetY() - vHitsHodoB[uBestB]->GetY() - dOffsetY));
450 Double_t dHitsDistZ = TMath::Abs(vHitsHodoA[uHitA]->GetZ() - vHitsHodoB[uBestB]->GetZ());
451 Double_t dAngle = TMath::RadToDeg() * TMath::ATan2(dHitsDistXY, dHitsDistZ);
456 if (1 == vHitsHodoA.size() && 1 == vHitsHodoB.size()) {
465 vHitsHodoB[uBestB]->GetY() - vHitsHodoA[uHitA]->GetY() - dOffsetY);
475 Double_t dBestTimeSts = 1e9;
476 UInt_t uBestSts = vHitsSts.size();
478 Double_t dHodoMeanTime = (dTimeA + dTimeB) / 2.0;
479 Double_t dHodoExtrX =
480 vHitsHodoA[uHitA]->GetX() + (vHitsHodoB[uBestB]->GetX() - vHitsHodoA[uHitA]->GetX()) *
dStsDistZ /
dHodoDistZ;
481 Double_t dHodoExtrY =
482 vHitsHodoA[uHitA]->GetY() + (vHitsHodoB[uBestB]->GetY() - vHitsHodoA[uHitA]->GetY()) *
dStsDistZ /
dHodoDistZ;
486 for (UInt_t uHitSts = 0; uHitSts < vHitsSts.size(); ++uHitSts) {
487 Double_t dTimeSts = vHitsSts[uHitSts]->GetTime();
488 Double_t dTimeDiffSts = dTimeSts - dHodoMeanTime;
503 vHitsSts[uHitSts]->GetY() - dHodoExtrY - dOffsetY);
505 vHitsSts[uHitSts]->GetY() - dHodoExtrX - dOffsetY);
508 if (TMath::Abs(dTimeDiffSts - dOffsetTSts) < dBestTimeSts) {
509 dBestTimeSts = TMath::Abs(dTimeDiffSts);
518 if (uBestSts < vHitsSts.size()) {
527 vHitsSts[uBestSts]->GetY() - dOffsetYSts);
531 vHitsSts[uBestSts]->GetY() - dHodoExtrY);
533 vHitsSts[uBestSts]->GetY() - dHodoExtrX);
534 phHitsStsBestDiff->Fill(vHitsSts[uBestSts]->GetX() - dHodoExtrX, vHitsSts[uBestSts]->GetY() - dHodoExtrY,
535 vHitsSts[uBestSts]->GetTime() - dHodoMeanTime);
537 if ((TMath::Abs(vHitsSts[uBestSts]->GetX() - dHodoExtrX - dOffsetXSts) < 3 * dSigmaXSts)
538 && (TMath::Abs(-vHitsSts[uBestSts]->GetY() - dHodoExtrY - dOffsetYSts) < 3 * dSigmaYSts)) {