fTracks=0;
fNtinit=0;
fTrackCopy=0;
+ fRef=0;
fSelected=0;
}
///////////////////////////////////////////////////////////////////////////
delete fTracks;
fTracks=0;
}
+ if (fRef)
+ {
+ delete fRef;
+ fRef=0;
+ }
if (fSelected)
{
delete fSelected;
fNtrk=j.fNtrk;
fTrackCopy=j.fTrackCopy;
fUserId=j.fUserId;
+ if (j.fRef) fRef=new AliPositionObj(*(j.fRef));
fSelected=0;
delete fTracks;
fTracks=0;
}
+ if (fRef)
+ {
+ delete fRef;
+ fRef=0;
+ }
}
///////////////////////////////////////////////////////////////////////////
void AliJet::Reset()
// The defaults are f="car" and u="rad".
Data(f,u); // Information of the current jet
+ if (fRef) { cout << " Ref-point :"; fRef->Data(f,u); }
// The tracks of this jet
AliTrack* t;
// The defaults are f="car" and u="rad".
Data(f,u); // Information of the current jet
+ if (fRef) { cout << " Ref-point :"; fRef->Data(f,u); }
// The tracks of this jet
AliTrack* t;
// 2) Subsequent invokations of this memberfunction with e.g. chmode=-1 and chmode=1
// provides a convenient way to investigate particle pairs with opposite charge
// (e.g. for invariant mass analysis).
+// 3) The selected track pointers are returned via a multi-purpose array,
+// which will be overwritten by subsequent selections.
+// In case the selected track list is to be used amongst other selections,
+// the user is advised to store the selected track pointers in a local
+// TObjArray or TRefArray.
if (fSelected)
{
return fSelected;
}
///////////////////////////////////////////////////////////////////////////
+TObjArray* AliJet::GetTracks(TString name)
+{
+// Provide references to all tracks with the specified name.
+//
+// Notes :
+// -------
+// 1) In case the user has labeled reconstructed tracks with the name of
+// the applied reconstruction algorithm, this memberfunction provides
+// easy access to all tracks reconstructed by a certain method.
+// 2) The selected track pointers are returned via a multi-purpose array,
+// which will be overwritten by subsequent selections.
+// In case the selected track list is to be used amongst other selections,
+// the user is advised to store the selected track pointers in a local
+// TObjArray or TRefArray.
+
+ if (fSelected)
+ {
+ fSelected->Clear();
+ }
+ else
+ {
+ fSelected=new TObjArray();
+ }
+
+ if (!fTracks) return fSelected;
+
+ AliTrack* tx=0;
+ TString s;
+ for (Int_t i=0; i<fNtrk; i++)
+ {
+ tx=(AliTrack*)fTracks->At(i);
+ if (!tx) continue;
+
+ s=tx->GetName();
+ if (s == name) fSelected->Add(tx);
+ }
+
+ 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; i<fNtrk; i++)
+ {
+ tx=(AliTrack*)fTracks->At(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; i<ntk; i++)
+ {
+ tx=(AliTrack*)arr->At(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.
return fUserId;
}
///////////////////////////////////////////////////////////////////////////
+void AliJet::SetReferencePoint(AliPosition& p)
+{
+// Store the position of the jet reference-point.
+// The reference-point of a jet provides a means to define a generic
+// space-time location for the jet as a whole.
+// This doesn't have to be necessarily the location where all the constituent
+// tracks originate (e.g. a bundle of parallel tracks doesn't have such
+// a location). As such the meaning of this reference-point is different from
+// a normal vertex position and allows to provide complimentary information.
+// This reference point is the preferable point to start e.g. extrapolations
+// and investigate coincidences in space and/or time.
+ if (fRef) delete fRef;
+ fRef=new AliPositionObj(p);
+}
+///////////////////////////////////////////////////////////////////////////
+AliPosition* AliJet::GetReferencePoint()
+{
+// Provide the position of the jet reference-point.
+// The reference-point of a jet provides a means to define a generic
+// space-time location for the jet as a whole.
+// This doesn't have to be necessarily the location where all the constituent
+// tracks originate (e.g. a bundle of parallel tracks doesn't have such
+// a location). As such the meaning of this reference-point is different from
+// a normal vertex position and allows to provide complimentary information.
+// This reference point is the preferable point to start e.g. extrapolations
+// and investigate coincidences in space and/or time.
+ return fRef;
+}
+///////////////////////////////////////////////////////////////////////////
TObjArray* AliJet::SortTracks(Int_t mode,TObjArray* tracks)
{
// Order the references to an array of tracks by looping over the input array "tracks"
fSelected->AddAt(tx,j); // add track at the end
break; // go for next track
}
-
+
+ val1=0;
+ val2=0;
+
switch (abs(mode))
{
case 1:
break;
}
- if (mode<0 && val1 < val2) continue;
- if (mode>0 && val1 > val2) continue;
+ if (mode<0 && val1 <= val2) continue;
+ if (mode>0 && val1 >= val2) continue;
nord++;
for (Int_t k=nord-1; k>j; k--) // create empty position