CbmRoot
CbmRichTrackExtrapolationMirrorIdeal.cxx
Go to the documentation of this file.
1 
9 
10 #include "CbmRichPoint.h"
11 
12 #include "CbmGlobalTrack.h"
13 #include "CbmMCTrack.h"
14 #include "CbmStsTrack.h"
15 #include "CbmTrackMatchNew.h"
16 #include "FairRootManager.h"
17 #include "FairTrackParam.h"
18 
19 #include "TClonesArray.h"
20 #include "TMatrixFSym.h"
21 
22 #include <iostream>
23 
24 using std::cout;
25 using std::endl;
26 
28  : fRichMirrorPoints(NULL)
29  , fMcTracks(NULL)
30  , fSTSArray(NULL)
31  , fTrackMatchArray(NULL) {}
32 
34 
36  FairRootManager* ioman = FairRootManager::Instance();
37  if (NULL == ioman) {
38  Fatal("CbmRichTrackExtrapolationMirrorIdeal::Init",
39  "RootManager not instantised!");
40  }
41 
42  fMcTracks = (TClonesArray*) ioman->GetObject("MCTrack");
43  if (NULL == fMcTracks) {
44  Fatal("CbmRichTrackExtrapolationMirrorIdeal::Init", "No MCTrack array!");
45  }
46 
47  fRichMirrorPoints = (TClonesArray*) ioman->GetObject("RichMirrorPoint");
48  if (NULL == fRichMirrorPoints) {
49  Fatal("CbmRichTrackExtrapolationMirrorIdeal::Init",
50  "No RichMirrorPoint array!");
51  }
52 
53  fSTSArray = (TClonesArray*) ioman->GetObject("StsTrack");
54  if (NULL == fSTSArray) {
55  Fatal("CbmRichTrackExtrapolationMirrorIdeal::Init", "No StsTrack array!");
56  }
57 
58  fTrackMatchArray = (TClonesArray*) ioman->GetObject("StsTrackMatch");
59  if (NULL == fTrackMatchArray) {
60  Fatal("CbmRichTrackExtrapolationMirrorIdeal::Init",
61  "No StsTrackMatch array!");
62  }
63 }
64 
66  TClonesArray* globalTracks,
67  TClonesArray* extrapolatedTrackParams,
68  double /*z*/) {
69  if (NULL == extrapolatedTrackParams) {
70  cout << "-E- CbmRichTrackExtrapolationMirrorIdeal::DoExtrapolate: "
71  "TrackParam Array missing!"
72  << endl;
73  return;
74  }
75 
76  if (NULL == globalTracks) {
77  cout << "-E- CbmRichTrackExtrapolationMirrorIdeal::DoExtrapolate: Global "
78  "Track Array missing!"
79  << endl;
80  return;
81  }
82 
83  Double_t tx, ty, qp;
84  Double_t charge = 1.;
85  TMatrixFSym covMat(5);
86  for (Int_t i = 0; i < 5; i++)
87  for (Int_t j = 0; j <= i; j++)
88  covMat(i, j) = 0;
89  covMat(0, 0) = covMat(1, 1) = covMat(2, 2) = covMat(3, 3) = covMat(4, 4) =
90  1.e-4;
91 
92  TVector3 pos, mom;
93  Int_t nTracks = globalTracks->GetEntriesFast();
94  for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
95  CbmGlobalTrack* gTrack = (CbmGlobalTrack*) globalTracks->At(iTrack);
96  new ((*extrapolatedTrackParams)[iTrack])
97  FairTrackParam(0., 0., 0., 0., 0., 0., covMat);
98  Int_t idSTS = gTrack->GetStsTrackIndex();
99 
100  if (idSTS < 0) continue;
101  CbmStsTrack* pSTStr = (CbmStsTrack*) fSTSArray->At(idSTS);
102  if (NULL == pSTStr) continue;
103  CbmTrackMatchNew* pTrackMatch =
104  (CbmTrackMatchNew*) fTrackMatchArray->At(idSTS);
105  if (NULL == pTrackMatch) continue;
106  Int_t iMCmatch = pTrackMatch->GetMatchedLink().GetIndex();
107  for (Int_t ii = 0; ii < fRichMirrorPoints->GetEntriesFast(); ii++) {
108  CbmRichPoint* pMirror = (CbmRichPoint*) fRichMirrorPoints->At(ii);
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;
117  }
118  }
119  }
120 }
CbmRichPoint.h
CbmMatch::GetMatchedLink
const CbmLink & GetMatchedLink() const
Definition: CbmMatch.h:37
CbmRichTrackExtrapolationMirrorIdeal::DoExtrapolation
virtual void DoExtrapolation(TClonesArray *globalTracks, TClonesArray *extrapolatedTrackParams, double z)
Inherited from CbmRichTrackExtrapolationBase.
Definition: CbmRichTrackExtrapolationMirrorIdeal.cxx:65
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmRichTrackExtrapolationMirrorIdeal::Init
virtual void Init()
Inherited from CbmRichTrackExtrapolationBase.
Definition: CbmRichTrackExtrapolationMirrorIdeal.cxx:35
CbmGlobalTrack.h
CbmRichTrackExtrapolationMirrorIdeal::fSTSArray
TClonesArray * fSTSArray
Definition: CbmRichTrackExtrapolationMirrorIdeal.h:63
CbmStsTrack.h
Data class for STS tracks.
CbmGlobalTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: CbmGlobalTrack.h:38
CbmRichTrackExtrapolationMirrorIdeal.h
This is the implementation of the TrackExtrapolation from MC points - operating on points in the RICH...
CbmTrackMatchNew.h
CbmRichTrackExtrapolationMirrorIdeal::fTrackMatchArray
TClonesArray * fTrackMatchArray
Definition: CbmRichTrackExtrapolationMirrorIdeal.h:64
CbmRichTrackExtrapolationMirrorIdeal::fRichMirrorPoints
TClonesArray * fRichMirrorPoints
Definition: CbmRichTrackExtrapolationMirrorIdeal.h:61
CbmRichTrackExtrapolationMirrorIdeal::fMcTracks
TClonesArray * fMcTracks
Definition: CbmRichTrackExtrapolationMirrorIdeal.h:62
CbmRichTrackExtrapolationMirrorIdeal::CbmRichTrackExtrapolationMirrorIdeal
CbmRichTrackExtrapolationMirrorIdeal()
Default constructor.
Definition: CbmRichTrackExtrapolationMirrorIdeal.cxx:27
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
CbmMCTrack.h
CbmRichTrackExtrapolationMirrorIdeal::~CbmRichTrackExtrapolationMirrorIdeal
virtual ~CbmRichTrackExtrapolationMirrorIdeal()
Destructor.
Definition: CbmRichTrackExtrapolationMirrorIdeal.cxx:33
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmTrackMatchNew
Definition: CbmTrackMatchNew.h:19
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmRichPoint
Definition: CbmRichPoint.h:24