16 #include "FairRootManager.h"
17 #include "FairTrackParam.h"
19 #include "TClonesArray.h"
20 #include "TMatrixFSym.h"
28 : fRichMirrorPoints(NULL)
31 , fTrackMatchArray(NULL) {}
36 FairRootManager* ioman = FairRootManager::Instance();
38 Fatal(
"CbmRichTrackExtrapolationMirrorIdeal::Init",
39 "RootManager not instantised!");
42 fMcTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
44 Fatal(
"CbmRichTrackExtrapolationMirrorIdeal::Init",
"No MCTrack array!");
49 Fatal(
"CbmRichTrackExtrapolationMirrorIdeal::Init",
50 "No RichMirrorPoint array!");
53 fSTSArray = (TClonesArray*) ioman->GetObject(
"StsTrack");
55 Fatal(
"CbmRichTrackExtrapolationMirrorIdeal::Init",
"No StsTrack array!");
60 Fatal(
"CbmRichTrackExtrapolationMirrorIdeal::Init",
61 "No StsTrackMatch array!");
66 TClonesArray* globalTracks,
67 TClonesArray* extrapolatedTrackParams,
69 if (NULL == extrapolatedTrackParams) {
70 cout <<
"-E- CbmRichTrackExtrapolationMirrorIdeal::DoExtrapolate: "
71 "TrackParam Array missing!"
76 if (NULL == globalTracks) {
77 cout <<
"-E- CbmRichTrackExtrapolationMirrorIdeal::DoExtrapolate: Global "
78 "Track Array missing!"
85 TMatrixFSym covMat(5);
86 for (Int_t
i = 0;
i < 5;
i++)
87 for (Int_t j = 0; j <=
i; j++)
89 covMat(0, 0) = covMat(1, 1) = covMat(2, 2) = covMat(3, 3) = covMat(4, 4) =
93 Int_t nTracks = globalTracks->GetEntriesFast();
94 for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
96 new ((*extrapolatedTrackParams)[iTrack])
97 FairTrackParam(0., 0., 0., 0., 0., 0., covMat);
100 if (idSTS < 0)
continue;
102 if (NULL == pSTStr)
continue;
105 if (NULL == pTrackMatch)
continue;
109 if (pMirror->GetTrackID() == iMCmatch) {
110 pMirror->Momentum(mom);
111 pMirror->Position(
pos);
112 tx = mom.Px() / mom.Pz();
113 ty = mom.Py() / mom.Pz();
114 qp = charge / mom.Mag();
115 FairTrackParam richtrack(
pos.X(),
pos.Y(),
pos.Z(), tx, ty, qp, covMat);
116 *(FairTrackParam*) (extrapolatedTrackParams->At(iTrack)) = richtrack;