13 #include "FairMCPoint.h"
14 #include "FairRootManager.h"
15 #include "FairTrackParam.h"
17 #include "TClonesArray.h"
29 , fPixelDigiMatches(NULL)
38 FairRootManager* ioman = FairRootManager::Instance();
40 Fatal(
"CbmMuchTrackFinderIdeal::Init",
"No FairRootManager!");
42 fMCTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
44 Fatal(
"CbmMuchTrackFinderIdeal::Init",
"No MCTrack array!");
46 fMCPoints = (TClonesArray*) ioman->GetObject(
"MuchPoint");
48 Fatal(
"CbmMuchTrackFinderIdeal::Init",
"No MuchPoint array!");
50 fPixelHits = (TClonesArray*) ioman->GetObject(
"MuchPixelHit");
52 Fatal(
"CbmMuchTrackFinderIdeal::Init",
"No MuchPixelHit array!");
56 Fatal(
"CbmMuchTrackFinderIdeal::Init",
"No MuchDigiMatch array!");
58 fClusters = (TClonesArray*) ioman->GetObject(
"MuchCluster");
60 Info(
"CbmMuchTrackFinderIdeal::Init",
61 "No cluster array -- simple hit to digi matching will be used");
69 Int_t nofMCTracks =
fMCTracks->GetEntriesFast();
70 for (Int_t iMCTrack = 0; iMCTrack < nofMCTracks; iMCTrack++) {
72 if (mcTrack == NULL)
continue;
73 if (std::abs(mcTrack->
GetPdgCode()) != 13)
continue;
82 for (Int_t iHit = 0; iHit <
fPixelHits->GetEntriesFast(); iHit++) {
87 for (Int_t iDigi = 0; iDigi < cluster->
GetNofDigis(); iDigi++) {
93 std::cout <<
"Event: " <<
fEvents++ << std::endl;
98 const TClonesArray* digiMatches,
103 if (!digiMatch)
return;
105 for (Int_t iDigi = 0; iDigi < digiMatch->
GetNofLinks(); iDigi++) {
107 if (pointIndex < 0)
return;
108 FairMCPoint* mcPoint = (FairMCPoint*) (
fMCPoints->At(pointIndex));
109 if (mcPoint == NULL)
return;
110 Int_t mcTrackIndex = mcPoint->GetTrackID();
111 if (mcTrackIndex < 0)
return;
113 if (mcTrack == NULL)
return;
117 Int_t trackIndex =
fTrackMap[mcTrackIndex];
119 track->
AddHit(hitIndex, hitType);
126 const FairMCPoint* mcPoint,
129 par.SetX(mcPoint->GetX());
130 par.SetY(mcPoint->GetY());
131 par.SetTx(mcPoint->GetPx() / mcPoint->GetPz());
132 par.SetTy(mcPoint->GetPy() / mcPoint->GetPz());
134 par.SetQp(-1. / mcTrack->
GetP());
136 par.SetQp(1. / mcTrack->
GetP());
137 par.SetZ(mcPoint->GetZ());
155 par.SetCovMatrix(cov);