19 vector<const DChargedTrackHypothesis*> locChargedTrackHypotheses;
20 locEventLoop->Get(locChargedTrackHypotheses);
33 vector<const DChargedTrack*> locChargedTracks;
36 map<JObject::oid_t, const DChargedTrack*> locTrackToCandidateID;
37 for(
auto locChargedTrack : locChargedTracks)
38 locTrackToCandidateID.emplace(locChargedTrack->candidateid, locChargedTrack);
40 vector<const DTrackTimeBased*> locTimeBasedTracks;
41 locEventLoop->Get(locTimeBasedTracks,
"Combo");
44 locEventLoop->GetSingle(locEventRFBunch);
47 locEventLoop->GetSingle(locDetectorMatches,
"Combo");
50 unordered_map<const DChargedTrack*, vector<const DTrackTimeBased*>> locTimeBasedByChargedTrack;
51 for(
auto& locTimeBasedTrack : locTimeBasedTracks)
53 auto locChargedTrack = locTrackToCandidateID[locTimeBasedTrack->candidateid];
54 locTimeBasedByChargedTrack[locChargedTrack].push_back(locTimeBasedTrack);
58 for(
auto& locChargedTrack : locChargedTracks)
60 auto locNewChargedTrack =
new DChargedTrack(*locChargedTrack);
61 for(
auto& locTimeBasedTrack : locTimeBasedByChargedTrack[locChargedTrack])
65 locNewChargedTrackHypothesis->AddAssociatedObject(locNewChargedTrack);
67 locNewChargedTrack->dChargedTrackHypotheses.push_back(locNewChargedTrackHypothesis);
69 locNewChargedTrack->AddAssociatedObject(locChargedTrack);
70 _data.push_back(locNewChargedTrack);
jerror_t brun(jana::JEventLoop *locEventLoop, int32_t runnumber)
Called everytime a new run number is detected.
vector< DChargedTrackHypothesis * > dCreatedHypotheses
DChargedTrackHypothesis * Create_ChargedTrackHypothesis(JEventLoop *locEventLoop, const DTrackTimeBased *locTrackTimeBased, const DDetectorMatches *locDetectorMatches, const DEventRFBunch *locEventRFBunch)
jerror_t init(void)
Called once at program start.
DChargedTrackHypothesis_factory * dChargedTrackHypothesisFactory
string dTrackSelectionTag
void Recycle_Hypotheses(vector< const DChargedTrackHypothesis * > &locHypos)
jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t eventnumber)
Called every event.