55 cout <<
"TRestTrackDetachIsolatedNodesProcess. Number of tracks : "
56 << fInputTrackEvent->GetNumberOfTracks() << endl;
59 fInputTrackEvent->PrintEvent();
62 for (
int tck = 0; tck < fInputTrackEvent->GetNumberOfTracks(); tck++)
63 fOutputTrackEvent->AddTrack(fInputTrackEvent->GetTrack(tck));
65 for (
int tck = 0; tck < fInputTrackEvent->GetNumberOfTracks(); tck++) {
66 if (!fInputTrackEvent->isTopLevel(tck))
continue;
67 Int_t tckId = fInputTrackEvent->GetTrack(tck)->GetTrackID();
69 TRestVolumeHits* hits = fInputTrackEvent->GetTrack(tck)->GetVolumeHits();
70 TRestVolumeHits* originHits = fInputTrackEvent->GetOriginTrackById(tckId)->GetVolumeHits();
72 Int_t nHits = hits->GetNumberOfHits();
77 Int_t pId = fInputTrackEvent->GetTrack(tck)->GetParentID();
78 cout <<
"Track : " << tck <<
" TrackID : " << tckId <<
" ParentID : " << pId << endl;
79 cout <<
"-----------------" << endl;
81 cout <<
"-----------------" << endl;
89 connectedHits.AddHit(hits->
GetPosition(0), hits->GetEnergy(0), 0, hits->GetType(0),
92 for (
int n = 1; n < nHits - 1; n++) {
93 TVector3 x0, x1, pos0, pos1;
95 Double_t hitConnectivity = 0;
99 Double_t distance = 0;
100 for (
int m = n - 1; m < n + 1; m++) {
105 pos0 = fTubeLengthReduction * (x1 - x0) + x0;
106 pos1 = (1 - fTubeLengthReduction) * (x1 - x0) + x0;
108 distance += (x0 - x1).Mag();
113 cout <<
"Hit : " << n <<
" Connectivity : " << hitConnectivity
114 <<
" distance : " << distance / 2. << endl;
116 if (hitConnectivity <= fConnectivityThreshold && distance / 2 > fThresholdDistance) {
117 isolatedHit.AddHit(hits->
GetPosition(n), hits->GetEnergy(n), 0, hits->GetType(n),
121 isoTrack.SetTrackID(fOutputTrackEvent->GetNumberOfTracks() + 1);
123 isoTrack.SetParentID(tckId);
125 isoTrack.SetVolumeHits(isolatedHit);
127 fOutputTrackEvent->AddTrack(&isoTrack);
131 connectedHits.AddHit(hits->
GetPosition(n), hits->GetEnergy(n), 0, hits->GetType(n),
136 connectedHits.AddHit(hits->
GetPosition(nHits - 1), hits->GetEnergy(nHits - 1), 0,
137 hits->GetType(nHits - 1), hits->GetSigma(nHits - 1));
140 connectedTrack.SetTrackID(fOutputTrackEvent->GetNumberOfTracks() + 1);
142 connectedTrack.SetParentID(tckId);
144 connectedTrack.SetVolumeHits(connectedHits);
146 fOutputTrackEvent->AddTrack(&connectedTrack);
150 cout <<
"xxxx DetachIsolatedNodes trackEvent output xxxxx" << endl;
151 fOutputTrackEvent->PrintEvent();
152 cout <<
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" << endl;
156 return fOutputTrackEvent;