15 #include "FairRootManager.h"
16 #include "FairTrackParam.h"
18 #include "TClonesArray.h"
19 #include "TMatrixFSym.h"
27 : fRefPlanePoints(NULL)
30 , fStsTrackMatches(NULL) {}
35 FairRootManager* ioman = FairRootManager::Instance();
37 Fatal(
"CbmRichTrackExtrapolationIdeal::Init",
38 "RootManager not instantised!");
41 fMcTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
43 Fatal(
"CbmRichTrackExtrapolationIdeal::Init",
"No MCTrack array!");
48 Fatal(
"CbmRichTrackExtrapolationIdeal::Init",
"No RefPlanePoint array!");
51 fStsTracks = (TClonesArray*) ioman->GetObject(
"StsTrack");
53 Fatal(
"CbmRichTrackExtrapolationIdeal::Init",
"No StsTrack array!");
58 Fatal(
"CbmRichTrackExtrapolationIdeal::Init",
"No StsTrackMatch array!");
63 TClonesArray* globalTracks,
64 TClonesArray* extrapolatedTrackParams,
66 if (NULL == extrapolatedTrackParams) {
67 cout <<
"-E- CbmRichTrackExtrapolationIdeal::DoExtrapolate: TrackParam "
73 if (NULL == globalTracks) {
74 cout <<
"-E- CbmRichTrackExtrapolationIdeal::DoExtrapolate: Global Track "
83 TMatrixFSym covMat(5);
84 for (Int_t
i = 0;
i < 5;
i++)
85 for (Int_t j = 0; j <=
i; j++)
87 covMat(0, 0) = covMat(1, 1) = covMat(2, 2) = covMat(3, 3) = covMat(4, 4) =
91 Int_t nTracks = globalTracks->GetEntriesFast();
92 for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
94 new ((*extrapolatedTrackParams)[iTrack])
95 FairTrackParam(0., 0., 0., 0., 0., 0., covMat);
97 if (idSTS < 0)
continue;
99 if (NULL == pSTStr)
continue;
102 if (NULL == pTrackMatch)
continue;
106 if (pRefPlane->GetTrackID() == iMCmatch) {
107 pRefPlane->Momentum(mom);
108 pRefPlane->Position(
pos);
109 tx = mom.Px() / mom.Pz();
110 ty = mom.Py() / mom.Pz();
111 qp = charge / mom.Mag();
112 FairTrackParam richtrack(
pos.X(),
pos.Y(),
pos.Z(), tx, ty, qp, covMat);
113 *(FairTrackParam*) (extrapolatedTrackParams->At(iTrack)) = richtrack;