13 #include <TGeoMatrix.h>
45 Double_t local[3] = {xLocal, yLocal, 0.};
48 fMatrix->LocalToMaster(local, global);
59 Double_t error[3] = {TMath::Sqrt(varX), TMath::Sqrt(varY), 0.};
62 Double_t hitTime = 0.5 * (clusterF.
GetTime() + clusterB.
GetTime());
65 Double_t hitTimeError = 0.5 * TMath::Sqrt(etF * etF + etB * etB);
86 const vector<CbmStsCluster>& clustersB,
87 vector<CbmStsHit>&
hits,
98 TGeoHMatrix* matrix) {
103 assert(TMath::Abs(stereoF - stereoB) > 0.1);
123 Double_t maxTerrF = 0.;
124 for (
auto& cluster : clustersF) {
125 if (cluster.GetTimeError() > maxTerrF) maxTerrF = cluster.GetTimeError();
127 Double_t maxTerrB = 0.;
128 for (
auto& cluster : clustersB) {
129 if (cluster.GetTimeError() > maxTerrB) maxTerrB = cluster.GetTimeError();
131 const Double_t maxTerrF2 = maxTerrF * maxTerrF;
132 const Double_t maxTerrB2 = maxTerrB * maxTerrB;
133 const Double_t max_sigma_both = 4. * TMath::Sqrt(maxTerrF2 + maxTerrB2);
138 for (UInt_t iClusterF = 0; iClusterF < clustersF.size(); iClusterF++) {
141 Double_t tF = clusterF.
GetTime();
143 Double_t max_sigma = 4. * TMath::Sqrt(tFerr2 + maxTerrB2);
145 for (UInt_t iClusterB = startB; iClusterB < clustersB.size(); iClusterB++) {
148 Double_t timeDiff = tF - clusterB.
GetTime();
149 if ((timeDiff > 0) && (timeDiff > max_sigma_both)) {
152 }
else if ((timeDiff > 0) && (timeDiff > max_sigma)) {
154 }
else if ((timeDiff < 0) && (
fabs(timeDiff) > max_sigma))
158 Double_t timeCut = -1.;
160 timeCut = timeCutAbs;
162 if (timeCutSig > 0.) {
165 timeCut = timeCutSig * TMath::Sqrt(eF * eF + eB * eB);
190 Int_t iChannel = Int_t(centre);
191 Double_t xDif = centre - Double_t(iChannel);
195 pair<Int_t, Int_t> stripSide =
GetStrip(iChannel);
196 iStrip = stripSide.first;
197 side = stripSide.second;
201 xCluster = (Double_t(iStrip) + xDif + 0.5) *
fPitch;
240 return (pair<Int_t, Int_t>(stripNr, side));
300 varY =
fErrorFac * (exF * exF + exB * exB);
323 std::cout <<
"Cluster position " << clusterF.
GetPosition() <<
": x " << xF
324 <<
" side " << side << std::endl;
328 Double_t du = exF * TMath::Cos(TMath::DegToRad() *
fStereoF);
332 Double_t dv = exB * TMath::Cos(TMath::DegToRad() *
fStereoB);
335 if (!(xF >= 0. || xF <=
fDx))
return 0;
336 if (!(xB >= 0. || xB <=
fDx))
return 0;
354 Int_t nF1 = TMath::Min(0, nF);
355 Int_t nF2 = TMath::Max(0, nF);
356 Int_t nB1 = TMath::Min(0, nB);
357 Int_t nB2 = TMath::Max(0, nB);
365 for (Int_t iF = nF1; iF <= nF2; iF++) {
366 Double_t xFi = xF - Double_t(iF) *
fDx;
367 for (Int_t iB = nB1; iB <= nB2; iB++) {
368 Double_t xBi = xB - Double_t(iB) *
fDx;
371 Bool_t found =
Intersect(xFi, exF, xBi, exB, xC, yC, varX, varY, varXY);
404 if (
x < -
fDx / 2.)
return kFALSE;
405 if (
x >
fDx / 2.)
return kFALSE;
406 if (
y < -
fDy / 2.)
return kFALSE;
407 if (
y >
fDy / 2.)
return kFALSE;