Go to the documentation of this file.
10 #include <FairLogger.h>
11 #include <FairTrackParam.h>
45 , fTrackLength(t.fTrackLength)
46 , fPidHypo(t.fPidHypo)
47 , fDistance(t.fDistance)
53 , fT0TtCov(t.fT0TtCov)
57 , fParamFirst(FairTrackParam(t.fParamFirst))
58 , fParamLast(FairTrackParam(t.fParamLast))
99 for (
int i = 0, k = 0;
i < 3;
i++)
100 for (
int j = 0; j <=
i; j++, k++)
111 for (
int i = 0, k = 0;
i < 3;
i++)
112 for (
int j = 0; j <=
i; j++, k++)
118 for (UInt_t iHit = 0; iHit <
fTofHit.size(); iHit++) {
127 for (UInt_t iHit = 0; iHit <
fTofHit.size(); iHit++) {
131 LOG(fatal) <<
" CbmTofTracklet::GetFirstInd, did only find " << iAddr;
151 TMath::Sqrt(TMath::Power(
GetFitX(0.), 2) + TMath::Power(
GetFitY(0.), 2));
171 Double_t dZ = pHit->
GetZ();
173 if (pHit->
GetZ() <
fhit[0].GetZ()) dSign = -1;
176 "GetTex T0 %7.3f, Z %7.1f, DZ %5.1f, Sign %2.0f, Tt %7.4f => Tex %7.3f, ",
188 Int_t nValidHits = 0;
195 for (UInt_t iHit = 0; iHit <
fTofHit.size(); iHit++) {
197 if (nValidHits == 0) {
200 dDist1 =
fhit[iHit1].GetZ()
206 if (
fhit[iHit].GetZ() <
fhit[iHit1].GetZ()) dSign = -1.;
207 aR[nValidHits] = dDist1 + dSign *
Dist3D(&
fhit[iHit], &
fhit[iHit1]);
208 at[nValidHits] =
fhit[iHit].GetTime();
209 ae[nValidHits] = 0.1;
258 Double_t sig_weight = 0;
261 for (Int_t
i = 0;
i < nValidHits;
i++) {
263 sig_weight = (ae[
i] * ae[
i]);
264 Rsum += (aR[
i] / sig_weight);
265 tsum += (at[
i] / sig_weight);
266 RRsum += (aR[
i] * aR[
i] / sig_weight);
267 Rtsum += (aR[
i] * at[
i] / sig_weight);
268 esum += (1 / sig_weight);
270 Double_t det_cov_mat =
274 fT0 = (RRsum * tsum - Rsum * Rtsum)
276 fTt = (-Rsum * tsum + esum * Rtsum)
279 RRsum / det_cov_mat);
289 LOG(debug) << Form(
"Trkl size %u, validHits %d, Tt = %6.4f TtErr = %2.4f T0 "
290 "= %6.2f T0Err = %2.2f T0TtCov = %6.4f",
305 for (UInt_t iHL = 0; iHL <
fhit.size() - 1; iHL++) {
307 for (UInt_t iHH = iHL + 1; iHH <
fhit.size(); iHH++) {
311 (
fhit[iHH].GetTime() -
fhit[iHL].GetTime())
320 LOG(WARNING) <<
"No valid hit pair ";
323 fTt = dTt / (Double_t) iNt;
333 for (UInt_t iHL = 0; iHL <
fhit.size() - 1; iHL++) {
336 for (UInt_t iHH = iHL + 1; iHH <
fhit.size(); iHH++) {
340 dTx += (
fhit[iHH].GetX() -
fhit[iHL].GetX())
341 / (
fhit[iHH].GetZ() -
fhit[iHL].GetZ());
351 for (UInt_t iHit = 0; iHit <
fTofHit.size(); iHit++) {
354 Double_t dDZ = pHit->
GetZ() -
fhit[iHit].GetZ();
355 dXref +=
fhit[iHit].GetX() + dTx * dDZ;
360 LOG(error) <<
"DetId " << iDetId <<
", Nref " << iNref <<
" sizes "
367 return pHit->
GetX() - dXref;
376 for (UInt_t iHL = 0; iHL <
fhit.size() - 1; iHL++) {
379 for (UInt_t iHH = iHL + 1; iHH <
fhit.size(); iHH++) {
382 dTy += (
fhit[iHH].GetY() -
fhit[iHL].GetY())
383 / (
fhit[iHH].GetZ() -
fhit[iHL].GetZ());
393 for (UInt_t iHit = 0; iHit <
fTofHit.size(); iHit++) {
396 Double_t dDZ = pHit->
GetZ() -
fhit[iHit].GetZ();
397 dYref +=
fhit[iHit].GetY() + dTy * dDZ;
402 LOG(error) <<
"DetId " << iDetId <<
", Nref " << iNref <<
" sizes "
409 return pHit->
GetY() - dYref;
419 for (UInt_t iHL = 0; iHL <
fhit.size() - 1; iHL++) {
422 for (UInt_t iHH = iHL + 1; iHH <
fhit.size(); iHH++) {
427 TMath::Sqrt(TMath::Power((
fhit[iHH].GetX() -
fhit[iHL].GetX()), 2)
428 + TMath::Power((
fhit[iHH].GetY() -
fhit[iHL].GetY()), 2)
429 + TMath::Power((
fhit[iHH].GetZ() -
fhit[iHL].GetZ()), 2));
431 if (
fhit[iHH].GetZ() <
fhit[iHL].GetZ()) dSign = -1.;
432 dTt += (
fhit[iHH].GetTime() -
fhit[iHL].GetTime()) / dDist * dSign;
438 LOG(error) <<
"No valid hit pair ";
441 dTt /= (Double_t) iNt;
446 for (UInt_t iHit = 0; iHit <
fTofHit.size(); iHit++) {
450 if (
fhit[iHit].GetZ() < pHit->
GetZ()) dSign = -1;
451 dTref +=
fhit[iHit].GetTime() - dTt * dSign *
Dist3D(&
fhit[iHit], pHit);
455 LOG(error) <<
"DetId " << iDetId <<
", Nref " << Nref <<
" sizes "
459 dTref /= (Double_t) Nref;
460 Double_t dTdif = pHit->
GetTime() - dTref;
467 for (UInt_t iHit = 0; iHit <
fTofHit.size(); iHit++) {
468 Int_t iHaddr =
fhit[iHit].GetAddress() & 0x003FFFFF;
474 if (iHaddr == iAddr)
return kTRUE;
480 for (UInt_t iHit = 0; iHit <
fTofHit.size(); iHit++) {
487 for (UInt_t iHit = 0; iHit <
fTofHit.size(); iHit++) {
498 fP[3] =
fhit[n].GetTime();
508 fP[3] =
fhit[n].GetTime();
547 " Hit %2d: Ind %5d, det 0x%08x, addr 0x%08x, chi %6.3f, ae[]= %6.4f",
553 fhit[iH].GetTimeError());
559 TMath::Sqrt(TMath::Power((pHit0->
GetX() - pHit1->
GetX()), 2)
560 + TMath::Power((pHit0->
GetY() - pHit1->
GetY()), 2)
561 + TMath::Power((pHit0->
GetZ() - pHit1->
GetZ()), 2));
569 if (
fhit.size() >= iNhit) {
570 for (UInt_t iHL = 0; iHL < iNhit - 1; iHL++) {
571 for (UInt_t iHH = iHL + 1; iHH < iNhit; iHH++) {
572 dTt += (
fhit[iHH].GetTime() -
fhit[iHL].GetTime())
573 / (
fhit[iHH].GetR() -
fhit[iHL].GetR());
579 LOG(debug) <<
" CbmTofTracklet::GetRefVel: No valid hit pair ";
581 dVel = (Double_t) iNt / dTt;
Double_t fP[4]
vector of TofHit objects
virtual Double_t GetTdif(Int_t iSmType, CbmTofHit *pHit)
Int_t GetAddress(UInt_t unit=0, UInt_t ladder=0, UInt_t halfladder=0, UInt_t module=0, UInt_t sensor=0, UInt_t side=0, UInt_t version=kCurrentVersion)
Construct address.
std::vector< Int_t > fTofDet
Index of TofHit.
FairTrackParam fParamLast
Track parameters at first and last fitted hit.
Provides information on attaching a TofHit to a TofTrack.
std::vector< Int_t > fTofHit
virtual Int_t HitIndexOfAddr(Int_t iAddr)
void SetCovariance(int index, Double_t cov)
Double_t GetTex(CbmTofHit *pHit)
virtual Double_t Dist3D(CbmTofHit *pHit0, CbmTofHit *pHit1)
std::string ToString() const
Return string representation of class.
virtual void GetFairTrackParamLast()
virtual Double_t GetMatChi2(Int_t iSm)
CbmTofTrackletParam fTrackPar
virtual ~CbmTofTracklet()
virtual Bool_t ContainsAddr(Int_t iAddr)
void Clear(Option_t *option="")
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Double_t GetRefVel(UInt_t N)
void SetParamLast(const FairTrackParam *par)
Double_t fTtErr
Error on Time at origin.
std::vector< CbmTofHit > fhit
Matching Chi2 of TofHit.
Int_t GetFirstInd(Int_t iSmType)
virtual CbmTofHit * HitPointerOfAddr(Int_t iAddr)
Double_t GetFitX(Double_t Z)
const Double_t * GetPoint(Int_t n)
const Double_t * GetFitPoint(Int_t n)
Double_t GetFitY(Double_t Z)
Double_t fT0TtCov
Error on slope dT/dr.
Double_t fT0Err
Time at origin.
Double_t fTt
Reference time of reference hit.
virtual Double_t GetXdif(Int_t iSmType, CbmTofHit *pHit)
Double_t GetCovariance(int index) const
std::vector< Double_t > fMatChi
DetLayer of TofHit.
Double_t GetFitT(Double_t R)
virtual Double_t GetYdif(Int_t iSmType, CbmTofHit *pHit)