18#include <TGeoMatrix.h>
35 UInt_t indexB, Double_t du, Double_t dv)
42 Double_t local[3] = {xLocal, yLocal, 0.};
45 fMatrix->LocalToMaster(local, global);
56 Double_t error[3] = {TMath::Sqrt(varX), TMath::Sqrt(varY), 0.};
59 Double_t hitTime = 0.5 * (clusterF.
GetTime() + clusterB.
GetTime());
62 Double_t hitTimeError = 0.5 * TMath::Sqrt(etF * etF + etB * etB);
65 fHits->emplace_back(
fAddress, global, error, varXY, indexF, indexB, hitTime, hitTimeError, du, dv);
74 vector<CbmStsHit>&
hits, UInt_t address, Double_t timeCutSig,
75 Double_t timeCutAbs, UInt_t nStripsF, UInt_t nStripsB, Double_t pitchF,
76 Double_t pitchB, Double_t lorentzF, Double_t lorentzB, TGeoHMatrix* matrix)
100 Double_t maxTerrF = 0.;
101 for (
auto& cluster : clustersF) {
102 if (cluster.GetTimeError() > maxTerrF) maxTerrF = cluster.GetTimeError();
104 Double_t maxTerrB = 0.;
105 for (
auto& cluster : clustersB) {
106 if (cluster.GetTimeError() > maxTerrB) maxTerrB = cluster.GetTimeError();
108 const Double_t maxTerrF2 = maxTerrF * maxTerrF;
109 const Double_t maxTerrB2 = maxTerrB * maxTerrB;
110 const Double_t max_sigma_both = 4. * TMath::Sqrt(maxTerrF2 + maxTerrB2);
115 for (UInt_t iClusterF = 0; iClusterF < clustersF.size(); iClusterF++) {
118 Double_t tF = clusterF.
GetTime();
120 Double_t max_sigma = 4. * TMath::Sqrt(tFerr2 + maxTerrB2);
122 for (UInt_t iClusterB = startB; iClusterB < clustersB.size(); iClusterB++) {
125 Double_t timeDiff = tF - clusterB.
GetTime();
126 if ((timeDiff > 0) && (timeDiff > max_sigma_both)) {
130 else if ((timeDiff > 0) && (timeDiff > max_sigma)) {
133 else if ((timeDiff < 0) && (fabs(timeDiff) > max_sigma))
137 Double_t timeCut = -1.;
139 timeCut = timeCutAbs;
141 if (timeCutSig > 0.) {
144 timeCut = timeCutSig * TMath::Sqrt(eF * eF + eB * eB);
147 if (fabs(clusterF.
GetTime() - clusterB.
GetTime()) > timeCut)
continue;
167 Int_t iChannel = Int_t(centre);
168 Double_t xDif = centre - Double_t(iChannel);
172 pair<Int_t, Int_t> stripSide =
GetStrip(iChannel);
173 iStrip = stripSide.first;
174 side = stripSide.second;
175 assert(side == 0 || side == 1);
180 xCluster = (Double_t(iStrip) + xDif + 0.5) *
fPitchF;
182 xCluster = (Double_t(iStrip) + xDif + 0.5) *
fPitchB;
217 return (pair<Int_t, Int_t>(stripNr, side));
224 UInt_t indexF, UInt_t indexB)
241 if (!(xF >= 0. || xF <=
fDx))
return 0;
242 if (!(xB >= 0. || xB <=
fDy))
return 0;
256 Double_t varX = exF * exF;
257 Double_t varY = exB * exB;
265 CreateHit(xC, yC, varX, varY, varXY, clusterF, clusterB, indexF, indexB, du, dv);
276 if (
x < -
fDx / 2.)
return kFALSE;
277 if (
x >
fDx / 2.)
return kFALSE;
278 if (
y < -
fDy / 2.)
return kFALSE;
279 if (
y >
fDy / 2.)
return kFALSE;
ClassImp(CbmConverterManager)
Data class for STS clusters.
Data class for a reconstructed hit in the STS.
static vector< vector< QAHit > > hits
Algorithm for hit finding in sensors with orthogonal strips.
Double_t fLorentzB
Lorentz shift correction back side [cm].
Double_t fDy
Active size in y [cm].
std::pair< Int_t, Int_t > GetStrip(UInt_t channel) const
Get strip and side from module channel.
void GetClusterPosition(Double_t ClusterCentre, Double_t &xCluster, Int_t &side)
Int_t IntersectClusters(const CbmStsCluster &clusterF, const CbmStsCluster &clusterB, UInt_t indexF, UInt_t indexB)
Find the intersection points of two clusters.
void CreateHit(Double_t xLocal, Double_t yLocal, Double_t varX, Double_t varY, Double_t varXY, const CbmStsCluster &clusterF, const CbmStsCluster &clusterB, UInt_t indexF, UInt_t indexB, Double_t du=0., Double_t dv=0.)
Create a new hit in the output array.
Double_t fPitchB
Strip pitch back side [cm].
UInt_t fNofStripsB
Number of strips backs side.
Double_t fPitchF
Strip pitch front side [cm].
std::vector< CbmStsHit > * fHits
///< Transformation matrix to global C.S.
UInt_t fAddress
Unique address for hits (sensor)
CbmStsAlgoFindHitsOrtho()
Constructor.
Double_t fLorentzF
Lorentz shift correction front side [cm].
Double_t fDx
Active size in x [cm].
UInt_t fNofStripsF
Number of strips front side.
Long64_t Exec(const std::vector< CbmStsCluster > &clustersF, const std::vector< CbmStsCluster > &clustersB, std::vector< CbmStsHit > &hits, UInt_t address, Double_t timeCutSig, Double_t timeCutAbs, UInt_t nStripsF, UInt_t nStripsB, Double_t pitchF, Double_t pitchB, Double_t lorentzF, Double_t lorentzB, TGeoHMatrix *matrix)
Execute algorithm.
Bool_t IsInside(Double_t x, Double_t y)
Check whether a point (x,y) is inside the active area.
Data class for STS clusters.
double GetPositionError() const
Cluster position error @value Error (r.m.s.) of cluster position in channel number units.
double GetTime() const
Get cluster time.
double GetPosition() const
Cluster position @value Cluster position in channel number units.
double GetTimeError() const
Get error of cluster time.