10 #include "FairRootManager.h"
12 #include "TClonesArray.h"
39 FairRootManager* ioman = FairRootManager::Instance();
41 cout <<
"-E- CbmStsTrackFinderIdeal::Init: "
42 <<
"RootManager not instantised!" << endl;
47 fStsMatch = (TClonesArray*) ioman->GetObject(
"StsTrackMatch");
49 cout <<
"-W- CbmTrackMergerIdeal::Init: "
50 <<
"No StsTrackMatch array!" << endl;
54 fTrdMatch = (TClonesArray*) ioman->GetObject(
"TrdTrackMatch");
56 cout <<
"-W- CbmTrackMergerIdeal::Init: "
57 <<
"No TrdTrackMatch array!" << endl;
65 TClonesArray* trdTracks,
66 TClonesArray* glbTracks) {
70 cout <<
"-E- CbmTrackMergerIdel::DoMerge: "
71 <<
"No GlobalTrack array!" << endl;
85 map<Int_t, Int_t> trdStsMap;
88 map<Int_t, Int_t> mcTrdMap;
92 nSts = stsTracks->GetEntriesFast();
93 if (nSts !=
fStsMatch->GetEntriesFast()) {
94 cout <<
"-E- CbmTrackMergerIdeal::DoMerge: "
95 <<
"Unequal array sizes of StsTrack and StsTrackMatch! (" << nSts
96 <<
", " <<
fStsMatch->GetEntriesFast() << endl;
103 nTrd = trdTracks->GetEntriesFast();
104 if (nTrd !=
fTrdMatch->GetEntriesFast()) {
105 cout <<
"-E- CbmTrackMergerIdeal::DoMerge: "
106 <<
"Unequal array sizes of TrdTrack and TrdTrackMatch! (" << nTrd
107 <<
", " <<
fTrdMatch->GetEntriesFast() << endl;
114 <<
"-I- CbmTrackMergerIdeal: " << nSts <<
" StsTracks, " << nTrd
115 <<
" TrdTracks" << endl;
118 for (Int_t iTrd = 0; iTrd < nTrd; iTrd++) {
122 cout <<
"-W- CbmTrackMergerIdeal::DoMerge: "
123 <<
"Empty TrdTrackMatch at position " << iTrd << endl;
126 if (mcTrdMap.find(iMC) != mcTrdMap.end()) {
127 cout <<
"-W- CbmTrackMergerIdeal::DoMerge: "
128 <<
"MCTrack " << iMC <<
" matched to TrdTrack " << mcTrdMap[iMC]
129 <<
" and " << iTrd << endl;
132 mcTrdMap[iMC] = iTrd;
136 for (Int_t iSts = 0; iSts < nSts; iSts++) {
139 cout <<
"-W- CbmTrackMergerIdeal::DoMerge: "
140 <<
"Empty StsTrackMatch at position " << iSts << endl;
146 if (mcTrdMap.find(iMC) != mcTrdMap.end()) {
148 trdStsMap[mcTrdMap[iMC]] = iSts;
153 cout <<
"-I- CbmTrackMergerIdeal: " << nGlb
154 <<
" GlobalTracks created from StsTracks" << endl;
155 cout <<
"-I- CbmTrackMergerIdeal: " << nMerged
156 <<
" StsTracks merged with TrdTracks" << endl;
161 for (Int_t iTrd = 0; iTrd < nTrd; iTrd++) {
162 if (trdStsMap.find(iTrd) == trdStsMap.end()) {
169 cout <<
"-I- CbmTrackMergerIdeal: " << nTrdOnly
170 <<
" GlobalTracks created from TrdTracks" << endl;
171 cout <<
"-I- CbmTrackMergerIdeal: Total " << nGlb <<
" GlobalTracks created"