8 #include "TClonesArray.h"
10 #include "FairMCPoint.h"
11 #include "FairRootManager.h"
74 FairRootManager* ioman = FairRootManager::Instance();
76 cout <<
"-E- PndSttMatchTracks::Init: "
77 <<
"RootManager not instantised!" << endl;
84 cout <<
"-E- PndSttMatchTracks::Init: No STTTrackCand array!" << endl;
89 fMatches =
new TClonesArray(
"PndSttTrackMatch",100);
106 cout <<
"-E- PndSttTrackFinderIdeal::DoFind: "
107 <<
"No hit arrays present, call AddHitCollection() first (at least once)! " << endl;
112 cout <<
"-E- PndSttTrackFinderIdeal::DoFind: "
113 <<
"No point arrays present, call AddHitCollection() first (at least once)! " << endl;
122 FairMCPoint*
point = NULL;
137 Int_t nMCTrackSum = 0;
144 for (Int_t iTrack=0; iTrack<nTracks; iTrack++)
150 cout <<
"-W- PndSttMatchTracks::Exec: Empty STTTrackCand at "
157 nAll = nTrue = nWrong = nFake = nMCTracks = 0;
160 if (
fVerbose > 2) cout << endl <<
"Track " << iTrack <<
", Hits "
164 for (Int_t iMHit=0; iMHit<
nHits; iMHit++)
176 cout <<
"-E- PndSttMatchTracks::Exec: "
177 <<
"No Hit " << iMHit <<
" for track " << iTrack << endl;
182 iPoint = mHit->GetRefIndex();
196 cout <<
"-E- PndSttMatchTracks::Exec: "
197 <<
"Empty MCPoint " << iPoint <<
" from Hit " << iMHit
198 <<
" (track " << iTrack <<
")" << endl;
202 iMCTrack = point->GetTrackID();
204 if (
fVerbose > 2 ) cout <<
"Track " << iTrack <<
", hit "
206 <<
", STTPoint " << iPoint <<
", MCTrack "
214 map<Int_t, Int_t>::iterator it;
217 if (
fVerbose > 2) cout << it->second
218 <<
" common points wth MCtrack "
219 << it->first << endl;
222 if ( it->second > nTrue )
224 iMCTrack = it->first;
229 nWrong = nAll - nTrue;
230 if (
fVerbose>1) cout <<
"-I- PndSttMatchTracks: STTTrack " << iTrack
231 <<
", MCTrack " << iMCTrack <<
", true "
232 << nTrue <<
", wrong " << nWrong <<
", fake "
233 << nFake <<
", #MCTracks " << nMCTracks << endl;
245 nMCTrackSum += nMCTracks;
271 cout <<
"-------------------------------------------------------"
273 cout <<
"-I- STT Track Matching -I-"
275 cout <<
"Reconstructed STTTracks : " << nTracks << endl;;
276 cout <<
"True hit assignments : " << qTrue <<
" %" << endl;
277 cout <<
"Wrong hit assignments : " << qWrong <<
" %" << endl;
278 cout <<
"Fake hit assignments : " << qFake <<
" %" << endl;
279 cout <<
"MCTracks per STTTrack : " << qMC << endl;
280 cout <<
"--------------------------------------------------------"
283 else if (
fVerbose) cout <<
"-I- PndSttMatchTracks: rec. " << nTracks <<
", quota "
284 << qTrue <<
" % " << endl;
293 newPointName(pointCollectionName),
294 newHitName(hitCollectionName);
304 *ioman = FairRootManager::Instance();
308 cout <<
"-E- PndSttFindTracks::AddHitCollection: "
309 <<
"RootManager not instantised!" << endl;
314 *fHitArray = (TClonesArray*) ioman->GetObject(hitCollectionName);
318 cout <<
"-W- PndSttFindTracks::AddHitCollection: No " << hitCollectionName <<
" STT hit array!"
324 *fPointArray = (TClonesArray*) ioman->GetObject(pointCollectionName);
328 cout <<
"-W- PndSttFindTracks::AddHitCollection: No " << pointCollectionName <<
" STT hit array!"
354 relativeCounter = hitCounter;
356 for (Int_t collectionCounter = 0; collectionCounter <
fHitCollectionList.GetEntries(); collectionCounter++)
361 if (relativeCounter < size)
368 relativeCounter -= size;
380 relativeCounter = hitCounter;
382 for (Int_t collectionCounter = 0; collectionCounter <
fHitCollectionList.GetEntries(); collectionCounter++)
387 if (relativeCounter < size)
398 relativeCounter -= size;
Bool_t fCollectionsComplete
virtual ~PndSttMatchTracks()
std::vector< std::string > fHitCollectionNames
std::vector< std::string > fPointCollectionNames
PndTrackCandHit GetSortedHit(UInt_t i)
FairMCPoint * GetPointFromCollections(Int_t hitCounter)
void SetPersistency(Bool_t val=kTRUE)
TClonesArray * fTrackCandidates
cout<< "POINTs for new FwEndCap == "<< tsim-> GetEntriesFast()
PndSttHit * GetHitFromCollections(Int_t hitCounter)
void AddHitCollectionName(char *hitCollectionName, char *pointCollectionName)
h_MC_angle SetTitle("MC truth: opening angle of #pi^{0}")
TList fPointCollectionList
virtual void Exec(Option_t *opt)
void AddHitCollection(char const *collectionName, char const *pointCollectionName)
virtual InitStatus Init()
std::map< Int_t, Int_t > fMatchMap
cout<<"the Event No is "<< i<< endl;{{if(hit_array->GetEntriesFast()!=mc_array->GetEntriesFast()) continue;PndSdsHit *hit=(PndSdsHit *) hit_array-> At(j)