EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MatchCandidateGroup.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MatchCandidateGroup.cxx
1 //
2 // AYK (ayk@bnl.gov)
3 //
4 // Match candidate group (overlap via hits) class;
5 //
6 //
7 
8 #include <MatchCandidateGroup.h>
9 
10 // ---------------------------------------------------------------------------------------
11 
13 {
14  // Mark this candidate as "some-group-bound";
15  match->SetGroupedStatus(true);
16 
17  // Place it into the candidate vector;
18  mMatchCandidates.insert(std::pair<__u64, MatchCandidate*>(match->Ambiguity(), match));
19 
20  // Loop through all its hits in all groups and pull out other candidates;
21  for(unsigned gr=0; gr<match->GetGdim(); gr++) {
22  for(unsigned mm=0; mm<match->GetLinearMemberCount(gr); mm++) {
23  GroupMember *member = match->GetSelMember(gr,mm); //assert(member);
24 
25  // If hit was accounted already, skip all the rest;
26  if (!member || mHits.find(member) != mHits.end()) continue;
27 
28  // Otherwise insert it and recursively loop through all track candidates
29  // which contain it;
30  mHits.insert(member);
31 
32  for(std::set<MatchCandidate*>::iterator it=member->Begin(); it != member->End(); it++) {
33  MatchCandidate *qmatch = *it;
34 
35  if (!qmatch->IsGrouped() && qmatch->IsActive() && qmatch != match)
36  AddCandidate(qmatch);
37  } //for iq
38  } //for mm
39  } //for gr
40 } // MatchCandidateGroup::AddCandidate()
41 
42 // ---------------------------------------------------------------------------------------