X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RALICE%2FAliJet.cxx;h=c0c34324a0e99b1d6d0cc91959de4cc6f627e7d3;hb=30672a969861d984df4dd05cf3112e77e36ed790;hp=5a7f9cd8e2441153da6f9894aeddfe74e46b5510;hpb=b1cb0e0ff5a817d45327a7830489ea12c0d04d54;p=u%2Fmrichter%2FAliRoot.git diff --git a/RALICE/AliJet.cxx b/RALICE/AliJet.cxx index 5a7f9cd8e24..c0c34324a0e 100644 --- a/RALICE/AliJet.cxx +++ b/RALICE/AliJet.cxx @@ -649,6 +649,68 @@ TObjArray* AliJet::GetTracks(TString name) return fSelected; } /////////////////////////////////////////////////////////////////////////// +void AliJet::RemoveTracks(TString name) +{ +// Remove all tracks with the specified name. +// If name="*" all tracks will be removed. +// +// Note : +// ------ +// In case the user has labeled reconstructed tracks with the name of +// the applied reconstruction algorithm, this memberfunction provides +// easy removal of all tracks reconstructed by a certain method. + + if (!fTracks) return; + + AliTrack* tx=0; + TString s; + TObject* obj=0; + for (Int_t i=0; iAt(i); + if (!tx) continue; + + s=tx->GetName(); + if (s==name || name=="*") + { + obj=fTracks->Remove(tx); + if (obj && fTracks->IsOwner()) delete tx; + } + } + fTracks->Compress(); + fNtrk=fTracks->GetEntries(); +} +/////////////////////////////////////////////////////////////////////////// +void AliJet::RemoveTracks(Int_t idmode,Int_t chmode,Int_t pcode) +{ +// Remove user selected tracks based on the idmode, chmode and pcode +// selections as specified by the user. +// For defintions of these selections see the corresponding GetTracks() +// memberfunction. + + if (!fTracks) return; + + TObjArray* arr=GetTracks(idmode,chmode,pcode); + if (!arr) return; + + Int_t ntk=arr->GetEntries(); + if (!ntk) return; + + AliTrack* tx=0; + TObject* obj=0; + for (Int_t i=0; iAt(i); + if (!tx) continue; + + obj=fTracks->Remove(tx); + if (obj && fTracks->IsOwner()) delete tx; + } + fTracks->Compress(); + fNtrk=fTracks->GetEntries(); + arr->Clear(); +} +/////////////////////////////////////////////////////////////////////////// void AliJet::ShowTracks(Int_t mode) { // Provide an overview of the available tracks.