16#include "FairMCPoint.h"
17#include "FairRootManager.h"
18#include "FairTrackParam.h"
19#include "TClonesArray.h"
31 , fPixelDigiMatches(NULL)
43 FairRootManager* ioman = FairRootManager::Instance();
44 if (ioman == NULL) LOG(fatal) << GetName() <<
"::Init: No FairRootManager!";
46 fMCTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
47 if (
fMCTracks == NULL) LOG(fatal) << GetName() <<
"::Init: No MCTrack array!";
49 fMCPoints = (TClonesArray*) ioman->GetObject(
"MuchPoint");
50 if (
fMCPoints == NULL) LOG(fatal) << GetName() <<
"::Init: No MuchPoint array!";
52 fPixelHits = (TClonesArray*) ioman->GetObject(
"MuchPixelHit");
53 if (
fPixelHits == NULL) LOG(fatal) << GetName() <<
"::Init: No MuchPixelHit array!";
56 if (
fPixelDigiMatches == NULL) LOG(fatal) << GetName() <<
"::Init: No MuchDigiMatch array!";
58 fClusters = (TClonesArray*) ioman->GetObject(
"MuchCluster");
60 Info(
"CbmMuchTrackFinderIdeal::Init",
"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++) {
92 std::cout <<
"Event: " <<
fEvents++ << std::endl;
100 if (!digiMatch)
return;
102 for (Int_t iDigi = 0; iDigi < digiMatch->
GetNofLinks(); iDigi++) {
104 if (pointIndex < 0)
return;
105 FairMCPoint* mcPoint = (FairMCPoint*) (
fMCPoints->At(pointIndex));
106 if (mcPoint == NULL)
return;
107 Int_t mcTrackIndex = mcPoint->GetTrackID();
108 if (mcTrackIndex < 0)
return;
110 if (mcTrack == NULL)
return;
114 Int_t trackIndex =
fTrackMap[mcTrackIndex];
116 track->
AddHit(hitIndex, hitType);
127 par.SetX(mcPoint->GetX());
128 par.SetY(mcPoint->GetY());
129 par.SetTx(mcPoint->GetPx() / mcPoint->GetPz());
130 par.SetTy(mcPoint->GetPy() / mcPoint->GetPz());
132 par.SetQp(-1. / mcTrack->
GetP());
134 par.SetQp(1. / mcTrack->
GetP());
135 par.SetZ(mcPoint->GetZ());
153 par.SetCovMatrix(cov);
Data container for MUCH clusters.
Class for pixel hits in MUCH detector.
ClassImp(CbmMuchTrackFinderIdeal)
int32_t GetDigi(int32_t index) const
Get digi at position index.
int32_t GetNofDigis() const
Number of digis in cluster.
int32_t GetMotherId() const
int32_t GetPdgCode() const
const CbmLink & GetLink(int32_t i) const
int32_t GetNofLinks() const
Data container for MUCH clusters.
TClonesArray * fPixelHits
std::map< Int_t, Int_t > fTrackMap
void SetTrackParam(const CbmMCTrack *mcTrack, const FairMCPoint *mcPoint, CbmMuchTrack *track)
virtual ~CbmMuchTrackFinderIdeal()
CbmMuchTrackFinderIdeal()
TClonesArray * fPixelDigiMatches
void ProcessDigiMatches(const TClonesArray *digiMatches, Int_t digiIndex, Int_t hitIndex, HitType hitType)
Int_t DoFind(TClonesArray *trackArray)
void AddHit(int32_t index, HitType type)
virtual int32_t GetNofHits() const
void SetParamFirst(const FairTrackParam *par)
void SetParamLast(const FairTrackParam *par)