24 #include "StContainers.h"
25 #include "StTrackDetectorInfo.h"
29 void dominatrackInfo(
const StTrack* recTrack,
int& dominatrackKey ,
short& dominatrackHits,
float& avgQuality) {
34 static short DetectorList[kMaxDetectorId];
35 dominatrackKey = -999;
38 multimap<int,float> idTruths;
39 set<int> uniqueIdTruths;
40 if (!recTrack)
return;
41 StPtrVecHit recHits = recTrack->detectorInfo()->hits();
43 for (StHitIterator hi=recHits.begin();
44 hi!=recHits.end(); hi++) {
46 idTruths.insert( multimap<int,float>::value_type(rHit->idTruth(),rHit->qaTruth()));
47 uniqueIdTruths.insert(static_cast<int>(rHit->idTruth()));
50 for (set<int>::iterator si=uniqueIdTruths.begin(); si!=uniqueIdTruths.end(); ++si) {
51 int currentNHitsIdTruth = idTruths.count(*si);
52 if (currentNHitsIdTruth>dominatrackHits) {
54 dominatrackHits = currentNHitsIdTruth;
58 pair<multimap<int,float>::iterator,multimap<int,float>::iterator> dominatrackRange = idTruths.equal_range(dominatrackKey);
59 for (multimap<int,float>::iterator mi=dominatrackRange.first; mi!=dominatrackRange.second; ++mi) {
60 avgQuality+=mi->second;
62 avgQuality/=dominatrackHits;
63 memset (DetectorList, 0, kMaxDetectorId*
sizeof(
short));
64 for (StHitIterator hi=recHits.begin();
65 hi!=recHits.end(); hi++) {
67 if (rHit->idTruth() == dominatrackKey) {
68 DetectorList[rHit->detector()]++;
71 else cout <<
"Not Matched hit " << *rHit << endl;
74 if (DetectorList[kTpcId] > 99) DetectorList[kTpcId] = 99;
75 if (DetectorList[kSvtId] > 9) DetectorList[kSvtId] = 9;
76 if (DetectorList[kSsdId] > 9) DetectorList[kSsdId] = 9;
77 dominatrackHits = DetectorList[kTpcId] + 100*(DetectorList[kSvtId] + 10*DetectorList[kSsdId]);